PSOC E8XXGP Device Support Library

| PSOC E8XXGP Device Support Library

Functions
Functions
PDL API Reference » SysFault (System Fault)

## General Description

## Functions
cy_en_SysFault_status_t | Cy_SysFault_Init (FAULT_STRUCT_Type *base, cy_stc_SysFault_t *config)
| Initializes the SysFault for recording faults. More...
void | Cy_SysFault_ClearStatus (FAULT_STRUCT_Type *base)
| Clears status register. More...
cy_en_SysFault_source_t | Cy_SysFault_GetErrorSource (FAULT_STRUCT_Type *base)
| Returns the source of error for the Fault. More...
uint32_t | Cy_SysFault_GetFaultData (FAULT_STRUCT_Type *base, cy_en_SysFault_Data_t dataSet)
| Returns the Fault information for the provided dataSet. More...
uint32_t | Cy_SysFault_GetPendingFault (FAULT_STRUCT_Type *base, cy_en_SysFault_Set_t pendingFault)
| Returns the sources of pending fault that are not captured. More...
void | Cy_SysFault_SetMaskByIdx (FAULT_STRUCT_Type *base, cy_en_SysFault_source_t idx)
| Enable the Fault to be captured. More...
void | Cy_SysFault_ClearMaskByIdx (FAULT_STRUCT_Type *base, cy_en_SysFault_source_t idx)
| Disable the faults to be captured. More...
uint32_t | Cy_SysFault_GetInterruptStatus (FAULT_STRUCT_Type *base)
| Returns the status of the interrupt. More...
void | Cy_SysFault_ClearInterrupt (FAULT_STRUCT_Type *base)
| Clears Active Interrupt Source. More...
void | Cy_SysFault_SetInterrupt (FAULT_STRUCT_Type *base)
| Triggers an interrupt via a software write. More...
void | Cy_SysFault_SetInterruptMask (FAULT_STRUCT_Type *base)
| Sets an interrupt mask. More...
void | Cy_SysFault_ClearInterruptMask (FAULT_STRUCT_Type *base)
| Clears an interrupt mask. More...
uint32_t | Cy_SysFault_GetInterruptMask (FAULT_STRUCT_Type *base)
| Returns the interrupt mask. More...
uint32_t | Cy_SysFault_GetInterruptStatusMasked (FAULT_STRUCT_Type *base)
| Returns whether masked interrupt triggered the interrupt. More...

## Function Documentation

## ◆ Cy_SysFault_Init()

cy_en_SysFault_status_t Cy_SysFault_Init | ( | FAULT_STRUCT_Type * | base,
|  | cy_stc_SysFault_t * | config
| ) |  |

Initializes the SysFault for recording faults.

Parameters

  base | The pointer to a Fault structure instance.
  config | The pointer to a Configuration structure.

Returns
  Fault status. Refer cy_en_SysFault_status_t

Function Usage
  /* Scenario: Configures the SysFault for recording faults. */
  /* Fault config */
  cy_stc_SysFault_t config =
  {
  .ResetEnable = false,
  .OutputEnable = true,
  .TriggerEnable = false,
  };
  /* Configure Interrupt for Fault structure */
  cy_stc_sysint_t IRQ_cfg =
  {
  .intrSrc = ((NvicMux3_IRQn << CY_SYSINT_INTRSRC_MUXIRQ_SHIFT) | cpuss_interrupts_fault_0_IRQn), /* Bit 0-15 of intrSrc is used to store system interrupt value and bit 16-31 to store CPU IRQ value */
  .intrPriority = 2UL
  };
  /*********************************************************************/
  /***** Fault report settings *****/
  /*********************************************************************/
  Cy_SysFault_ClearStatus(FAULT_STRUCT0); // clear status
  Cy_SysFault_SetMaskByIdx(FAULT_STRUCT0, CY_SYSFAULT_SRSS_MCWDT0); // enable Fault MCWDT #0
  Cy_SysFault_SetInterruptMask(FAULT_STRUCT0);
  cy_en_SysFault_status_t status = Cy_SysFault_Init(FAULT_STRUCT0, &config);
  /*********************************************************************/
  /***** Interrupt settings *****/
  /*********************************************************************/
  Cy_SysInt_Init(&IRQ_cfg, &irqFaultHandler);
  NVIC_SetPriority((IRQn_Type) NvicMux3_IRQn, 2UL);
  NVIC_EnableIRQ((IRQn_Type) NvicMux3_IRQn);
  /* Triggers an interrupt via a software write.*/
  Cy_SysFault_SetInterrupt(FAULT_STRUCT0);
  cy_stc_SysFault_t::ResetEnable
  bool ResetEnable
  Enables the Reset request when it is True.
  Definition: cy_sysfault.h:271
  cy_stc_SysFault_t
  Configuration structure for a Fault control register.
  Definition: cy_sysfault.h:268
  cy_en_SysFault_status_t
  cy_en_SysFault_status_t
  SysFault driver error codes.
  Definition: cy_sysfault.h:162
  Cy_SysFault_ClearStatus
  void Cy_SysFault_ClearStatus(FAULT_STRUCT_Type *base)
  Clears status register.
  Definition: cy_sysfault.c:47
  Cy_SysFault_SetInterruptMask
  void Cy_SysFault_SetInterruptMask(FAULT_STRUCT_Type *base)
  Sets an interrupt mask.
  Definition: cy_sysfault.c:196
  Cy_SysFault_Init
  cy_en_SysFault_status_t Cy_SysFault_Init(FAULT_STRUCT_Type *base, cy_stc_SysFault_t *config)
  Initializes the SysFault for recording faults.
  Definition: cy_sysfault.c:31
  Cy_SysFault_SetInterrupt
  void Cy_SysFault_SetInterrupt(FAULT_STRUCT_Type *base)
  Triggers an interrupt via a software write.
  Definition: cy_sysfault.c:190
  Cy_SysFault_SetMaskByIdx
  void Cy_SysFault_SetMaskByIdx(FAULT_STRUCT_Type *base, cy_en_SysFault_source_t idx)
  Enable the Fault to be captured.
  Definition: cy_sysfault.c:112
  cy_stc_sysint_t::intrSrc
  IRQn_Type intrSrc
  Interrupt source.
  Definition: cy_sysint.h:229
  cy_stc_sysint_t
  Initialization configuration structure for a single interrupt channel.
  Definition: cy_sysint.h:227
  Cy_SysInt_Init
  cy_en_sysint_status_t Cy_SysInt_Init(const cy_stc_sysint_t *config, cy_israddress userIsr)
  Initializes the referenced interrupt by setting the priority and the interrupt vector.
  Definition: cy_sysint_v2.c:80
  CY_SYSINT_INTRSRC_MUXIRQ_SHIFT
  #define CY_SYSINT_INTRSRC_MUXIRQ_SHIFT
  Bit 0-11 indicate system interrupt and bit 12-15 will indicate the CPU IRQ.
  Definition: cy_sysint.h:179

## ◆ Cy_SysFault_ClearStatus()

void Cy_SysFault_ClearStatus | ( | FAULT_STRUCT_Type * | base | ) |

Clears status register.

Parameters

  base | The pointer to a Fault structure instance.

