See Quick start guide for WDT driver.
This is a driver for configuring, enabling, disabling and use of the on-chip WDT.
The WDT module depends on the following modules:
Modules | |
Related Project(s) | |
In this section you can find all the projects related to the Watchdog Timer (WDT). | |
Quick Start Guide(s) | |
In this section you can find a list of all Quick Start guides related to the Watchdog Timer (WDT). | |
Macros | |
#define | wdt_reset() __asm__ __volatile__("wdr"); |
This macro resets (clears/refreshes) the Watchdog Timer. More... | |
Enumerations | |
enum | wdt_timeout_period_t { WDT_TIMEOUT_PERIOD_8CLK = (0x00), WDT_TIMEOUT_PERIOD_16CLK = (0x01), WDT_TIMEOUT_PERIOD_32CLK = (0x02), WDT_TIMEOUT_PERIOD_64CLK = (0x03), WDT_TIMEOUT_PERIOD_125CLK = (0x04), WDT_TIMEOUT_PERIOD_250CLK = (0x05), WDT_TIMEOUT_PERIOD_500CLK = (0x06), WDT_TIMEOUT_PERIOD_1KCLK = (0x07), WDT_TIMEOUT_PERIOD_2KCLK = (0x08), WDT_TIMEOUT_PERIOD_4KCLK = (0x09), WDT_TIMEOUT_PERIOD_8KCLK = (0x0A) } |
Watchdog timeout period setting. More... | |
enum | wdt_window_period_t { WDT_WINDOW_PERIOD_8CLK = (0x00), WDT_WINDOW_PERIOD_16CLK = (0x01), WDT_WINDOW_PERIOD_32CLK = (0x02), WDT_WINDOW_PERIOD_64CLK = (0x03), WDT_WINDOW_PERIOD_125CLK = (0x04), WDT_WINDOW_PERIOD_250CLK = (0x05), WDT_WINDOW_PERIOD_500CLK = (0x06), WDT_WINDOW_PERIOD_1KCLK = (0x07), WDT_WINDOW_PERIOD_2KCLK = (0x08), WDT_WINDOW_PERIOD_4KCLK = (0x09), WDT_WINDOW_PERIOD_8KCLK = (0x0A) } |
Watchdog window period setting. More... | |
Functions | |
void | wdt_disable (void) |
Disable Watchdog. More... | |
bool | wdt_disable_window_mode (void) |
Disable Watchdog window mode without changing period settings. More... | |
void | wdt_enable (void) |
Enable Watchdog. More... | |
bool | wdt_enable_window_mode (void) |
Enable Watchdog window mode. More... | |
static enum wdt_timeout_period_t | wdt_get_timeout_period (void) |
Gets the Watchdog timeout period. More... | |
static enum wdt_window_period_t | wdt_get_window_period (void) |
Gets the Watchdog window period. More... | |
static bool | wdt_is_enabled (void) |
Check if the Watchdog Enable flag is set. More... | |
void | wdt_reset_mcu (void) |
Reset MCU via Watchdog. More... | |
void | wdt_set_timeout_period (enum wdt_timeout_period_t to_period) |
Set Watchdog timeout period. More... | |
bool | wdt_set_window_period (enum wdt_window_period_t win_period) |
Set Watchdog window period. More... | |
static void | wdt_wait_while_busy (void) |
Wait until WD settings are synchronized to the WD clock domain. More... | |
static bool | wdt_window_mode_is_enabled (void) |
Check if the Watchdog Window mode flag is set. More... | |
#define wdt_reset | ( | ) | __asm__ __volatile__("wdr"); |
This macro resets (clears/refreshes) the Watchdog Timer.
Referenced by main(), and wdt_reset_mcu().
enum wdt_timeout_period_t |
Watchdog timeout period setting.
enum wdt_window_period_t |
Watchdog window period setting.
void wdt_disable | ( | void | ) |
Disable Watchdog.
This function disables the WDT without changing period settings.
The function writes the correct signature to the Configuration Change Protection register before writing the CTRL register. Interrupts are automatically ignored during the change enable period. Disable functions operate asynchronously with immediate effect.
References ccp_write_io(), and temp.
Referenced by lowpower_init(), main(), and test_sha204_wakeup().
bool wdt_disable_window_mode | ( | void | ) |
Disable Watchdog window mode without changing period settings.
This function disables the WDT window mode without changing period settings.
The function writes the correct signature to the Configuration Change Protection register before writing the WINCTRL register. Interrupts are automatically ignored during the change enable period. Disable functions operate asynchronously with immediate effect.
true | The WDT was enabled and the window mode is disabled. false The WDT (& the window mode) is already disabled. |
References ccp_write_io(), temp, and wdt_is_enabled().
void wdt_enable | ( | void | ) |
Enable Watchdog.
This function enables the WDT without changing period settings.
The function writes the correct signature to the Configuration Change Protection register before writing the CTRL register. Interrupts are automatically ignored during the change enable period. The function will wait for the WDT to be synchronized to the WDT clock domain before proceeding
References ccp_write_io(), temp, and wdt_wait_while_busy().
Referenced by main(), and test_sha204_wakeup().
bool wdt_enable_window_mode | ( | void | ) |
Enable Watchdog window mode.
This function enables the WDT window mode without changing period settings.
The function writes the correct signature to the Configuration Change Protection register before writing the WINCTRL register. Interrupts are automatically ignored during the change enable period. The function will wait for the WDT to be synchronized to the WDT clock domain before proceeding
true | The WDT was enabled and the setting is done. false The WDT is disabled and the setting is discarded. |
References ccp_write_io(), temp, wdt_is_enabled(), and wdt_wait_while_busy().
Referenced by main().
|
inlinestatic |
Gets the Watchdog timeout period.
This function reads the value of the WDT timeout period.
The | WDT timeout period. |
Referenced by main().
|
inlinestatic |
Gets the Watchdog window period.
This function reads the value of the WDT closed window coded period.
The | WDT window period. |
|
inlinestatic |
Check if the Watchdog Enable flag is set.
false | WDT disabled true WDT enabled |
Referenced by wdt_disable_window_mode(), wdt_enable_window_mode(), and wdt_set_window_period().
void wdt_reset_mcu | ( | void | ) |
Reset MCU via Watchdog.
This function generates an hardware microcontroller reset using the WDT.
The function loads enables the WDT in window mode. Executing a "wdr" asm instruction when the windows is closed, provides a quick mcu reset.
References ccp_write_io(), temp, wdt_reset, and wdt_wait_while_busy().
Referenced by main().
void wdt_set_timeout_period | ( | enum wdt_timeout_period_t | to_period | ) |
Set Watchdog timeout period.
This function sets the coded field of the WDT timeout period.
The function writes the correct signature to the Configuration Change Protection register before writing the CTRL register. Interrupts are automatically ignored during the change enable period. The function will wait for the WDT to be synchronized to the WDT clock domain before proceeding
to_period | WDT timeout coded period |
References ccp_write_io(), temp, and wdt_wait_while_busy().
Referenced by main(), and test_sha204_wakeup().
bool wdt_set_window_period | ( | enum wdt_window_period_t | win_period | ) |
Set Watchdog window period.
This function sets the coded field of the WDT closed window period. Note that this setting is available only if the WDT is enabled (hardware behaviour relayed by software).
The function writes the correct signature to the Configuration Change Protection register before writing the WINCTRL register. Interrupts are automatically ignored during the change enable period. The function will wait for the WDT to be synchronized to the WDT clock domain before proceeding
win_period | Window coded period |
true | The WDT was enabled and the setting is done. false The WDT is disabled and the setting is discarded. |
References ccp_write_io(), temp, wdt_is_enabled(), and wdt_wait_while_busy().
Referenced by main().
|
inlinestatic |
Wait until WD settings are synchronized to the WD clock domain.
Referenced by wdt_enable(), wdt_enable_window_mode(), wdt_reset_mcu(), wdt_set_timeout_period(), and wdt_set_window_period().
|
inlinestatic |
Check if the Watchdog Window mode flag is set.
false | WDT Window disabled true WDT Window enabled |