Skip to Content
GNU/Linux Rapid Embedded Programming
book

GNU/Linux Rapid Embedded Programming

by Rodolfo Giometti
March 2017
Intermediate to advanced
732 pages
15h 24m
English
Packt Publishing
Content preview from GNU/Linux Rapid Embedded Programming

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Embedded Programming with C++17

Hands-On Embedded Programming with C++17

Maya Posch

Publisher Resources

ISBN: 9781786461803Supplemental Content