FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
Loading...
Searching...
No Matches
watchdog::WatchdogSignal Class Reference

Simple API to handle watchdog signals. More...

#include <fastarduino/watchdog.h>

Inheritance diagram for watchdog::WatchdogSignal:

Public Member Functions

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 159 of file watchdog.h.

◆ end()

void watchdog::WatchdogSignal::end ( )
inline

Stop this watchdog timer.

No more watchdog interrupts get triggered.

Definition at line 169 of file watchdog.h.


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