Difference between revisions of "EPC-R5710 GPIO"

From ESS-WIKI
Jump to: navigation, search
(Created page with " === '''GPIO Pin''' === {| border="1" cellpadding="1" cellspacing="1" style="width: 500px;" |- | '''Pin''' | '''Numbers''' |- | GPIO1 | 43 |- | GPIO2 | 42 |- | GPIO3 | 475 |-...")
 
 
Line 31: Line 31:
 
Step 2: Export GPIO interface
 
Step 2: Export GPIO interface
  
[[File:EPC-R5710 GPIO 1.png|400x400px]][[File:EPC-R5710 GPIO Connector.png]]<br/> &nbsp;
+
[[File:EPC-R5710 GPIO 1.png|400x400px|EPC-R5710 GPIO 1.png]][[File:EPC-R5710 GPIO Connector.png|RTENOTITLE]]
 +
<pre># echo 43 > /sys/class/gpio/export
 +
# echo 42 > /sys/class/gpio/export
 +
# echo out > /sys/class/gpio/gpio1/direction
 +
# echo in > /sys/class/gpio/gpio2/direction
 +
# cat /sys/class/gpio/gpio2/value
 +
0#
 +
echo 1 > /sys/class/gpio/gpio1/value
 +
# cat /sys/class/gpio/gpio2/value
 +
1
 +
</pre>
 +
 
 +
[[File:EPC-R5710 GPIO loopback.png]]

Latest revision as of 10:18, 7 September 2023

GPIO Pin

Pin Numbers
GPIO1 43
GPIO2 42
GPIO3 475
GPIO4 474
GPIO5 472

Generate the path node number of the corresponding gpioX, increasing with the export orde.

GPIO Loopback Test (Using GPIO1 and GPIO2 as examples)

Step 1: Connect GPIO1 and GPIO2

Step 2: Export GPIO interface

EPC-R5710 GPIO 1.pngRTENOTITLE

# echo 43 > /sys/class/gpio/export
# echo 42 > /sys/class/gpio/export
# echo out > /sys/class/gpio/gpio1/direction
# echo in > /sys/class/gpio/gpio2/direction
# cat /sys/class/gpio/gpio2/value
0#
echo 1 > /sys/class/gpio/gpio1/value
# cat /sys/class/gpio/gpio2/value
1

EPC-R5710 GPIO loopback.png