LPCOpen Platform
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CHIP: LPC18xx/43xx WWDT driver

Macros

#define WDT_OSC   (CGU_IRC_FREQ)
 
#define WWDT_WDMOD_WDEN   ((uint32_t) (1 << 0))
 
#define WWDT_WDMOD_WDRESET   ((uint32_t) (1 << 1))
 
#define WWDT_WDMOD_WDTOF   ((uint32_t) (1 << 2))
 
#define WWDT_WDMOD_WDINT   ((uint32_t) (1 << 3))
 
#define WWDT_WDMOD_WDPROTECT   ((uint32_t) (1 << 4))
 
#define WWDT_TICKS_MIN   0xFF
 
#define WWDT_TICKS_MAX   0xFFFFFF
 

Functions

void Chip_WWDT_Init (void)
 Initialize the Watchdog timer.
 
STATIC INLINE void Chip_WWDT_SetTimeOut (uint32_t timeout)
 Set WDT timeout constant value used for feed.
 
STATIC INLINE void Chip_WWDT_Feed (void)
 Feed watchdog timer.
 
STATIC INLINE void Chip_WWDT_SetWarning (uint32_t timeout)
 Set WWDT warning interrupt.
 
STATIC INLINE void Chip_WWDT_SetWindow (uint32_t timeout)
 Set WWDT window time.
 
STATIC INLINE void Chip_WWDT_SetOption (uint32_t options)
 Enable watchdog timer options.
 
STATIC INLINE void Chip_WWDT_UnsetOption (uint32_t options)
 Disable/clear watchdog timer options.
 
STATIC INLINE void Chip_WWDT_Start (void)
 Enable WWDT activity.
 
STATIC INLINE uint32_t Chip_WWDT_GetStatus (void)
 Read WWDT status flag.
 
void Chip_WWDT_ClearStatusFlag (uint32_t status)
 Clear WWDT interrupt status flags.
 
STATIC INLINE uint32_t WWDT_GetCurrentCount (void)
 Get the current value of WDT.
 

Detailed Description

Macro Definition Documentation

#define WDT_OSC   (CGU_IRC_FREQ)

WDT oscillator frequency value

Definition at line 47 of file wwdt_18xx_43xx.h.

#define WWDT_TICKS_MAX   0xFFFFFF

Maximum tick count for timer value and window value

Definition at line 64 of file wwdt_18xx_43xx.h.

#define WWDT_TICKS_MIN   0xFF

Minimum tick count for timer value and window value

Definition at line 61 of file wwdt_18xx_43xx.h.

#define WWDT_WDMOD_WDEN   ((uint32_t) (1 << 0))

WWDT interrupt enable bit

Definition at line 50 of file wwdt_18xx_43xx.h.

#define WWDT_WDMOD_WDINT   ((uint32_t) (1 << 3))

WDT Time Out flag bit

Definition at line 56 of file wwdt_18xx_43xx.h.

#define WWDT_WDMOD_WDPROTECT   ((uint32_t) (1 << 4))

WWDT Protect flag bit

Definition at line 58 of file wwdt_18xx_43xx.h.

#define WWDT_WDMOD_WDRESET   ((uint32_t) (1 << 1))

WWDT interrupt enable bit

Definition at line 52 of file wwdt_18xx_43xx.h.

#define WWDT_WDMOD_WDTOF   ((uint32_t) (1 << 2))

WWDT time out flag bit

Definition at line 54 of file wwdt_18xx_43xx.h.

Function Documentation

void Chip_WWDT_ClearStatusFlag ( uint32_t  status)

Clear WWDT interrupt status flags.

Parameters
flag: Or'ed value of status flag(s) that you want to clear, should be:
  • WWDT_WDMOD_WDTOF: Clear watchdog timeout flag
  • WWDT_WDMOD_WDINT: Clear watchdog warning flag
Returns
None

Definition at line 61 of file wwdt_18xx_43xx.c.

STATIC INLINE void Chip_WWDT_Feed ( void  )

Feed watchdog timer.

Returns
None If this function isn't called, a watchdog timer warning will occur. After the warning, a timeout will occur if a feed has happened.

Definition at line 88 of file wwdt_18xx_43xx.h.

STATIC INLINE uint32_t Chip_WWDT_GetStatus ( void  )

Read WWDT status flag.

Returns
Watchdog status, an Or'ed value of WWDT_WDMOD_*

Definition at line 160 of file wwdt_18xx_43xx.h.

void Chip_WWDT_Init ( void  )

Initialize the Watchdog timer.

Returns
None

Definition at line 51 of file wwdt_18xx_43xx.c.

STATIC INLINE void Chip_WWDT_SetOption ( uint32_t  options)

Enable watchdog timer options.

Parameters
options: An or'ed set of options of values WWDT_WDMOD_WDEN, WWDT_WDMOD_WDRESET, and WWDT_WDMOD_WDPROTECT
Returns
None You can enable more than one option at once (ie, WWDT_WDMOD_WDRESET | WWDT_WDMOD_WDPROTECT), but use the WWDT_WDMOD_WDEN after all other options are set (or unset) with no other options.

Definition at line 128 of file wwdt_18xx_43xx.h.

STATIC INLINE void Chip_WWDT_SetTimeOut ( uint32_t  timeout)

Set WDT timeout constant value used for feed.

Parameters
timeout: WDT timeout in ticks, between WWDT_TICKS_MIN and WWDT_TICKS_MAX
Returns
none

Definition at line 77 of file wwdt_18xx_43xx.h.

STATIC INLINE void Chip_WWDT_SetWarning ( uint32_t  timeout)

Set WWDT warning interrupt.

Parameters
timeout: WDT warning in ticks, between 0 and 1023
Returns
None This is the number of ticks after the watchdog interrupt that the warning interrupt will be generated.

Definition at line 101 of file wwdt_18xx_43xx.h.

STATIC INLINE void Chip_WWDT_SetWindow ( uint32_t  timeout)

Set WWDT window time.

Parameters
timeout: WDT timeout in ticks, between WWDT_TICKS_MIN and WWDT_TICKS_MAX
Returns
none The watchdog timer must be fed between the timeout from the Chip_WWDT_SetTimeOut() function and this function, with this function defining the last tick before the watchdog window interrupt occurs.

Definition at line 114 of file wwdt_18xx_43xx.h.

STATIC INLINE void Chip_WWDT_Start ( void  )

Enable WWDT activity.

Returns
None

Definition at line 150 of file wwdt_18xx_43xx.h.

STATIC INLINE void Chip_WWDT_UnsetOption ( uint32_t  options)

Disable/clear watchdog timer options.

Parameters
options: An or'ed set of options of values WWDT_WDMOD_WDEN, WWDT_WDMOD_WDRESET, and WWDT_WDMOD_WDPROTECT
Returns
None You can disable more than one option at once (ie, WWDT_WDMOD_WDRESET | WWDT_WDMOD_WDTOF).

Definition at line 141 of file wwdt_18xx_43xx.h.

STATIC INLINE uint32_t WWDT_GetCurrentCount ( void  )

Get the current value of WDT.

Returns
current value of WDT

Definition at line 178 of file wwdt_18xx_43xx.h.