# Is there another way to interface with BeagleBone Black hardware

As an example, to turn on one of the on-board LED's you need to update the text file "/sys/class/leds/beaglebone:green:usr0"

In writing some tests just turning on and off lights, it's very slow. I believe this is because it uses the file system instead of directly interfacing with the hardware via an API or memory addressing.

Just wondering if there is any other way other than the file system. I don't know if this is a Linux thing or a BeagleBone Black thing.

• Of course there is. Write a kernel module. – Ignacio Vazquez-Abrams Nov 23 '17 at 3:05
• @IgnacioVazquez-Abrams Thanks Ignacio. Do you have any references specific to the BBB? Also, why would they not provide this from the manufacturer? – user3953989 Nov 23 '17 at 3:08
• No clue what pins the LEDs are connected to. See the documentation and kernel source. – Ignacio Vazquez-Abrams Nov 23 '17 at 3:09

An option is to use mmap (memory map) and then by utilizing GPIO registers, you can control GPIO pins with higher speed. However, PRU(Programmable Real-time Unit) may result in higher speeds even more than mmap method, but this high-speed control costs for assembly programming (However in Starterware you can write code for PRU in C). For more information about PRU you can refer to Technical Reference Manual of AM335x.
Take a look at this address for mmap example.