Function Usage
  /* Scenario: Configures the SysFault for recording faults. */
  /* Fault config */
  cy_stc_SysFault_t config =
  {
  .ResetEnable = false,
  .OutputEnable = true,
  .TriggerEnable = false,
  };
  /* Configure Interrupt for Fault structure */
  cy_stc_sysint_t IRQ_cfg =
  {
  .intrSrc = ((NvicMux3_IRQn << CY_SYSINT_INTRSRC_MUXIRQ_SHIFT) | cpuss_interrupts_fault_0_IRQn), /* Bit 0-15 of intrSrc is used to store system interrupt value and bit 16-31 to store CPU IRQ value */
  .intrPriority = 2UL
  };
  /*********************************************************************/
  /***** Fault report settings *****/
  /*********************************************************************/
  Cy_SysFault_ClearStatus(FAULT_STRUCT0); // clear status
  Cy_SysFault_SetMaskByIdx(FAULT_STRUCT0, CY_SYSFAULT_SRSS_MCWDT0); // enable Fault MCWDT #0
  Cy_SysFault_SetInterruptMask(FAULT_STRUCT0);
  cy_en_SysFault_status_t status = Cy_SysFault_Init(FAULT_STRUCT0, &config);
  /*********************************************************************/
  /***** Interrupt settings *****/
  /*********************************************************************/
  Cy_SysInt_Init(&IRQ_cfg, &irqFaultHandler);
  NVIC_SetPriority((IRQn_Type) NvicMux3_IRQn, 2UL);
  NVIC_EnableIRQ((IRQn_Type) NvicMux3_IRQn);
  /* Triggers an interrupt via a software write.*/
  Cy_SysFault_SetInterrupt(FAULT_STRUCT0);

## ◆ Cy_SysFault_GetErrorSource()

cy_en_SysFault_source_t Cy_SysFault_GetErrorSource | ( | FAULT_STRUCT_Type * | base | ) |

Returns the source of error for the Fault.

Parameters

  base | The pointer to a Fault structure instance.

Returns
  Fault source.

Function Usage
  /* Scenario: Handle the faults generated and get the fault data. */
  /* Returns the status of the interrupt for the fault structure */
  uint32_t intrSource = Cy_SysFault_GetInterruptStatus(FAULT_STRUCT0);
  /* Returns the interrupt mask. */
  uint32_t intrMskStatus =Cy_SysFault_GetInterruptMask(FAULT_STRUCT0);
  /* Returns whether masked interrupt and triggered the interrupt are same. */
  uint32_t intrMskdStatus = Cy_SysFault_GetInterruptStatusMasked(FAULT_STRUCT0);
  cy_en_SysFault_source_t status = Cy_SysFault_GetErrorSource(FAULT_STRUCT0);
  if(status != CY_SYSFAULT_NO_FAULT)
  {
  if(status == CY_SYSFAULT_SRSS_MCWDT0) // MCWDT0 fault
  {
  Cy_SysFault_GetFaultData(FAULT_STRUCT0, CY_SYSFAULT_DATA0); //Get fault data
  }
  }
  /* Clears an interrupt mask.*/
  Cy_SysFault_ClearInterruptMask(FAULT_STRUCT0);
  /* Clear Interrupt flag */
  Cy_SysFault_ClearInterrupt(FAULT_STRUCT0);
  CY_SYSFAULT_DATA0
  @ CY_SYSFAULT_DATA0
  Used to get the Fault data for DATA0 register.
  Definition: cy_sysfault.h:182
  Cy_SysFault_GetFaultData
  uint32_t Cy_SysFault_GetFaultData(FAULT_STRUCT_Type *base, cy_en_SysFault_Data_t dataSet)
  Returns the Fault information for the provided dataSet.
  Definition: cy_sysfault.c:69
  Cy_SysFault_GetInterruptStatusMasked
  uint32_t Cy_SysFault_GetInterruptStatusMasked(FAULT_STRUCT_Type *base)
  Returns whether masked interrupt triggered the interrupt.
  Definition: cy_sysfault.c:212
  Cy_SysFault_ClearInterrupt
  void Cy_SysFault_ClearInterrupt(FAULT_STRUCT_Type *base)
  Clears Active Interrupt Source.
  Definition: cy_sysfault.c:184
  Cy_SysFault_GetErrorSource
  cy_en_SysFault_source_t Cy_SysFault_GetErrorSource(FAULT_STRUCT_Type *base)
  Returns the source of error for the Fault.
  Definition: cy_sysfault.c:53
  Cy_SysFault_GetInterruptMask
  uint32_t Cy_SysFault_GetInterruptMask(FAULT_STRUCT_Type *base)
  Returns the interrupt mask.
  Definition: cy_sysfault.c:206
  Cy_SysFault_GetInterruptStatus
  uint32_t Cy_SysFault_GetInterruptStatus(FAULT_STRUCT_Type *base)
  Returns the status of the interrupt.
  Definition: cy_sysfault.c:178
  Cy_SysFault_ClearInterruptMask
  void Cy_SysFault_ClearInterruptMask(FAULT_STRUCT_Type *base)
  Clears an interrupt mask.
  Definition: cy_sysfault.c:201

