FastArduino  v1.7
C++ library to build fast but small Arduino/AVR projects
watchdog::WatchdogSignal Class Reference

Simple API to handle watchdog signals. More...

#include <fastarduino/watchdog.h>

Inheritance diagram for watchdog::WatchdogSignal:

Public Member Functions

 WatchdogSignal (const WatchdogSignal &)=delete
 
WatchdogSignaloperator= (const WatchdogSignal &)=delete
 
void begin (TimeOut timeout=TimeOut::TO_16ms)
 Start the watchdog timer with the given timeout period. More...
 
void end ()
 Stop this watchdog timer. More...
 

Detailed Description

Simple API to handle watchdog signals.

In this mode, the AVR watchdog timer is used to wake up the MCU at a specific timer period, in order to leave a low-power sleep mode, to e.g. perform periodic tasks. With this API, you do not need to register an ISR callback if you do not need one; in this situation you need to register an empty ISR with REGISTER_WATCHDOG_ISR_EMPTY() macro. If you want to register a callback on every watchdog timer tick, then you can use either REGISTER_WATCHDOG_ISR_FUNCTION or REGISTER_WATCHDOG_ISR_METHOD macros.

Definition at line 144 of file watchdog.h.

Member Function Documentation

◆ begin()

void watchdog::WatchdogSignal::begin ( TimeOut  timeout = TimeOut::TO_16ms)
inline

Start the watchdog timer with the given timeout period.

From now on, watchdog interrupts get generated at timeout period, and the MCU gets awakened at this period too, if sleeping.

Parameters
timeoutthe watchdog timeout period

Definition at line 157 of file watchdog.h.

◆ end()

void watchdog::WatchdogSignal::end ( )
inline

Stop this watchdog timer.

No more watchdog interrupts get triggered.

Definition at line 167 of file watchdog.h.


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