AXIOMTEK SCM186 User Manual page 38

Nxp i.mx 8m plus arm-based smarc module
Table of Contents

Advertisement

SCM186 NXP i.MX 8M Plus ARM-based Evaluation Kit
3.5.1.7 GPIO
Herodotus supports GPIO connector for 10 external GPIO control. This section explains how
to control GPIO.
To exercise the external GPIO, it needs to export each GPIO by their GPIO chip number,
there are, the following table and command demonstrates the GPIO chip number and several
steps to configure GPIO.
Vcc
GPIO number
N/A
GND
GPIO number
N/A
To export GPIO, please execute the below command.
sh-5.1#
cd /sys/class/gpio
echo "GPIO number" > export
sh-5.1#
To set GPIO direction as input, please execute the below command.
echo in > gpio"GPIO number"/direction
sh-5.1#
To set GPIO direction as output, please execute the below command.
echo out > gpio"GPIO number"/direction
sh-5.1#
To get GPIO status, please execute the below command.
cat gpio"GPIO number"/direction
sh-5.1#
To get GPIO value, please execute the below command.
cat gpio"GPIO number"/value
sh-5.1#
To set GPIO value, please execute the below command. (GPIO status out only)
GPIO set low
echo 0 > gpio"GPIO number"/value
sh-5.1#
GPIO set high
echo 1 > gpio"GPIO number"/value
sh-5.1#
p.s. The default status of all GPIO is high.
32
DIO0
DIO1
DIO2
43
33
6
DIO5
DIO6
DIO7
133
40
41
DIO3
DIO4
35
36
DIO8
DIO9
42
34
Herodotus BSP User Guide

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SCM186 and is the answer not in the manual?

Table of Contents