Mistake on this page?
Report an issue in GitHub or email us
Modules | Data Structures | Enumerations | Functions
Watchdog HAL API

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

Detailed Description

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.

Defined behavior

Undefined behavior

Notes

Enumeration Type Documentation

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 107 of file watchdog_api.h.

Function Documentation

watchdog_features_t hal_watchdog_get_platform_features ( void  )

Get information on the current platforms supported watchdog functionality.

Returns
watchdog_feature_t indicating supported watchdog features on the current platform
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.

Returns
Reload value for the watchdog timer in milliseconds.
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.

Parameters
[in]configConfiguration settings for the watchdog timer
Returns
WATCHDOG_STATUS_OK if the watchdog is configured correctly and has started. Otherwise a status indicating the fault.
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.

Returns
Returns WATCHDOG_STATUS_OK if the watchdog timer was succesfully stopped, or if the timer was never started. Returns WATCHDOG_STATUS_NOT_SUPPORTED if the watchdog cannot be disabled on the current platform.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.