NHS31xx SW API
wwdt: Windowed Watchdog Timer driver

Detailed Description

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.

Warning
The watchdog reset status is cleared on system reset. It is thus not possible to distinguish between a hard reset after toggling the RESETN pin and a WWDT timeout.
Note
This mode is not supported by this driver.
Warning
Using the interrupt mode will not protect against hangs inside an interrupt handler which has a higher priority. See IRQn_Type for a full list of interrupts and their priority.
To configure and start the WWDT:
  1. Call Chip_WWDT_Start.
To reset the expiry timer and prevent a reset:
  1. Call Chip_WWDT_Feed periodically.
Example - WWDT
Chip_Clock_System_BusyWait_ms(1111); /* Less than 3 seconds */
Chip_GPIO_SetPinOutHigh(NSS_GPIO, 0, 1); /* This call will be executed */
Chip_Clock_System_BusyWait_ms(2222); /* Less than 3 seconds */
Chip_GPIO_SetPinOutLow(NSS_GPIO, 0, 1); /* This call will be executed */
Chip_Clock_System_BusyWait_ms(3333); /* Longer than 3 seconds */
Chip_GPIO_SetPinOutHigh(NSS_GPIO, 0, 2); /* This call will never be executed */

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)
 

Data Structure Documentation

◆ NSS_WWDT_T

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.

Macro Definition Documentation

◆ WWDT_WDMOD_BITMASK

#define WWDT_WDMOD_BITMASK   ((uint32_t) 0x0FUL)

WWDT Mode Bitmask

◆ WWDT_WDMOD_WDEN

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

WWDT enable bit

◆ WWDT_WDMOD_WDRESET

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

WWDT reset enable bit

◆ WWDT_WDMOD_WDTOF

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

WWDT time out flag bit

◆ WWDT_WDMOD_WDINT

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

WWDT interrupt flag bit

Function Documentation

◆ Chip_WWDT_Start()

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.

Parameters
timeoutThe 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.
Precondition
This function may only be called once after a reset.

◆ 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.