oxy-linux-pwm

Crates.iooxy-linux-pwm
lib.rsoxy-linux-pwm
version0.1.2
sourcesrc
created_at2024-04-28 05:13:35.411737
updated_at2024-05-31 09:41:20.333086
descriptionA crate for controlling the PWM on the linux
homepage
repositoryhttps://github.com/yhw2003/oxy-linux-pwm
max_upload_size
id1223010
size13,845
杨浩武 (yhw2003)

documentation

README

Oxy-linux-plus

This is a Rust PWM crate for Linux that automatically selects software or hardware implementation. Hardware PWM will be implemented through the Linux sysfs ABI. Please check if your PWM chip is under /sys/class/pwm directory. (The software pwm engine has not been done)

// the channel will be reset after channel dropped
fn demo() {
    reset_all();
    let chip = PwmChip::new(0);
    let channel = chip.get_channel(0);
    channel.set_period(Duration::from_micros(50));
    channel.set_duty_cycle(Duration::from_micros(25));
    channel.enable();    
}
Commit count: 10

cargo fmt