Difference between revisions of "EPC-R5710 GPIO"
From ESS-WIKI
Xingxing.li (talk | contribs) (Created page with " === '''GPIO Pin''' === {| border="1" cellpadding="1" cellspacing="1" style="width: 500px;" |- | '''Pin''' | '''Numbers''' |- | GPIO1 | 43 |- | GPIO2 | 42 |- | GPIO3 | 475 |-...") |
Xingxing.li (talk | contribs) |
||
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]]< | + | [[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 09: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
# 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