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

Common source code for the helper tools dts_custom.bas and dts_universal.bas. More...

`#include "../pruio/pruio_pins.bi"`
Include dependency graph for pruiotools.bas:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Macros

#define | PMUX_NAME /* "pruio-" */
| The name of the pinmux folders in /sys/devices/ocp.* (must match the definition in pruio.bas).
#define | ALL_START
| The start of the source file. More...
#define | ENTRY_EXCL(_T_) /* !"\n """ & _T_ & """," */
| An entry line for the `exclusive-use =` section.
#define | ALL_END
| The end of the source file (pinmux setting). More...
#define | FRAG0_START
| The start of fragment0 in the source file (pinmux settings). More...
#define | FRAG0_END
| The end of fragment0 in the source file (pinmux settings). More...
#define | FRAG1_START
| The start of fragment1 in the source file (pinmux_helper). More...
#define | FRAG1_END
| The end of fragment1 in the source file (pinmux_helper). More...
#define | GPIO_DEF
| The default settings for the GPIO modes. More...
#define | PIN_DEL(_A_) /* FOR i AS LONG = 0 TO UBOUND(_A_) : M(_A_(i)) = "" : NEXT */
| Macro to delete the pin configuration for a pin set array.

## Typedefs

typedef UBYTE | uint8
| Type alias.

## Enumerations

enum | { NP = &b001000, PU = &b010000, PD = &b000000, RX = &b100000, _O_ = NP, _I_ = RX + PD, I_O = RX + NP, IOD = RX + NP, TMRi = _I_, TMRo = _O_, CAPi = _I_, CAPo = _O_, QEPi = _I_, QEPo = _O_, PWMi = _I_, PWMo = _O_ }
| Enumerators for pin modes. More...

## Functions

FUNCTION_AS_STRING | f0custom (BYVAL_AS_UBYTE I)
| Create lines for fragment0 for all settings of a pin. More...
FUNCTION_AS_STRING | f0entry (BYVAL_AS_UBYTE I)
| Create lines for fragment0 for all settings of a pin. More...
FUNCTION_AS_STRING | f1entry (BYVAL_AS_UBYTE I)
| Create lines for fragment1 for all settings of a pin. More...
FUNCTION_CDECL_AS_ZSTRING_PTR | nameBall (BYVAL_AS_UBYTE Ball)
| Get header pin connected to CPU ball. More...

## Variables

STRING | M [109+1]
| The array to be filled with modus settings for all pins.

## Detailed Description

Common source code for the helper tools dts_custom.bas and dts_universal.bas.

This file contains common source code used by the device tree overlay helper tools dts_custom.bas and dts_universal.bas. Do not edit (experts only).

Licence: GPLv3

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

Since
  0.2

Definition in file pruiotools.bas.

## Macro Definition Documentation

#define ALL_END

Value:
/* _
!"\n fragment@2 {" _
!"\n target = <&pruss>;" _
!"\n __overlay__ {" _
!"\n status = ""okay"";"_
!"\n };" _
!"\n };" _
!"\n };" */

The end of the source file (pinmux setting).

Definition at line 44 of file pruiotools.bas.

#define ALL_START

Value:
/* _
"// dts file auto generated by pruio_config (don't edit)" _
!"\n/dts-v1/;" _
!"\n/plugin/;" _
!"\n" _
!"\n/ {" _
!"\n compatible = ""ti,beaglebone"", ""ti,beaglebone-black"";" _
!"\n" _
!"\n // identification" _
!"\n board-name = """ & FILE_NAME & """;" _
!"\n manufacturer = ""TJF"";" _
!"\n part-number = ""PruIoBBB"";" _
!"\n version = """ & VERS_NAME & """;" _
!"\n" _
!"\n // state the resources this cape uses" _
!"\n exclusive-use =" */

The start of the source file.

Definition at line 23 of file pruiotools.bas.

#define FRAG0_END

Value:
/* _
!"\n };" _
!"\n };" */

The end of fragment0 in the source file (pinmux settings).

Definition at line 63 of file pruiotools.bas.

#define FRAG0_START

Value:
/* _
!"\n ""pruss"";" _
!"\n" _
!"\n fragment@0 {" _
!"\n target = <&am33xx_pinmux>;" _
!"\n __overlay__ {" */

The start of fragment0 in the source file (pinmux settings).

Definition at line 55 of file pruiotools.bas.

#define FRAG1_END

Value:
/* _
!"\n };" _
!"\n };" */

The end of fragment1 in the source file (pinmux_helper).

Definition at line 75 of file pruiotools.bas.

#define FRAG1_START

Value:
/* _
!"\n fragment@1 {" _
!"\n target = <&ocp>;" _
!"\n __overlay__ {" */

The start of fragment1 in the source file (pinmux_helper).

Definition at line 69 of file pruiotools.bas.

#define GPIO_DEF

Value:
/* CHR( _
7 + RX + NP _ ' input, open (no resistor)
, 7 + RX + PU _ ' input, pullup resistor
, 7 + RX + PD _ ' input, pulldown resistor
, 7 + NP _ ' output (no resistor)
) */

The default settings for the GPIO modes.

Definition at line 103 of file pruiotools.bas.

## Enumeration Type Documentation

anonymous enum

Enumerators for pin modes.

Enumerator
NP | no resistor connected
PU | pullup resistor connected
PD | pulldown resistor connected
RX | input receiver enabled
_O_ | setting for an output pin.
_I_ | setting for an input pin.
I_O | setting for an in-/out-put pin.
IOD | setting for an in-/out-put pin.
TMRi | setting for a TIMER input pin.
TMRo | setting for a TIMER output pin.
CAPi | setting for a CAP input pin.
CAPo | setting for a CAP output pin.
QEPi | setting for a QEP input pin.
QEPo | setting for a QEP output pin (sync).
PWMi | setting for a PWM input pin (sync).
PWMo | setting for a PWM output pin.

Definition at line 81 of file pruiotools.bas.

## Function Documentation

FUNCTION_AS_STRING f0custom | ( | BYVAL_AS_UBYTE | I | ) |

Create lines for fragment0 for all settings of a pin.

Parameters

  I | The index (ball number) of the pin in global array M.

Returns
  A string containing several lines with pin settings for fragment0.

FIXME

Definition at line 125 of file pruiotools.bas.

FUNCTION_AS_STRING f0entry | ( | BYVAL_AS_UBYTE | I | ) |

Create lines for fragment0 for all settings of a pin.

Parameters

  I | The index (ball number) of the pin in global array M.

Returns
  A string containing several lines with pin settings for fragment0.

FIXME

Definition at line 146 of file pruiotools.bas.

FUNCTION_AS_STRING f1entry | ( | BYVAL_AS_UBYTE | I | ) |

Create lines for fragment1 for all settings of a pin.

Parameters

  I | The index (ball number) of the pin in global array M.

Returns
  A string containing an entry with pin settings for fragment1.

FIXME

Note
  The maximum number of configurations for a pin is 36.

Definition at line 177 of file pruiotools.bas.

FUNCTION_CDECL_AS_ZSTRING_PTR nameBall | ( | BYVAL_AS_UBYTE | Ball | ) |

Get header pin connected to CPU ball.

Parameters

  Ball | The CPU ball number.

Returns
  A string pointer (don't free it) on success (otherwise zero).

Since
  0.2

This function creates a text description of the header pin connected to a CPU ball. The returned string is owned by this function and must not be freed.

When the CPU ball is not connected to a header pin, this function returns 0 (zero).

Definition at line 216 of file pruiotools.bas.