pub struct PwmPin<'d, Pin, PWM, const OP: u8, const IS_A: bool> { /* private fields */ }
Expand description
A pin driven by an MCPWM operator
Implementations§
source§impl<'d, Pin, PWM, const OP: u8, const IS_A: bool> PwmPin<'d, Pin, PWM, OP, IS_A>where
Pin: OutputPin,
PWM: PwmPeripheral,
impl<'d, Pin, PWM, const OP: u8, const IS_A: bool> PwmPin<'d, Pin, PWM, OP, IS_A>where
Pin: OutputPin,
PWM: PwmPeripheral,
sourcepub fn update_fed(&self, cycles: u16)
pub fn update_fed(&self, cycles: u16)
Updates dead-time FED register
WARNING: FED is connected to the operator, and could be connected to another pin
sourcepub fn update_red(&self, cycles: u16)
pub fn update_red(&self, cycles: u16)
Updates dead-time RED register
WARNING: RED is connected to the operator, and could be connected to another pin
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 get_timestamp(&self) -> u16
pub fn get_timestamp(&self) -> u16
Get the old timestamp.
The value of the timestamp will take effect according to the set
PwmUpdateMethod
.
Trait Implementations§
source§impl<'d, Pin, PWM, const OP: u8, const IS_A: bool> PwmPin for PwmPin<'d, Pin, PWM, OP, IS_A>where
Pin: OutputPin,
PWM: PwmPeripheral,
impl<'d, Pin, PWM, const OP: u8, const IS_A: bool> PwmPin for PwmPin<'d, Pin, PWM, OP, IS_A>where
Pin: OutputPin,
PWM: PwmPeripheral,
source§fn disable(&mut self)
fn disable(&mut self)
This only set the timestamp to 0, if you want to disable the PwmPin, it must be done on the timer itself.
source§fn enable(&mut self)
fn enable(&mut self)
This only set the timestamp to the maximum, if you want to disable the PwmPin, it must be done on the timer itself.
source§fn get_duty(&self) -> <PwmPin<'d, Pin, PWM, OP, IS_A> as PwmPin>::Duty
fn get_duty(&self) -> <PwmPin<'d, Pin, PWM, OP, IS_A> as PwmPin>::Duty
Get the duty of the pin
source§fn get_max_duty(&self) -> <PwmPin<'d, Pin, PWM, OP, IS_A> as PwmPin>::Duty
fn get_max_duty(&self) -> <PwmPin<'d, Pin, PWM, OP, IS_A> as PwmPin>::Duty
Get the max duty of the pin