PolledTimer.h
Go to the documentation of this file.
251 template <typename Clock, NanoTime::Unit unit> using OneShot = Timer<Clock, unit, false, uint32_t>;
252 template <typename Clock, NanoTime::Unit unit> using Periodic = Timer<Clock, unit, true, uint32_t>;
bool reset(const TimeType &timeInterval)
Start the timer with a new expiry interval.
Definition: PolledTimer.h:143
static constexpr uint64_t ticks()
Return the corresponding tick value for the time interval.
Definition: NanoTime.h:511
void cancel()
Cancelling a timer means it will never expire.
Definition: PolledTimer.h:166
bool expired()
Determine if timer has expired.
Definition: PolledTimer.h:205
bool resetTicks(const TimeType &interval)
Start the timer with a new expiry interval.
Definition: PolledTimer.h:155
Class template to represent a fixed time value for a specific Clock.
Definition: NanoTime.h:120
NanoTime::Time< TimeType > elapsedTime() const
Get elapsed time since start() was last called.
Definition: PolledTimer.h:186
Class template for accessing a Clock in specific time units.
Definition: NanoTime.h:122
Time< T > time(Unit unit, T value)
Helper function to create a Time and deduce the type.
Definition: NanoTime.h:429
Timer(const TimeType &timeInterval=0)
Create a Timer with optional expiry time.
Definition: PolledTimer.h:95
Definition: PolledTimer.h:45
TimeType TimeType
Definition: NanoTime.h:638
static constexpr uint64_t ticksToTime()
Get the time for a given number of clock ticks.
Definition: NanoTime.h:734
static constexpr uint64_t timeToTicks()
Get the number of ticks for a given time.
Definition: NanoTime.h:724
TickType elapsedTicks() const
Get elapsed ticks since start() was last called.
Definition: PolledTimer.h:178
void reset()
Start the timer with a new expiry interval.
Definition: PolledTimer.h:116
constexpr uint32_t checkTime()
Check the given time interval is valid and return the corresponding tick count.
Definition: PolledTimer.h:128
typename NanoTime::Nanoseconds ::TickType TickType
Definition: PolledTimer.h:72
NanoTime::TimeConst< Clock, NanoTime::Microseconds, POLLED_TIMER_MARGIN_US > Margin
Definition: PolledTimer.h:74