HARMAN_STCT_IOG1_USER_GUIDE Rev.
C1
15
3.3 GPIO Interface
To access any GPIO pin by user, user need to export particular gpio to user
space. Then user must set direction (in & out) for particular pin based on
requirement. Then user can set the values to particular gpio pin.
For testing the GPIO pins, execute following commands.
echo XX > /sys/class/gpio/export
echo "out / in" > /sys/class/gpio/gpioXX/direction
echo 0 > /sys/class/gpio/gpioXX/value
echo 1 > /sys/class/gpio/gpioXX/value
Note:- XX is calculated using the GPIO bank number.(Bank-1)*32+GPIO
no in the bank.
3.3.1 LED GPIO
GPIO
X
_IO
YY
→
X- bank number; YY- gpio number;
GPIO1_IO14 - Green Led
GPIO1_IO15 - Green Led
GPIO1_IO16 - Blue Led
GPIO1_IO17 & GPIO1_IO18 - Bicolour Led
Example commands for GPIO1_IO14
XX=(1-1)*32+14 = 14
echo 14 > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio14/direction
echo 0 > /sys/class/gpio/gpio14/value
echo 1 > /sys/class/gpio/gpio14/value
0 – for turn off LED; 1 – for turn on LED;
If values(1 or 0) will be set to pin numbers 17 and 18 alternatively, then the
Bi color led will change the color.
3.3.2 Input GPIO
User can access 4 input gpio, which are following
GPIO4_IO21 : Gpio number 117
GPIO4_IO19 : Gpio number 115
GPIO3_IO22 : Gpio number 86
GPIO3_IO25 : Gpio number 89
Содержание IoT-GW-02
Страница 1: ...HARMAN_STCT_IOG1_USER_GUIDE Rev C1 1 STCT_IOG1_USER_GUIDE Rev C1 15 AUG 2016...
Страница 2: ...HARMAN_STCT_IOG1_USER_GUIDE Rev C1 2...
Страница 3: ...HARMAN_STCT_IOG1_USER_GUIDE Rev C1 3...
Страница 7: ...HARMAN_STCT_IOG1_USER_GUIDE Rev C1 7 1 Introduction Fig 1 Hardware Block Diagram...