pub struct PwmPin<'d, PWM, const OP: u8, const IS_A: bool> { /* private fields */ }Expand description
A pin driven by an MCPWM operator.
Implementations§
Source§impl<'d, PWM: PwmPeripheral, const OP: u8, const IS_A: bool> PwmPin<'d, PWM, OP, IS_A>
impl<'d, PWM: PwmPeripheral, const OP: u8, const IS_A: bool> PwmPin<'d, PWM, OP, IS_A>
Sourcepub fn set_actions(&mut self, value: PwmActions<IS_A>)
pub fn set_actions(&mut self, value: PwmActions<IS_A>)
Configures what actions should be taken on timing events.
Sourcepub fn set_update_method(&mut self, update_method: PwmUpdateMethod)
pub fn set_update_method(&mut self, update_method: PwmUpdateMethod)
Sets how a new timestamp syncs with the timer.
Sourcepub fn set_timestamp(&mut self, value: u16)
pub fn set_timestamp(&mut self, value: u16)
Writes a new timestamp.
The written value will take effect according to the set
PwmUpdateMethod.
Sourcepub fn timestamp(&self) -> u16
pub fn timestamp(&self) -> u16
Returns the old timestamp.
The value of the timestamp will take effect according to the set
PwmUpdateMethod.
Trait Implementations§
Source§impl<PWM: PwmPeripheral, const OP: u8, const IS_A: bool> ErrorType for PwmPin<'_, PWM, OP, IS_A>
Available on crate feature unstable only.Implements no error type for the PwmPin because the method are infallible.
impl<PWM: PwmPeripheral, const OP: u8, const IS_A: bool> ErrorType for PwmPin<'_, PWM, OP, IS_A>
Available on crate feature
unstable only.Implements no error type for the PwmPin because the method are infallible.
Source§impl<PWM: PwmPeripheral, const OP: u8, const IS_A: bool> SetDutyCycle for PwmPin<'_, PWM, OP, IS_A>
Available on crate feature unstable only.Implements the trait SetDutyCycle for PwmPin.
impl<PWM: PwmPeripheral, const OP: u8, const IS_A: bool> SetDutyCycle for PwmPin<'_, PWM, OP, IS_A>
Available on crate feature
unstable only.Implements the trait SetDutyCycle for PwmPin.
Source§fn max_duty_cycle(&self) -> u16
fn max_duty_cycle(&self) -> u16
Returns the max duty of the PwmPin.
Source§fn set_duty_cycle(&mut self, duty: u16) -> Result<(), Infallible>
fn set_duty_cycle(&mut self, duty: u16) -> Result<(), Infallible>
Sets the max duty of the PwmPin.
Source§fn set_duty_cycle_fully_off(&mut self) -> Result<(), Self::Error>
fn set_duty_cycle_fully_off(&mut self) -> Result<(), Self::Error>
Set the duty cycle to 0%, or always inactive.
Source§fn set_duty_cycle_fully_on(&mut self) -> Result<(), Self::Error>
fn set_duty_cycle_fully_on(&mut self) -> Result<(), Self::Error>
Set the duty cycle to 100%, or always active.
Auto Trait Implementations§
impl<'d, PWM, const OP: u8, const IS_A: bool> !UnwindSafe for PwmPin<'d, PWM, OP, IS_A>
impl<'d, PWM, const OP: u8, const IS_A: bool> Freeze for PwmPin<'d, PWM, OP, IS_A>where
PhantomData<PWM>: Freeze,
impl<'d, PWM, const OP: u8, const IS_A: bool> RefUnwindSafe for PwmPin<'d, PWM, OP, IS_A>where
PhantomData<PWM>: RefUnwindSafe,
impl<'d, PWM, const OP: u8, const IS_A: bool> Send for PwmPin<'d, PWM, OP, IS_A>where
PhantomData<PWM>: Send,
impl<'d, PWM, const OP: u8, const IS_A: bool> Sync for PwmPin<'d, PWM, OP, IS_A>where
PhantomData<PWM>: Sync,
impl<'d, PWM, const OP: u8, const IS_A: bool> Unpin for PwmPin<'d, PWM, OP, IS_A>where
PhantomData<PWM>: Unpin,
impl<'d, PWM, const OP: u8, const IS_A: bool> UnsafeUnpin for PwmPin<'d, PWM, OP, IS_A>where
PhantomData<PWM>: UnsafeUnpin,
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