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>)
Configure 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)
Set how a new timestamp syncs with the timer
Sourcepub fn set_timestamp(&mut self, value: u16)
 
pub fn set_timestamp(&mut self, value: u16)
Write a new timestamp.
The written value will take effect according to the set
PwmUpdateMethod.
Sourcepub fn timestamp(&self) -> u16
 
pub fn timestamp(&self) -> u16
Get 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.Implement 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.Implement 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.Implement 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.Implement the trait SetDutyCycle for PwmPin
Source§fn max_duty_cycle(&self) -> u16
 
fn max_duty_cycle(&self) -> u16
Get 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>
Set 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.
Source§fn set_duty_cycle_fraction(
    &mut self,
    num: u16,
    denom: u16,
) -> Result<(), Self::Error>
 
fn set_duty_cycle_fraction( &mut self, num: u16, denom: u16, ) -> Result<(), Self::Error>
Set the duty cycle to 
num / denom. Read moreSource§fn set_duty_cycle_percent(&mut self, percent: u8) -> Result<(), Self::Error>
 
fn set_duty_cycle_percent(&mut self, percent: u8) -> Result<(), Self::Error>
Set the duty cycle to 
percent / 100 Read more