pub struct CounterHz<TIM> { /* private fields */ }Expand description
Hardware timers
Implementations§
Source§impl<TIM: GeneralTimer> CounterHz<TIM>
impl<TIM: GeneralTimer> CounterHz<TIM>
pub fn start(&mut self, timeout: Hertz) -> Result<(), Error>
pub fn wait(&mut self) -> Result<(), Error>
pub fn cancel(&mut self) -> Result<(), Error>
Sourcepub fn start_raw(&mut self, psc: u16, arr: u16)
pub fn start_raw(&mut self, psc: u16, arr: u16)
Restarts the timer in count down mode with user-defined prescaler and auto-reload register
Sourcepub fn psc(&self) -> u16
pub fn psc(&self) -> u16
Retrieves the content of the prescaler register. The real prescaler is this value + 1.
Sourcepub fn now(&self) -> MicrosDurationU32
pub fn now(&self) -> MicrosDurationU32
Returns the number of microseconds since the last update event. NOTE: This method is not a very good candidate to keep track of time, because it is very easy to lose an update event.
Auto Trait Implementations§
impl<TIM> Freeze for CounterHz<TIM>where
TIM: Freeze,
impl<TIM> RefUnwindSafe for CounterHz<TIM>where
TIM: RefUnwindSafe,
impl<TIM> Send for CounterHz<TIM>where
TIM: Send,
impl<TIM> Sync for CounterHz<TIM>where
TIM: Sync,
impl<TIM> Unpin for CounterHz<TIM>where
TIM: Unpin,
impl<TIM> UnwindSafe for CounterHz<TIM>where
TIM: 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