|
STM32 core 3.0.1-dev
Arduino core for STM32 based boards: API reference
|
← STM32duino documentation
|
Independent watchdog (IWDG) controller, exposed as the global IWatchdog object. More...
#include <IWatchdog.h>
Public Member Functions | |
| IWatchdogClass () | |
| Construct the controller and enable the watchdog peripheral clock when required. | |
| void | begin (uint32_t timeout, uint32_t window=IWDG_TIMEOUT_MAX) |
| Enable the IWDG. | |
| void | set (uint32_t timeout, uint32_t window=IWDG_TIMEOUT_MAX) |
| Set the timeout and window values of the watchdog and refresh its counter. | |
| void | get (uint32_t *timeout, uint32_t *window=NULL) |
| Get the current timeout and window values of the watchdog. | |
| void | reload (void) |
| Reload the counter to prevent a watchdog reset. | |
| bool | isEnabled (void) |
| Check whether the watchdog has been enabled with begin(). | |
| bool | isReset (bool clear=false) |
| Check if the system has resumed from an IWDG reset. | |
| void | clearReset (void) |
| Clear the IWDG reset flag. | |
Independent watchdog (IWDG) controller, exposed as the global IWatchdog object.
| void IWatchdogClass::begin | ( | uint32_t | timeout, |
| uint32_t | window = IWDG_TIMEOUT_MAX |
||
| ) |
Enable the IWDG.
Must be called only once.
Once enabled, the watchdog cannot be stopped.
| timeout | Timeout in microseconds. Ignored if it is not valid (see IS_IWDG_TIMEOUT()). |
| window | Optional window in microseconds. Default: IWDG_TIMEOUT_MAX. |
| void IWatchdogClass::get | ( | uint32_t * | timeout, |
| uint32_t * | window = NULL |
||
| ) |
Get the current timeout and window values of the watchdog.
| timeout | Pointer where the timeout in microseconds is stored. Nothing is done if NULL. |
| window | Optional pointer where the window in microseconds is stored. Default: NULL. |
|
inline |
Check whether the watchdog has been enabled with begin().
| bool IWatchdogClass::isReset | ( | bool | clear = false | ) |
Check if the system has resumed from an IWDG reset.
| clear | If true, clear the IWDG reset flag after reading it. Default: false. |
| void IWatchdogClass::reload | ( | void | ) |
Reload the counter to prevent a watchdog reset.
Does nothing if the watchdog is not enabled.
| void IWatchdogClass::set | ( | uint32_t | timeout, |
| uint32_t | window = IWDG_TIMEOUT_MAX |
||
| ) |
Set the timeout and window values of the watchdog and refresh its counter.
| timeout | Timeout in microseconds. Ignored if the watchdog is enabled and the value is not valid. |
| window | Optional window in microseconds. Default: IWDG_TIMEOUT_MAX. |