Struct stm32f4xx_hal::timer::FTimer
source · [−]pub struct FTimer<TIM, const FREQ: u32> { /* private fields */ }
Expand description
Timer wrapper for fixed precision timers.
Uses fugit::TimerDurationU32
for most of operations
Implementations
sourceimpl<TIM: Instance + WithPwm, const FREQ: u32> FTimer<TIM, FREQ>
impl<TIM: Instance + WithPwm, const FREQ: u32> FTimer<TIM, FREQ>
pub fn pwm<P, PINS>(
self,
_pins: PINS,
time: TimerDurationU32<FREQ>
) -> Pwm<TIM, P, PINS, FREQ> where
PINS: Pins<TIM, P>,
sourceimpl<TIM: Instance, const FREQ: u32> FTimer<TIM, FREQ>
impl<TIM: Instance, const FREQ: u32> FTimer<TIM, FREQ>
sourcepub fn counter(self) -> Counter<TIM, FREQ>
pub fn counter(self) -> Counter<TIM, FREQ>
Creates Counter
that imlements embedded_hal::timer::CountDown
sourcepub fn delay(self) -> Delay<TIM, FREQ>
pub fn delay(self) -> Delay<TIM, FREQ>
Creates Delay
that imlements embedded_hal::blocking::delay traits
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
Auto Trait Implementations
impl<TIM, const FREQ: u32> RefUnwindSafe for FTimer<TIM, FREQ> where
TIM: RefUnwindSafe,
impl<TIM, const FREQ: u32> Send for FTimer<TIM, FREQ> where
TIM: Send,
impl<TIM, const FREQ: u32> Sync for FTimer<TIM, FREQ> where
TIM: Sync,
impl<TIM, const FREQ: u32> Unpin for FTimer<TIM, FREQ> where
TIM: Unpin,
impl<TIM, const FREQ: u32> UnwindSafe for FTimer<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