Skip to main content

Touch

The interface between the COM Display Adapter board and the COM Carrier Board has an I2C channel for touch controllers either on the COM Display Adapter board (i.e. the AR1021) or on the attached display itself. The LVDS interface on the COM Carrier Board includes an I2C channel as well. HDMI and MIPI-DSI displays can have touch controllers but they will have to be connected using an additional interface (e.g. USB) and that is not handled in this document as it is display specific.

The Display Solutions for COM Boards page describes the different interfaces, how to physically connect a display and it has a list of some of the supported displays. There is also the Adding Displays to iMX Developer's Kit document which has more in-depth descriptions of the commands below.

U-Boot

The U-Boot does not support touch events by itself but it is used to configure the touch interface(s) that Linux will use. The eatouch command to control which display interfaces should be enabled and how they should be configured.

Run the eatouch command to see available options (output is for the iMX6 Quad COM board).

eatouch
Available Touch Controllers:
1) ar1021
2) ilitek
3) sitronix
4) egalax
5) ft5x06

Current Setup:
rgb conn. lvds0 conn. lvds1 conn.
ar1021 Disabled Disabled Disabled
ilitek Disabled Disabled Disabled
sitronix Disabled Disabled Disabled
egalax Disabled Disabled Disabled
ft5x06 Disabled Disabled Disabled

The eatouch command is described in detail in the Adding Displays to iMX Developer's Kit document. To enable the AR1021 touch controller (used by a display with resistive touch panel connected via the parallel RGB interface).

eatouch enable rgb 1
Current Setup:
rgb conn. lvds0 conn. lvds1 conn.
ar1021 Enabled 0x4d Disabled Disabled
ilitek Disabled Disabled Disabled
sitronix Disabled Disabled Disabled
egalax Disabled Disabled Disabled
ft5x06 Disabled Disabled Disabled

To make the change, save the environment variables and reset the board.

saveenv
reset

Linux

To see which devices are available.

evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: 20cc000.snvs-pwrkey
/dev/input/event1: ar1021 I2C Touchscreen
/dev/input/event2: EETI eGalax Touch Screen

In this case there are two touch controllers enabled: AR1021 and eGalax.

Use the evtest program again to test if a touch controller works.

evtest /dev/input/event1
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
Input device name: "ar1021 I2C Touchscreen"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 330 (BTN_TOUCH)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 2494
Min 0
Max 4095
Event code 1 (ABS_Y)
Value 499
Min 0
Max 4095
Properties:
Testing ... (interrupt to exit)
Event: time 1446835189.051908, type 3 (EV_ABS), code 0 (ABS_X), value 2791
Event: time 1446835189.051908, type 3 (EV_ABS), code 1 (ABS_Y), value 1918
Event: time 1446835189.051908, -------------- SYN_REPORT ------------
Event: time 1446835189.063241, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1446835189.063241, -------------- SYN_REPORT ------------
Event: time 1446835189.069177, type 3 (EV_ABS), code 1 (ABS_Y), value 1919
Event: time 1446835189.069177, -------------- SYN_REPORT ------------
Event: time 1446835189.087452, type 3 (EV_ABS), code 0 (ABS_X), value 2792
Event: time 1446835189.087452, type 3 (EV_ABS), code 1 (ABS_Y), value 1917

The program will continue to listen for and display touch events until stopped with Ctrl+C.