Struct sysfs_pwm::Pwm
[−]
[src]
pub struct Pwm { /* fields omitted */ }
Methods
impl Pwm
[src]
fn new(chip: u32, number: u32) -> Result<Pwm>
Create a new Pwm wiht the provided chip/number
This function does not export the Pwm pin
fn with_exported<F>(&self, closure: F) -> Result<()> where F: FnOnce() -> Result<()>
Run a closure with the GPIO exported
fn export(&self) -> Result<()>
Export the Pwm for use
fn unexport(&self) -> Result<()>
Unexport the PWM
fn enable(&self, enable: bool) -> Result<()>
Enable/Disable the PWM Signal
fn get_duty_cycle_ns(&self) -> Result<u32>
Get the currently configured duty_cycle in nanoseconds
fn set_duty_cycle_ns(&self, duty_cycle_ns: u32) -> Result<()>
The active time of the PWM signal
Value is in nanoseconds and must be less than the period.
fn get_period_ns(&self) -> Result<u32>
Get the currently configured period in nanoseconds
fn set_period_ns(&self, period_ns: u32) -> Result<()>
The period of the PWM signal in Nanoseconds