gpiotool 应用方式

  • 原创
  • |
  • 浏览:750
  • |
  • 更新:

简单介绍嵌入式ARM 系统下Gpio工具的应用

工具/原料

  • 串口,开发版,电脑
  • 串口工具

方法/步骤

  1. 1

    登陆IMM系统,在串口下查看系统状态

  2. 2

    $ cd /usr/local/bin/

  3. 3

     ./gpiotool 

  4. 3
    此文章未经许可获取自百度经验
  5. 4

    Gpio Test Tool - Copyright (c) 2006 - 2007 cetc.

    Usage : gpiotool <gpionumber> <option> [--verbose]

            --get-dir:              Get the specified gpio's direction

            --set-dir-input:        Set the specified gpio to be an input

            --set-dir-output:       Set the specified gpio to be an output

            --get-pol:              Get the specified gpio polarity

            --set-pol-high:         Set the specified gpio polarity

            --set-pol-low:          Set the specified gpio polarity

            --get-pull-up-down:             Get the specified gpio pull-up/pull-down control bits

            --set-pull-down:        Set Internal Pull-down enabled for specified gpio

            --set-pull-up:          Set Internal Pull-up enabled for specified gpio

            --set-no-pull-up-down:          Set No pull-up/Pull-down for the specified gpio

            --get-gpios-data:       Get the data for multiple gpios, with spaces between each number

            --set-gpios-high:       Set the data to high for multiple gpios, with spaces between each number

            --set-gpios-low:        Set the data to low for multiple gpios, with spaces between each number

            --get-gpios-dir:        Get the direction for multiple gpios, with spaces between each number

            --set-gpios-dir-input:          Set the direction to input for multiple gpios, with spaces between each number

            --set-gpios-dir-output:         Set the direction to output for multiple gpios, with spaces between each number

            --get-data:             Get the specified gpio's data

            --set-data-high:        Set the specified gpio high

            --set-data-low:         Set the specified gpio low

            --set-od-high:          Set the specified gpio as open drain output line with high level

            --set-od-low:           Set the specified gpio as open drain output line with low level

            --set-gpio-ints:        Set the gpio interrupts (as specified in the code)

            --wait-for-ints:        Wait for the gpio interrupts (as specified in the code)

            --set-sgpio-int-cont-mode:      Set the continous mode after interrupt

            --reset-gpio-ints:      Reset the gpio interrupts

            --enable-debouncing:    Enable GPIO Debouncing

            --disable-debouncing:   Disable GPIO Debouncing

            --get-debounce-event:   Get GPIO Debounce event

            --get-debounce-clock:   Get GPIO Debounce clock value

            --set-debounce-clock:   set GPIO Debounce clock value

            --reg-reading-on-int:   Register the reding address on gpio interrupt

            --get-reading-on-int:   Get Registered reading on gpio interrupt.

            --verbose:              Verbose for Debugging messages 

  6. 5

    翻译提示步骤,查看使用格式

  7. 6

    $ ./gpiotool 19 --set-dir-output   /*设置方向*/

    $ ./gpiotool 19 --get-dir          /*查看方向*/

    Output Pin

  8. 7

    $ ./gpiotool 19 --get-data         /*查看高低*/

    Pin is High 

    $ ./gpiotool 19 --set-data-low     /*拉低*/

    END

注意事项

  • IMM系统下,GPIOtool是linux内核工具
经验内容仅供参考,如果您需解决具体问题(尤其法律、医学等领域),建议您详细咨询相关领域专业人士。
作者声明:本篇经验系本人依照真实经历原创,未经许可,谢绝转载。
展开阅读全部