COSA
An Object-Oriented Platform for Arduino Programming
|
#include <Alarm.hh>
Classes | |
class | Clock |
Public Member Functions | |
Alarm (::Clock *clock, uint32_t period) | |
void | period (uint32_t time) |
uint32_t | period () const |
void | reschedule () |
void | expire_at (uint32_t time) |
uint32_t | expire_at () const |
void | expire_after (uint32_t time) |
int32_t | expire_after () const |
uint32_t | time () const |
bool | is_started () const |
bool | start () |
bool | stop () |
virtual void | on_expired () |
virtual void | run () |
void | detach () |
Linkage * | succ () const |
Linkage * | pred () const |
void | attach (Linkage *pred) |
Protected Member Functions | |
virtual void | on_event (uint8_t type, uint16_t value) |
Protected Attributes | |
uint32_t | m_period |
uint32_t | m_expires |
Scheduler * | m_scheduler |
Linkage * | m_succ |
Linkage * | m_pred |
The Alarm class is an extension of the Periodic job class. It allows repeated jobs with seconds as time unit. The abstract Alarm Clock is used as the alarm scheduler. It is triggered by an external interrupt typically from an RTC device.
|
inline |
|
inlineinherited |
Attach given linkage as predecessor. Will check and detach if already attached.
[in] | pred | linkage to attach. |
Definition at line 71 of file Linkage.hh.
|
inlineinherited |
Detach this link. Unlink from any list.
Definition at line 125 of file Linkage.hh.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineprotectedvirtualinherited |
Periodic event handler; dispatch the run() function on timeout events and reschedule the periodic job.
[in] | type | the type of event. |
[in] | value | the event value. |
Reimplemented from Job.
Definition at line 91 of file Periodic.hh.
|
inlinevirtualinherited |
Job member function that is called Scheduler::dispatch() when the job time has expired. This function is normally called from an interrupt service routine. The default implementation will push a timeout event with the job as target. The default event handler will call the job run() virtual member function. Override this function if the job should be executed during the interrupt service routine.
|
inlineinherited |
Set timeout period.
[in] | time | period of timeout. |
Definition at line 57 of file Periodic.hh.
|
inlineinherited |
|
inlineinherited |
Return predecessor in sequence.
Definition at line 60 of file Linkage.hh.
|
inlineinherited |
Reschedule after a new period.
Definition at line 76 of file Periodic.hh.
|
inlinevirtualinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
protectedinherited |
|
protectedinherited |
Time period. Time unit is defined by the scheduler.
Definition at line 100 of file Periodic.hh.
|
protectedinherited |
Definition at line 94 of file Linkage.hh.
|
protectedinherited |
|
protectedinherited |
Double linked list pointers.
Definition at line 93 of file Linkage.hh.