pub trait _embedded_hal_PwmPin {
    type Duty;

    // Required methods
    fn disable(&mut self);
    fn enable(&mut self);
    fn get_duty(&self) -> Self::Duty;
    fn get_max_duty(&self) -> Self::Duty;
    fn set_duty(&mut self, duty: Self::Duty);
}
Expand description

A single PWM channel / pin

See Pwm for details

Required Associated Types§

source

type Duty

Type for the duty methods

The implementer is free to choose a float / percentage representation (e.g. 0.0 .. 1.0) or an integer representation (e.g. 0 .. 65535)

Required Methods§

source

fn disable(&mut self)

Disables a PWM channel

source

fn enable(&mut self)

Enables a PWM channel

source

fn get_duty(&self) -> Self::Duty

Returns the current duty cycle

source

fn get_max_duty(&self) -> Self::Duty

Returns the maximum duty cycle value

source

fn set_duty(&mut self, duty: Self::Duty)

Sets a new duty cycle

Implementations on Foreign Types§

source§

impl<I> PwmPin for Pwm2<I>where I: PinId,

§

type Duty = u16

source§

fn disable(&mut self)

source§

fn enable(&mut self)

source§

fn get_duty(&self) -> <Pwm2<I> as PwmPin>::Duty

source§

fn get_max_duty(&self) -> <Pwm2<I> as PwmPin>::Duty

source§

fn set_duty(&mut self, duty: <Pwm2<I> as PwmPin>::Duty)

source§

impl<I> PwmPin for Pwm1<I>where I: PinId,

§

type Duty = u16

source§

fn disable(&mut self)

source§

fn enable(&mut self)

source§

fn get_duty(&self) -> <Pwm1<I> as PwmPin>::Duty

source§

fn get_max_duty(&self) -> <Pwm1<I> as PwmPin>::Duty

source§

fn set_duty(&mut self, duty: <Pwm1<I> as PwmPin>::Duty)

source§

impl<I> PwmPin for Pwm5<I>where I: PinId,

§

type Duty = u16

source§

fn disable(&mut self)

source§

fn enable(&mut self)

source§

fn get_duty(&self) -> <Pwm5<I> as PwmPin>::Duty

source§

fn get_max_duty(&self) -> <Pwm5<I> as PwmPin>::Duty

source§

fn set_duty(&mut self, duty: <Pwm5<I> as PwmPin>::Duty)

source§

impl<I> PwmPin for Pwm7<I>where I: PinId,

§

type Duty = u16

source§

fn disable(&mut self)

source§

fn enable(&mut self)

source§

fn get_duty(&self) -> <Pwm7<I> as PwmPin>::Duty

source§

fn get_max_duty(&self) -> <Pwm7<I> as PwmPin>::Duty

source§

fn set_duty(&mut self, duty: <Pwm7<I> as PwmPin>::Duty)

source§

impl<I> PwmPin for Pwm6<I>where I: PinId,

§

type Duty = u16

source§

fn disable(&mut self)

source§

fn enable(&mut self)

source§

fn get_duty(&self) -> <Pwm6<I> as PwmPin>::Duty

source§

fn get_max_duty(&self) -> <Pwm6<I> as PwmPin>::Duty

source§

fn set_duty(&mut self, duty: <Pwm6<I> as PwmPin>::Duty)

source§

impl<I> PwmPin for Pwm3<I>where I: PinId,

§

type Duty = u16

source§

fn disable(&mut self)

source§

fn enable(&mut self)

source§

fn get_duty(&self) -> <Pwm3<I> as PwmPin>::Duty

source§

fn get_max_duty(&self) -> <Pwm3<I> as PwmPin>::Duty

source§

fn set_duty(&mut self, duty: <Pwm3<I> as PwmPin>::Duty)

source§

impl<I> PwmPin for Pwm0<I>where I: PinId,

§

type Duty = u16

source§

fn disable(&mut self)

source§

fn enable(&mut self)

source§

fn get_duty(&self) -> <Pwm0<I> as PwmPin>::Duty

source§

fn get_max_duty(&self) -> <Pwm0<I> as PwmPin>::Duty

source§

fn set_duty(&mut self, duty: <Pwm0<I> as PwmPin>::Duty)

source§

impl<I> PwmPin for Pwm4<I>where I: PinId,

§

type Duty = u16

source§

fn disable(&mut self)

source§

fn enable(&mut self)

source§

fn get_duty(&self) -> <Pwm4<I> as PwmPin>::Duty

source§

fn get_max_duty(&self) -> <Pwm4<I> as PwmPin>::Duty

source§

fn set_duty(&mut self, duty: <Pwm4<I> as PwmPin>::Duty)

Implementors§