FastArduino  v1.7
C++ library to build fast but small Arduino/AVR projects
watchdog::Watchdog< EVENT > Class Template Reference

Simple API to use watchdog timer as a clock for events generation. More...

#include <fastarduino/watchdog.h>

Inheritance diagram for watchdog::Watchdog< EVENT >:
Collaboration diagram for watchdog::Watchdog< EVENT >:

Public Member Functions

 Watchdog (containers::Queue< EVENT > &event_queue)
 Construct a new watchdog-based clock that will, for each watchdog timeout, add an event to the given event_queue for further processing. More...
 
- Public Member Functions inherited from watchdog::WatchdogRTT
 WatchdogRTT ()
 Construct a new watchdog-based clock that will count elapsed milliseconds since it was started with begin(). More...
 
void begin (TimeOut timeout=TimeOut::TO_16ms)
 Start the watchdog clock with the given timeout period. More...
 
uint32_t millis () const
 Get the number of milliseconds that elapsed since begin() was called. More...
 
void reset ()
 Reset current counter to 0. More...
 
void delay (uint32_t ms)
 Delay program execution for the given amount of milliseconds. More...
 
- Public Member Functions inherited from watchdog::WatchdogSignal
 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...
 

Friends

struct isr_handler
 

Detailed Description

template<typename EVENT>
class watchdog::Watchdog< EVENT >

Simple API to use watchdog timer as a clock for events generation.

For this to work correctly, you need to register the proper ISR through REGISTER_WATCHDOG_CLOCK_ISR() macro first.

Template Parameters
EVENTthe events::Event<T> generated

Definition at line 304 of file watchdog.h.

Constructor & Destructor Documentation

◆ Watchdog()

template<typename EVENT >
watchdog::Watchdog< EVENT >::Watchdog ( containers::Queue< EVENT > &  event_queue)
inlineexplicit

Construct a new watchdog-based clock that will, for each watchdog timeout, add an event to the given event_queue for further processing.

This clock also counts elapsed milliseconds since it was started with begin().

Parameters
event_queuethe queue to which Events will be pushed on each watchdog tick
See also
REGISTER_WATCHDOG_CLOCK_ISR()

Definition at line 319 of file watchdog.h.


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