ARTiGO A820 Linux BSP v3.2.1 Quick Start Guide
22
5.8.
Setting Up GPIO
The DIO port on the ARTiGO A820 consists of 9 pins. The following section explains
setting up these pins for input/output communication
DIO port diagram
5.8.1.
Setting Up DIO Port for GPIO Functionality
The echo value of GPIO pins are listed below:
Pin
Signal
GPIO echo value
1
GPIO_7
7
2
GPIO_1
1
3
GPIO_8
8
4
GPIO_2
2
5
GPIO_9
9
6
GPIO_4
4
7
GPIO_16
203
8
GPIO_5
5
9
GND
GPIO port pinout table
Set the multifunction pin as a GPIO pin. Here is the example for GPIO pin 1:
$ echo 7 > /sys/class/gpio/export
5.8.2.
Setting Up GPI Mode
To set a pin to "input" mode (GPI), use the following command (here is the example for
GPIO pin 1):
$ echo "in" > /sys/class/gpio/gpio7/directio
n
To read the GPI input value, use the following command:
$ cat /sys/class/gpio/gpio203/value
5.8.3.
Setting Up GPO Mode
To set a pin to “output” mode (GPO), use the following command (here is the example
for GPIO pin 1):
$ echo "out" > /sys/class/gpio/gpio7/direction
COM 1
DIO
USB
RESET
PWR
WIRELESS
485
232
DIO port
5
1
9
6
Содержание ARTiGO A820
Страница 1: ...1 00 10262016 160700 QUICK START GUIDE ARTiGO A820 Linux BSP v3 2 1...
Страница 28: ......