gpio
General Purpuse Input Output pins, found on many SBC devices.
9front / plan9 provide GPIO support for some devices, eg. Raspberry Pi.
usage
Quick reference for working with gpio pins.
-
mount gpio:
bind -a '#G' /dev
-
read pin state:
cat /dev/gpio/GPIO0
-
write pin state:
echo 1 > /dev/gpio/GPIO0 echo 0 > /dev/gpio/GPIO0
-
select pin function (rpi):
echo func out > /dev/gpio/board/GPIO0
(possible functions are: "in", "out", "f5", "f4", "f0", "f1", "f2", "f3”)
-
select pin pull state (rpi):
echo pull up > /dev/gpio/board/GPIO0
(possible pull states are: "off", "down", "up”)