Touch
1. I2C Touch
Taking M5-R1 as an example, the board currently provides one I2C touch interface, and the touch driver adapted for this interface is gt9xx.
2. Touch Debugging
A touchscreen is an input-subsystem device. The input subsystem is the unified driver framework that Linux provides for input devices. Input devices such as buttons, keyboards, touchscreens, and mice are driven in a similar way. Input devices driven through the input subsystem can submit data to the kernel via a unified data structure, which includes the time, type, code, and specific key value or coordinates. The kernel exposes this to user space through file interfaces under /dev/input.
You can use the getevent command to retrieve the events that an input-subsystem device reports to the system.
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 ------------