This is an old revision of the document!


following Instuction only works for Linux kernel 3.11 or greater

PWM devices are listed under /sys/class/pwm

root@MBaXXX:~ cd /sys/class/pwm                                                   // enter pwm folder in sysfs
root@MBaXXX:/sys/class/pwm cd pwmchip<pwmchipnr>                                  // enter the desired pwmchip folder
root@MBaXXX:/sys/your/path/to/pwmchip/pwmchip<pwmchipnr> echo <pwmnr> > export    // export device PWM<pwmnr> 
root@MBaXXX:/sys/your/path/to/pwmchip/pwmchip<pwmchipnr> cd pwm<pwmnr>            // enter exported pwm device folder 

example

root@MBaXXX:~ echo "normal" > /sys/class/pwm/pwmchip<pwmchipnr>/pwm<pwmnr>/polarity      // set polarity to normal
root@MBaXXX:~ echo "inversed" > /sys/class/pwm/pwmchip<pwmchipnr>/pwm<pwmnr>/polarity    // set polarity to inversed

++++ example |

root@MBaXXX:~ echo "normal" > /sys/class/pwm/pwmchip0/pwm0/polarity 
root@MBaXXX:~ echo "inversed" > /sys/class/pwm/pwmchip0/pwm0/polarity 
  • Last modified: 2022/08/04 15:04