O'Reilly logo

BeagleBone Essentials 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

Writing our own device driver

In the previous chapter, we made use of the GPIO subsystem of the kernel to manage a LED, now we'll go further to manage the GPIOs from the kernel using a dedicated driver. Actually, what we are going to write is not properly a driver for a real device, but we can use it in order to show you how a complex kernel functionality can be abstracted as a file.

Let's suppose we need to count some pulses that arrive on our BeagleBone Black in a certain amount of time; in this case, we can use one GPIO for each pulse source. We can also consider that the maximum possible pulse frequency is really low (max 50 Hz).

Tip

Note that this situation is quite common, and it can be found in some counter devices. In fact, these devices ...

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