LPCOpen Platform for LPC18XX/43XX microcontrollers: CHIP: LPC18xx/43xx Windowed Watchdog driver

| LPCOpen Platform for LPC18XX/43XX microcontrollers 18XX43XX LPCOpen Platform for the NXP LPC18XX/43XX family of Microcontrollers

- Main Page
- Modules
- Data Structures
- Files

Data Structures | Macros | Functions
CHIP: LPC18xx/43xx Windowed Watchdog driver
LPC18xx/43xx chip specific drivers

## Detailed Description

## Data Structures
struct | LPC_WWDT_T
| Windowed Watchdog register block structure. More...

## Macros
#define | WATCHDOG_WINDOW_SUPPORT
#define | WDT_OSC (CGU_IRC_FREQ)
#define | WWDT_WDMOD_BITMASK ((uint32_t) 0x1F)
| Watchdog Mode register definitions. More...
#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))

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

## Macro Definition Documentation

#define WATCHDOG_WINDOW_SUPPORT

Definition at line 44 of file wwdt_18xx_43xx.h.

#define WDT_OSC (CGU_IRC_FREQ)

WDT oscillator frequency value

Definition at line 47 of file wwdt_18xx_43xx.h.

#define WWDT_WDMOD_BITMASK ((uint32_t) 0x1F)

Watchdog Mode register definitions.

Watchdog Mode Bitmask

Definition at line 68 of file wwdt_18xx_43xx.h.

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

WWDT interrupt enable bit

Definition at line 70 of file wwdt_18xx_43xx.h.

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

WDT Time Out flag bit

Definition at line 76 of file wwdt_18xx_43xx.h.

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

WWDT Protect flag bit

Definition at line 78 of file wwdt_18xx_43xx.h.

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

WWDT interrupt enable bit

Definition at line 72 of file wwdt_18xx_43xx.h.

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

WWDT time out flag bit

Definition at line 74 of file wwdt_18xx_43xx.h.

## Function Documentation

void Chip_WWDT_ClearStatusFlag | ( | LPC_WWDT_T * | pWWDT,
|  | uint32_t | status
| ) |  |

Clear WWDT interrupt status flags.

Parameters

  pWWDT | : The base of WatchDog Timer peripheral on the chip
  status | : 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 68 of file wwdt_18xx_43xx.c.

void Chip_WWDT_DeInit | ( | LPC_WWDT_T * | pWWDT | ) |

Shutdown the Watchdog timer.

Parameters

  pWWDT | : The base of WatchDog Timer peripheral on the chip

Returns
  None

Definition at line 63 of file wwdt_18xx_43xx.c.

STATIC INLINE void Chip_WWDT_Feed | ( | LPC_WWDT_T * | pWWDT | ) |

Feed watchdog timer.

Parameters

  pWWDT | : The base of WatchDog Timer peripheral on the chip

Returns
  None

Note
  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 112 of file wwdt_18xx_43xx.h.

STATIC INLINE uint32_t Chip_WWDT_GetCurrentCount | ( | LPC_WWDT_T * | pWWDT | ) |

Get the current value of WDT.

Parameters

  pWWDT | : The base of WatchDog Timer peripheral on the chip

Returns
  current value of WDT

Definition at line 214 of file wwdt_18xx_43xx.h.

STATIC INLINE uint32_t Chip_WWDT_GetStatus | ( | LPC_WWDT_T * | pWWDT | ) |

Read WWDT status flag.

Parameters

  pWWDT | : The base of WatchDog Timer peripheral on the chip

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

Definition at line 194 of file wwdt_18xx_43xx.h.

void Chip_WWDT_Init | ( | LPC_WWDT_T * | pWWDT | ) |

Initialize the Watchdog timer.

Parameters

  pWWDT | : The base of WatchDog Timer peripheral on the chip

Returns
  None

Definition at line 51 of file wwdt_18xx_43xx.c.

STATIC INLINE void Chip_WWDT_SetOption | ( | LPC_WWDT_T * | pWWDT,
|  | uint32_t | options
| ) |  |

Enable watchdog timer options.

Parameters

  pWWDT | : The base of WatchDog Timer peripheral on the chip
  options | : An or'ed set of options of values WWDT_WDMOD_WDEN, WWDT_WDMOD_WDRESET, and WWDT_WDMOD_WDPROTECT

Returns
  None

Note
  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. If WWDT_WDMOD_LOCK is used, it cannot be unset.

Definition at line 159 of file wwdt_18xx_43xx.h.

STATIC INLINE void Chip_WWDT_SetTimeOut | ( | LPC_WWDT_T * | pWWDT,
|  | uint32_t | timeout
| ) |  |

Set WDT timeout constant value used for feed.

Parameters

  pWWDT | : The base of WatchDog Timer peripheral on the chip
  timeout | : WDT timeout in ticks, between WWDT_TICKS_MIN and WWDT_TICKS_MAX

Returns
  none

Definition at line 100 of file wwdt_18xx_43xx.h.

STATIC INLINE void Chip_WWDT_SetWarning | ( | LPC_WWDT_T * | pWWDT,
|  | uint32_t | timeout
| ) |  |

Set WWDT warning interrupt.

Parameters

  pWWDT | : The base of WatchDog Timer peripheral on the chip
  timeout | : WDT warning in ticks, between 0 and 1023

Returns
  None

Note
  This is the number of ticks after the watchdog interrupt that the warning interrupt will be generated.

Definition at line 127 of file wwdt_18xx_43xx.h.

STATIC INLINE void Chip_WWDT_SetWindow | ( | LPC_WWDT_T * | pWWDT,
|  | uint32_t | timeout
| ) |  |

Set WWDT window time.

Parameters

  pWWDT | : The base of WatchDog Timer peripheral on the chip
  timeout | : WDT timeout in ticks, between WWDT_TICKS_MIN and WWDT_TICKS_MAX

Returns
  None

Note
  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 141 of file wwdt_18xx_43xx.h.

STATIC INLINE void Chip_WWDT_Start | ( | LPC_WWDT_T * | pWWDT | ) |

Enable WWDT activity.

Parameters

  pWWDT | : The base of WatchDog Timer peripheral on the chip

Returns
  None

Definition at line 183 of file wwdt_18xx_43xx.h.

STATIC INLINE void Chip_WWDT_UnsetOption | ( | LPC_WWDT_T * | pWWDT,
|  | uint32_t | options
| ) |  |

Disable/clear watchdog timer options.

Parameters

  pWWDT | : The base of WatchDog Timer peripheral on the chip
  options | : An or'ed set of options of values WWDT_WDMOD_WDEN, WWDT_WDMOD_WDRESET, and WWDT_WDMOD_WDPROTECT

Returns
  None

Note
  You can disable more than one option at once (ie, WWDT_WDMOD_WDRESET | WWDT_WDMOD_WDTOF).

Definition at line 173 of file wwdt_18xx_43xx.h.