CAT2 Peripheral Driver Library

Functions

void Cy_WDT_Init (void)
 Initializes the Watchdog timer to its default state: More...
 
__STATIC_INLINE void Cy_WDT_Enable (void)
 Enables watchdog timer reset generation.
 
__STATIC_INLINE bool Cy_WDT_IsEnabled (void)
 Returns the WDT enable/disable state.
 
__STATIC_INLINE void Cy_WDT_Disable (void)
 Disables the WDT reset generation.
 
__STATIC_INLINE uint32_t Cy_WDT_GetCount (void)
 Reads the current WDT counter value. More...
 
void Cy_WDT_SetMatch (uint32_t match)
 Configures the WDT counter match comparison value. More...
 
__STATIC_INLINE uint32_t Cy_WDT_GetMatch (void)
 Reads the WDT counter match comparison value. More...
 
void Cy_WDT_SetIgnoreBits (uint32_t bitsNum)
 Configures the number of the most significant bits of the Watchdog timer that are not checked against the match. More...
 
__STATIC_INLINE uint32_t Cy_WDT_GetIgnoreBits (void)
 Reads the number of the most significant bits of the Watchdog timer that are not checked against the match. More...
 
__STATIC_INLINE void Cy_WDT_MaskInterrupt (void)
 After masking interrupts from the WDT, they are not passed to the CPU. More...
 
__STATIC_INLINE void Cy_WDT_UnmaskInterrupt (void)
 After unmasking interrupts from the WDT, they are passed to CPU. More...
 
void Cy_WDT_ClearInterrupt (void)
 Clears the WDT match flag which is set every time the WDT counter reaches a WDT match value. More...
 
__STATIC_INLINE void Cy_WDT_ClearWatchdog (void)
 Clears ("feeds") the watchdog, to prevent a XRES device reset. More...
 

Detailed Description

Function Documentation

◆ Cy_WDT_Init()

void Cy_WDT_Init ( void  )

Initializes the Watchdog timer to its default state:

  • WDT disabled
  • WDT match value is 4096
  • None of ignore bits are set: the whole WDT counter bits are checked against the match value.

This function clears the WDT interrupt.

◆ Cy_WDT_GetCount()

__STATIC_INLINE uint32_t Cy_WDT_GetCount ( void  )

Reads the current WDT counter value.

Returns
A live counter value.

◆ Cy_WDT_SetMatch()

void Cy_WDT_SetMatch ( uint32_t  match)

Configures the WDT counter match comparison value.

Parameters
matchThe valid range is [0-65535]. The value to be used to match against the counter.

◆ Cy_WDT_GetMatch()

__STATIC_INLINE uint32_t Cy_WDT_GetMatch ( void  )

Reads the WDT counter match comparison value.

Returns
The counter match value.

◆ Cy_WDT_SetIgnoreBits()

void Cy_WDT_SetIgnoreBits ( uint32_t  bitsNum)

Configures the number of the most significant bits of the Watchdog timer that are not checked against the match.

Parameters
bitsNumThe number of the most significant bits. The valid range is [0-15].

The value of bitsNum controls the time-to-reset of the Watchdog timer. This happens after 3 successive matches.

Note
Certain products may enforce a minimum value for this register through design time configuration.
Warning
This function changes the WDT interrupt period, therefore the device can go into an infinite WDT reset loop. This may happen if a WDT reset occurs faster that a device start-up.

◆ Cy_WDT_GetIgnoreBits()

__STATIC_INLINE uint32_t Cy_WDT_GetIgnoreBits ( void  )

Reads the number of the most significant bits of the Watchdog timer that are not checked against the match.

Returns
The number of the most significant bits.

◆ Cy_WDT_MaskInterrupt()

__STATIC_INLINE void Cy_WDT_MaskInterrupt ( void  )

After masking interrupts from the WDT, they are not passed to the CPU.

This function does not disable the WDT-reset generation.

◆ Cy_WDT_UnmaskInterrupt()

__STATIC_INLINE void Cy_WDT_UnmaskInterrupt ( void  )

After unmasking interrupts from the WDT, they are passed to CPU.

This function does not impact the reset generation.

◆ Cy_WDT_ClearInterrupt()

void Cy_WDT_ClearInterrupt ( void  )

Clears the WDT match flag which is set every time the WDT counter reaches a WDT match value.

Two unserviced interrupts lead to a system reset (i.e. at the third match).

◆ Cy_WDT_ClearWatchdog()

__STATIC_INLINE void Cy_WDT_ClearWatchdog ( void  )

Clears ("feeds") the watchdog, to prevent a XRES device reset.

This function simply call Cy_WDT_ClearInterrupt() function.