![]() |
NHS31xx SW API
|
This driver provides a simplified API to the WWDT hardware block. The WWDT driver provides the following functionalities:
If you require interrupt mode, need to check the status, or need to do anything else than described above, you must interact with the NSS_WWDT register block directly.
The WWDT hardware block controls a special timer which can perform a configured action on expiry. This can be used to recover from an anomaly in software: for example an infinite loop or an endless wait for an event or interrupt. The WWDT can be configured to work in 2 modes as given below.
Data Structures | |
struct | NSS_WWDT_T |
Macros | |
#define | WWDT_WDMOD_BITMASK ((uint32_t) 0x0FUL) |
#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)) |
Functions | |
void | Chip_WWDT_Start (uint32_t timeout) |
void | Chip_WWDT_Feed (void) |
struct NSS_WWDT_T |
WWDT register block structure
Data Fields | ||
---|---|---|
__IO uint32_t | MOD |
WWDT mode register. This register contains the basic mode and status of the WWDT Timer. |
__IO uint32_t | TC |
WWDT timer constant register. This register determines the time-out value. |
__O uint32_t | FEED |
WWDT feed sequence register. Writing 0xAA followed by 0x55 to this register reloads the WWDT timer with the value contained in WDTC. |
__I uint32_t | TV |
WWDT timer value register. This register reads out the current value of the WWDT timer. |
#define WWDT_WDMOD_BITMASK ((uint32_t) 0x0FUL) |
WWDT Mode Bitmask
#define WWDT_WDMOD_WDEN ((uint32_t) (1 << 0)) |
WWDT enable bit
#define WWDT_WDMOD_WDRESET ((uint32_t) (1 << 1)) |
WWDT reset enable bit
#define WWDT_WDMOD_WDTOF ((uint32_t) (1 << 2)) |
WWDT time out flag bit
#define WWDT_WDMOD_WDINT ((uint32_t) (1 << 3)) |
WWDT interrupt flag bit
void Chip_WWDT_Start | ( | uint32_t | timeout | ) |
Initialize, configure and start the WWDT hardware block. All necessary calls to the clock driver will also be made.
timeout | The maximum allowed time in number of seconds between two calls to Chip_WWDT_Feed. When this function leaves, the application has timeout seconds before it must call Chip_WWDT_Feed. |
void Chip_WWDT_Feed | ( | void | ) |
Feed the WWDT timer. Calling this function pushes back a reset for the number of seconds as given in a previous call to Chip_WWDT_Start. The application must continue calling this function periodically within the configured timeout period; failure to do so will cause a reset.