avr-classes
|
#include <periodictimer.h>
Public Member Functions | |
PeriodicTimer (EventReceiver *receiver, const Event &event, COUNTERTYPE timeout) | |
![]() | |
OneShotTimer (EventReceiver *receiver, const Event &event, COUNTERTYPE timeout) | |
COUNTERTYPE | getTimeout (void) const |
void | setTimeout (COUNTERTYPE timeout) |
virtual void | onTick (void) override |
void | reset (void) |
void | restart (void) |
![]() | |
TimerService (void) | |
void | start (void) |
void | stop (void) |
bool | isRunning (void) const |
Protected Member Functions | |
virtual void | elapsed (void) override |
Countdown timer that sends an event when it has elapsed and automatically restarts itself. A PeriodicTimer can be paused using the stop() and start() methods, and reset to the original timeout value using reset(). The PeriodicTimer needs to be added to a TimerServiceHost instance. The base tick frequency of the TimerServiceHost specifies the rate at which the timeout value is decremented.
COUNTERTYPE | Data type for timeout value, e.g. uint16_t. |
|
inline |
Constructor.
receiver | Receiver of the elapsed event. |
event | Event to be sent when timer has elapsed. |
timeout | Timeout value, actual time depends on base tick frequency of used TimerServiceHost. |
|
inlineoverrideprotectedvirtual |
Method that is called when the timer is running and reaches zero.
Reimplemented from OneShotTimer< COUNTERTYPE >.