STM32 core 3.0.1-dev
Arduino core for STM32 based boards: API reference
← STM32duino documentation
Loading...
Searching...
No Matches
IWatchdogClass Class Reference

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.
 

Detailed Description

Independent watchdog (IWDG) controller, exposed as the global IWatchdog object.

Member Function Documentation

◆ begin()

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.

Parameters
timeoutTimeout in microseconds. Ignored if it is not valid (see IS_IWDG_TIMEOUT()).
windowOptional window in microseconds. Default: IWDG_TIMEOUT_MAX.

◆ get()

void IWatchdogClass::get ( uint32_t *  timeout,
uint32_t *  window = NULL 
)

Get the current timeout and window values of the watchdog.

Parameters
timeoutPointer where the timeout in microseconds is stored. Nothing is done if NULL.
windowOptional pointer where the window in microseconds is stored. Default: NULL.

◆ isEnabled()

bool IWatchdogClass::isEnabled ( void  )
inline

Check whether the watchdog has been enabled with begin().

Returns
true if the watchdog is enabled, false otherwise.

◆ isReset()

bool IWatchdogClass::isReset ( bool  clear = false)

Check if the system has resumed from an IWDG reset.

Parameters
clearIf true, clear the IWDG reset flag after reading it. Default: false.
Returns
true if the last reset was caused by the IWDG, false otherwise.

◆ reload()

void IWatchdogClass::reload ( void  )

Reload the counter to prevent a watchdog reset.

Does nothing if the watchdog is not enabled.

◆ set()

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.

Parameters
timeoutTimeout in microseconds. Ignored if the watchdog is enabled and the value is not valid.
windowOptional window in microseconds. Default: IWDG_TIMEOUT_MAX.

The documentation for this class was generated from the following files: