Cherry PUMA SOM-RK3399-Q7 User Manual page 19

Powerful system-on-module for versatile applications featuring the rockchip rk3399 application processor
Hide thumbs Also See for PUMA SOM-RK3399-Q7:
Table of Contents

Advertisement

The GPIO numbers printed on the board refer to numbers used in the Qseven specification. They are different
than the ones used in Linux via /sys/class/gpio.
The mapping is shown in the following table:
To calculate the Linux GPIO # for CPU pins that are not listed in this table, use the following formula:
n
=
(block_number
*
32)
Where:
• block_number: index of the block number
• sub_block_number: the alphabetical index of the block name, minus 1
• index: the pin number within the block
Example:
GPIO4_D4
->
(4
*
32)
+
To enable a GPIO, write the Linux GPIO # to the special export file:
echo
156
>
/sys/class/gpio/export
ls /sys/class/gpio/gpio156
cat /sys/class/gpio/gpio156/direction
in
cat /sys/class/gpio/gpio156/value
0
To set the direction to output, write out in the GPIO's direction file:
echo out
>
/sys/class/gpio/gpio156/direction
echo
1
>
/sys/class/gpio/gpio156/value
RK3399-Q7 User Manual
© Cherry Embedded Solutions GmbH
Fig. 3.15: GPIO header
Qseven signal
GPIO0
GPIO1
GPIO2
GPIO3
GPIO4
GPIO5
GPIO6
GPIO7
+
(sub_block_number
*
(3
*
8)
+
4
=
156
CPU pin
Linux GPIO #
GPIO4_D4
156
GPIO4_D1
153
GPIO4_D0
152
GPIO4_D5
157
GPIO4_D2
154
GPIO4_C4
148
GPIO4_C3
147
GPIO4_D3
155
8)
+
index
v1.6
Page 15

Advertisement

Table of Contents
loading

Table of Contents