Trait esp_ward::_embedded_hal_PwmPin
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§
type Duty
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§
fn disable(&mut self)
fn disable(&mut self)
Disables a PWM channel
fn enable(&mut self)
fn enable(&mut self)
Enables a PWM channel
fn get_max_duty(&self) -> Self::Duty
fn get_max_duty(&self) -> Self::Duty
Returns the maximum duty cycle value
Implementations on Foreign Types§
§impl<'d, Pin, PWM, const OP: u8, const IS_A: bool> PwmPin for PwmPin<'d, Pin, PWM, OP, IS_A>where
Pin: OutputPin,
PWM: PwmPeripheral,
impl<'d, Pin, PWM, const OP: u8, const IS_A: bool> PwmPin for PwmPin<'d, Pin, PWM, OP, IS_A>where
Pin: OutputPin,
PWM: PwmPeripheral,
§fn disable(&mut self)
fn disable(&mut self)
This only set the timestamp to 0, if you want to disable the PwmPin, it must be done on the timer itself.
§fn enable(&mut self)
fn enable(&mut self)
This only set the timestamp to the maximum, if you want to disable the PwmPin, it must be done on the timer itself.
§fn get_max_duty(&self) -> <PwmPin<'d, Pin, PWM, OP, IS_A> as PwmPin>::Duty
fn get_max_duty(&self) -> <PwmPin<'d, Pin, PWM, OP, IS_A> as PwmPin>::Duty
Get the max duty of the pin
§fn set_duty(&mut self, duty: <PwmPin<'d, Pin, PWM, OP, IS_A> as PwmPin>::Duty)
fn set_duty(&mut self, duty: <PwmPin<'d, Pin, PWM, OP, IS_A> as PwmPin>::Duty)
Set the duty of the pin