Common source code for the helper tools dts_custom.bas and dts_universal.bas. More...
#include "../pruio/pruio_pins.bi"
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 | CREATE() |
Macro creating the files. | |
#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 | PinModes { 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 = IOD , QEPo = _O_ , PWMi = _I_ , PWMo = _O_ } |
Enumerators for pin modes. More... | |
Functions | |
FUNCTION_AS_STRING | f0entry (BYVAL_AS_UBYTE I) |
Create lines for fragment@0 with all settings of a pin. More... | |
FUNCTION_AS_STRING | f1entry (BYVAL_AS_UBYTE I) |
Create lines for fragment@0 with 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. | |
STRING | USER_ADD_ON |
A variable to add user fragments (starting at fragment@3 {}), in order to enable subsystems. | |
LONG | MULTI_FLAG = 0 |
The flag for multiple settings. | |
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-2023 by Thomas{ doT ]Freiherr[ At ]gmx[ DoT }net
Definition in file pruiotools.bas.
#define ALL_END |
The end of the source file (pinmux setting).
Definition at line 37 of file pruiotools.bas.
#define ALL_START |
The start of the source file.
Definition at line 31 of file pruiotools.bas.
#define FRAG0_END |
The end of fragment0 in the source file (pinmux settings).
Definition at line 44 of file pruiotools.bas.
#define FRAG0_START |
The start of fragment0 in the source file (pinmux settings).
Definition at line 41 of file pruiotools.bas.
#define FRAG1_END |
The end of fragment1 in the source file (pinmux_helper).
Definition at line 51 of file pruiotools.bas.
#define FRAG1_START |
The start of fragment1 in the source file (pinmux_helper).
Definition at line 48 of file pruiotools.bas.
#define GPIO_DEF |
The default settings for the GPIO modes.
Definition at line 79 of file pruiotools.bas.
enum PinModes |
Enumerators for pin modes.
Definition at line 57 of file pruiotools.bas.
FUNCTION_AS_STRING f0entry | ( | BYVAL_AS_UBYTE | I | ) |
Create lines for fragment@0
with all settings of a pin.
I | The index (ball number) of the pin in global array M. |
This function creates a buch of lines used in fragment@0
, declaring the DT-nodes for all the defined pinmux modes in array M(). In this fragment the pinmux modes get declared. Each nodes is named (and labeled) by the letter B
and two hexadecimal numbers, concatenated by an underscore. The first number is the CPU ball number and the second is the pinmux mode. Ie. B6B_2F
stands for CPU ball 6B
(= P9_25) in modus 2F
(= GPIO input, no resistor).
Definition at line 98 of file pruiotools.bas.
FUNCTION_AS_STRING f1entry | ( | BYVAL_AS_UBYTE | I | ) |
Create lines for fragment@0
with all settings of a pin.
I | The index (ball number) of the pin in global array M. |
This function creates a buch of lines used in fragment@1
, declaring the DT-nodes for all the defined pinmux modes in array M(). In this fragment the name entries for the status files in the sysfs get declared. Each pinmux mode is named by a hexadecimal number. The number represents the pinmux mode. Ie. x2F
stands for modus 2F
(= GPIO input, no resistor).
Definition at line 132 of file pruiotools.bas.
FUNCTION_CDECL_AS_ZSTRING_PTR nameBall | ( | BYVAL_AS_UBYTE | Ball | ) |
Get header pin connected to CPU ball.
Ball | The CPU ball number. |
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 172 of file pruiotools.bas.