oxy-linux-pwm 0.1.2

A crate for controlling the PWM on the linux
Documentation
  • Coverage
  • 0%
    0 out of 17 items documented0 out of 12 items with examples
  • Size
  • Source code size: 13.84 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 439.36 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • yhw2003/oxy-linux-pwm
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • yhw2003

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();    
}