Embedded Template Library 1.0
Loading...
Searching...
No Matches
etl::icallback_timer_locked Class Referenceabstract

Interface for callback timer. More...

#include <callback_timer_locked.h>

Classes

class  callback_node
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
typedef etl::delegate< void(etl::timer::id::type)> event_callback_type

Public Member Functions

etl::timer::id::type register_timer (const callback_type &callback_, uint32_t period_, bool repeating_)
 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.
virtual bool tick (uint32_t count)=0
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_, lock_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
bool is_active (etl::timer::id::type id_) const
void set_insert_callback (event_callback_type insert_)
 Set a callback when a timer is inserted on list.
void set_remove_callback (event_callback_type remove_)
 Set a callback when a timer is removed from list.
void clear_insert_callback ()
void clear_remove_callback ()

Public Attributes

const uint_least8_t Max_Timers

Protected Member Functions

 icallback_timer_locked (timer_data *const timer_array_, const uint_least8_t Max_Timers_)
 Constructor.

Friends

template<uint_least8_t>
class callback_timer_locked
template<uint_least8_t, uint32_t>
class callback_timer_deferred_locked

Detailed Description

Interface for callback timer.

Member Function Documentation

◆ is_active()

bool etl::icallback_timer_locked::is_active ( etl::timer::id::type id_) const
inline

Checks if a timer is currently active. Returns true if the timer is active, otherwise false.

◆ tick()

virtual bool etl::icallback_timer_locked::tick ( uint32_t count)
pure virtual

◆ time_to_next()

uint32_t etl::icallback_timer_locked::time_to_next ( ) const
inline

Get the time to the next timer event. Returns etl::timer::interval::No_Active_Interval if there is no active timer.


The documentation for this class was generated from the following file: