QNX 下gpio 读取

1、读取gpio状态

msmgpiotool read + gpio 号

eg:msmgpiotool read 172

2、拉高拉低gpio电平

msmgpiotool write +gpio号 +1/0

eg:

msmgpiotool write 172 1

msmgpiotool write 172 0

3、官方给的用法解释,按需自查

msmgpiotool 
usage: msmgpiotool <command> <gpio> <arg>
Provides a mechanism to easily view and reconfigure TLMM GPIOs on the command line.

commands:
  dump
  info         <gpio number>
  write        <gpio number> <value>
  read         <gpio>
  rawread      <gpio>
  set-dir      <gpio number> <value>
  set-drive    <gpio number> <value>
  set-pull     <gpio number> <value>
  set-func     <gpio number> <value>
  enable-irq   <gpio number> <value>
  clear-irq    <gpio>
  set-pol      <gpio number> <value>
  set-trigger  <gpio number> <value>

Description:
     dump        prints the entire GPIO configuration table

     info        prints the configuration for the specified gpio

     set-dir     sets the direction when in gpio mode
                 [0] Input, [1] Output

     set-drive   sets the pin drive strength regardless of mode
                 drive strength = [n] * 2mA for n[0..15]

     set-pull    sets internal pull on the pin regardless of mode
                 [0] No pull [1] Pull Down [2] Keeper [3] Pull Up

     set-func    sets the pin function.  Set to 0 for GPIO mode
                 valid for n[0..15]

     enable-irq  configures the pin as a gpio interrupt source
                 [0] Enable [1] Disable

     clear-irq   clears the pending IRQ status

     set-pol     sets the interrupt polarity of the gpio
                 [0] Inverted [1] Normal

     set-trigger sets the irq trigger type
                 [0] Level [1] Edge

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值