pub struct Counter<TIM, const FREQ: u32>(_);
Expand description
Periodic non-blocking timer that imlements embedded_hal::timer::CountDown
Implementations
Methods from Deref<Target = FTimer<T, FREQ>>
sourcepub fn listen(&mut self, event: Event)
pub fn listen(&mut self, event: Event)
Starts listening for an event
Note, you will also have to enable the TIM2 interrupt in the NVIC to start receiving events.
sourcepub fn clear_interrupt(&mut self, event: Event)
pub fn clear_interrupt(&mut self, event: Event)
Clears interrupt associated with event
.
If the interrupt is not cleared, it will immediately retrigger after the ISR has finished.
pub fn get_interrupt(&mut self) -> Event
pub fn set_master_mode(&mut self, mode: TIM::Mms)
Trait Implementations
sourceimpl<TIM: Instance, const FREQ: u32> Timer<FREQ> for Counter<TIM, FREQ>
impl<TIM: Instance, const FREQ: u32> Timer<FREQ> for Counter<TIM, FREQ>
sourcefn now(&mut self) -> TimerInstantU32<FREQ>
fn now(&mut self) -> TimerInstantU32<FREQ>
Return current time Instant
sourcefn start(&mut self, duration: TimerDurationU32<FREQ>) -> Result<(), Self::Error>
fn start(&mut self, duration: TimerDurationU32<FREQ>) -> Result<(), Self::Error>
Start timer with a duration
impl<TIM: Instance, const FREQ: u32> Periodic for Counter<TIM, FREQ>
Auto Trait Implementations
impl<TIM, const FREQ: u32> RefUnwindSafe for Counter<TIM, FREQ> where
TIM: RefUnwindSafe,
impl<TIM, const FREQ: u32> Send for Counter<TIM, FREQ> where
TIM: Send,
impl<TIM, const FREQ: u32> Sync for Counter<TIM, FREQ> where
TIM: Sync,
impl<TIM, const FREQ: u32> Unpin for Counter<TIM, FREQ> where
TIM: Unpin,
impl<TIM, const FREQ: u32> UnwindSafe for Counter<TIM, FREQ> where
TIM: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more