Expand description
Hardware agnostic interfaces for time and timers within the Tock kernel.
These traits are designed to be able encompass the wide
variety of hardware counters in a general yet efficient way. They
abstract the frequency of a counter through the Frequency
trait
and the width of a time value through the Ticks
trait. Higher-level software abstractions should generally rely on
standard and common implementations of these traits (e.g.. u32
ticks and 16MHz frequency). Hardware counter implementations and
peripherals can represent the actual hardware units an translate
into these more general ones.
Structs§
Enums§
- Freq1K
Hz - 1KHz
Frequency
- Freq1M
Hz - 1MHz
Frequency
- Freq10M
Hz - 10MHz
Frequency
- Freq16K
Hz - 16KHz
Frequency
- Freq16M
Hz - 16MHz
Frequency
- Freq32K
Hz - 32.768KHz
Frequency
- Freq100M
Hz - 100MHz
Frequency
Traits§
- Alarm
- Interface for receiving notification when a particular time
(
Counter
value) is reached. - Alarm
Client - Callback handler for when an Alarm fires (a
Counter
reaches a specific value). - Convert
Ticks - Counter
- Represents a free-running hardware counter that can be started and stopped.
- Frequency
- Represents a clock’s frequency in Hz, allowing code to transform
between computer time units and wall clock time. It is typically
an associated type for an implementation of the
Time
trait. - Overflow
Client - Callback handler for when a counter has overflowed past its maximum value and returned to 0.
- Ticks
- An integer type defining the width of a time value, which allows clients to know when wraparound will occur.
- Time
- Represents a moment in time, obtained by calling
now
. - Timer
- Interface for controlling callbacks when an interval has passed.
- Timer
Client - Callback handler for when a timer fires.
- Timestamp
- Represents a static moment in time, that does not change over
repeated calls to
Time::now
.