pub struct InputCapture<'d, T: GeneralInstance4Channel> { /* private fields */ }
Expand description
Input capture driver.
Implementations§
source§impl<'d, T: GeneralInstance4Channel> InputCapture<'d, T>
impl<'d, T: GeneralInstance4Channel> InputCapture<'d, T>
sourcepub 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
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.
sourcepub fn is_enabled(&self, channel: Channel) -> bool
pub fn is_enabled(&self, channel: Channel) -> bool
Check whether given channel is enabled
sourcepub fn set_input_capture_mode(
&mut self,
channel: Channel,
mode: InputCaptureMode,
)
pub fn set_input_capture_mode( &mut self, channel: Channel, mode: InputCaptureMode, )
Set the input capture mode for a given channel.
sourcepub fn set_input_ti_selection(
&mut self,
channel: Channel,
tisel: InputTISelection,
)
pub fn set_input_ti_selection( &mut self, channel: Channel, tisel: InputTISelection, )
Set input TI selection.
sourcepub fn get_capture_value(&self, channel: Channel) -> u32
pub fn get_capture_value(&self, channel: Channel) -> u32
Get capture value for a channel.
sourcepub fn get_input_interrupt(&self, channel: Channel) -> bool
pub fn get_input_interrupt(&self, channel: Channel) -> bool
Get input interrupt.
sourcepub async fn wait_for_rising_edge(&mut self, channel: Channel) -> u32
pub async fn wait_for_rising_edge(&mut self, channel: Channel) -> u32
Asynchronously wait until the pin sees a rising edge.
sourcepub async fn wait_for_falling_edge(&mut self, channel: Channel) -> u32
pub async fn wait_for_falling_edge(&mut self, channel: Channel) -> u32
Asynchronously wait until the pin sees a falling edge.
sourcepub async fn wait_for_any_edge(&mut self, channel: Channel) -> u32
pub async fn wait_for_any_edge(&mut self, channel: Channel) -> u32
Asynchronously wait until the pin sees any edge.
sourcepub async fn wait_for_rising_edge_alternate(&mut self, channel: Channel) -> u32
pub async fn wait_for_rising_edge_alternate(&mut self, channel: Channel) -> u32
Asynchronously wait until the (alternate) pin sees a rising edge.
sourcepub async fn wait_for_falling_edge_alternate(&mut self, channel: Channel) -> u32
pub async fn wait_for_falling_edge_alternate(&mut self, channel: Channel) -> u32
Asynchronously wait until the (alternate) pin sees a falling edge.
sourcepub async fn wait_for_any_edge_alternate(&mut self, channel: Channel) -> u32
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> 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