imx6 电容屏参数更改

imx6使用电容屏时需要获取对应的usb的event。其中用到了shell的一些命令。分析如下。
#   inputCheckLine=`cat /proc/bus/input/devices | grep -n "Vendor=0eef" | grep "Product=0020 Version=0001"| awk -F: '{print $1}'`
#   touchEvent=`sed -n "$((${inputCheckLine}+5))p" /proc/bus/input/devices | grep -o "event."`
    inputCheckLine=`cat /proc/bus/input/devices | grep -n "AR1020 Touchscreen" | awk -F: '{print $1}'`
    touchEvent=`sed -n "$((${inputCheckLine}+4))p" /proc/bus/input/devices | grep -o "event."`

root@freescale ~$ cat /proc/bus/input/devices 
I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="gpio-keys"
P: Phys=gpio-keys/input0
S: Sysfs=/devices/platform/gpio-keys/input/input0
U: Uniq=
H: Handlers=kbd event0 
B: PROP=0
B: EV=3
B: KEY=100000 0 0 0

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="AR1020 Touchscreen"
P: Phys=
S: Sysfs=/devices/virtual/input/input1
U: Uniq=
H: Handlers=cpufreq_interactive mouse0 event1 
B: PROP=0
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=3
......

grep -n匹配并打印行号
root@freescale ~$ cat /proc/bus/input/devices | grep -n "AR1020 Touchscreen"
12:N: Name="AR1020 Touchscreen"
这样获得了AR1020 Touchscreen所在的行。所需要的event1在16行
root@freescale ~$ sed -n "16p" /proc/bus/input/devices                      
H: Handlers=cpufreq_interactive mouse0 event1 

root@freescale ~$ sed -n "16p" /proc/bus/input/devices | grep -o "event."
event1

sed -n    : 不输出到终端
sed '16p' : 打印第16行
grep -o   : only match

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值