[edit190406]
The original text below is deprecated. Meanwhile the code works on all Beaglebones (white, black, green, blue and Pocket).
Find the current source at https://github.com/dtjf/libpruio
the on-line documentation at http://users.freebasic-portal.de/tjf/Pr ... /doc/html/
an the binaries in Arend Lammertinks PPA.
[/edit190406]
Developing I/O tasks on Beaglebone (white or black) hardware isn't really fun. For digital I/O you've to deal with issues like
- multiple source (device tree overlays and your program)
- several device tree compiler versions (option -@)
- pure documentation (spread all over the kernel source)
- faulty ADC kernel driver
- no control over the ADC device setting
- slow sampling rates
All these pitfalls don't realy help when you want to focus on your core problem and create new software.
Here's my solution
libpruio is a driver for the AM33xx processor family. It controls the subsystems
- Control Module (pinmuxing)
- GPIO 0 to 3 (General Purpose Input and Output)
- TSC_ADC_SS (Touch Screen Controler and Analog to Digital Convertor SubSystem)
- PWMSS (Pulse Width Modulation SubSystem)
libpruio handles
- waking up subsystems
- reading original subsystems configurations on start up
- enable or disable subsystems at run-time
- configure subsystems at run-time
- setting GPIO configurations
- performing GPIO operations (read / write in IO mode)
- output of pulse trains (PWM)
- analysing of pulse trains (CAP)
- setting ADC configurations
- reading single ADC samples (IO mode, controlled by host)
- reading multiple ADC samples with accurate timing (MM mode, controlled by PRUSS)
- using triggers to start ADC sampling in MM mode (GPIO or ADC input)
- restoring the original configurations on close down
- 1.bas: minimal example
- analyse.bas: output initial devices configurations
- button.bas: output the state fo an pullup GPIO input in IO mode (since 0.0.2)
- io_input.bas: output the digital and analog lines in IO mode
- pwm_cap.bas: output a measured pulse train of a PWM output
- sos.bas: blink a user led in SOS code
- stepper.bas: drive a stepper motor
- pwm_adc.bas: show a graph of analog inputs of three PWM outputs
- oszi.bas: show a graph of analog inputs
- rb_oszi.bas: show a graph of two analog inputs from ring buffer
- triggers.bas: start measurements by trigger events in MM mode
Download the package at