Class template adding delegate callback method support to the basic CallbackTimer template. More...
#include <Timer.h>
Inheritance diagram for DelegateCallbackTimer< TimerApi >:
Collaboration diagram for DelegateCallbackTimer< TimerApi >:
Public Member Functions | |
| template<TimeType microseconds> | |
| DelegateCallbackTimer & | initializeUs (TimerDelegate delegateFunction) |
| Initialise timer in microseconds, with static check. More... | |
| template<uint32_t milliseconds> | |
| DelegateCallbackTimer & | initializeMs (TimerDelegate delegateFunction) |
| Initialise hardware timer in milliseconds, with static check. More... | |
| DelegateCallbackTimer & | initializeMs (uint32_t milliseconds, TimerDelegate delegateFunction) |
| Initialise millisecond timer. More... | |
| DelegateCallbackTimer & | initializeUs (uint32_t microseconds, TimerDelegate delegateFunction) |
| Initialise microsecond timer. More... | |
| void | setCallback (TimerDelegate delegateFunction) |
| Set timer trigger function using Delegate callback method. More... | |
Public Member Functions inherited from CallbackTimer< TimerApi > | |
| template<NanoTime::Unit unit, TimeType time> | |
| CallbackTimer & | initialize (TimerCallback callback, void *arg=nullptr) |
| Initialise timer with an interval (static check) and callback. More... | |
| template<NanoTime::Unit unit> | |
| CallbackTimer & | initialize (TimeType time, TimerCallback callback, void *arg=nullptr) |
| Initialise timer with an interval and callback. More... | |
| template<TimeType microseconds> | |
| CallbackTimer & | initializeUs (TimerCallback callback, void *arg=nullptr) |
| Initialise timer in microseconds (static check) with Timer Callback and optional argument. More... | |
| template<TimeType microseconds> | |
| CallbackTimer & | initializeUs (InterruptCallback callback=nullptr) |
| Initialise timer in microseconds (static check) with optional Interrupt Callback (no argument) More... | |
| CallbackTimer & | initializeUs (TimeType microseconds, TimerCallback callback, void *arg=nullptr) |
| Initialise timer in microseconds with Timer Callback and optional argument. More... | |
| CallbackTimer & | initializeUs (TimeType microseconds, InterruptCallback callback=nullptr) |
| Initialise timer in microseconds with optional Interrupt Callback (no arg) More... | |
| template<uint32_t milliseconds> | |
| CallbackTimer & | initializeMs (TimerCallback callback, void *arg=nullptr) |
| Initialise hardware timer in milliseconds (static check) with Timer Callback and optional argument. More... | |
| template<uint32_t milliseconds> | |
| CallbackTimer & | initializeMs (InterruptCallback callback=nullptr) |
| Initialise hardware timer in milliseconds (static check) and optional Interrupt Callback (no arg) More... | |
| CallbackTimer & | initializeMs (uint32_t milliseconds, TimerCallback callback, void *arg=nullptr) |
| Initialise hardware timer in milliseconds with Timer Callback and optional argument. More... | |
| CallbackTimer & | initializeMs (uint32_t milliseconds, InterruptCallback callback=nullptr) |
| Initialise hardware timer in milliseconds with optional Interrupt Callback (no arg) More... | |
| bool | start (bool repeating=true) |
| Start timer running. More... | |
| bool | startOnce () |
| Start one-shot timer. More... | |
| void | stop () |
| Stops timer. More... | |
| bool | restart () |
| Restart timer. More... | |
| bool | isStarted () const |
| Check if timer is started. More... | |
| NanoTime::Time< TimeType > | getIntervalUs () const |
| Get timer interval in microseconds. More... | |
| NanoTime::Time< uint32_t > | getIntervalMs () const |
| Get timer interval in milliseconds. More... | |
| TickType | getInterval () const |
| Get timer interval in clock ticks. More... | |
| bool | checkInterval (TickType ticks) const |
| Check timer interval is valid. More... | |
| bool | setInterval (TickType ticks) |
| Set timer interval in timer ticks. More... | |
| template<TimeType ticks> | |
| void | setInterval () |
| Set timer interval in timer ticks (static check) More... | |
| template<NanoTime::Unit unit, TimeType time> | |
| void | setInterval () |
| Set timer interval in specific time unit (static check) More... | |
| template<NanoTime::Unit unit> | |
| bool | setInterval (TimeType time) |
| Set timer interval in timer ticks. More... | |
| bool | setIntervalUs (TimeType microseconds) |
| Set timer interval in microseconds. More... | |
| template<TimeType microseconds> | |
| void | setIntervalUs () |
| Set timer interval in microseconds (static check) More... | |
| bool | setIntervalMs (uint32_t milliseconds) |
| Set timer interval in milliseconds. More... | |
| template<uint32_t milliseconds> | |
| void | setIntervalMs () |
| Set timer interval in milliseconds (static check) More... | |
| void | setCallback (TimerCallback callback, void *arg=nullptr) |
| Set timer trigger callback. More... | |
| void | setCallback (InterruptCallback callback) |
| Set timer trigger callback. More... | |
Additional Inherited Members | |
Public Types inherited from CallbackTimer< TimerApi > | |
| using | Millis = NanoTime::TimeSource< Clock, NanoTime::Milliseconds, uint32_t > |
| using | Micros = NanoTime::TimeSource< Clock, NanoTime::Microseconds, TimeType > |
Static Public Member Functions inherited from CallbackTimer< TimerApi > | |
| static constexpr Millis | millis () |
| Get a millisecond time source. More... | |
| static constexpr Micros | micros () |
| Get a microsecond time source. More... | |
| template<uint64_t us> | |
| static constexpr uint64_t | usToTicks () |
| Convert microsecond count into timer ticks. More... | |
| static TickType | usToTicks (TimeType time) |
| Convert microsecond count into timer ticks. More... | |
| template<uint64_t ticks> | |
| static constexpr uint64_t | ticksToUs () |
| Convert timer ticks into microseconds. More... | |
| static TimeType | ticksToUs (TickType ticks) |
| Convert timer ticks into microseconds. More... | |
| template<uint64_t ticks> | |
| static constexpr void | checkInterval () |
| Check timer interval in ticks is valid (static check) More... | |
| template<NanoTime::Unit unit, uint64_t time> | |
| static constexpr void | checkInterval () |
| Check timer interval in specific time unit is valid (static check) More... | |
| template<uint64_t milliseconds> | |
| static constexpr void | checkIntervalMs () |
| Check timer interval in milliseconds is valid (static check) More... | |
| template<uint64_t microseconds> | |
| static constexpr void | checkIntervalUs () |
| Check timer interval in microseconds is valid (static check) More... | |
Protected Attributes inherited from CallbackTimer< TimerApi > | |
| bool | callbackSet = false |
| User has provided callback function. More... | |
| bool | intervalSet = false |
| User has set valid time interval. More... | |
| bool | repeating = false |
| Timer is auto-repeat. More... | |
| bool | started = false |
| Timer is active, or has fired. More... | |
Detailed Description
template<typename TimerApi>
class DelegateCallbackTimer< TimerApi >
Class template adding delegate callback method support to the basic CallbackTimer template.
Member Function Documentation
◆ initializeMs() [1/2]
template<typename TimerApi >
template<uint32_t milliseconds>
|
inline |
Initialise hardware timer in milliseconds, with static check.
- Template Parameters
-
milliseconds Timer interval in milliseconds
- Parameters
-
delegateFunction Function to call when timer triggers
- Return values
-
ExtendedCallbackTimer& Reference to timer
◆ initializeMs() [2/2]
template<typename TimerApi >
|
inline |
Initialise millisecond timer.
- Parameters
-
milliseconds Duration of timer in milliseconds delegateFunction Function to call when timer triggers
- Note
- Delegate callback method
◆ initializeUs() [1/2]
template<typename TimerApi >
template<TimeType microseconds>
|
inline |
Initialise timer in microseconds, with static check.
- Template Parameters
-
microseconds Timer interval in microseconds
- Parameters
-
delegateFunction Function to call when timer triggers
- Return values
-
ExtendedCallbackTimer& Reference to timer
◆ initializeUs() [2/2]
template<typename TimerApi >
|
inline |
Initialise microsecond timer.
- Parameters
-
microseconds Duration of timer in milliseconds delegateFunction Function to call when timer triggers
- Note
- Delegate callback method
◆ setCallback()
template<typename TimerApi >
|
inline |
Set timer trigger function using Delegate callback method.
- Parameters
-
delegateFunction Function to be called on timer trigger
- Note
- Don't use this for interrupt timers
The documentation for this class was generated from the following file:
Public Member Functions inherited from
1.8.17