Embedded Template Library 1.0
|
Interface for message timer. More...
#include <message_timer_locked.h>
Classes | |
struct | timer_data |
The configuration of a timer. More... | |
Public Types | |
typedef etl::delegate< void(void)> | callback_type |
typedef etl::delegate< bool(void)> | try_lock_type |
typedef etl::delegate< void(void)> | lock_type |
typedef etl::delegate< void(void)> | unlock_type |
Public Member Functions | |
etl::timer::id::type | register_timer (const etl::imessage &message_, etl::imessage_router &router_, uint32_t period_, bool repeating_, etl::message_router_id_t destination_router_id_=etl::imessage_router::ALL_MESSAGE_ROUTERS) |
Register a timer. | |
bool | unregister_timer (etl::timer::id::type id_) |
Unregister a timer. | |
void | enable (bool state_) |
Enable/disable the timer. | |
bool | is_running () const |
Get the enable/disable state. | |
void | clear () |
Clears the timer of data. | |
bool | tick (uint32_t count) |
bool | start (etl::timer::id::type id_, bool immediate_=false) |
Starts a timer. | |
bool | stop (etl::timer::id::type id_) |
Stops a timer. | |
bool | set_period (etl::timer::id::type id_, uint32_t period_) |
Sets a timer's period. | |
bool | set_mode (etl::timer::id::type id_, bool repeating_) |
Sets a timer's mode. | |
void | set_locks (try_lock_type try_lock_, lock_type lock_, unlock_type unlock_) |
Sets the lock and unlock delegates. | |
bool | has_active_timer () const |
Check if there is an active timer. | |
uint32_t | time_to_next () const |
Public Attributes | |
const uint_least8_t | MAX_TIMERS |
Protected Member Functions | |
imessage_timer_locked (timer_data *const timer_array_, const uint_least8_t MAX_TIMERS_) | |
Constructor. | |
~imessage_timer_locked () | |
Destructor. | |
Interface for message timer.
|
inline |
Get the time to the next timer event. Returns etl::timer::interval::No_Active_Interval if there is no active timer.