O'Reilly logo

GNU/Linux Rapid Embedded Programming by Rodolfo Giometti

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

PWM devices in Linux

Let's use the BeagleBone Black to see how a PWM device works (the steps that follow are almost the same for the SAMA5D3 Xplained and other GNU/Linux supporting these devices). We saw earlier that for each PWM generator, we have a well-defined directory in /sys/class/pwm/. In our case, we have the directory named pwmchip0. Then, by taking a look at its contents, we can find the following items:

root@bbb:~# ls /sys/class/pwm/pwmchip0/
device/   export    npwm      power/    subsystem/ uevent     unexport

You can notice that this representation is quite similar to the GPIO controllers we saw in the GPIOs in Linux section, in Chapter 6General Purposes Input Output signals – GPIO . So, the export and unexport files are used to export and unexport ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required