Struct stm32l4xx_hal::timer::Timer
source · [−]pub struct Timer<TIM> { /* private fields */ }
Expand description
Hardware timers
Implementations
sourceimpl Timer<TIM2>
impl Timer<TIM2>
sourcepub fn tim2(tim: TIM2, timeout: Hertz, clocks: Clocks, apb: &mut APB1R1) -> Self
pub fn tim2(tim: TIM2, timeout: Hertz, clocks: Clocks, apb: &mut APB1R1) -> Self
Configures a TIM peripheral as a periodic count down timer
sourcepub fn free_running_tim2(
tim: TIM2,
clocks: Clocks,
frequency: Hertz,
event_on_overflow: bool,
apb: &mut APB1R1
) -> Self
pub fn free_running_tim2(
tim: TIM2,
clocks: Clocks,
frequency: Hertz,
event_on_overflow: bool,
apb: &mut APB1R1
) -> Self
Start a free running, monotonic, timer running at some specific frequency.
May generate events on overflow of the timer.
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.
sourcepub fn clear_update_interrupt_flag(&mut self)
pub fn clear_update_interrupt_flag(&mut self)
Clears Update Interrupt Flag
sourceimpl Timer<TIM6>
impl Timer<TIM6>
sourcepub fn tim6(tim: TIM6, timeout: Hertz, clocks: Clocks, apb: &mut APB1R1) -> Self
pub fn tim6(tim: TIM6, timeout: Hertz, clocks: Clocks, apb: &mut APB1R1) -> Self
Configures a TIM peripheral as a periodic count down timer
sourcepub fn free_running_tim6(
tim: TIM6,
clocks: Clocks,
frequency: Hertz,
event_on_overflow: bool,
apb: &mut APB1R1
) -> Self
pub fn free_running_tim6(
tim: TIM6,
clocks: Clocks,
frequency: Hertz,
event_on_overflow: bool,
apb: &mut APB1R1
) -> Self
Start a free running, monotonic, timer running at some specific frequency.
May generate events on overflow of the timer.
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.
sourcepub fn clear_update_interrupt_flag(&mut self)
pub fn clear_update_interrupt_flag(&mut self)
Clears Update Interrupt Flag
sourceimpl Timer<TIM15>
impl Timer<TIM15>
sourcepub fn tim15(tim: TIM15, timeout: Hertz, clocks: Clocks, apb: &mut APB2) -> Self
pub fn tim15(tim: TIM15, timeout: Hertz, clocks: Clocks, apb: &mut APB2) -> Self
Configures a TIM peripheral as a periodic count down timer
sourcepub fn free_running_tim15(
tim: TIM15,
clocks: Clocks,
frequency: Hertz,
event_on_overflow: bool,
apb: &mut APB2
) -> Self
pub fn free_running_tim15(
tim: TIM15,
clocks: Clocks,
frequency: Hertz,
event_on_overflow: bool,
apb: &mut APB2
) -> Self
Start a free running, monotonic, timer running at some specific frequency.
May generate events on overflow of the timer.
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.
sourcepub fn clear_update_interrupt_flag(&mut self)
pub fn clear_update_interrupt_flag(&mut self)
Clears Update Interrupt Flag
sourceimpl Timer<TIM16>
impl Timer<TIM16>
sourcepub fn tim16(tim: TIM16, timeout: Hertz, clocks: Clocks, apb: &mut APB2) -> Self
pub fn tim16(tim: TIM16, timeout: Hertz, clocks: Clocks, apb: &mut APB2) -> Self
Configures a TIM peripheral as a periodic count down timer
sourcepub fn free_running_tim16(
tim: TIM16,
clocks: Clocks,
frequency: Hertz,
event_on_overflow: bool,
apb: &mut APB2
) -> Self
pub fn free_running_tim16(
tim: TIM16,
clocks: Clocks,
frequency: Hertz,
event_on_overflow: bool,
apb: &mut APB2
) -> Self
Start a free running, monotonic, timer running at some specific frequency.
May generate events on overflow of the timer.
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.
sourcepub fn clear_update_interrupt_flag(&mut self)
pub fn clear_update_interrupt_flag(&mut self)
Clears Update Interrupt Flag
sourceimpl Timer<TIM7>
impl Timer<TIM7>
sourcepub fn tim7(tim: TIM7, timeout: Hertz, clocks: Clocks, apb: &mut APB1R1) -> Self
pub fn tim7(tim: TIM7, timeout: Hertz, clocks: Clocks, apb: &mut APB1R1) -> Self
Configures a TIM peripheral as a periodic count down timer
sourcepub fn free_running_tim7(
tim: TIM7,
clocks: Clocks,
frequency: Hertz,
event_on_overflow: bool,
apb: &mut APB1R1
) -> Self
pub fn free_running_tim7(
tim: TIM7,
clocks: Clocks,
frequency: Hertz,
event_on_overflow: bool,
apb: &mut APB1R1
) -> Self
Start a free running, monotonic, timer running at some specific frequency.
May generate events on overflow of the timer.
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.
sourcepub fn clear_update_interrupt_flag(&mut self)
pub fn clear_update_interrupt_flag(&mut self)
Clears Update Interrupt Flag
Trait Implementations
impl Periodic for Timer<TIM2>
impl Periodic for Timer<TIM6>
impl Periodic for Timer<TIM15>
impl Periodic for Timer<TIM16>
impl Periodic for Timer<TIM7>
Auto Trait Implementations
impl<TIM> RefUnwindSafe for Timer<TIM> where
TIM: RefUnwindSafe,
impl<TIM> Send for Timer<TIM> where
TIM: Send,
impl<TIM> Sync for Timer<TIM> where
TIM: Sync,
impl<TIM> Unpin for Timer<TIM> where
TIM: Unpin,
impl<TIM> UnwindSafe for Timer<TIM> 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