设为首页收藏本站
查看: 864|回复: 0

【米尔瑞萨RZ/G2L开发板-试用体验】LCD触摸屏测试

[复制链接]

33

主题

15

回帖

855

积分

管理员

积分
855
米尔小助手1 发表于 2023-6-12 17:58:51 | 显示全部楼层 |阅读模式
我们连接RGB的LCD屏后,先进入终端把开机启动的mxapp2关闭。有两种方式,一是killall mxapp2,二是用top查到mxapp2的进程,然后用kill 进程ID
执行测试
  1. root@myir-yg2lx:~# framebuffer_test
  2. The framebuffer device was opened successfully.
  3. vinfo.xres=800
  4. vinfo.yres=480
  5. vinfo.bits_per_bits=32
  6. vinfo.xoffset=0
  7. vinfo.yoffset=0
  8. red.offset=16
  9. green.offset=8
  10. blue.offset=0
  11. transp.offset=0
  12. finfo.line_length=3200
  13. finfo.type = PACKED_PIXELS
  14. The framebuffer device was mapped to memory successfully.
  15. color: red   rgb_val: 00FF0000
  16. color: green   rgb_val: 0000FF00
  17. color: blue   rgb_val: 000000FF
  18. color: r & g   rgb_val: 00FFFF00
  19. color: g & b   rgb_val: 0000FFFF
  20. color: r & b   rgb_val: 00FF00FF
  21. color: white   rgb_val: 00FFFFFF
  22. color: black   rgb_val: 00000000
复制代码


注意 如果有上述输出,但是屏没有显示,是因为设备树没有更新,需要进入uboot执行:
  1. => setenv fdt_file myb-rzg2l-disp.dtb
  2. => saveenv
复制代码


触摸测试
需要连接带触摸的屏,我这里是MY-TFT070-K
终端执行行“evtest”进入测试界面
  1. root@myir-yg2lx:~# evtest
  2. No device specified, trying to scan all of /dev/input/event*
  3. Available devices:
  4. /dev/input/event0:      keyboard
  5. /dev/input/event1:      generic ft5x06 (79)
  6. /dev/input/event2:      A4TECH USB Device Keyboard
  7. /dev/input/event3:      A4TECH USB Device System Control
  8. /dev/input/event4:      A4TECH USB Device Consumer Control
  9. /dev/input/event5:      A4TECH USB Device
  10. /dev/input/event6:      A4TECH USB Device
  11. Select the device event number [0-6]:
复制代码

从结果我看到,触摸屏ft5x06为event1。我们输入1
  1. Select the device event number [0-6]: 1
  2. Input driver version is 1.0.1
  3. Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
  4. Input device name: "generic ft5x06 (79)"
  5. Supported events:
  6.   Event type 0 (EV_SYN)
  7.   Event type 1 (EV_KEY)
  8.     Event code 330 (BTN_TOUCH)
  9.   Event type 3 (EV_ABS)
  10.     Event code 0 (ABS_X)
  11.       Value    155
  12.       Min        0
  13.       Max      799
  14.     Event code 1 (ABS_Y)
  15.       Value    476
  16.       Min        0
  17.       Max      479
  18.     Event code 47 (ABS_MT_SLOT)
  19.       Value      0
  20.       Min        0
  21.       Max        4
  22.     Event code 53 (ABS_MT_POSITION_X)
  23.       Value      0
  24.       Min        0
  25.       Max      799
  26.     Event code 54 (ABS_MT_POSITION_Y)
  27.       Value      0
  28.       Min        0
  29.       Max      479
  30.     Event code 57 (ABS_MT_TRACKING_ID)
  31.       Value      0
  32.       Min        0
  33.       Max    65535
  34. Properties:
  35.   Property type 1 (INPUT_PROP_DIRECT)
  36. Testing ... (interrupt to exit)
复制代码

然后我们点击屏就有相应的输出:
  1. Event: time 3029532101.3029532101, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 34
  2. Event: time 3029532101.3029532101, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 486
  3. Event: time 3029532101.3029532101, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 172
  4. Event: time 3029532101.3029532101, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
  5. Event: time 3029532101.3029532101, type 3 (EV_ABS), code 0 (ABS_X), value 486
  6. Event: time 3029532101.3029532101, type 3 (EV_ABS), code 1 (ABS_Y), value 172
  7. Event: time 3029532101.3029532101, -------------- SYN_REPORT ------------
  8. Event: time 3029532101.3029532101, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 485
  9. Event: time 3029532101.3029532101, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 171
  10. Event: time 3029532101.3029532101, type 3 (EV_ABS), code 0 (ABS_X), value 485
  11. Event: time 3029532101.3029532101, type 3 (EV_ABS), code 1 (ABS_Y), value 171
  12. Event: time 3029532101.3029532101, -------------- SYN_REPORT ------------
  13. Event: time 3029532101.3029532101, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 484
  14. Event: time 3029532101.3029532101, type 3 (EV_ABS), code 0 (ABS_X), value 484
  15. Event: time 3029532101.3029532101, -------------- SYN_REPORT ------------
  16. Event: time 3029532101.3029532101, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 485
  17. Event: time 3029532101.30295322
  18. Event: time 3029532101.3029532101, -------------- SYN_REPORT ------------
  19. Event: time 3029532101.3029532101, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value -1
  20. Event: time 3029532101.3029532101, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
  21. Event: time 3029532101.3029532101, -------------- SYN_REPORT ------------
复制代码

由上面可知,主要显示坐标值、键值,具体信息如下:
EV_SYN:同步事件
EV_KEY:按键事件,如 BTN_TOUCH 表示是触摸按键
EV_ABS:绝对坐标,如触摸屏上报的坐标
BTN_TOUCH:触摸按键
ABS_MT_SLOT:事件中对应的 value
ABS_MT_TRACKING_ID 表示采集信息开始
单点触摸信息是以 ABS 承载并按一定顺序发送,如:
ABS_X:是相对于屏幕绝对坐标 X
ABS_Y:是相对于屏幕绝对坐标 Y
而多点触摸信息则是以 ABS_MT 承载并按一定顺序发送,如:
ABS_MT_POSITION_X:表示屏幕接触面的中心点 x 坐标位置.
ABS_MT_POSITION_Y:表示屏幕接触面的中心点 Y 坐标位置

回复

使用道具 举报

您需要登录后才可以回帖 登录

本版积分规则

Archiver|手机版|小黑屋|米尔科技论坛   

GMT+8, 2024-12-21 22:50 , Processed in 0.043820 second(s), 23 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表