pub struct PwmHzManager<TIM>where
TIM: Instance + WithPwm,{ /* private fields */ }
Implementations§
Source§impl<TIM> PwmHzManager<TIM>where
TIM: Instance + WithPwm + Split,
impl<TIM> PwmHzManager<TIM>where
TIM: Instance + WithPwm + Split,
Source§impl<TIM> PwmHzManager<TIM>where
TIM: Instance + WithPwm,
impl<TIM> PwmHzManager<TIM>where
TIM: Instance + WithPwm,
Sourcepub fn get_max_duty(&self) -> u16
pub fn get_max_duty(&self) -> u16
Get the maximum duty cycle value of the timer
If 0
returned means max_duty is 2^16
Sourcepub fn get_period(&self) -> Hertz
pub fn get_period(&self) -> Hertz
Get the PWM frequency of the timer in Hertz
Sourcepub fn set_period(&mut self, period: Hertz)
pub fn set_period(&mut self, period: Hertz)
Set the PWM frequency for the timer in Hertz
Source§impl<TIM> PwmHzManager<TIM>where
TIM: Instance + WithPwm + Advanced,
impl<TIM> PwmHzManager<TIM>where
TIM: Instance + WithPwm + Advanced,
Sourcepub fn set_dead_time(&mut self, dts_ticks: u16)
pub fn set_dead_time(&mut self, dts_ticks: u16)
Set number DTS ticks during that the primary and complementary PWM pins are simultaneously forced to their inactive states
( see Polarity
setting ) when changing PWM state. This duration when both channels are in an ‘off’ state is called ‘dead time’.
This is necessary in applications like motor control or power converters to prevent the destruction of the switching elements by short circuit in the moment of switching.
Sourcepub fn set_dead_time_bits(&mut self, bits: u8)
pub fn set_dead_time_bits(&mut self, bits: u8)
Set raw dead time (DTG) bits
The dead time generation is nonlinear and constrained by the DTS tick duration. DTG register configuration and calculation of the actual resulting dead time is described in the application note RM0368 from ST Microelectronics
Sourcepub fn get_dead_time(&self) -> u16
pub fn get_dead_time(&self) -> u16
Return dead time for complementary pins in the unit of DTS ticks
Sourcepub fn get_dead_time_bits(&self) -> u8
pub fn get_dead_time_bits(&self) -> u8
Get raw dead time (DTG) bits
Sourcepub fn set_cms(&mut self, mode: CenterAlignedMode)
pub fn set_cms(&mut self, mode: CenterAlignedMode)
Sets the alignment mode