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: Peri<'d, T>,
    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: Peri<'d, T>, 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