0
\$\begingroup\$

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.

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

1 Answer 1

1
\$\begingroup\$

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.