embassy-mcxa

Crates

git

Versions

mcx-a256

Flavors

DualPwm

Struct DualPwm 

Source
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>

Source

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.

Source

pub fn split(self) -> (Pwm<'d>, Pwm<'d>)

Split self into its underlying channels.

Upon calling this method, changing PWM frequency will be disallowed. Only duty cycles can be changed.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.