pub trait TimerExt: Sized {
// Required methods
fn counter<const FREQ: u32>(self, clocks: &Clocks) -> Counter<Self, FREQ>;
fn counter_hz(self, clocks: &Clocks) -> CounterHz<Self>;
fn delay<const FREQ: u32>(self, clocks: &Clocks) -> Delay<Self, FREQ>;
// Provided methods
fn counter_ms(self, clocks: &Clocks) -> CounterMs<Self> { ... }
fn counter_us(self, clocks: &Clocks) -> CounterUs<Self> { ... }
fn delay_ms(self, clocks: &Clocks) -> DelayMs<Self> { ... }
fn delay_us(self, clocks: &Clocks) -> DelayUs<Self> { ... }
}
Required Methods§
sourcefn counter<const FREQ: u32>(self, clocks: &Clocks) -> Counter<Self, FREQ>
fn counter<const FREQ: u32>(self, clocks: &Clocks) -> Counter<Self, FREQ>
Non-blocking Counter with custom fixed precision
sourcefn counter_hz(self, clocks: &Clocks) -> CounterHz<Self>
fn counter_hz(self, clocks: &Clocks) -> CounterHz<Self>
Non-blocking Counter with dynamic precision which uses Hertz
as Duration units
Provided Methods§
sourcefn counter_ms(self, clocks: &Clocks) -> CounterMs<Self>
fn counter_ms(self, clocks: &Clocks) -> CounterMs<Self>
Non-blocking Counter with fixed precision of 1 ms (1 kHz sampling)
Can wait from 2 ms to 65 sec for 16-bit timer and from 2 ms to 49 days for 32-bit timer.
NOTE: don’t use this if your system frequency more than 65 MHz
sourcefn counter_us(self, clocks: &Clocks) -> CounterUs<Self>
fn counter_us(self, clocks: &Clocks) -> CounterUs<Self>
Non-blocking Counter with fixed precision of 1 μs (1 MHz sampling)
Can wait from 2 μs to 65 ms for 16-bit timer and from 2 μs to 71 min for 32-bit timer.
Object Safety§
This trait is not object safe.