Struct stm32wlxx_hal::lptim::LpTim2
source · pub struct LpTim2 { /* private fields */ }
Expand description
Low-power timer 2 driver.
Implementations§
source§impl LpTim2
impl LpTim2
sourcepub fn new_trigger_pin<P: LpTim2Etr>(
&mut self,
filter: Filter,
pol: TrgPol,
pin: P,
cs: &CriticalSection
) -> LpTim2Trg<P>
pub fn new_trigger_pin<P: LpTim2Etr>( &mut self, filter: Filter, pol: TrgPol, pin: P, cs: &CriticalSection ) -> LpTim2Trg<P>
sourcepub fn free_trigger_pin<P: LpTim2Etr>(&mut self, pin: LpTim2Trg<P>) -> P
pub fn free_trigger_pin<P: LpTim2Etr>(&mut self, pin: LpTim2Trg<P>) -> P
Free the trigger pin previously created with
new_trigger_pin
.
This is will the trigger source to a software trigger.
Panics
- (debug) timer is enabled.
Example
source§impl LpTim2
impl LpTim2
sourcepub fn new_output_pin<P: LpTim2Out>(
&mut self,
pin: P,
cs: &CriticalSection
) -> LpTim2OutPin<P>
pub fn new_output_pin<P: LpTim2Out>( &mut self, pin: P, cs: &CriticalSection ) -> LpTim2OutPin<P>
Setup a new output pin.
sourcepub fn free_output_pin<P: LpTim2Out>(&mut self, pin: LpTim2OutPin<P>) -> P
pub fn free_output_pin<P: LpTim2Out>(&mut self, pin: LpTim2OutPin<P>) -> P
Free the output pin previously created with
new_output_pin
.
Trait Implementations§
source§impl LpTim for LpTim2
impl LpTim for LpTim2
source§fn new(tim: Self::Pac, clk: Clk, pre: Prescaler, rcc: &mut RCC) -> Self
fn new(tim: Self::Pac, clk: Clk, pre: Prescaler, rcc: &mut RCC) -> Self
Create a new LPTIM driver. Read more
source§unsafe fn pulse_reset(rcc: &mut RCC)
unsafe fn pulse_reset(rcc: &mut RCC)
Reset the LPTIM peripheral. Read more
source§fn enable_clock(rcc: &mut RCC)
fn enable_clock(rcc: &mut RCC)
Enable clocks for the LPTIM peripheral. Read more
source§unsafe fn disable_clock(rcc: &mut RCC)
unsafe fn disable_clock(rcc: &mut RCC)
Disable the LPTIM peripheral clock. Read more
source§fn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Returns
true
if the timer is enabled.source§fn setup_trigger(&mut self, filter: Filter, pol: TrgPol, sel: Self::TrgSel)
fn setup_trigger(&mut self, filter: Filter, pol: TrgPol, sel: Self::TrgSel)
Setup a non-pin trigger. Read more
source§fn set_max_duty(&mut self, duty: u16)
fn set_max_duty(&mut self, duty: u16)
Set the maximum duty cycle (autoreload value). Read more
Auto Trait Implementations§
impl RefUnwindSafe for LpTim2
impl Send for LpTim2
impl !Sync for LpTim2
impl Unpin for LpTim2
impl UnwindSafe for LpTim2
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