[][src]Struct async_stm32f1xx::timer::AsyncTimer

pub struct AsyncTimer<T>(_);

An asynchronous abstraction over a timer.

Examples

let mut timer: AsyncTimer<_> = Timer::tim2(dp.TIM2, &clocks, &mut apb1).into();
loop {
    led.toggle();
    timer.delay_for(2.hz()).await;
}

Implementations

impl<T> AsyncTimer<T> where
    T: CountDown
[src]

pub fn delay_for<C>(&mut self, count: C) -> Delay<T> where
    C: Into<T::Time>, 
[src]

Creates a Future that resolves after the given time has been count down.

impl AsyncTimer<CountDownTimer<TIM2>>[src]

pub fn release(self) -> TIM2[src]

Releases the TIM peripheral

impl AsyncTimer<CountDownTimer<TIM3>>[src]

pub fn release(self) -> TIM3[src]

Releases the TIM peripheral

Trait Implementations

impl<T> AsMut<T> for AsyncTimer<T>[src]

impl From<Timer<TIM2>> for AsyncTimer<CountDownTimer<TIM2>>[src]

impl From<Timer<TIM3>> for AsyncTimer<CountDownTimer<TIM3>>[src]

Auto Trait Implementations

impl<T> Send for AsyncTimer<T> where
    T: Send

impl<T> Sync for AsyncTimer<T> where
    T: Sync

impl<T> Unpin for AsyncTimer<T> where
    T: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.