Struct stm32wlxx_hal::lptim::LpTim2

source ·
pub struct LpTim2 { /* private fields */ }
Expand description

Low-power timer 2 driver.

Implementations§

source§

impl LpTim2

source

pub fn new_trigger_pin<P: LpTim2Etr>( &mut self, filter: Filter, pol: TrgPol, pin: P, cs: &CriticalSection ) -> LpTim2Trg<P>

Setup a new pin trigger.

Panics
  • (debug) timer is enabled.
Example

See LpTim3::new_trigger_pin.

source

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

See LpTim3::free_trigger_pin.

source§

impl LpTim2

source

pub fn new_output_pin<P: LpTim2Out>( &mut self, pin: P, cs: &CriticalSection ) -> LpTim2OutPin<P>

Setup a new output pin.

source

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 Debug for LpTim2

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl LpTim for LpTim2

§

type TrgSel = TrgSel

Trigger selection options.
source§

fn new(tim: Self::Pac, clk: Clk, pre: Prescaler, rcc: &mut RCC) -> Self

Create a new LPTIM driver. Read more
source§

fn free(self) -> Self::Pac

Free the LPTIM registers from the driver. Read more
source§

unsafe fn pulse_reset(rcc: &mut RCC)

Reset the LPTIM peripheral. Read more
source§

fn enable_clock(rcc: &mut RCC)

Enable clocks for the LPTIM peripheral. Read more
source§

unsafe fn disable_clock(rcc: &mut RCC)

Disable the LPTIM peripheral clock. Read more
source§

fn clk(rcc: &RCC) -> Clk

Get the clock source. Read more
source§

fn hz(&self) -> &Ratio<u32>

Get the clock speed in hertz. Read more
source§

fn cnt() -> u16

Get the timer count.
source§

fn isr() -> u32

Get the interrupt status.
source§

fn set_ier(&mut self, ier: u32)

Enable and disable interrupts. Read more
source§

unsafe fn set_icr(&mut self, icr: u32)

Clear interrupts. Read more
source§

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)

Setup a non-pin trigger. Read more
source§

fn set_max_duty(&mut self, duty: u16)

Set the maximum duty cycle (autoreload value). Read more
source§

impl PwmPin for LpTim2

§

type Duty = u16

Type for the duty methods Read more
source§

fn disable(&mut self)

Disables a PWM channel
source§

fn enable(&mut self)

Enables a PWM channel
source§

fn get_duty(&self) -> Self::Duty

Returns the current duty cycle
source§

fn get_max_duty(&self) -> Self::Duty

Returns the maximum duty cycle value
source§

fn set_duty(&mut self, duty: Self::Duty)

Sets a new duty cycle
source§

impl CountDown for LpTim2

§

type Time = u16

The unit of time used by this timer
source§

fn start<T>(&mut self, count: T)where T: Into<Self::Time>,

Starts a new count down
source§

fn wait(&mut self) -> Result<(), Void>

Non-blockingly “waits” until the count down finishes 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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.