Trait embedded_hal::pwm::blocking::PwmPin[][src]

pub trait PwmPin {
    type Error: Debug;
    type Duty;
    fn disable(&mut self) -> Result<(), Self::Error>;
fn enable(&mut self) -> Result<(), Self::Error>;
fn get_duty(&self) -> Result<Self::Duty, Self::Error>;
fn get_max_duty(&self) -> Result<Self::Duty, Self::Error>;
fn set_duty(&mut self, duty: Self::Duty) -> Result<(), Self::Error>; }
Expand description

A single PWM channel / pin

See Pwm for details

Associated Types

Enumeration of PwmPin errors

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

Disables a PWM channel

Enables a PWM channel

Returns the current duty cycle

While the pin is transitioning to the new duty cycle after a set_duty call, this may return the old or the new duty cycle depending on the implementation.

Returns the maximum duty cycle value

Sets a new duty cycle

Implementors