触摸
1. I2C触摸
以M5-R1为例,该板卡目前拥有一组I2C接口的触摸接口,目前该接口适配的触摸驱动为gt9xx.
2. 触摸调试
触摸屏属于input输入子系统设备,input子系统是Linux对输入设备提供的统一驱动框架。 如按键、键盘、触摸屏和鼠标等输入设备的驱动方式是类似的, 使用input子系统驱动的输入设备可以通过统一的数据结构提交给内核, 该数据结构包括输入的时间、类型、代号以及具体的键值或坐标, 内核通过/dev/input目录下的文件接口传递给用户空间。
input输入子设备系统可以通过getevent命令来获取设备上报给系统的事件
root@rk3588-buildroot:/# ls /dev/input/
by-path event0 event1 event2 event3 event4 event5
root@rk3588-buildroot:/# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: rk805 pwrkey
/dev/input/event1: headset-keys
/dev/input/event2: rockchip-es8388 Headset
/dev/input/event3: bt-powerkey
/dev/input/event4: adc-keys
/dev/input/event5: rockchip-hdmi1 rockchip-hdmi1
Select the device event number [0-5]: 5
Input driver version is 1.0.1
Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0
Input device name: "rockchip-hdmi1 rockchip-hdmi1"
Supported events:
Event type 0 (EV_SYN)
Event type 5 (EV_SW)
Event code 6 (SW_LINEOUT_INSERT) state 0
Properties:
Testing ... (interrupt to exit)
Event: time 1609504724.413926, type 5 (EV_SW), code 6 (SW_LINEOUT_INSERT), value 1
Event: time 1609504724.413926, -------------- SYN_REPORT ------------
Event: time 1609504739.890499, type 5 (EV_SW), code 6 (SW_LINEOUT_INSERT), value 0
Event: time 1609504739.890499, -------------- SYN_REPORT ------------