COSA
An Object-Oriented Platform for Arduino Programming
|
#include <Menu.hh>
Public Types | |
enum | { NO_KEY = 0, SELECT_KEY, LEFT_KEY, DOWN_KEY, UP_KEY, RIGHT_KEY } |
Public Member Functions | |
KeypadController (Walker *walker, Job::Scheduler *scheduler) | |
virtual void | on_key_down (uint8_t nr) |
virtual void | on_key_up (uint8_t nr) |
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 () |
void | detach () |
Linkage * | succ () const |
Linkage * | pred () const |
void | attach (Linkage *pred) |
Public Attributes | |
Walker * | m_walker |
Protected Member Functions | |
virtual void | run () |
virtual void | on_event (uint8_t type, uint16_t value) |
Protected Attributes | |
Key | m_key |
uint32_t | m_period |
uint32_t | m_expires |
Scheduler * | m_scheduler |
Linkage * | m_succ |
Linkage * | m_pred |
Static Protected Attributes | |
static const uint16_t | SAMPLE_MS = 64 |
Menu walker controller for the LCD keypad. Adapt the keypad key down events to the Menu walker. For simplicity the key map for the walker and the LCD keypad are the same.
|
inherited |
|
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.
|
inlinevirtual |
|
inlinevirtualinherited |
|
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.
|
protectedvirtualinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
protectedinherited |
|
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.
|
staticprotectedinherited |