Macros | Functions
Watchdog Timer (WDT)

Macros

#define WDT_KEY_PASSWORD   0xA5000000
 
#define WDT_MAX_VALUE   4095
 
#define WDT_SLCK_DIV   128
 

Functions

void wdt_disable (Wdt *p_wdt)
 Disable the watchdog timer. More...
 
uint32_t wdt_get_status (Wdt *p_wdt)
 Check the watchdog timer status. More...
 
uint32_t wdt_get_timeout_value (uint32_t ul_us, uint32_t ul_sclk)
 Get counter value or permitted range value of watchdog timer from the desired timeout period (in us). More...
 
uint32_t wdt_get_us_timeout_period (Wdt *p_wdt, uint32_t ul_sclk)
 Get the timeout period of the WatchDog Timer in microseconds. More...
 
void wdt_init (Wdt *p_wdt, uint32_t ul_mode, uint16_t us_counter, uint16_t us_delta)
 Initialize watchdog timer with the given mode. More...
 
void wdt_restart (Wdt *p_wdt)
 Restart the watchdog timer. More...
 

Detailed Description

Driver for the WDT (Watchdog Timer). This driver provides access to the main features of the WDT controller. The Watchdog Timer can be used to prevent system lock-up if the software becomes trapped in a deadlock. It features a 12-bit down counter that allows a watchdog period of up to 16 seconds (slow clock at 32.768 kHz). It can generate a general reset or a processor reset only. In addition, it can be stopped while the processor is in debug mode or idle mode.

Macro Definition Documentation

◆ WDT_KEY_PASSWORD

#define WDT_KEY_PASSWORD   0xA5000000

Definition at line 71 of file wdt.c.

◆ WDT_MAX_VALUE

#define WDT_MAX_VALUE   4095

Definition at line 73 of file wdt.c.

◆ WDT_SLCK_DIV

#define WDT_SLCK_DIV   128

Definition at line 72 of file wdt.c.

Function Documentation

◆ wdt_disable()

void wdt_disable ( Wdt p_wdt)

Disable the watchdog timer.

Definition at line 120 of file wdt.c.

◆ wdt_get_status()

uint32_t wdt_get_status ( Wdt p_wdt)

Check the watchdog timer status.

Returns
Bitmask of watchdog timer status.

Definition at line 146 of file wdt.c.

◆ wdt_get_timeout_value()

uint32_t wdt_get_timeout_value ( uint32_t  ul_us,
uint32_t  ul_sclk 
)

Get counter value or permitted range value of watchdog timer from the desired timeout period (in us).

Note
The value returned by this function can be used by wdt_init() if it is not WDT_INVALID_ARGUMENT.
Parameters
ul_usThe desired timeout period (in us).
ul_sclkThe slow clock on board (in Hz).
Returns
If the desired period is beyond the watchdog period, this function returns WDT_INVALID_ARGUMENT. Otherwise it returns valid value.

Definition at line 88 of file wdt.c.

◆ wdt_get_us_timeout_period()

uint32_t wdt_get_us_timeout_period ( Wdt p_wdt,
uint32_t  ul_sclk 
)

Get the timeout period of the WatchDog Timer in microseconds.

Parameters
p_wdtPointer to a WDT instance.
ul_sclkThe slow clock frequency (in Hz).
Returns
The timeout period in microseconds.

Definition at line 159 of file wdt.c.

◆ wdt_init()

void wdt_init ( Wdt p_wdt,
uint32_t  ul_mode,
uint16_t  us_counter,
uint16_t  us_delta 
)

Initialize watchdog timer with the given mode.

Parameters
p_wdtPointer to a WDT instance.
ul_modeBitmask of watchdog timer mode.
us_counterThe value loaded in the 12-bit Watchdog Counter.
us_deltaThe permitted range for reloading the Watchdog Timer.

Definition at line 110 of file wdt.c.

◆ wdt_restart()

void wdt_restart ( Wdt p_wdt)

Restart the watchdog timer.

Definition at line 129 of file wdt.c.



inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:18:01