| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
IP: WWDT register block and driver
IP drivers: Common drivers used on multiple NXP devices

## Detailed Description

Windowed Watchdog

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

## Macros
#define | WATCHDOG_WINDOW_SUPPORT
#define | WWDT_WDMOD_BITMASK ((uint32_t) 0x1F)
| Watchdog Mode register definitions.
#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 | IP_WWDT_Init (IP_WWDT_001_T *pWWDT)
| Initialize the Watchdog Timer.
STATIC INLINE void | IP_WWDT_DeInit (IP_WWDT_001_T *pWWDT)
| De-initialize the Watchdog Timer.
STATIC INLINE void | IP_WWDT_SetTimeOut (IP_WWDT_001_T *pWWDT, uint32_t timeout)
| Set WDT timeout constant value used for feed.
STATIC INLINE void | IP_WWDT_Feed (IP_WWDT_001_T *pWWDT)
| Feed watchdog timer.
STATIC INLINE void | IP_WWDT_SetWarning (IP_WWDT_001_T *pWWDT, uint32_t timeout)
| Set WWDT warning interrupt.
STATIC INLINE void | IP_WWDT_SetWindow (IP_WWDT_001_T *pWWDT, uint32_t timeout)
| Set WWDT window time.
STATIC INLINE void | IP_WWDT_SetOption (IP_WWDT_001_T *pWWDT, uint32_t options)
| Enable watchdog timer options.
STATIC INLINE void | IP_WWDT_UnsetOption (IP_WWDT_001_T *pWWDT, uint32_t options)
| Disable/clear watchdog timer options.
STATIC INLINE void | IP_WWDT_Start (IP_WWDT_001_T *pWWDT)
| Enable WWDT activity.
STATIC INLINE uint32_t | IP_WWDT_GetStatus (IP_WWDT_001_T *pWWDT)
| Read WWDT status flag.
void | IP_WWDT_ClearStatusFlag (IP_WWDT_001_T *pWWDT, uint32_t status)
| Clear WWDT interrupt status flags.
STATIC INLINE uint32_t | IP_WWDT_GetCurrentCount (IP_WWDT_001_T *pWWDT)
| Get the current value of WDT.

## Macro Definition Documentation

#define WATCHDOG_WINDOW_SUPPORT

Definition at line 48 of file wwdt_001.h.

#define WWDT_WDMOD_BITMASK ((uint32_t) 0x1F)

Watchdog Mode register definitions.

Watchdog Mode Bitmask

Definition at line 79 of file wwdt_001.h.

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

WWDT interrupt enable bit

Definition at line 81 of file wwdt_001.h.

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

WDT Time Out flag bit

Definition at line 87 of file wwdt_001.h.

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

WWDT Protect flag bit

Definition at line 90 of file wwdt_001.h.

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

WWDT interrupt enable bit

Definition at line 83 of file wwdt_001.h.

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

WWDT time out flag bit

Definition at line 85 of file wwdt_001.h.

## Function Documentation

void IP_WWDT_ClearStatusFlag | ( | IP_WWDT_001_T * | pWWDT,
|  | uint32_t | status
| ) |  |

Clear WWDT interrupt status flags.

Parameters

  pWWDT | : pointer to WWDT register block
  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 63 of file wwdt_001.c.

STATIC INLINE void IP_WWDT_DeInit | ( | IP_WWDT_001_T * | pWWDT | ) |

De-initialize the Watchdog Timer.

Parameters

  pWWDT | : pointer to WWDT register block

Returns
  None

Definition at line 116 of file wwdt_001.h.

STATIC INLINE void IP_WWDT_Feed | ( | IP_WWDT_001_T * | pWWDT | ) |

Feed watchdog timer.

Parameters

  pWWDT | : pointer to WWDT register block

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 151 of file wwdt_001.h.

STATIC INLINE uint32_t IP_WWDT_GetCurrentCount | ( | IP_WWDT_001_T * | pWWDT | ) |

Get the current value of WDT.

Returns
  current value of WDT

Definition at line 251 of file wwdt_001.h.

STATIC INLINE uint32_t IP_WWDT_GetStatus | ( | IP_WWDT_001_T * | pWWDT | ) |

Read WWDT status flag.

Parameters

  pWWDT | : pointer to WWDT register block

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

Definition at line 232 of file wwdt_001.h.

void IP_WWDT_Init | ( | IP_WWDT_001_T * | pWWDT | ) |

Initialize the Watchdog Timer.

Parameters

  pWWDT | : pointer to WWDT register block

Returns
  None

Definition at line 51 of file wwdt_001.c.

STATIC INLINE void IP_WWDT_SetOption | ( | IP_WWDT_001_T * | pWWDT,
|  | uint32_t | options
| ) |  |

Enable watchdog timer options.

Parameters

  pWWDT | : pointer to WWDT register block
  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.

Definition at line 197 of file wwdt_001.h.

STATIC INLINE void IP_WWDT_SetTimeOut | ( | IP_WWDT_001_T * | pWWDT,
|  | uint32_t | timeout
| ) |  |

Set WDT timeout constant value used for feed.

Parameters

  pWWDT | : pointer to WWDT register block
  timeout | : WDT timeout in ticks

Returns
  none

Definition at line 125 of file wwdt_001.h.

STATIC INLINE void IP_WWDT_SetWarning | ( | IP_WWDT_001_T * | pWWDT,
|  | uint32_t | timeout
| ) |  |

Set WWDT warning interrupt.

Parameters

  pWWDT | : pointer to WWDT register block
  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 166 of file wwdt_001.h.

STATIC INLINE void IP_WWDT_SetWindow | ( | IP_WWDT_001_T * | pWWDT,
|  | uint32_t | timeout
| ) |  |

Set WWDT window time.

Parameters

  pWWDT | : pointer to WWDT register block
  timeout | : WDT timeout in ticks

Returns
  none

Note
  The watchdog timer must be fed between the timeout from the IP_WWDT_SetTimeOut() function and this function, with this function defining the last tick before the watchdog window interrupt occurs.

Definition at line 180 of file wwdt_001.h.

STATIC INLINE void IP_WWDT_Start | ( | IP_WWDT_001_T * | pWWDT | ) |

Enable WWDT activity.

Parameters

  pWWDT | : pointer to WWDT register block

Returns
  None

Definition at line 221 of file wwdt_001.h.

STATIC INLINE void IP_WWDT_UnsetOption | ( | IP_WWDT_001_T * | pWWDT,
|  | uint32_t | options
| ) |  |

Disable/clear watchdog timer options.

Parameters

  pWWDT | : pointer to WWDT register block
  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 211 of file wwdt_001.h.