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
  • 相关阅读:
    2021年4月28日
    2021年4月18日
    2021年3月4日
    2020年11月20日
    20201112
    ThreadLocal原理分析
    git与gitlab
    DevOps与CICD简介
    代码扫描利器sonarqube
    看完小白也会使用,Android投屏神器scrcpy详细教程
  • 原文地址:https://www.cnblogs.com/helloworldtoyou/p/5505916.html
Copyright © 2011-2022 走看看