A Ticker is used to call a function at a recurring interval. More...
#include <Ticker.h>
Public Member Functions | |
void | attach (Callback< void()> func, float t) |
Attach a function to be called by the Ticker, specifying the interval in seconds. More... | |
template<typename T , typename M > | |
void | attach (T *obj, M method, float t) |
Attach a member function to be called by the Ticker, specifying the interval in seconds. More... | |
void | attach_us (Callback< void()> func, us_timestamp_t t) |
Attach a function to be called by the Ticker, specifying the interval in microseconds. More... | |
template<typename T , typename M > | |
void | attach_us (T *obj, M method, us_timestamp_t t) |
Attach a member function to be called by the Ticker, specifying the interval in microseconds. More... | |
void | detach () |
Detach the function. More... | |
Static Public Member Functions | |
static void | irq (uint32_t id) |
The handler registered with the underlying timer interrupt. More... | |
A Ticker is used to call a function at a recurring interval.
You can use as many separate Ticker objects as you require.
Example:
void attach | ( | Callback< void()> | func, |
float | t | ||
) |
void attach | ( | T * | obj, |
M | method, | ||
float | t | ||
) |
Attach a member function to be called by the Ticker, specifying the interval in seconds.
obj | pointer to the object to call the member function on |
method | pointer to the member function to be called |
t | the time between calls in seconds |
void attach_us | ( | Callback< void()> | func, |
us_timestamp_t | t | ||
) |
Attach a function to be called by the Ticker, specifying the interval in microseconds.
func | pointer to the function to be called |
t | the time between calls in micro-seconds |
void attach_us | ( | T * | obj, |
M | method, | ||
us_timestamp_t | t | ||
) |
Attach a member function to be called by the Ticker, specifying the interval in microseconds.
obj | pointer to the object to call the member function on |
method | pointer to the member function to be called |
t | the time between calls in microseconds |
void detach | ( | ) |
Detach the function.
|
staticinherited |
The handler registered with the underlying timer interrupt.
id | Timer Event ID |