Oh. I was wondering. Is it possible to get more digital outputs by using the regular beagle bone digital inputs? Or is it only possible to utilize the bela pins for all I/o ? This wouldn't need to be as low latency as the bela (thinking led's as feedback to user).
Regular beaglebone inputs?
- Edited
You can still use the Beaglebone's GPIO pins which are not used by Bela or other on-board devices.
An example of this is in the PRU.cpp
file, where we toggle a pin from ARM for testing purposes.
https://github.com/BelaPlatform/Bela/blob/master/core/PRU.cpp
Using mmap
to map the file descriptor to memory (line 419), you can then read or write it from within the audio thread (lines 654, 764).
That pin is not actually relevant to Bela, in fact we are going to disable that soon, so feel free to steal all of that code for your purposes. Actually I just created two issues for this so I won't forget
https://github.com/BelaPlatform/Bela/issues/176
https://github.com/BelaPlatform/Bela/issues/177
Alternatively, if you are happy to do it from outside the audio thread, you can probably simply use the functions already available in https://github.com/BelaPlatform/Bela/blob/master/core/GPIOcontrol.cpp , which we borrowed from the excellent work of Derek Molloy.
Okay. From looking at
http://beagleboard.org/boards
It says the black has 7 analog inputs and 65 digital pins. Are all those available? Or does the be la use up some of those?
- Edited
Bela uses all the pins highlighted here for the 16 digital I/O and then pin 24 on header P8 and pins 10-15-17-18-19-20-21-22-23-24-25-26-27-28-29-30-31 on header P9 for communication with the board.
The multiplexer capelet additionally uses pins 40 to 46 on P8
Check out the pin diagrams here to see what is left available, note that some of them are in use by the system.
Also note that some of the available pins may require you to change the pinmuxer in order to use them as GPIOs or analogs. The website with the pin diagrams is the most exhaustive guide on the BBB I could find and has all the resources you'll need.
Also note that the BBB's own analog inputs, besides being slow, low-resolution and noisy, also have a maximum voltage of 1.8V. If you exceed that, you can trash your BBB.
Related, I made a memory-mapping GPIO class, that can be used to switch GPIOs from the audio thread with minimal effort:
https://github.com/BelaPlatform/Bela/blob/master/include/Gpio.h
barebone docs:
http://docs.bela.io/classGpio.html
Examples:
TODO