pub struct BridgeConverter<TIM, PSCL> { /* private fields */ }Expand description
Fixed-frequency bridge converter driver.
Implementations§
Source§impl<TIM, PSCL: HrtimPrescaler> BridgeConverter<TIM, PSCL>where
TIM: InstanceX + HrPwmAdvExt<PreloadSource = PreloadSource> + HrPwmAdvExt,
HrTim<TIM, PSCL, NoDma, NoDma>: HrTimer,
impl<TIM, PSCL: HrtimPrescaler> BridgeConverter<TIM, PSCL>where
TIM: InstanceX + HrPwmAdvExt<PreloadSource = PreloadSource> + HrPwmAdvExt,
HrTim<TIM, PSCL, NoDma, NoDma>: HrTimer,
Sourcepub fn new<P1, P2>(
timer: TIM,
pin1: P1,
pin2: P2,
frequency: Hertz,
prescaler: PSCL,
hr_control: &mut HrPwmControl,
) -> Selfwhere
P1: Output1Pin<TIM>,
P2: Output2Pin<TIM>,
HrPwmBuilder<TIM, PSCL, PreloadSource, P1, P2>: HrPwmBuilderExt<TIM, PSCL, P1, P2>,
pub fn new<P1, P2>(
timer: TIM,
pin1: P1,
pin2: P2,
frequency: Hertz,
prescaler: PSCL,
hr_control: &mut HrPwmControl,
) -> Selfwhere
P1: Output1Pin<TIM>,
P2: Output2Pin<TIM>,
HrPwmBuilder<TIM, PSCL, PreloadSource, P1, P2>: HrPwmBuilderExt<TIM, PSCL, P1, P2>,
Create a new HRTIM bridge converter driver.
Sourcepub fn set_dead_time(&mut self, dead_time: u16)
pub fn set_dead_time(&mut self, dead_time: u16)
Set the dead time as a proportion of the maximum compare value
Sourcepub fn get_max_compare_value(&mut self) -> u16
pub fn get_max_compare_value(&mut self) -> u16
Get the maximum compare value of a duty cycle
Sourcepub fn set_primary_duty(&mut self, primary_duty: u16)
pub fn set_primary_duty(&mut self, primary_duty: u16)
The primary duty is the period in which the primary switch is active
In the case of a buck converter, this is the high-side switch In the case of a boost converter, this is the low-side switch
Sourcepub fn set_secondary_duty(&mut self, secondary_duty: u16)
pub fn set_secondary_duty(&mut self, secondary_duty: u16)
The secondary duty is the period in any switch is active
If less than or equal to the primary duty, the secondary switch will be active for one tick If a fully complementary output is desired, the secondary duty can be set to the max compare
Auto Trait Implementations§
impl<TIM, PSCL> Freeze for BridgeConverter<TIM, PSCL>
impl<TIM, PSCL> RefUnwindSafe for BridgeConverter<TIM, PSCL>where
TIM: RefUnwindSafe,
PSCL: RefUnwindSafe,
impl<TIM, PSCL> Send for BridgeConverter<TIM, PSCL>
impl<TIM, PSCL> Sync for BridgeConverter<TIM, PSCL>
impl<TIM, PSCL> Unpin for BridgeConverter<TIM, PSCL>
impl<TIM, PSCL> UnwindSafe for BridgeConverter<TIM, PSCL>where
TIM: UnwindSafe,
PSCL: UnwindSafe,
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