Gpio Test - Advantech ROM-3420CD-MDA1E User Manual

Rom-3420 series risc-based rtx module with freescale i.mx6 arm cortex a9 processor
Table of Contents

Advertisement

#hexdump ‐C /dev/mmcblk1 ‐s 25720832 ‐n 16
01887800  30 31 32 33 34 35 36 37  38 39 41 42 43 44 45 46  |0123456789ABCDEF|
Note!
Please make sure parameter "seek" is equal to 25118 as indicated in
red in above codes. If you create the file to a wrong sector, that may
damage the system.
3.1.5

GPIO Test

3.1.5.1
GPIO Default Setting
ROM-DB3900
GPIO8
GPIO9
#cd /sys/class/gpio
You can use "ls" to list all GPIO devices, and you should also see GPIO ports in
above table.
3.1.5.2
Testing
A. Set gpio1 GPI (in)
#echo in > ./gpio1/direction
#cat ./gpio1/direction
in
B. Set gpio2 GPO (out)
#echo out > ./gpio2/direction
#cat ./gpio2/direction
out
C. Set gpio2 GPO value "0"
#echo 0 > ./gpio2/value
D. Get gpio1 value
#cat ./gpio1/value
0
As you can see in above procedure A and B, we set gpio 1 as GPI and gpio 2 as
GPO so once we send data out from gpio 2, it should be able to receive the same
data from gpio 1.
ROM-3420 User Manual
Linux OS
/sys/class/gpio
gpio1
gpio 2
12

Advertisement

Table of Contents
loading

This manual is also suitable for:

Rom-3420wd-mda1eRom-3420cq-mda1eRom-3420wq-mda1e

Table of Contents