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