Struct stm32f1xx_hal::timer::Timer
source · pub struct Timer<TIM> { /* private fields */ }
Expand description
Timer wrapper
Implementations§
source§impl Timer<SYST>
impl Timer<SYST>
sourcepub fn counter_hz(self) -> SysCounterHz
pub fn counter_hz(self) -> SysCounterHz
Creates SysCounterHz which takes Hertz as Duration
sourcepub fn counter<const FREQ: u32>(self) -> SysCounter<FREQ>
pub fn counter<const FREQ: u32>(self) -> SysCounter<FREQ>
Creates SysCounter with custom precision (core frequency recommended is known)
sourcepub fn counter_us(self) -> SysCounterUs
pub fn counter_us(self) -> SysCounterUs
Creates SysCounter 1 microsecond precision
source§impl Timer<SYST>
impl Timer<SYST>
source§impl<TIM: Instance> Timer<TIM>
impl<TIM: Instance> Timer<TIM>
pub fn configure(&mut self, clocks: &Clocks)
pub fn counter_hz(self) -> CounterHz<TIM>
pub fn release(self) -> TIM
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