4.2 touch panel

This example demonstrates how to test touch screen by ts_calibrate application built with Buildroot.

Hardware preparation:

  • Hardware debugging environment to see chapter2.
Board Type MYD-AM335X MYD-AM335X-Y MYD-AM335X-J
Touch screen interface (MY-TFT070RV2) 7 inch resistive screen connection J8 (MY-TFT070CV2) 7 inch capacitive screen/(MY-TFT070RV2) 7 inch resistive screen connection J7 (MY-TFT070CV27) inch capacitive screen/(MY-TFT070RV2) 7 inch resistive screen connection J8

Software Preparation:

  • Linux Kernel 4.1.18
  • TS_CALIBRATE application

Test Steps:

  • Connect MY-TFT070CV2 module to MYD-AM335X series development board, power on the board and view the device node in /dev/input directory.
1
2
3
4
5
6
7
8
9
10
11
# ls /dev/input
by-path event1 event3 mice mouse1
event0 event2 event4 mouse0
# cat /sys/class/input/event0/device/name
beeper
# cat /sys/class/input/event1/device/name
tps65217_pwrbutton
# cat /sys/class/input/event2/device/name
ft5x06_ts
# cat /sys/class/input/event3/device/name
ti-tsc

The result above shows the resistive touch screen is corresponding to /dev/input/event3;
The capacitive touch screen is corresponding to `/dev/input/event2, so test capactive touch screen as below:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# export TSLIB_TSDEVICE=/dev/input/event2
# ts_calibrate
xres = 800, yres = 480
Took 4 samples...
Top left : X = 57 Y = 56
Took 2 samples...
Top right : X = 743 Y = 64
Took 4 samples...
Bot right : X = 742 Y = 438
Took 4 samples...
Bot left : X = 61 Y = 443
Took 4 samples...
Center : X = 398 Y = 246
-8.802551 1.024123 -0.004216
-8.078796 -0.002245 0.998305
Calibration constants: -576884 67116 -276 -529452 -147 65424 65536
#
  • Power off the MYD-AM335X series development board,connect MY-TFT070RV2 module to MYD-AM335X series development board, power on the board and view the device node in /dev/input directory.
1
2
3
4
5
6
7
8
9
10
11
# ls /dev/input
by-path event0 event1 event2 event3 mice mouse0
# cat /sys/class/input/event0/device/name
beeper
# cat /sys/class/input/event1/device/name
ti-tsc
# cat /sys/class/input/event2/device/name
tps65217_pwrbutton
# cat /sys/class/input/event3/device/name
[email protected]
#

The result above shows the resistive touch screen is corresponding to /dev/input/event1, so test resistive touch screen as below:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# export TSLIB_TSDEVICE=/dev/input/event1
# ts_calibrate
xres = 800, yres = 480
Took 32 samples...
Top left : X = 299 Y = 619
Took 21 samples...
Top right : X = 3689 Y = 659
Took 29 samples...
Bot right : X = 3732 Y = 3463
Took 27 samples...
Bot left : X = 280 Y = 3423
Took 18 samples...
Center : X = 2009 Y = 2072
-7.786255 0.204611 -0.000881
-34.248169 -0.001587 0.135514
Calibration constants: -510280 13409 -57 -2244488 -103 8881 65536