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