## ◆ Cy_SysFault_GetFaultData()

uint32_t Cy_SysFault_GetFaultData | ( | FAULT_STRUCT_Type * | base,
|  | cy_en_SysFault_Data_t | dataSet
| ) |  |

Returns the Fault information for the provided dataSet.

Parameters

  base | The pointer to a Fault structure instance.
  dataSet | Instance of data register.

Returns
  Fault information.

Function Usage
  /* Scenario: Handle the faults generated and get the fault data. */
  /* Returns the status of the interrupt for the fault structure */
  uint32_t intrSource = Cy_SysFault_GetInterruptStatus(FAULT_STRUCT0);
  /* Returns the interrupt mask. */
  uint32_t intrMskStatus =Cy_SysFault_GetInterruptMask(FAULT_STRUCT0);
  /* Returns whether masked interrupt and triggered the interrupt are same. */
  uint32_t intrMskdStatus = Cy_SysFault_GetInterruptStatusMasked(FAULT_STRUCT0);
  cy_en_SysFault_source_t status = Cy_SysFault_GetErrorSource(FAULT_STRUCT0);
  if(status != CY_SYSFAULT_NO_FAULT)
  {
  if(status == CY_SYSFAULT_SRSS_MCWDT0) // MCWDT0 fault
  {
  Cy_SysFault_GetFaultData(FAULT_STRUCT0, CY_SYSFAULT_DATA0); //Get fault data
  }
  }
  /* Clears an interrupt mask.*/
  Cy_SysFault_ClearInterruptMask(FAULT_STRUCT0);
  /* Clear Interrupt flag */
  Cy_SysFault_ClearInterrupt(FAULT_STRUCT0);

## ◆ Cy_SysFault_GetPendingFault()

uint32_t Cy_SysFault_GetPendingFault | ( | FAULT_STRUCT_Type * | base,
|  | cy_en_SysFault_Set_t | pendingFault
| ) |  |

Returns the sources of pending fault that are not captured.

Parameters

  base | The pointer to a Fault structure instance.
  pendingFault | Instance of PENDING register. PENDING0 returns the occurred pending Faults in the range of 0-31 Fault ID.

Returns
  The status of pending Faults.

Function Usage
  /* Scenario: Capture the Faults that are triggered and not enabled. */
  /* Fault config */
  cy_stc_SysFault_t config =
  {
  .ResetEnable = false,
  .OutputEnable = true,
  .TriggerEnable = false,
  };
  /*********************************************************************/
  /***** Fault report settings *****/
  /*********************************************************************/
  Cy_SysFault_ClearStatus(FAULT_STRUCT0); // clear status
  Cy_SysFault_ClearMaskByIdx(FAULT_STRUCT0, CY_SYSFAULT_SRSS_MCWDT0); // Clear fault Id mask. To keep the fault in pending state
  cy_en_SysFault_status_t status = Cy_SysFault_Init(FAULT_STRUCT0, &config);
  uint32_t faultIdSet = Cy_SysFault_GetPendingFault(FAULT_STRUCT0, CY_SYSFAULT_SET0);
  CY_SYSFAULT_SET0
  @ CY_SYSFAULT_SET0
  Set of Faults in the range of 0-31 Fault ID.
  Definition: cy_sysfault.h:172
  Cy_SysFault_GetPendingFault
  uint32_t Cy_SysFault_GetPendingFault(FAULT_STRUCT_Type *base, cy_en_SysFault_Set_t pendingFault)
  Returns the sources of pending fault that are not captured.
  Definition: cy_sysfault.c:77
  Cy_SysFault_ClearMaskByIdx
  void Cy_SysFault_ClearMaskByIdx(FAULT_STRUCT_Type *base, cy_en_SysFault_source_t idx)
  Disable the faults to be captured.
  Definition: cy_sysfault.c:145

