pub struct TIM2 { /* private fields */ }
Expand description
General purpose timers
See peripheral structure
Implementations§
Source§impl TIM2
impl TIM2
Sourcepub const PTR: *const RegisterBlock = {0x40000000 as *const stm32f4_staging::stm32f429::tim2::RegisterBlock}
pub const PTR: *const RegisterBlock = {0x40000000 as *const stm32f4_staging::stm32f429::tim2::RegisterBlock}
Pointer to the register block
Sourcepub const fn ptr() -> *const RegisterBlock
pub const fn ptr() -> *const RegisterBlock
Return the pointer to the register block
Sourcepub unsafe fn steal() -> TIM2
pub unsafe fn steal() -> TIM2
Steal an instance of this peripheral
§Safety
Ensure that the new instance of the peripheral cannot be used in a way that may race with any existing instances, for example by only accessing read-only or write-only registers, or by consuming the original peripheral and using critical sections to coordinate access between multiple new instances.
Additionally, other software such as HALs may rely on only one peripheral instance existing to ensure memory safety; ensure no stolen instances are passed to such software.
Methods from Deref<Target = RegisterBlock>§
Sourcepub fn ccmr1_input(&self) -> &Reg<CCMR1_INPUTrs>
pub fn ccmr1_input(&self) -> &Reg<CCMR1_INPUTrs>
0x18 - capture/compare mode register 1 (input mode)
Sourcepub fn ccmr1_output(&self) -> &Reg<CCMR1_OUTPUTrs>
pub fn ccmr1_output(&self) -> &Reg<CCMR1_OUTPUTrs>
0x18 - capture/compare mode register 1 (output mode)
Sourcepub fn ccmr2_input(&self) -> &Reg<CCMR2_INPUTrs>
pub fn ccmr2_input(&self) -> &Reg<CCMR2_INPUTrs>
0x1c - capture/compare mode register 2 (input mode)
Sourcepub fn ccmr2_output(&self) -> &Reg<CCMR2_OUTPUTrs>
pub fn ccmr2_output(&self) -> &Reg<CCMR2_OUTPUTrs>
0x1c - capture/compare mode register 2 (output mode)
Trait Implementations§
Source§impl Enable for TIM2
impl Enable for TIM2
Source§fn is_enabled() -> bool
fn is_enabled() -> bool
Source§fn is_disabled() -> bool
fn is_disabled() -> bool
Source§unsafe fn enable_unchecked()
unsafe fn enable_unchecked()
Source§unsafe fn disable_unchecked()
unsafe fn disable_unchecked()
Source§impl LPEnable for TIM2
impl LPEnable for TIM2
Source§fn enable_in_low_power(rcc: &RccRB)
fn enable_in_low_power(rcc: &RccRB)
Source§fn disable_in_low_power(rcc: &RccRB)
fn disable_in_low_power(rcc: &RccRB)
Source§fn is_enabled_in_low_power() -> bool
fn is_enabled_in_low_power() -> bool
Source§fn is_disabled_in_low_power() -> bool
fn is_disabled_in_low_power() -> bool
Source§unsafe fn enable_in_low_power_unchecked()
unsafe fn enable_in_low_power_unchecked()
Source§unsafe fn disable_in_low_power_unchecked()
unsafe fn disable_in_low_power_unchecked()
impl Instance for TIM2
impl Send for TIM2
Auto Trait Implementations§
impl Freeze for TIM2
impl RefUnwindSafe for TIM2
impl !Sync for TIM2
impl Unpin for TIM2
impl UnwindSafe for TIM2
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
Source§impl<T> BusTimerClock for T
impl<T> BusTimerClock for T
Source§impl<TIM> MonoTimer64Ext for TIMwhere
TIM: Instance + General + WithPwm,
impl<TIM> MonoTimer64Ext for TIMwhere
TIM: Instance + General + WithPwm,
fn monotonic64<const FREQ: u32>(self, clocks: &Clocks) -> MonoTimer64<TIM, FREQ>
fn monotonic64_us(self, clocks: &Clocks) -> MonoTimer64<Self, 1_000_000>
Source§impl<TIM> MonoTimerExt for TIM
impl<TIM> MonoTimerExt for TIM
Source§impl<TIM> PwmExt for TIMwhere
TIM: Instance + WithPwm + Split,
impl<TIM> PwmExt for TIMwhere
TIM: Instance + WithPwm + Split,
fn pwm<const FREQ: u32>( self, time: Duration<u32, 1, FREQ>, clocks: &Clocks, ) -> (PwmManager<TIM, FREQ>, <TIM as Split>::Channels)
fn pwm_hz( self, time: Rate<u32, 1, 1>, clocks: &Clocks, ) -> (PwmHzManager<TIM>, <TIM as Split>::Channels)
fn pwm_us( self, time: TimerDurationU32<1_000_000>, clocks: &Clocks, ) -> (PwmManager<Self, 1_000_000>, Self::Channels)
Source§impl<TIM> TimerExt for TIMwhere
TIM: Instance,
impl<TIM> TimerExt for TIMwhere
TIM: Instance,
Source§fn counter<const FREQ: u32>(self, clocks: &Clocks) -> Counter<TIM, FREQ>
fn counter<const FREQ: u32>(self, clocks: &Clocks) -> Counter<TIM, FREQ>
Source§fn counter_hz(self, clocks: &Clocks) -> CounterHz<TIM>
fn counter_hz(self, clocks: &Clocks) -> CounterHz<TIM>
Hertz
as Duration units