Figure 2.3: GPIO pins numbering for Raspberry Pi.
•
From
,
RPI__GPIO7U
– digital input 7 with internal pull-up resistor
•
From
,
RPI__GPIO8D
– digital input 8 with internal pull-down resistor
•
From
,
RPI__GPIO21
– digital input 21 without any internal pull-up/down resistor
In general, the link to a particular GPIO pin consist of the driver name
RPI
, two under-
scores
__
, pin mode (
GPIO
or
PWM
), pin number and an optional symbol
U
for internal
pull-up or
D
for internal pull-down in inputs and
H
or
L
for initial state in outputs. The
pin numbering on Raspberry Pi is shown in Fig.
2.3
.
All the input and output flags for the Raspberry Pi GPIO pins are prepared by de-
fault in the folder
C:\Program Files (x86)\REX Controls\REX <version>\Examples\RaspberryPi_examples\
00_IO_Flags
.
Visit the
http://elinux.org/RPi_Low-level_peripherals
webpage for detailed in-
formation about individual GPIO pins.
2.2.2
The PiFace Digital expansion board
Necessary
IODRV
block configuration for PiFace Digital:
•
Block name
–
RPI
•
module
–
RPiDrv
•
classname
–
RPiDrv
Because the inputs and outputs of the board are strictly separated, the input flags
contain
PFI
string and the output ones contain
PFO
string as shown in Fig.
2.5
. Simi-
larly to the GPIO pins, the pull-up resistors in inputs can be activated by the optional
7