Aria Ti am335x GPIO control: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (C2h2 moved page Aria am335x GPIO control to Aria Ti am335x GPIO control) |
(No difference)
|
Latest revision as of 04:44, 3 November 2020
Control GPIO via Shell
To control GPIO3_21, we need to control on gpio117 (32*3+21 = 117)
init (only do once)
# mount -t debugfs none /sys/kernel/debug #mount debugfs # echo 7 > /sys/kernel/debug/omap_mux/mcasp0_ahclkx #pinmux to mode 7 (gpio mode) # echo 117 > /sys/class/gpio/export #export the pin # echo out > /sys/class/gpio/gpio117/direction #set direction, out or in
on and off
# echo 1 > /sys/class/gpio/gpio117/value #on # echo 0 > /sys/class/gpio/gpio117/value #off
LED Blink test
# while true;do echo 1 > /sys/class/gpio/gpio117/value ; sleep 1 ;echo 0 > /sys/class/gpio/gpio117/value ;sleep 1 ;done