RA0002 - Technical Information Manual
17
Using Ion R4300P GPIO Interface
This paragraph describes how to manage the GPI/O of the Ion R4300P reader.
The Ion R4300P reader has 13 general purpose input and output (GPIO) interfaces, but to control RA0002 you need
only 9 signal.
The GPIO lines can be managed directly from the console Linux shell of the reader. Looking into the
/dev
directory,
you can find an inner dedicated directory for each GPIO line:
root@ion:~# ls –d /dev/gpio*
/dev/gpio0 /dev/gpio11 /dev/gpio3 /dev/gpio6 /dev/gpio9
/dev/gpio1 /dev/gpio12 /dev/gpio4 /dev/gpio7
/dev/gpio10 /dev/gpio2 /dev/gpio5 /dev/gpio8
For instance, the first GPIO line is mapped to the gpio0 directory and, looking into it, you’ll find the following pseudo-
files:
root@ion:~# ls /dev/gpio0/
device
direction power subsystem uevent value
using the pseudo-file
direction
you can configure the GPIO line as an input or as an output while using the pseudo-file
value
you can get/set the GPIO line level.
For instance, to know the configuration of the first GPIO line you can perform the following commands:
root@ion:~# cat /dev/gpio0/direction
in
To get the level of the first GPIO line you can perform the following commands:
root@ion:~# cat /dev/gpio0/value
1
Since all the GPIO lines are configured as input lines by default at the startup, in order to set a GPIO line to a specified
level you have to configure it as an output line before. Let consider the following example where we set the GPIO line 0
to the low level:
root@ion:~# echo out > /dev/gpio0/direction
root@ion:~# cat /dev/gpio0/direction
out
root@ion:~# echo 0 > /dev/gpio0/value
For technical information on Ion GPIO ports please refer to
Ion R4300P Technical Information Manual