Low Power Timout. More...
#include <LowPowerTimeout.h>
Public Types | |
using | clock = LowPowerClock |
Clock to use with attach_absolute, guaranteeing running only while attached or manually locked. More... | |
using | steady_clock = LowPowerClock |
Clock to use with attach_absolute, running always. More... | |
Public Member Functions | |
LowPowerClock::time_point | scheduled_time () const |
template<class F > | |
void | attach_absolute (F &&func, LowPowerClock::time_point abs_time) |
Attach a function to be called by the Timeout, specifying the absolute time. More... | |
std::chrono::microseconds | remaining_time () const |
Return time remaining until callback. More... | |
template<typename F > | |
MBED_FORCEINLINE void | attach (F &&func, float t) |
Attach a function to be called by the Ticker, specifying the interval in seconds. More... | |
void | attach (Callback< void()> func, std::chrono::microseconds t) |
Attach a function to be called by the Ticker, specifying the interval in microseconds. 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... | |
void | detach () |
Detach the function. More... | |
Low Power Timout.
Definition at line 38 of file LowPowerTimeout.h.
using clock = LowPowerClock |
Clock to use with attach_absolute, guaranteeing running only while attached or manually locked.
Definition at line 43 of file LowPowerTimeout.h.
using steady_clock = LowPowerClock |
Clock to use with attach_absolute, running always.
Definition at line 46 of file LowPowerTimeout.h.
|
inherited |
Attach a function to be called by the Ticker, specifying the interval in seconds.
The method forwards its arguments to attach_us() rather than copying them which may not be trivial depending on the callback copied. The function is forcibly inlined to not use floating-point operations. This is possible given attach_us() expects an integer value for the callback interval.
func | pointer to the function to be called |
t | the time between calls in seconds |
10ms
rather than 0.01f
.
|
inherited |
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_absolute | ( | F && | func, |
LowPowerClock::time_point | abs_time | ||
) |
Attach a function to be called by the Timeout, specifying the absolute time.
func | pointer to the function to be called |
abs_time | the absolute time for the call, referenced to LowPowerClock |
Definition at line 64 of file LowPowerTimeout.h.
|
inherited |
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 |
10ms
rather than 10000
.
|
inherited |
Detach the function.
|
inherited |
LowPowerClock::time_point scheduled_time | ( | ) | const |
Definition at line 49 of file LowPowerTimeout.h.