## ◆ Cy_SysFault_SetMaskByIdx()

void Cy_SysFault_SetMaskByIdx | ( | FAULT_STRUCT_Type * | base,
|  | cy_en_SysFault_source_t | idx
| ) |  |

Enable the Fault to be captured.

Parameters

  base | The pointer to a Fault structure instance.
  idx | The Fault id to be set in the mask register.

Returns
  None.

Function Usage
  /* Scenario: Configures the SysFault for recording faults. */
  /* Fault config */
  cy_stc_SysFault_t config =
  {
  .ResetEnable = false,
  .OutputEnable = true,
  .TriggerEnable = false,
  };
  /* Configure Interrupt for Fault structure */
  cy_stc_sysint_t IRQ_cfg =
  {
  .intrSrc = ((NvicMux3_IRQn << CY_SYSINT_INTRSRC_MUXIRQ_SHIFT) | cpuss_interrupts_fault_0_IRQn), /* Bit 0-15 of intrSrc is used to store system interrupt value and bit 16-31 to store CPU IRQ value */
  .intrPriority = 2UL
  };
  /*********************************************************************/
  /***** Fault report settings *****/
  /*********************************************************************/
  Cy_SysFault_ClearStatus(FAULT_STRUCT0); // clear status
  Cy_SysFault_SetMaskByIdx(FAULT_STRUCT0, CY_SYSFAULT_SRSS_MCWDT0); // enable Fault MCWDT #0
  Cy_SysFault_SetInterruptMask(FAULT_STRUCT0);
  cy_en_SysFault_status_t status = Cy_SysFault_Init(FAULT_STRUCT0, &config);
  /*********************************************************************/
  /***** Interrupt settings *****/
  /*********************************************************************/
  Cy_SysInt_Init(&IRQ_cfg, &irqFaultHandler);
  NVIC_SetPriority((IRQn_Type) NvicMux3_IRQn, 2UL);
  NVIC_EnableIRQ((IRQn_Type) NvicMux3_IRQn);
  /* Triggers an interrupt via a software write.*/
  Cy_SysFault_SetInterrupt(FAULT_STRUCT0);

## ◆ Cy_SysFault_ClearMaskByIdx()

void Cy_SysFault_ClearMaskByIdx | ( | FAULT_STRUCT_Type * | base,
|  | cy_en_SysFault_source_t | idx
| ) |  |

Disable the faults to be captured.

Parameters

  base | The pointer to a Fault structure instance.
  idx | The fault id to be cleared in the mask register.

Returns
  None.

Function Usage
  /* Scenario: Capture the Faults that are triggered and not enabled. */
  /* Fault config */
  cy_stc_SysFault_t config =
  {
  .ResetEnable = false,
  .OutputEnable = true,
  .TriggerEnable = false,
  };
  /*********************************************************************/
  /***** Fault report settings *****/
  /*********************************************************************/
  Cy_SysFault_ClearStatus(FAULT_STRUCT0); // clear status
  Cy_SysFault_ClearMaskByIdx(FAULT_STRUCT0, CY_SYSFAULT_SRSS_MCWDT0); // Clear fault Id mask. To keep the fault in pending state
  cy_en_SysFault_status_t status = Cy_SysFault_Init(FAULT_STRUCT0, &config);
  uint32_t faultIdSet = Cy_SysFault_GetPendingFault(FAULT_STRUCT0, CY_SYSFAULT_SET0);

## ◆ Cy_SysFault_GetInterruptStatus()

