All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
dts_universal.bas File Reference

Tool to create, compile and install an universal device tree overlay for libpruio for run-time pinmuxing. More...

`#include "pruiotools.bas"`
`#include "P8.bi"`
`#include "P9.bi"`
Include dependency graph for dts_universal.bas:

Go to the source code of this file.

## Macros

#define | FILE_NAME /* "libpruio" */
| The file name.
#define | VERS_NAME /* "00A0" */
| The version.
#define | PATH_NAME /* "/lib/firmware" */
| The folder to place the compiled overlay binary.

## Variables

VAR | fnam = FILE_NAME & "-" & VERS_NAME
| The file name (without path / suffix)
VAR | fnr = FREEFILE
| The file number.
VAR | x = IIF(LEN(M(i)), nameBall(i), 0)
| The header pin name.

## Detailed Description

Tool to create, compile and install an universal device tree overlay for libpruio for run-time pinmuxing.

This is a helper tool for an universal device tree overlay. Adapt this FB source code, compile it and run the executable. This will create a device tree overlay source file in the current directory, and, if you execute the binary with root privileges, this overlay gets compiled and installed in /lib/firmware.

The universal overlay provides pinmuxing capability at run-time. Root privileges are required to achieve this. It claims all header pins and prepares configurations for all modes. By default the free header pins on a Beaglebone Black are declared. Customizing can be done to include more pins (ie. the HDMI pins when not used) or to reduce the number of pins (ie. when they interfere with other capes).

- To include a pins group uncomment the matching `PIN_DEL(...)` line, or
- to drop a pin add a code line like `M(P8_08) = ""` right below the `PIN_DEL(...)` lines.

When done,

1. compile the tool by `fbc -w all dts_universal.bas`, and
2. execute the binary with root privileges by `sudo ./dts_universal`

to install the compiled overlay in /lib/firmware. The overlay source remains in the current folder (file libpruio-0A00.dts). Load the overlay by

sudo su
echo libpruio > /sys/devices/bone_capemgr.*/slots
exit

(Or execute the `echo ...` command in your boot sequence. Or use capemgr to load the overlay. See Preconditions for further information.)

Licence: GPLv3

Copyright 2014 by Thomas{ dOt ]Freiherr[ At ]gmx[ DoT }net

Compile by:

fbc -w all dts_universal.bas

Since
  0.2

Definition in file dts_universal.bas.