pub struct PwmInput<'d, T: GeneralInstance4Channel> { /* private fields */ }
Expand description
PWM Input driver.
Implementations§
source§impl<'d, T: GeneralInstance4Channel> PwmInput<'d, T>
impl<'d, T: GeneralInstance4Channel> PwmInput<'d, T>
sourcepub fn new(
tim: impl Peripheral<P = T> + 'd,
pin: impl Peripheral<P = impl Channel1Pin<T>> + 'd,
pull: Pull,
freq: Hertz,
) -> Self
pub fn new( tim: impl Peripheral<P = T> + 'd, pin: impl Peripheral<P = impl Channel1Pin<T>> + 'd, pull: Pull, freq: Hertz, ) -> Self
Create a new PWM input driver.
sourcepub fn new_alt(
tim: impl Peripheral<P = T> + 'd,
pin: impl Peripheral<P = impl Channel2Pin<T>> + 'd,
pull: Pull,
freq: Hertz,
) -> Self
pub fn new_alt( tim: impl Peripheral<P = T> + 'd, pin: impl Peripheral<P = impl Channel2Pin<T>> + 'd, pull: Pull, freq: Hertz, ) -> Self
Create a new PWM input driver.
sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check whether given channel is enabled
sourcepub fn get_period_ticks(&self) -> u32
pub fn get_period_ticks(&self) -> u32
Get the period tick count
sourcepub fn get_width_ticks(&self) -> u32
pub fn get_width_ticks(&self) -> u32
Get the pulse width tick count
sourcepub fn get_duty_cycle(&self) -> f32
pub fn get_duty_cycle(&self) -> f32
Get the duty cycle in 100%
Auto Trait Implementations§
impl<'d, T> Freeze for PwmInput<'d, T>where
T: Freeze,
impl<'d, T> RefUnwindSafe for PwmInput<'d, T>where
T: RefUnwindSafe,
impl<'d, T> Send for PwmInput<'d, T>where
T: Send,
impl<'d, T> Sync for PwmInput<'d, T>where
T: Sync,
impl<'d, T> Unpin for PwmInput<'d, T>where
T: Unpin,
impl<'d, T> !UnwindSafe for PwmInput<'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