21#include <mstd_utility>
22#include "drivers/TickerDataClock.h"
23#include "drivers/TimerEvent.h"
24#include "platform/Callback.h"
25#include "platform/mbed_toolchain.h"
26#include "platform/NonCopyable.h"
27#include "hal/lp_ticker_api.h"
85#if defined(__ICCARM__)
86 MBED_DEPRECATED_SINCE(
"mbed-os-6.0.0",
"Pass a chrono duration, not a float second count. For example use `10ms` rather than `0.01f`.")
90 MBED_DEPRECATED_SINCE(
"mbed-os-6.0.0",
"Pass a chrono duration, not a float second count. For example use `10ms` rather than `0.01f`.")
94 auto float_interval = std::chrono::duration<float>(t);
95 attach(std::forward<F>(func), std::chrono::duration_cast<std::chrono::microseconds>(float_interval));
109 MBED_DEPRECATED_SINCE(
"mbed-os-6.0.0",
"Pass a chrono duration, not an integer microsecond count. For example use `10ms` rather than `10000`.")
128#if !defined(DOXYGEN_ONLY)
149 void attach_absolute(
Callback<
void()> func, TickerDataClock::time_point abs_time);
151 void handler()
override;
152 std::chrono::microseconds _delay{0};
153 Callback<void()> _function;
154 bool _lock_deepsleep;
157 void setup(std::chrono::microseconds t);
158 void setup_absolute(TickerDataClock::time_point t);
Callback class based on template specialization.
Prevents generation of copy constructor and copy assignment operator in derived classes.
A Ticker is used to call a function at a recurring interval.
void detach()
Detach the function.
void attach_us(Callback< void()> func, us_timestamp_t t)
Attach a function to be called by the Ticker, specifying the interval in microseconds.
MBED_FORCEINLINE void attach(F &&func, float t)
Attach a function to be called by the Ticker, specifying the interval in seconds.
Base abstraction for timer interrupts.
uint64_t us_timestamp_t
A us timestamp stored in a 64 bit integer.