关闭

使用/sys/class/gpio对A31S的GPIO通过ADB进行设置

173人阅读 评论(0) 收藏 举报

在XP下,连接开发板,进入CMD模式

1、C:\Documents and Settings\Administrator>d:

2、D:\Program Files\sdk\platform-tools>adb devices

List of devices attached
20141125        device


3、D:\Program Files\sdk\platform-tools>adb shell
root@fiber-a31st:/

4、root@fiber-a31st:/ # cd /sys/class/gpio
cd /sys/class/gpio
5、root@fiber-a31st:/sys/class/gpio # for i in gpiochip* ; do echo `cat $i/label`:
`cat $i/base` ; done
o echo `cat $i/label`: `cat $i/base` ; done                                   <
GPA: 0
GPE: 100
GPF: 119
GPG: 127
GPH: 148
GPL: 181
GPM: 192
axp_pin: 202
GPB: 30
GPC: 40
GPD: 70
6、root@fiber-a31st:/sys/class/gpio # echo 192 > /sys/class/gpio/export
echo 192 > /sys/class/gpio/export
7、root@fiber-a31st:/sys/class/gpio # echo out > /sys/class/gpio/gpio192/direction
gpio/gpio192/direction                                                        <
8、root@fiber-a31st:/sys/class/gpio # echo 1 > /sys/class/gpio/gpio192/value
echo 1 > /sys/class/gpio/gpio192/value
9、root@fiber-a31st:/sys/class/gpio # echo 0 > /sys/class/gpio/gpio192/value
echo 0 > /sys/class/gpio/gpio192/value
10、root@fiber-a31st:/sys/class/gpio # echo 1 > /sys/class/gpio/gpio192/value
echo 1 > /sys/class/gpio/gpio192/value
root@fiber-a31st:/sys/class/gpio #


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:2470次
    • 积分:123
    • 等级:
    • 排名:千里之外
    • 原创:9篇
    • 转载:4篇
    • 译文:0篇
    • 评论:1条
    最新评论