pub struct Stopwatch<TIM> { /* private fields */ }Implementations§
Source§impl Stopwatch<TIM1>
impl Stopwatch<TIM1>
pub fn tim1(tim: TIM1, rcc: &mut Rcc) -> Self
Sourcepub fn set_clock(&mut self, clk: Hertz)
pub fn set_clock(&mut self, clk: Hertz)
Overrides the counter clock input frequency
Useful if the APB Timer Clock changes after the Stopwatch is created or
to deliberately speed up or slow down the Stopwatch from actual measured time.
Sourcepub fn set_prescaler(&mut self, prescaler: u16)
pub fn set_prescaler(&mut self, prescaler: u16)
Set the prescaler which divides the input clock frequency before the counter
The counter frequency is equal to the input clock divided by the prescaler + 1.
pub fn reset(&mut self)
pub fn pause(&mut self)
pub fn resume(&mut self)
pub fn release(self) -> TIM1
pub fn now(&self) -> Instant
pub fn elapsed(&self, ts: Instant) -> MicroSecond
pub fn trace<F>(&self, closure: F) -> MicroSecondwhere
F: FnMut(),
Source§impl Stopwatch<TIM3>
impl Stopwatch<TIM3>
pub fn tim3(tim: TIM3, rcc: &mut Rcc) -> Self
Sourcepub fn set_clock(&mut self, clk: Hertz)
pub fn set_clock(&mut self, clk: Hertz)
Overrides the counter clock input frequency
Useful if the APB Timer Clock changes after the Stopwatch is created or
to deliberately speed up or slow down the Stopwatch from actual measured time.
Sourcepub fn set_prescaler(&mut self, prescaler: u16)
pub fn set_prescaler(&mut self, prescaler: u16)
Set the prescaler which divides the input clock frequency before the counter
The counter frequency is equal to the input clock divided by the prescaler + 1.
pub fn reset(&mut self)
pub fn pause(&mut self)
pub fn resume(&mut self)
pub fn release(self) -> TIM3
pub fn now(&self) -> Instant
pub fn elapsed(&self, ts: Instant) -> MicroSecond
pub fn trace<F>(&self, closure: F) -> MicroSecondwhere
F: FnMut(),
Source§impl Stopwatch<TIM14>
impl Stopwatch<TIM14>
pub fn tim14(tim: TIM14, rcc: &mut Rcc) -> Self
Sourcepub fn set_clock(&mut self, clk: Hertz)
pub fn set_clock(&mut self, clk: Hertz)
Overrides the counter clock input frequency
Useful if the APB Timer Clock changes after the Stopwatch is created or
to deliberately speed up or slow down the Stopwatch from actual measured time.
Sourcepub fn set_prescaler(&mut self, prescaler: u16)
pub fn set_prescaler(&mut self, prescaler: u16)
Set the prescaler which divides the input clock frequency before the counter
The counter frequency is equal to the input clock divided by the prescaler + 1.
pub fn reset(&mut self)
pub fn pause(&mut self)
pub fn resume(&mut self)
pub fn release(self) -> TIM14
pub fn now(&self) -> Instant
pub fn elapsed(&self, ts: Instant) -> MicroSecond
pub fn trace<F>(&self, closure: F) -> MicroSecondwhere
F: FnMut(),
Source§impl Stopwatch<TIM16>
impl Stopwatch<TIM16>
pub fn tim16(tim: TIM16, rcc: &mut Rcc) -> Self
Sourcepub fn set_clock(&mut self, clk: Hertz)
pub fn set_clock(&mut self, clk: Hertz)
Overrides the counter clock input frequency
Useful if the APB Timer Clock changes after the Stopwatch is created or
to deliberately speed up or slow down the Stopwatch from actual measured time.
Sourcepub fn set_prescaler(&mut self, prescaler: u16)
pub fn set_prescaler(&mut self, prescaler: u16)
Set the prescaler which divides the input clock frequency before the counter
The counter frequency is equal to the input clock divided by the prescaler + 1.
pub fn reset(&mut self)
pub fn pause(&mut self)
pub fn resume(&mut self)
pub fn release(self) -> TIM16
pub fn now(&self) -> Instant
pub fn elapsed(&self, ts: Instant) -> MicroSecond
pub fn trace<F>(&self, closure: F) -> MicroSecondwhere
F: FnMut(),
Source§impl Stopwatch<TIM17>
impl Stopwatch<TIM17>
pub fn tim17(tim: TIM17, rcc: &mut Rcc) -> Self
Sourcepub fn set_clock(&mut self, clk: Hertz)
pub fn set_clock(&mut self, clk: Hertz)
Overrides the counter clock input frequency
Useful if the APB Timer Clock changes after the Stopwatch is created or
to deliberately speed up or slow down the Stopwatch from actual measured time.
Sourcepub fn set_prescaler(&mut self, prescaler: u16)
pub fn set_prescaler(&mut self, prescaler: u16)
Set the prescaler which divides the input clock frequency before the counter
The counter frequency is equal to the input clock divided by the prescaler + 1.
pub fn reset(&mut self)
pub fn pause(&mut self)
pub fn resume(&mut self)
pub fn release(self) -> TIM17
pub fn now(&self) -> Instant
pub fn elapsed(&self, ts: Instant) -> MicroSecond
pub fn trace<F>(&self, closure: F) -> MicroSecondwhere
F: FnMut(),
Source§impl Stopwatch<TIM2>
impl Stopwatch<TIM2>
pub fn tim2(tim: TIM2, rcc: &mut Rcc) -> Self
Sourcepub fn set_clock(&mut self, clk: Hertz)
pub fn set_clock(&mut self, clk: Hertz)
Overrides the counter clock input frequency
Useful if the APB Timer Clock changes after the Stopwatch is created or
to deliberately speed up or slow down the Stopwatch from actual measured time.
Sourcepub fn set_prescaler(&mut self, prescaler: u16)
pub fn set_prescaler(&mut self, prescaler: u16)
Set the prescaler which divides the input clock frequency before the counter
The counter frequency is equal to the input clock divided by the prescaler + 1.
pub fn reset(&mut self)
pub fn pause(&mut self)
pub fn resume(&mut self)
pub fn release(self) -> TIM2
pub fn now(&self) -> Instant
pub fn elapsed(&self, ts: Instant) -> MicroSecond
pub fn trace<F>(&self, closure: F) -> MicroSecondwhere
F: FnMut(),
Source§impl Stopwatch<TIM6>
impl Stopwatch<TIM6>
pub fn tim6(tim: TIM6, rcc: &mut Rcc) -> Self
Sourcepub fn set_clock(&mut self, clk: Hertz)
pub fn set_clock(&mut self, clk: Hertz)
Overrides the counter clock input frequency
Useful if the APB Timer Clock changes after the Stopwatch is created or
to deliberately speed up or slow down the Stopwatch from actual measured time.
Sourcepub fn set_prescaler(&mut self, prescaler: u16)
pub fn set_prescaler(&mut self, prescaler: u16)
Set the prescaler which divides the input clock frequency before the counter
The counter frequency is equal to the input clock divided by the prescaler + 1.
pub fn reset(&mut self)
pub fn pause(&mut self)
pub fn resume(&mut self)
pub fn release(self) -> TIM6
pub fn now(&self) -> Instant
pub fn elapsed(&self, ts: Instant) -> MicroSecond
pub fn trace<F>(&self, closure: F) -> MicroSecondwhere
F: FnMut(),
Source§impl Stopwatch<TIM7>
impl Stopwatch<TIM7>
pub fn tim7(tim: TIM7, rcc: &mut Rcc) -> Self
Sourcepub fn set_clock(&mut self, clk: Hertz)
pub fn set_clock(&mut self, clk: Hertz)
Overrides the counter clock input frequency
Useful if the APB Timer Clock changes after the Stopwatch is created or
to deliberately speed up or slow down the Stopwatch from actual measured time.
Sourcepub fn set_prescaler(&mut self, prescaler: u16)
pub fn set_prescaler(&mut self, prescaler: u16)
Set the prescaler which divides the input clock frequency before the counter
The counter frequency is equal to the input clock divided by the prescaler + 1.
pub fn reset(&mut self)
pub fn pause(&mut self)
pub fn resume(&mut self)
pub fn release(self) -> TIM7
pub fn now(&self) -> Instant
pub fn elapsed(&self, ts: Instant) -> MicroSecond
pub fn trace<F>(&self, closure: F) -> MicroSecondwhere
F: FnMut(),
Source§impl Stopwatch<TIM15>
impl Stopwatch<TIM15>
pub fn tim15(tim: TIM15, rcc: &mut Rcc) -> Self
Sourcepub fn set_clock(&mut self, clk: Hertz)
pub fn set_clock(&mut self, clk: Hertz)
Overrides the counter clock input frequency
Useful if the APB Timer Clock changes after the Stopwatch is created or
to deliberately speed up or slow down the Stopwatch from actual measured time.
Sourcepub fn set_prescaler(&mut self, prescaler: u16)
pub fn set_prescaler(&mut self, prescaler: u16)
Set the prescaler which divides the input clock frequency before the counter
The counter frequency is equal to the input clock divided by the prescaler + 1.