uint32_t Cy_SysFault_GetInterruptStatus | ( | FAULT_STRUCT_Type * | base | ) |

Returns the status of the interrupt.

Parameters

  base | The pointer to a Fault structure instance.

Returns
  Interrupt status.

Function Usage
  /* Scenario: Handle the faults generated and get the fault data. */
  /* Returns the status of the interrupt for the fault structure */
  uint32_t intrSource = Cy_SysFault_GetInterruptStatus(FAULT_STRUCT0);
  /* Returns the interrupt mask. */
  uint32_t intrMskStatus =Cy_SysFault_GetInterruptMask(FAULT_STRUCT0);
  /* Returns whether masked interrupt and triggered the interrupt are same. */
  uint32_t intrMskdStatus = Cy_SysFault_GetInterruptStatusMasked(FAULT_STRUCT0);
  cy_en_SysFault_source_t status = Cy_SysFault_GetErrorSource(FAULT_STRUCT0);
  if(status != CY_SYSFAULT_NO_FAULT)
  {
  if(status == CY_SYSFAULT_SRSS_MCWDT0) // MCWDT0 fault
  {
  Cy_SysFault_GetFaultData(FAULT_STRUCT0, CY_SYSFAULT_DATA0); //Get fault data
  }
  }
  /* Clears an interrupt mask.*/
  Cy_SysFault_ClearInterruptMask(FAULT_STRUCT0);
  /* Clear Interrupt flag */
  Cy_SysFault_ClearInterrupt(FAULT_STRUCT0);

## ◆ Cy_SysFault_ClearInterrupt()

void Cy_SysFault_ClearInterrupt | ( | FAULT_STRUCT_Type * | base | ) |

Clears Active Interrupt Source.

Parameters

  base | The pointer to a Fault structure instance.

Returns
  None.

Function Usage
  /* Scenario: Handle the faults generated and get the fault data. */
  /* Returns the status of the interrupt for the fault structure */
  uint32_t intrSource = Cy_SysFault_GetInterruptStatus(FAULT_STRUCT0);
  /* Returns the interrupt mask. */
  uint32_t intrMskStatus =Cy_SysFault_GetInterruptMask(FAULT_STRUCT0);
  /* Returns whether masked interrupt and triggered the interrupt are same. */
  uint32_t intrMskdStatus = Cy_SysFault_GetInterruptStatusMasked(FAULT_STRUCT0);
  cy_en_SysFault_source_t status = Cy_SysFault_GetErrorSource(FAULT_STRUCT0);
  if(status != CY_SYSFAULT_NO_FAULT)
  {
  if(status == CY_SYSFAULT_SRSS_MCWDT0) // MCWDT0 fault
  {
  Cy_SysFault_GetFaultData(FAULT_STRUCT0, CY_SYSFAULT_DATA0); //Get fault data
  }
  }
  /* Clears an interrupt mask.*/
  Cy_SysFault_ClearInterruptMask(FAULT_STRUCT0);
  /* Clear Interrupt flag */
  Cy_SysFault_ClearInterrupt(FAULT_STRUCT0);

## ◆ Cy_SysFault_SetInterrupt()

void Cy_SysFault_SetInterrupt | ( | FAULT_STRUCT_Type * | base | ) |

Triggers an interrupt via a software write.

Parameters

  base | The pointer to a Fault structure instance.

Returns
  None.

