Aria Ti am335x GPIO control

From Ariaboard Wiki
Revision as of 04:44, 3 November 2020 by C2h2 (talk | contribs) (C2h2 moved page Aria am335x GPIO control to Aria Ti am335x GPIO control)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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