Low-level interface to the Independent Watchdog Timer of a target. More...
Modules | |
Watchdog HAL tests | |
Greentea tests for the Watchdog HAL. | |
Data Structures | |
struct | watchdog_config_t |
Watchdog configuration. More... | |
struct | watchdog_features_t |
Watchdog features. More... | |
Enumerations |
Functions | |
watchdog_status_t | hal_watchdog_init (const watchdog_config_t *config) |
Initialize and start a watchdog timer with the given configuration. More... | |
void | hal_watchdog_kick (void) |
Refreshes the watchdog timer. More... | |
watchdog_status_t | hal_watchdog_stop (void) |
Stops the watchdog timer. More... | |
uint32_t | hal_watchdog_get_reload_value (void) |
Get the watchdog timer refresh value. More... | |
watchdog_features_t | hal_watchdog_get_platform_features (void) |
Get information on the current platforms supported watchdog functionality. More... | |
Low-level interface to the Independent Watchdog Timer of a target.
This module provides platform independent access to the system watchdog timer which is an embedded peripheral that will reset the system in the case of system failures or malfunctions.
The watchdog timer initializes a system timer with a time period specified in the configuration. This timer counts down and triggers a system reset when it wraps. To prevent the system reset the timer must be continually kicked/refreshed by calling hal_watchdog_kick which will reset the countdown to the user specified reset value.
UINT32_MAX
milliseconds; minimum timeout is 1 millisecond.enum watchdog_status_t |
Status of a watchdog operation.
Enumerator | |
---|---|
WATCHDOG_STATUS_OK |
Operation successful. |
WATCHDOG_STATUS_NOT_SUPPORTED |
Operation not supported. |
WATCHDOG_STATUS_INVALID_ARGUMENT |
Invalid argument. |
Definition at line 117 of file watchdog_api.h.
watchdog_features_t hal_watchdog_get_platform_features | ( | void | ) |
Get information on the current platforms supported watchdog functionality.
uint32_t hal_watchdog_get_reload_value | ( | void | ) |
Get the watchdog timer refresh value.
This function returns the configured refresh timeout of the watchdog timer.
watchdog_status_t hal_watchdog_init | ( | const watchdog_config_t * | config | ) |
Initialize and start a watchdog timer with the given configuration.
If the watchdog timer is configured and starts successfully, this function returns WATCHDOG_STATUS_OK.
If the timeout specified is outside the range supported by the platform, it returns WATCHDOG_STATUS_INVALID_ARGUMENT.
[in] | config | Configuration settings for the watchdog timer |
void hal_watchdog_kick | ( | void | ) |
Refreshes the watchdog timer.
Call this function periodically before the watchdog times out. Otherwise, the system resets.
If a watchdog is not running, this function does nothing.
watchdog_status_t hal_watchdog_stop | ( | void | ) |
Stops the watchdog timer.
Calling this function disables any running watchdog timers if the current platform supports them.