pub struct AsyncTimer<T>(/* private fields */);
Expand description
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§
Source§impl<T> AsyncTimer<T>where
T: CountDown,
impl<T> AsyncTimer<T>where
T: CountDown,
Source§impl AsyncTimer<CountDownTimer<TIM2>>
impl AsyncTimer<CountDownTimer<TIM2>>
Source§impl AsyncTimer<CountDownTimer<TIM3>>
impl AsyncTimer<CountDownTimer<TIM3>>
Trait Implementations§
Source§impl<T> AsMut<T> for AsyncTimer<T>
impl<T> AsMut<T> for AsyncTimer<T>
Source§impl From<Timer<TIM2>> for AsyncTimer<CountDownTimer<TIM2>>
impl From<Timer<TIM2>> for AsyncTimer<CountDownTimer<TIM2>>
Auto Trait Implementations§
impl<T> Freeze for AsyncTimer<T>where
T: Freeze,
impl<T> RefUnwindSafe for AsyncTimer<T>where
T: RefUnwindSafe,
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,
impl<T> UnwindSafe for AsyncTimer<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more