March 2017
Intermediate to advanced
732 pages
15h 24m
English
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 6, General Purposes Input Output signals – GPIO
. So, the export and unexport files are used to export and unexport ...