Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    V853开发板硬件指南——GPIO点灯测试

    V853系列-AI视觉
    v853开发板软硬件指南
    1
    1
    245
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • bayche
      bayche LV 5 last edited by q1215200171

      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熄灭
      

      LED.jpg

      1 Reply Last reply Reply Quote Share 0
      • 1 / 1
      • First post
        Last post

      Copyright © 2022 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

      行为准则 | 用户协议 | 隐私权政策