S B C X U s e r ' s G u i d e
v . 1 . 0 . 1
gadget: high-speed config #1: Linux File-Backed Storage
5.13
GPIOs
i.MX6 can handle external pins in many different ways and most of them
can be configured as GPIOs. When a pin is set as a GPIO, it is possible
to read its value, change its direction or change output value directly from
the shell. The GPIOs can be easily accessed from sysfs: in the
/sys/class/gpio/ folder there are sub-folders, one for each
manageableGPIO. Each sub-folder contains files that indicate:
●
direction (in / out)
◾
The direction indicates wheter the PIN is listening, in, or ready to
send an output.
●
Value (0 / 1)
◾
The value, is just like a state. Where 0 means low, and 1 means high.
For further details about how to manage the GPIOs from sysfs, please
refer to the Linux kernel documentation at Documentation/gpio.txt.
5.13.1
Available GPIOs
The following table reports the signals available as GPIOs by default:
Connector.PIN
Pin Name
GPIO number
Sysfs mapping
J33.28
EIM_D26
GPIO3_IO26
gpio90
J33.30
EIM_D27
GPIO3_IO27
gpio91
J33.32
GPIO_17
GPIO7_IO12
gpio204
J33.34
GPIO_6/
I2C3_SDA
GPIO1_IO06
gpio6
5.13.2
Accessing the peripheral
If not already exported, the GPIO must be added to the list of exported
GPIOs:
echo XX > /sys/class/gpio/export
To read a GPIO direction:
cat /sys/class/gpio/gpioXX/direction
In or Out output is now expected To change the pin direction:
echo out > /sys/class/gpio/gpioXX/direction
or
December, 2019
56/139
Summary of Contents for SBC AXEL
Page 2: ...S B C X U s e r s G u i d e v 1 0 1 Page intentionally left blank December 2019 2 139 ...
Page 105: ...S B C X U s e r s G u i d e v 1 0 1 December 2019 105 139 ...
Page 106: ...S B C X U s e r s G u i d e v 1 0 1 December 2019 106 139 ...
Page 107: ...S B C X U s e r s G u i d e v 1 0 1 December 2019 107 139 Fig 44 QtQuick Hello World ...
Page 119: ...S B C X U s e r s G u i d e v 1 0 1 December 2019 119 139 ...
Page 121: ...S B C X U s e r s G u i d e v 1 0 1 December 2019 121 139 ...
Page 139: ...S B C X U s e r s G u i d e v 1 0 1 December 2019 139 139 ...