用户空间的GPIO操作

用户空间的GPIO的操作

1
2
3
4
5
6
7
8
9
10
11
# cd sys/class/gpio/
# ls
export gpiochip0 gpiochip32 gpiochip64 gpiochip96 unexport
# echo 33 > export
# ls
export gpiochip0 gpiochip64 unexport
gpio33 gpiochip32 gpiochip96
# cd gpio33/
# ls
active_low edge subsystem value
direction power uevent

输入输出

support “in” and “out”

1
echo "in" > direction

GPIO中断

support “both” or “none”, “rising”, “falling” edge trigger”

上升沿中断

1
echo "rising" > edge

下降沿中断

1
echo "falling" > edge