我们连接RGB的LCD屏后,先进入终端把开机启动的mxapp2关闭。有两种方式,一是killall mxapp2,二是用top查到mxapp2的进程,然后用kill 进程ID
执行测试
root@myir-yg2lx:~# framebuffer_testTheframebuffer device was opened successfully.vinfo.xres=800vinfo.yres=480vinfo.bits_per_bits=32vinfo.xoffset=0vinfo.yoffset=0red.offset=16green.offset=8blue.offset=0transp.offset=0finfo.line_length=3200finfo.type = PACKED_PIXELSTheframebuffer device was mapped to memory successfully.color: red rgb_val:00FF0000color: green rgb_val:0000FF00color: blue rgb_val:000000FFcolor: r & g rgb_val:00FFFF00color: g & b rgb_val:0000FFFFcolor: r & b rgb_val:00FF00FFcolor: white rgb_val:00FFFFFFcolor: black rgb_val:00000000
注意 如果有上述输出,但是屏没有显示,是因为设备树没有更新,需要进入uboot执行:
=> setenv fdt_file myb-rzg2l-disp.dtb => saveenv
触摸测试
需要连接带触摸的屏,我这里是MY-TFT070-K
终端执行行“evtest”进入测试界面
root@myir-yg2lx:~# evtest No device specified, trying to scanall of/dev/input/event* Available devices:/dev/input/event0: keyboard/dev/input/event1: generic ft5x06 (79)/dev/input/event2: A4TECHUSBDevice Keyboard/dev/input/event3: A4TECH USB Device System Control/dev/input/event4: A4TECH USB Device Consumer Control/dev/input/event5: A4TECH USB Device/dev/input/event6: A4TECH USB Device Select the device event number [0-6]:
从结果我看到,触摸屏ft5x06为event1。我们输入1
Selectthedeviceeventnumber[0-6]:1Inputdriverversionis1.0.1InputdeviceID:bus0x18vendor0x0product0x0version0x0Inputdevicename:"generic ft5x06 (79)"Supportedevents:Eventtype0(EV_SYN)Eventtype1(EV_KEY)Eventcode330(BTN_TOUCH)Eventtype3(EV_ABS)Eventcode0(ABS_X)Value155Min0Max799Eventcode1(ABS_Y)Value476Min0Max479Eventcode47(ABS_MT_SLOT)Value0Min0Max4Eventcode53(ABS_MT_POSITION_X)Value0Min0Max799Eventcode54(ABS_MT_POSITION_Y)Value0Min0Max479Eventcode57(ABS_MT_TRACKING_ID)Value0Min0Max65535Properties:Propertytype1(INPUT_PROP_DIRECT)Testing...(interrupttoexit)
然后我们点击屏就有相应的输出:
Event:time3029532101.3029532101,type3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 34Event: time3029532101.3029532101,type3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 486Event: time3029532101.3029532101,type3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 172Event: time3029532101.3029532101,type1 (EV_KEY), code 330 (BTN_TOUCH), value 1Event: time3029532101.3029532101,type3 (EV_ABS), code 0 (ABS_X), value 486Event: time3029532101.3029532101,type3 (EV_ABS), code 1 (ABS_Y), value 172Event: time3029532101.3029532101,-------------- SYN_REPORT ------------Event: time3029532101.3029532101,type3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 485Event: time3029532101.3029532101,type3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 171Event: time3029532101.3029532101,type3 (EV_ABS), code 0 (ABS_X), value 485Event: time3029532101.3029532101,type3 (EV_ABS), code 1 (ABS_Y), value 171Event: time3029532101.3029532101,-------------- SYN_REPORT ------------Event: time3029532101.3029532101,type3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 484Event: time3029532101.3029532101,type3 (EV_ABS), code 0 (ABS_X), value 484Event: time3029532101.3029532101,-------------- SYN_REPORT ------------Event: time3029532101.3029532101,type3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 485Event: time3029532101.30295322Event: time3029532101.3029532101,-------------- SYN_REPORT ------------Event: time3029532101.3029532101,type3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value -1Event: time3029532101.3029532101,type1 (EV_KEY), code 330 (BTN_TOUCH), value 0Event: time3029532101.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 坐标位置
审核编辑:汤梓红
- 测试
+关注
关注
8文章
4831浏览量
125752 - 触摸屏
+关注
关注
42文章
2243浏览量
114796 - 开发板
+关注
关注
25文章
4704浏览量
95772 - 米尔
+关注
关注
0文章
45浏览量
7836
发布评论请先登录
相关推荐
评论