zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    英语面试-Behavioral Question
    算法与数据结构-各种循环的时间复杂度分析(英语)
    英语面试-Behavioral Question
    CS硕士全日制考研资料(含完整复习计划)
    算法与数据结构-树-简单-合并二叉树
    算法与数据结构-树-简单-二叉树的所有路径
    gcd的理解
    数学总结
    图论总结
    数据结构总结
  • 原文地址:https://www.cnblogs.com/helloworldtoyou/p/5505916.html
Copyright © 2011-2022 走看看