Stopwatch

Struct Stopwatch 

Source
pub struct Stopwatch<TIM> { /* private fields */ }

Implementations§

Source§

impl Stopwatch<TIM1>

Source

pub fn tim1(tim: TIM1, rcc: &mut Rcc) -> Self

Source

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.

Source

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.

Source

pub fn reset(&mut self)

Source

pub fn pause(&mut self)

Source

pub fn resume(&mut self)

Source

pub fn release(self) -> TIM1

Source

pub fn now(&self) -> Instant

Source

pub fn elapsed(&self, ts: Instant) -> MicroSecond

Source

pub fn trace<F>(&self, closure: F) -> MicroSecond
where F: FnMut(),

Source§

impl Stopwatch<TIM3>

Source

pub fn tim3(tim: TIM3, rcc: &mut Rcc) -> Self

Source

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.

Source

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.

Source

pub fn reset(&mut self)

Source

pub fn pause(&mut self)

Source

pub fn resume(&mut self)

Source

pub fn release(self) -> TIM3

Source

pub fn now(&self) -> Instant

Source

pub fn elapsed(&self, ts: Instant) -> MicroSecond

Source

pub fn trace<F>(&self, closure: F) -> MicroSecond
where F: FnMut(),

Source§

impl Stopwatch<TIM14>

Source

pub fn tim14(tim: TIM14, rcc: &mut Rcc) -> Self

Source

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.

Source

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.

Source

pub fn reset(&mut self)

Source

pub fn pause(&mut self)

Source

pub fn resume(&mut self)

Source

pub fn release(self) -> TIM14

Source

pub fn now(&self) -> Instant

Source

pub fn elapsed(&self, ts: Instant) -> MicroSecond

Source

pub fn trace<F>(&self, closure: F) -> MicroSecond
where F: FnMut(),

Source§

impl Stopwatch<TIM16>

Source

pub fn tim16(tim: TIM16, rcc: &mut Rcc) -> Self

Source

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.

Source

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.

Source

pub fn reset(&mut self)

Source

pub fn pause(&mut self)

Source

pub fn resume(&mut self)

Source

pub fn release(self) -> TIM16

Source

pub fn now(&self) -> Instant

Source

pub fn elapsed(&self, ts: Instant) -> MicroSecond

Source

pub fn trace<F>(&self, closure: F) -> MicroSecond
where F: FnMut(),

Source§

impl Stopwatch<TIM17>

Source

pub fn tim17(tim: TIM17, rcc: &mut Rcc) -> Self

Source

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.

Source

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.

Source

pub fn reset(&mut self)

Source

pub fn pause(&mut self)

Source

pub fn resume(&mut self)

Source

pub fn release(self) -> TIM17

Source

pub fn now(&self) -> Instant

Source

pub fn elapsed(&self, ts: Instant) -> MicroSecond

Source

pub fn trace<F>(&self, closure: F) -> MicroSecond
where F: FnMut(),

Source§

impl Stopwatch<TIM2>

Source

pub fn tim2(tim: TIM2, rcc: &mut Rcc) -> Self

Source

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.

Source

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.

Source

pub fn reset(&mut self)

Source

pub fn pause(&mut self)

Source

pub fn resume(&mut self)

Source

pub fn release(self) -> TIM2

Source

pub fn now(&self) -> Instant

Source

pub fn elapsed(&self, ts: Instant) -> MicroSecond

Source

pub fn trace<F>(&self, closure: F) -> MicroSecond
where F: FnMut(),

Source§

impl Stopwatch<TIM6>

Source

pub fn tim6(tim: TIM6, rcc: &mut Rcc) -> Self

Source

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.

Source

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.

Source

pub fn reset(&mut self)

Source

pub fn pause(&mut self)

Source

pub fn resume(&mut self)

Source

pub fn release(self) -> TIM6

Source

pub fn now(&self) -> Instant

Source

pub fn elapsed(&self, ts: Instant) -> MicroSecond

Source

pub fn trace<F>(&self, closure: F) -> MicroSecond
where F: FnMut(),

Source§

impl Stopwatch<TIM7>

Source

pub fn tim7(tim: TIM7, rcc: &mut Rcc) -> Self

Source

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.

Source

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.

Source

pub fn reset(&mut self)

Source

pub fn pause(&mut self)

Source

pub fn resume(&mut self)

Source

pub fn release(self) -> TIM7

Source

pub fn now(&self) -> Instant

Source

pub fn elapsed(&self, ts: Instant) -> MicroSecond

Source

pub fn trace<F>(&self, closure: F) -> MicroSecond
where F: FnMut(),

Source§

impl Stopwatch<TIM15>

Source

pub fn tim15(tim: TIM15, rcc: &mut Rcc) -> Self

Source

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.

Source

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.

Source

pub fn reset(&mut self)

Source

pub fn pause(&mut self)

Source

pub fn resume(&mut self)

Source

pub fn release(self) -> TIM15

Source

pub fn now(&self) -> Instant

Source

pub fn elapsed(&self, ts: Instant) -> MicroSecond

Source

pub fn trace<F>(&self, closure: F) -> MicroSecond
where F: FnMut(),

Auto Trait Implementations§

§

impl<TIM> Freeze for Stopwatch<TIM>
where TIM: Freeze,

§

impl<TIM> RefUnwindSafe for Stopwatch<TIM>
where TIM: RefUnwindSafe,

§

impl<TIM> Send for Stopwatch<TIM>
where TIM: Send,

§

impl<TIM> Sync for Stopwatch<TIM>
where TIM: Sync,

§

impl<TIM> Unpin for Stopwatch<TIM>
where TIM: Unpin,

§

impl<TIM> UnwindSafe for Stopwatch<TIM>
where TIM: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.