Function Usage
  /* Scenario: Configures the SysFault for recording faults. */
  /* Fault config */
  cy_stc_SysFault_t config =
  {
  .ResetEnable = false,
  .OutputEnable = true,
  .TriggerEnable = false,
  };
  /* Configure Interrupt for Fault structure */
  cy_stc_sysint_t IRQ_cfg =
  {
  .intrSrc = ((NvicMux3_IRQn << CY_SYSINT_INTRSRC_MUXIRQ_SHIFT) | cpuss_interrupts_fault_0_IRQn), /* Bit 0-15 of intrSrc is used to store system interrupt value and bit 16-31 to store CPU IRQ value */
  .intrPriority = 2UL
  };
  /*********************************************************************/
  /***** Fault report settings *****/
  /*********************************************************************/
  Cy_SysFault_ClearStatus(FAULT_STRUCT0); // clear status
  Cy_SysFault_SetMaskByIdx(FAULT_STRUCT0, CY_SYSFAULT_SRSS_MCWDT0); // enable Fault MCWDT #0
  Cy_SysFault_SetInterruptMask(FAULT_STRUCT0);
  cy_en_SysFault_status_t status = Cy_SysFault_Init(FAULT_STRUCT0, &config);
  /*********************************************************************/
  /***** Interrupt settings *****/
  /*********************************************************************/
  Cy_SysInt_Init(&IRQ_cfg, &irqFaultHandler);
  NVIC_SetPriority((IRQn_Type) NvicMux3_IRQn, 2UL);
  NVIC_EnableIRQ((IRQn_Type) NvicMux3_IRQn);
  /* Triggers an interrupt via a software write.*/
  Cy_SysFault_SetInterrupt(FAULT_STRUCT0);

## ◆ Cy_SysFault_SetInterruptMask()

void Cy_SysFault_SetInterruptMask | ( | FAULT_STRUCT_Type * | base | ) |

Sets an interrupt mask.

Parameters

  base | The pointer to a Fault structure instance.

Returns
  None.

Function Usage
  /* Scenario: Configures the SysFault for recording faults. */
  /* Fault config */
  cy_stc_SysFault_t config =
  {
  .ResetEnable = false,
  .OutputEnable = true,
  .TriggerEnable = false,
  };
  /* Configure Interrupt for Fault structure */
  cy_stc_sysint_t IRQ_cfg =
  {
  .intrSrc = ((NvicMux3_IRQn << CY_SYSINT_INTRSRC_MUXIRQ_SHIFT) | cpuss_interrupts_fault_0_IRQn), /* Bit 0-15 of intrSrc is used to store system interrupt value and bit 16-31 to store CPU IRQ value */
  .intrPriority = 2UL
  };
  /*********************************************************************/
  /***** Fault report settings *****/
  /*********************************************************************/
  Cy_SysFault_ClearStatus(FAULT_STRUCT0); // clear status
  Cy_SysFault_SetMaskByIdx(FAULT_STRUCT0, CY_SYSFAULT_SRSS_MCWDT0); // enable Fault MCWDT #0
  Cy_SysFault_SetInterruptMask(FAULT_STRUCT0);
  cy_en_SysFault_status_t status = Cy_SysFault_Init(FAULT_STRUCT0, &config);
  /*********************************************************************/
  /***** Interrupt settings *****/
  /*********************************************************************/
  Cy_SysInt_Init(&IRQ_cfg, &irqFaultHandler);
  NVIC_SetPriority((IRQn_Type) NvicMux3_IRQn, 2UL);
  NVIC_EnableIRQ((IRQn_Type) NvicMux3_IRQn);
  /* Triggers an interrupt via a software write.*/
  Cy_SysFault_SetInterrupt(FAULT_STRUCT0);

## ◆ Cy_SysFault_ClearInterruptMask()

void Cy_SysFault_ClearInterruptMask | ( | FAULT_STRUCT_Type * | base | ) |

Clears an interrupt mask.

Parameters

  base | The pointer to a Fault structure instance.

Returns
  None.

