V853开发板硬件指南——GPIO点灯测试
-
GPIO 点灯测试
开发板有一颗 LED 灯供用户操作,接在 PH11 上。换算该 IO 的数字标号为:7 * 32 + 11 = 235,或者查看 IO 复用情况表,其中(MUX UNCLAIMED) 表示这个 GPIO 目前没有被使用:
root@TinaLinux:/# cat /sys/kernel/debug/pinctrl/pio/pinmux-pins
它会输出以下内容
...上略 pin 231 (PH7): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 232 (PH8): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 233 (PH9): uart0 (GPIO UNCLAIMED) function uart0 group PH9 pin 234 (PH10): uart0 (GPIO UNCLAIMED) function uart0 group PH10 pin 235 (PH11): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 236 (PH12): (MUX UNCLAIMED) pio:236 pin 237 (PH13): 2020000.wiegand pio:237 function wiegand group PH13 pin 238 (PH14): 2020000.wiegand pio:238 function wiegand group PH14 pin 239 (PH15): (MUX UNCLAIMED) pio:239 ...下略
我们先导出该 GPIO:
echo 235 > /sys/class/gpio/export cd /sys/class/gpio/gpio235
然后再将该 IO 置为输出状态,即可操作其电平:
echo out > direction echo 1 > value #LED点亮 echo 0 > value #LED熄灭
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号