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: Peri<'d, T>,
pin: Peri<'d, impl Channel1Pin<T>>,
pull: Pull,
freq: Hertz,
) -> Self
pub fn new( tim: Peri<'d, T>, pin: Peri<'d, impl Channel1Pin<T>>, pull: Pull, freq: Hertz, ) -> Self
Create a new PWM input driver.
Sourcepub fn new_alt(
tim: Peri<'d, T>,
pin: Peri<'d, impl Channel2Pin<T>>,
pull: Pull,
freq: Hertz,
) -> Self
pub fn new_alt( tim: Peri<'d, T>, pin: Peri<'d, impl Channel2Pin<T>>, 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