pub struct Capture<'d> { /* private fields */ }Expand description
Capture driver
Implementations§
Source§impl<'d> Capture<'d>
impl<'d> Capture<'d>
Sourcepub fn new_with_input_pin<T: Instance, CH: CTimerChannel<T>, PIN: InputPin>(
ctimer: CTimer<'d>,
ch: Peri<'d, CH>,
pin: Peri<'d, PIN>,
_irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
config: Config,
) -> Result<Self, CaptureError>where
(T, CH, PIN): ValidInputMuxConfig,
pub fn new_with_input_pin<T: Instance, CH: CTimerChannel<T>, PIN: InputPin>(
ctimer: CTimer<'d>,
ch: Peri<'d, CH>,
pin: Peri<'d, PIN>,
_irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
config: Config,
) -> Result<Self, CaptureError>where
(T, CH, PIN): ValidInputMuxConfig,
Create Capture driver
Upon Drop, the external pin will be placed into Disabled
state.
pub fn frequency(&self) -> u32
pub async fn capture(&mut self) -> Result<Timestamp, CaptureError>
Trait Implementations§
Source§impl<'d> SetConfig for Capture<'d>
impl<'d> SetConfig for Capture<'d>
Source§type ConfigError = CaptureError
type ConfigError = CaptureError
The error type that can occur if
set_config fails.Source§fn set_config(&mut self, config: &Self::Config) -> Result<(), Self::ConfigError>
fn set_config(&mut self, config: &Self::Config) -> Result<(), Self::ConfigError>
Set the configuration of the driver.
Auto Trait Implementations§
impl<'d> Freeze for Capture<'d>
impl<'d> !RefUnwindSafe for Capture<'d>
impl<'d> Send for Capture<'d>
impl<'d> Sync for Capture<'d>
impl<'d> Unpin for Capture<'d>
impl<'d> !UnwindSafe for Capture<'d>
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