pub struct SysCounter<const FREQ: u32>(/* private fields */);
Expand description
SysTick timer with precision of 1 μs (1 MHz sampling)
Implementations§
Methods from Deref<Target = Timer<SYST>>§
pub fn configure(&mut self, clocks: &Clocks)
pub fn configure_external(&mut self, clocks: &Clocks)
pub fn configure(&mut self, clocks: &Clocks)
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
Sourcepub fn stop_in_debug(&mut self, dbg: &mut DBG, state: bool)
pub fn stop_in_debug(&mut self, dbg: &mut DBG, state: bool)
Stopping timer in debug mode can cause troubles when sampling the signal
pub fn set_master_mode(&mut self, mode: TIM::Mms)
Trait Implementations§
Source§impl<const FREQ: u32> Cancel for SysCounter<FREQ>
impl<const FREQ: u32> Cancel for SysCounter<FREQ>
Source§impl<const FREQ: u32> Deref for SysCounter<FREQ>
impl<const FREQ: u32> Deref for SysCounter<FREQ>
Source§impl<const FREQ: u32> DerefMut for SysCounter<FREQ>
impl<const FREQ: u32> DerefMut for SysCounter<FREQ>
Source§impl<const FREQ: u32> Timer<FREQ> for SysCounter<FREQ>
impl<const FREQ: u32> Timer<FREQ> for SysCounter<FREQ>
Source§fn now(&mut self) -> TimerInstantU32<FREQ>
fn now(&mut self) -> TimerInstantU32<FREQ>
Return current time
Instant
Source§fn start(&mut self, duration: TimerDurationU32<FREQ>) -> Result<(), Self::Error>
fn start(&mut self, duration: TimerDurationU32<FREQ>) -> Result<(), Self::Error>
Start timer with a
duration
Source§impl<const FREQ: u32> CountDown for SysCounter<FREQ>
impl<const FREQ: u32> CountDown for SysCounter<FREQ>
impl<const FREQ: u32> Periodic for SysCounter<FREQ>
Auto Trait Implementations§
impl<const FREQ: u32> Freeze for SysCounter<FREQ>
impl<const FREQ: u32> RefUnwindSafe for SysCounter<FREQ>
impl<const FREQ: u32> Send for SysCounter<FREQ>
impl<const FREQ: u32> !Sync for SysCounter<FREQ>
impl<const FREQ: u32> Unpin for SysCounter<FREQ>
impl<const FREQ: u32> UnwindSafe for SysCounter<FREQ>
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