Embedded Template Library 1.0
Loading...
Searching...
No Matches
etl::callback_timer_deferred_locked< MAX_TIMERS_, MAX_HANDLERS_ > Class Template Reference

The deferred callback timer. More...

#include <callback_timer_deferred_locked.h>

Public Types

typedef icallback_timer_locked::callback_type callback_type
 
typedef icallback_timer_locked::try_lock_type try_lock_type
 
typedef icallback_timer_locked::lock_type lock_type
 
typedef icallback_timer_locked::unlock_type unlock_type
 
- Public Types inherited from etl::icallback_timer_locked
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_STATIC_ASSERT (MAX_TIMERS_<=254U, "No more than 254 timers are allowed")
 
 callback_timer_deferred_locked ()
 Constructor.
 
 callback_timer_deferred_locked (try_lock_type try_lock_, lock_type lock_, unlock_type unlock_)
 Constructor.
 
bool tick (uint32_t count) final
 Handle the tick call.
 
void handle_deferred (void)
 
etl::timer::id::type register_timer (const callback_type &callback_, uint32_t period_, bool repeating_)
 Register a timer.
 
etl::timer::id::type register_timer (const callback_type &callback_, uint32_t period_, bool repeating_, uint_least8_t priority_)
 
- Public Member Functions inherited from etl::icallback_timer_locked
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.
 
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
 

Additional Inherited Members

- Public Attributes inherited from etl::icallback_timer_locked
const uint_least8_t MAX_TIMERS
 
- Protected Member Functions inherited from etl::icallback_timer_locked
 icallback_timer_locked (timer_data *const timer_array_, const uint_least8_t MAX_TIMERS_)
 Constructor.
 

Detailed Description

template<uint_least8_t MAX_TIMERS_, uint32_t MAX_HANDLERS_>
class etl::callback_timer_deferred_locked< MAX_TIMERS_, MAX_HANDLERS_ >

The deferred callback timer.

Member Function Documentation

◆ handle_deferred()

template<uint_least8_t MAX_TIMERS_, uint32_t MAX_HANDLERS_>
void etl::callback_timer_deferred_locked< MAX_TIMERS_, MAX_HANDLERS_ >::handle_deferred ( void  )
inline

Handles the work collected during the tick() call You can call this function after tick() or you can call this on another task to handle the timer events.

◆ register_timer()

template<uint_least8_t MAX_TIMERS_, uint32_t MAX_HANDLERS_>
etl::timer::id::type etl::callback_timer_deferred_locked< MAX_TIMERS_, MAX_HANDLERS_ >::register_timer ( const callback_type callback_,
uint32_t  period_,
bool  repeating_,
uint_least8_t  priority_ 
)
inline

Register a timer with priority. priority_ 0 is highest priority, 255 is lowest Suggestion: this could be used as amonth of work to do and less work will be done in first place.

◆ tick()

template<uint_least8_t MAX_TIMERS_, uint32_t MAX_HANDLERS_>
bool etl::callback_timer_deferred_locked< MAX_TIMERS_, MAX_HANDLERS_ >::tick ( uint32_t  count)
inlinefinalvirtual

Handle the tick call.

Implements etl::icallback_timer_locked.


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