Trait stm32f4xx_hal::timer::TimerExt

source ·
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§

source

fn counter<const FREQ: u32>(self, clocks: &Clocks) -> Counter<Self, FREQ>

Non-blocking Counter with custom fixed precision

source

fn counter_hz(self, clocks: &Clocks) -> CounterHz<Self>

Non-blocking Counter with dynamic precision which uses Hertz as Duration units

source

fn delay<const FREQ: u32>(self, clocks: &Clocks) -> Delay<Self, FREQ>

Blocking Delay with custom fixed precision

Provided Methods§

source

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

source

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.

source

fn delay_ms(self, clocks: &Clocks) -> DelayMs<Self>

Blocking Delay with fixed precision of 1 ms (1 kHz sampling)

Can wait from 2 ms to 49 days.

NOTE: don’t use this if your system frequency more than 65 MHz

source

fn delay_us(self, clocks: &Clocks) -> DelayUs<Self>

Blocking Delay with fixed precision of 1 μs (1 MHz sampling)

Can wait from 2 μs to 71 min.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<TIM: Instance> TimerExt for TIM