msm gpio tool

system:qnx

1. how to use

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

2. read gpio interrupt

# tlmm_gpio_interrupt_test 
usage is : tlmm_gpio_interrupt_test <gpio_number> <trigger> 
Acceptable trigger values are as follows 
            trigger = (GPIO_INTERRUPT_TRIGGER_DISABLE)  0 
            trigger = (GPIO_INTERRUPT_TRIGGER_HIGH)     1 
            trigger = (GPIO_INTERRUPT_TRIGGER_LOW)      2 
            trigger = (GPIO_INTERRUPT_TRIGGER_RISING)   3 
            trigger = (GPIO_INTERRUPT_TRIGGER_FALLING)  4 
            trigger = (GPIO_INTERRUPT_TRIGGER_DUAL)     5 

etc: read gpio number 110 interrupt

# tlmm_gpio_interrupt_test 110 4
Enter Test 
GPIO 110 trigger 4 
 irq corresponding to gpio 110 is 790 status 0
Wakeup setup successfully completed  and now wait for interrupt 
Got GPIO110 interrupt
Got GPIO110 interrupt
Got GPIO110 interrupt
Got GPIO110 interrupt
Got GPIO110 interrupt

3. pull up gpio

 msmgpiotool write 89 1
Wrote GPIO 89 to 1
#
# msmgpiotool info 89     
OFFSET   GPIO  IN    OUT   DIR  DRIVE  PULL       ALT FUNCTION  TARGET  IRQ  POL  TRIG   STS  
---------------------------------------------------------------------------------------------
f15b000  89 High  High  Out  2 mA   Pull up    0             NONE    0    1    Level  0    
# 

4.read gpio status

msmgpiotool read 89
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值