Embassy
embassy-stm32

Crates

git

Versions

stm32u073m8

Flavors

Struct embassy_stm32::timer::input_capture::InputCapture

source ·
pub struct InputCapture<'d, T: GeneralInstance4Channel> { /* private fields */ }
Expand description

Input capture driver.

Implementations§

source§

impl<'d, T: GeneralInstance4Channel> InputCapture<'d, T>

source

pub fn new( tim: impl Peripheral<P = T> + 'd, _ch1: Option<CapturePin<'d, T, Ch1>>, _ch2: Option<CapturePin<'d, T, Ch2>>, _ch3: Option<CapturePin<'d, T, Ch3>>, _ch4: Option<CapturePin<'d, T, Ch4>>, _irq: impl Binding<T::CaptureCompareInterrupt, CaptureCompareInterruptHandler<T>> + 'd, freq: Hertz, counting_mode: CountingMode ) -> Self

Create a new input capture driver.

source

pub fn enable(&mut self, channel: Channel)

Enable the given channel.

source

pub fn disable(&mut self, channel: Channel)

Disable the given channel.

source

pub fn is_enabled(&self, channel: Channel) -> bool

Check whether given channel is enabled

source

pub fn set_input_capture_mode( &mut self, channel: Channel, mode: InputCaptureMode )

Set the input capture mode for a given channel.

source

pub fn set_input_ti_selection( &mut self, channel: Channel, tisel: InputTISelection )

Set input TI selection.

source

pub fn get_capture_value(&self, channel: Channel) -> u32

Get capture value for a channel.

source

pub fn get_input_interrupt(&self, channel: Channel) -> bool

Get input interrupt.

source

pub async fn wait_for_rising_edge(&mut self, channel: Channel) -> u32

Asynchronously wait until the pin sees a rising edge.

source

pub async fn wait_for_falling_edge(&mut self, channel: Channel) -> u32

Asynchronously wait until the pin sees a falling edge.

source

pub async fn wait_for_any_edge(&mut self, channel: Channel) -> u32

Asynchronously wait until the pin sees any edge.

source

pub async fn wait_for_rising_edge_alternate(&mut self, channel: Channel) -> u32

Asynchronously wait until the (alternate) pin sees a rising edge.

source

pub async fn wait_for_falling_edge_alternate(&mut self, channel: Channel) -> u32

Asynchronously wait until the (alternate) pin sees a falling edge.

source

pub async fn wait_for_any_edge_alternate(&mut self, channel: Channel) -> u32

Asynchronously wait until the (alternate) pin sees any edge.

Auto Trait Implementations§

§

impl<'d, T> Freeze for InputCapture<'d, T>
where T: Freeze,

§

impl<'d, T> RefUnwindSafe for InputCapture<'d, T>
where T: RefUnwindSafe,

§

impl<'d, T> Send for InputCapture<'d, T>
where T: Send,

§

impl<'d, T> Sync for InputCapture<'d, T>
where T: Sync,

§

impl<'d, T> Unpin for InputCapture<'d, T>
where T: Unpin,

§

impl<'d, T> !UnwindSafe for InputCapture<'d, T>

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>,

§

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>,

§

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.