![Phytec pciGrabber4x4 Hardware Manual Download Page 145](http://html1.mh-extra.com/html/phytec/pcigrabber4x4/pcigrabber4x4_hardware-manual_1554182145.webp)
Programming Manual
PHYTEC Messtechnik GmbH 2008 L-720e_0
137
P
ro
g
ra
m
m
in
g
M
a
n
u
a
l
Reading/Writing data via the option port (GPIO-Port)
Reading the jumper settings
8 I/O pins are available on the pin header row option port. These pins
can be controlled with the following three functions:
void Set_GPIO_Direction (WORD nDevNo, WORD nDirection);
void Set_GPIO_Data (WORD nDevNo, WORD nData);
WORD Get_GPIO_Data (WORD nDevNo);
nDirection: can have values between 0 and 4096
(direction control of the board)
nData:
Data, which should be output via the option port
return value: Data, which are read from the option port
The bit from 1 to 8 are the I/Os of the Option Ports and Bit from 9 to
12 the jumpers.
The pciGrabber-4x4 has an option port with pins, which can be used
separately to read or write digital signals. With the following
functions the option port is controlled. You can define which pins will
work as input or output, set which output pins have low or high level
and determine what level is applied to the input pins.
With the help of the function
Set_GPIO_Direction
each pin of the
port can be configured as input or output. For this purpose the lower
8-bits of the parameter
nDirection
are evaluated. If a bit is set to 1, the
corresponding port is configured as output. A 0 results in a configura-
tion as input.
Caution:
Please pay attention, that a pin of the port is only switched to output,
when no external signal is applied to the pin. Otherwise it might
happen, that the pin circuitry is damaged.
All pins are configured to input when starting the computer. Please
ensure that the pins are high ohm and therefor the logic level is not