Function Usage
  /* Scenario: Handle the faults generated and get the fault data. */
  /* Returns the status of the interrupt for the fault structure */
  uint32_t intrSource = Cy_SysFault_GetInterruptStatus(FAULT_STRUCT0);
  /* Returns the interrupt mask. */
  uint32_t intrMskStatus =Cy_SysFault_GetInterruptMask(FAULT_STRUCT0);
  /* Returns whether masked interrupt and triggered the interrupt are same. */
  uint32_t intrMskdStatus = Cy_SysFault_GetInterruptStatusMasked(FAULT_STRUCT0);
  cy_en_SysFault_source_t status = Cy_SysFault_GetErrorSource(FAULT_STRUCT0);
  if(status != CY_SYSFAULT_NO_FAULT)
  {
  if(status == CY_SYSFAULT_SRSS_MCWDT0) // MCWDT0 fault
  {
  Cy_SysFault_GetFaultData(FAULT_STRUCT0, CY_SYSFAULT_DATA0); //Get fault data
  }
  }
  /* Clears an interrupt mask.*/
  Cy_SysFault_ClearInterruptMask(FAULT_STRUCT0);
  /* Clear Interrupt flag */
  Cy_SysFault_ClearInterrupt(FAULT_STRUCT0);

## ◆ Cy_SysFault_GetInterruptMask()

uint32_t Cy_SysFault_GetInterruptMask | ( | FAULT_STRUCT_Type * | base | ) |

Returns the interrupt mask.

Parameters

  base | The pointer to a Fault structure instance.

Returns
  Interrupt Mask.

Function Usage
  /* Scenario: Handle the faults generated and get the fault data. */
  /* Returns the status of the interrupt for the fault structure */
  uint32_t intrSource = Cy_SysFault_GetInterruptStatus(FAULT_STRUCT0);
  /* Returns the interrupt mask. */
  uint32_t intrMskStatus =Cy_SysFault_GetInterruptMask(FAULT_STRUCT0);
  /* Returns whether masked interrupt and triggered the interrupt are same. */
  uint32_t intrMskdStatus = Cy_SysFault_GetInterruptStatusMasked(FAULT_STRUCT0);
  cy_en_SysFault_source_t status = Cy_SysFault_GetErrorSource(FAULT_STRUCT0);
  if(status != CY_SYSFAULT_NO_FAULT)
  {
  if(status == CY_SYSFAULT_SRSS_MCWDT0) // MCWDT0 fault
  {
  Cy_SysFault_GetFaultData(FAULT_STRUCT0, CY_SYSFAULT_DATA0); //Get fault data
  }
  }
  /* Clears an interrupt mask.*/
  Cy_SysFault_ClearInterruptMask(FAULT_STRUCT0);
  /* Clear Interrupt flag */
  Cy_SysFault_ClearInterrupt(FAULT_STRUCT0);

## ◆ Cy_SysFault_GetInterruptStatusMasked()

uint32_t Cy_SysFault_GetInterruptStatusMasked | ( | FAULT_STRUCT_Type * | base | ) |

Returns whether masked interrupt triggered the interrupt.

Parameters

  base | The pointer to a Fault structure instance.

Returns
  Interrupt Mask.

Function Usage
  /* Scenario: Handle the faults generated and get the fault data. */
  /* Returns the status of the interrupt for the fault structure */
  uint32_t intrSource = Cy_SysFault_GetInterruptStatus(FAULT_STRUCT0);
  /* Returns the interrupt mask. */
  uint32_t intrMskStatus =Cy_SysFault_GetInterruptMask(FAULT_STRUCT0);
  /* Returns whether masked interrupt and triggered the interrupt are same. */
  uint32_t intrMskdStatus = Cy_SysFault_GetInterruptStatusMasked(FAULT_STRUCT0);
  cy_en_SysFault_source_t status = Cy_SysFault_GetErrorSource(FAULT_STRUCT0);
  if(status != CY_SYSFAULT_NO_FAULT)
  {
  if(status == CY_SYSFAULT_SRSS_MCWDT0) // MCWDT0 fault
  {
  Cy_SysFault_GetFaultData(FAULT_STRUCT0, CY_SYSFAULT_DATA0); //Get fault data
  }
  }
  /* Clears an interrupt mask.*/
  Cy_SysFault_ClearInterruptMask(FAULT_STRUCT0);
  /* Clear Interrupt flag */
  Cy_SysFault_ClearInterrupt(FAULT_STRUCT0);