pub struct DualPwm<'d> {
pub pwm0: Pwm<'d>,
pub pwm1: Pwm<'d>,
/* private fields */
}Expand description
Dual channel PWM driver.
A single period match channel is shared for two independent PWM outputs. That is, both PWM output channels run on the same frequency, with optionally different duty cycles.
Fields§
§pwm0: Pwm<'d>§pwm1: Pwm<'d>Implementations§
Source§impl<'d> DualPwm<'d>
impl<'d> DualPwm<'d>
Sourcepub fn new<T: Instance, DUTY0: CTimerChannel<T>, DUTY1: CTimerChannel<T>, PIN0: OutputPin<T>, PIN1: OutputPin<T>>(
ctimer: CTimer<'d>,
duty_ch0: Peri<'d, DUTY0>,
duty_ch1: Peri<'d, DUTY1>,
period_ch: Peri<'d, impl CTimerChannel<T>>,
pin0: Peri<'d, PIN0>,
pin1: Peri<'d, PIN1>,
config: Config,
) -> Result<Self, PwmError>
pub fn new<T: Instance, DUTY0: CTimerChannel<T>, DUTY1: CTimerChannel<T>, PIN0: OutputPin<T>, PIN1: OutputPin<T>>( ctimer: CTimer<'d>, duty_ch0: Peri<'d, DUTY0>, duty_ch1: Peri<'d, DUTY1>, period_ch: Peri<'d, impl CTimerChannel<T>>, pin0: Peri<'d, PIN0>, pin1: Peri<'d, PIN1>, config: Config, ) -> Result<Self, PwmError>
Create Pwm driver with a two pins for two PWM outputs.
Upon Drop, all external pins will be placed into Disabled
state.
Auto Trait Implementations§
impl<'d> Freeze for DualPwm<'d>
impl<'d> !RefUnwindSafe for DualPwm<'d>
impl<'d> Send for DualPwm<'d>
impl<'d> Sync for DualPwm<'d>
impl<'d> Unpin for DualPwm<'d>
impl<'d> !UnwindSafe for DualPwm<'d>
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