Trait kernel::hil::pwm::PwmPin

source ·
pub trait PwmPin {
    // Required methods
    fn start(
        &self,
        frequency_hz: usize,
        duty_cycle: usize
    ) -> Result<(), ErrorCode>;
    fn stop(&self) -> Result<(), ErrorCode>;
    fn get_maximum_frequency_hz(&self) -> usize;
    fn get_maximum_duty_cycle(&self) -> usize;
}
Expand description

Higher-level PWM interface that restricts the user to a specific PWM pin. This is particularly useful for passing to capsules that need to control only a specific pin.

Required Methods§

source

fn start(&self, frequency_hz: usize, duty_cycle: usize) -> Result<(), ErrorCode>

Start a PWM output. Same as the start function in the Pwm trait.

source

fn stop(&self) -> Result<(), ErrorCode>

Stop a PWM output. Same as the stop function in the Pwm trait.

source

fn get_maximum_frequency_hz(&self) -> usize

Return the maximum PWM frequency supported by the PWM implementation. Same as the get_maximum_frequency_hz function in the Pwm trait.

source

fn get_maximum_duty_cycle(&self) -> usize

Return an opaque number that represents a 100% duty cycle. This value Same as the get_maximum_duty_cycle function in the Pwm trait.

Implementors§