Hardware system timer that will reset the system in the case of system failures or malfunctions. More...
#include <Watchdog.h>
Public Member Functions | |
bool | start () |
Start the watchdog timer with the maximum timeout available on a target. More... | |
bool | start (uint32_t timeout) |
Start the watchdog timer. More... | |
bool | stop () |
Stops the watchdog timer. More... | |
uint32_t | get_timeout () const |
Get the watchdog timer refresh value. More... | |
uint32_t | get_max_timeout () const |
Get the maximum refresh value for the current platform in milliseconds. More... | |
bool | is_running () const |
Check if watchdog is already running. More... | |
void | kick () |
Kick watchdog. More... | |
Static Public Member Functions | |
static Watchdog & | get_instance () |
As Watchdog might not stop ever, there is just one instance - we use single instance. More... | |
Hardware system timer that will reset the system in the case of system failures or malfunctions.
There is only one instance in the system.
Example:
Definition at line 52 of file Watchdog.h.
|
static |
As Watchdog might not stop ever, there is just one instance - we use single instance.
This ensures we keep Watchdog alive. To operate watchdog, use start/stop methods.
Definition at line 58 of file Watchdog.h.
uint32_t get_max_timeout | ( | ) | const |
Get the maximum refresh value for the current platform in milliseconds.
uint32_t get_timeout | ( | ) | const |
Get the watchdog timer refresh value.
This function returns the refresh timeout of the watchdog timer.
bool is_running | ( | ) | const |
Check if watchdog is already running.
void kick | ( | ) |
Kick watchdog.
This method is useful to control kicking by application in ticker callback periodically
bool start | ( | ) |
Start the watchdog timer with the maximum timeout available on a target.
Timeout is defined as get_max_timeout()
bool start | ( | uint32_t | timeout | ) |
Start the watchdog timer.
timeout | Watchdog timeout |
bool stop | ( | ) |
Stops the watchdog timer.
Calling this function will attempt to disable any currently running watchdog timers if supported by the current platform.