FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
|
Watchdog API. More...
#include "boards/board.h"
#include "boards/board_traits.h"
#include <avr/interrupt.h>
#include "interrupts.h"
#include "events.h"
Go to the source code of this file.
Classes | |
class | watchdog::WatchdogSignal |
Simple API to handle watchdog signals. More... | |
class | watchdog::WatchdogRTT |
Simple API to use watchdog timer as a real-time clock. More... | |
class | watchdog::Watchdog< EVENT > |
Simple API to use watchdog timer as a clock for events generation. More... | |
Namespaces | |
namespace | watchdog |
Defines the simple API for Watchdog timer management. | |
Macros | |
#define | REGISTER_WATCHDOG_CLOCK_ISR(EVENT) |
Register the necessary ISR (Interrupt Service Routine) for a watchdog::Watchdog to work properly. More... | |
#define | REGISTER_WATCHDOG_RTT_ISR() |
Register the necessary ISR (Interrupt Service Routine) for a watchdog::WatchdogRTT to work properly. More... | |
#define | REGISTER_WATCHDOG_ISR_METHOD(HANDLER, CALLBACK) |
Register the necessary ISR (Interrupt Service Routine) with a callback method that will be called every time a watchdog timeout occurs, according to how watchdog::WatchdogSignal was started. More... | |
#define | REGISTER_WATCHDOG_ISR_FUNCTION(CALLBACK) |
Register the necessary ISR (Interrupt Service Routine) with a callback function that will be called every time a watchdog timeout occurs, according to how watchdog::WatchdogSignal was started. More... | |
#define | REGISTER_WATCHDOG_ISR_EMPTY() EMPTY_INTERRUPT(WDT_vect) |
Register an empty ISR (Interrupt Service Routine) for a watchdog::WatchdogSignal. More... | |
#define | DECL_WATCHDOG_ISR_HANDLERS_FRIEND |
This macro shall be used in a class containing a private callback method, registered by REGISTER_WATCHDOG_ISR_METHOD . More... | |
Enumerations | |
enum class | watchdog::TimeOut : uint8_t { watchdog::TO_16ms = 0 , watchdog::TO_32ms , watchdog::TO_64ms , watchdog::TO_125ms , watchdog::TO_250ms , watchdog::TO_500ms , watchdog::TO_1s , watchdog::TO_2s , watchdog::TO_4s , watchdog::TO_8s } |
Defines the watchdog timeout period; watchdog interrupts will be triggered at the selected period. More... | |
Watchdog API.
Definition in file watchdog.h.
#define REGISTER_WATCHDOG_CLOCK_ISR | ( | EVENT | ) |
Register the necessary ISR (Interrupt Service Routine) for a watchdog::Watchdog to work properly.
EVENT | the type of Event<T> to be generated by the watchdog |
Definition at line 36 of file watchdog.h.
#define REGISTER_WATCHDOG_RTT_ISR | ( | ) |
Register the necessary ISR (Interrupt Service Routine) for a watchdog::WatchdogRTT to work properly.
Definition at line 47 of file watchdog.h.
#define REGISTER_WATCHDOG_ISR_METHOD | ( | HANDLER, | |
CALLBACK | |||
) |
Register the necessary ISR (Interrupt Service Routine) with a callback method that will be called every time a watchdog timeout occurs, according to how watchdog::WatchdogSignal was started.
HANDLER | the class holding the callback method |
CALLBACK | the method of HANDLER that will be called when the interrupt is triggered; this must be a proper PTMF (pointer to member function). |
Definition at line 61 of file watchdog.h.
#define REGISTER_WATCHDOG_ISR_FUNCTION | ( | CALLBACK | ) |
Register the necessary ISR (Interrupt Service Routine) with a callback function that will be called every time a watchdog timeout occurs, according to how watchdog::WatchdogSignal was started.
CALLBACK | the function that will be called when the interrupt is triggered |
Definition at line 74 of file watchdog.h.
#define REGISTER_WATCHDOG_ISR_EMPTY | ( | ) | EMPTY_INTERRUPT(WDT_vect) |
Register an empty ISR (Interrupt Service Routine) for a watchdog::WatchdogSignal.
This may be needed when using watchdog just to awaken a sleeping MCU, but without any necessary immediate callback.
Definition at line 85 of file watchdog.h.
#define DECL_WATCHDOG_ISR_HANDLERS_FRIEND |
This macro shall be used in a class containing a private callback method, registered by REGISTER_WATCHDOG_ISR_METHOD
.
It declares the class where it is used as a friend of all necessary functions so that the private callback method can be called properly.
Definition at line 93 of file watchdog.h.