Struct PwmInput

Source
pub struct PwmInput<TIM, REMAP, PINS> { /* private fields */ }
Expand description

PWM Input

Implementations§

Source§

impl<REMAP, PINS> PwmInput<TIM1, REMAP, PINS>
where REMAP: Remap<Periph = TIM1>, PINS: Pins<REMAP>,

Source

pub fn read_frequency( &self, mode: ReadMode, clocks: &Clocks, ) -> Result<Hertz, Error>

Return the frequency sampled by the timer

Source

pub fn read_duty(&self, mode: ReadMode) -> Result<(u16, u16), Error>

Return the duty in the form of a fraction : (duty_cycle/period)

Source§

impl<REMAP, PINS> PwmInput<TIM2, REMAP, PINS>
where REMAP: Remap<Periph = TIM2>, PINS: Pins<REMAP>,

Source

pub fn read_frequency( &self, mode: ReadMode, clocks: &Clocks, ) -> Result<Hertz, Error>

Return the frequency sampled by the timer

Source

pub fn read_duty(&self, mode: ReadMode) -> Result<(u16, u16), Error>

Return the duty in the form of a fraction : (duty_cycle/period)

Source§

impl<REMAP, PINS> PwmInput<TIM3, REMAP, PINS>
where REMAP: Remap<Periph = TIM3>, PINS: Pins<REMAP>,

Source

pub fn read_frequency( &self, mode: ReadMode, clocks: &Clocks, ) -> Result<Hertz, Error>

Return the frequency sampled by the timer

Source

pub fn read_duty(&self, mode: ReadMode) -> Result<(u16, u16), Error>

Return the duty in the form of a fraction : (duty_cycle/period)

Source§

impl<REMAP, PINS> PwmInput<TIM4, REMAP, PINS>
where REMAP: Remap<Periph = TIM4>, PINS: Pins<REMAP>,

Source

pub fn read_frequency( &self, mode: ReadMode, clocks: &Clocks, ) -> Result<Hertz, Error>

Return the frequency sampled by the timer

Source

pub fn read_duty(&self, mode: ReadMode) -> Result<(u16, u16), Error>

Return the duty in the form of a fraction : (duty_cycle/period)

Auto Trait Implementations§

§

impl<TIM, REMAP, PINS> Freeze for PwmInput<TIM, REMAP, PINS>

§

impl<TIM, REMAP, PINS> RefUnwindSafe for PwmInput<TIM, REMAP, PINS>
where TIM: RefUnwindSafe, REMAP: RefUnwindSafe, PINS: RefUnwindSafe,

§

impl<TIM, REMAP, PINS> Send for PwmInput<TIM, REMAP, PINS>
where TIM: Send, REMAP: Send, PINS: Send,

§

impl<TIM, REMAP, PINS> Sync for PwmInput<TIM, REMAP, PINS>
where TIM: Sync, REMAP: Sync, PINS: Sync,

§

impl<TIM, REMAP, PINS> Unpin for PwmInput<TIM, REMAP, PINS>
where TIM: Unpin, REMAP: Unpin, PINS: Unpin,

§

impl<TIM, REMAP, PINS> UnwindSafe for PwmInput<TIM, REMAP, PINS>
where TIM: UnwindSafe, REMAP: UnwindSafe, PINS: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.