Skip to main content

PwmOps

Trait PwmOps 

Source
pub trait PwmOps<const C: u8>: ChannelEnable<C> {
    // Required methods
    fn apply_pwm_mode(&mut self);
    fn set_chxcv(&mut self, cv: u16);
}
Expand description

Register operations on compare channel C of a timer.

Required Methods§

Source

fn apply_pwm_mode(&mut self)

Configures the channel as a PWM output and readies it for a duty value.

Covers direction, compare mode and polarity at once: a channel in PWM mode while still pointed at its input drives nothing.

Source

fn set_chxcv(&mut self, cv: u16)

Writes the compare value the channel switches its output at.

The output stays active while the counter is below this value, so one full period is car() + 1 and duty is the ratio between the two.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl PwmOps<0> for Timer0

Source§

fn apply_pwm_mode(&mut self)

Source§

fn set_chxcv(&mut self, cv: u16)

Source§

impl PwmOps<0> for Timer2

Source§

fn apply_pwm_mode(&mut self)

Source§

fn set_chxcv(&mut self, cv: u16)

Source§

impl PwmOps<0> for Timer13

Source§

fn apply_pwm_mode(&mut self)

Source§

fn set_chxcv(&mut self, cv: u16)

Source§

impl PwmOps<0> for Timer15

Source§

fn apply_pwm_mode(&mut self)

Source§

fn set_chxcv(&mut self, cv: u16)

Source§

impl PwmOps<0> for Timer16

Source§

fn apply_pwm_mode(&mut self)

Source§

fn set_chxcv(&mut self, cv: u16)

Source§

impl PwmOps<1> for Timer0

Source§

fn apply_pwm_mode(&mut self)

Source§

fn set_chxcv(&mut self, cv: u16)

Source§

impl PwmOps<1> for Timer2

Source§

fn apply_pwm_mode(&mut self)

Source§

fn set_chxcv(&mut self, cv: u16)

Source§

impl PwmOps<2> for Timer0

Source§

fn apply_pwm_mode(&mut self)

Source§

fn set_chxcv(&mut self, cv: u16)

Source§

impl PwmOps<2> for Timer2

Source§

fn apply_pwm_mode(&mut self)

Source§

fn set_chxcv(&mut self, cv: u16)

Source§

impl PwmOps<3> for Timer0

Source§

fn apply_pwm_mode(&mut self)

Source§

fn set_chxcv(&mut self, cv: u16)

Source§

impl PwmOps<3> for Timer2

Source§

fn apply_pwm_mode(&mut self)

Source§

fn set_chxcv(&mut self, cv: u16)

Implementors§