【米尔MYD-YG2LX开发板】触摸屏测试
<div class='showpostmsg'><p>我们连接RGB的LCD屏后,先进入终端把开机启动的mxapp2关闭。有两种方式,一是killall mxapp2,二是用top查到mxapp2的进程,然后用kill 进程ID</p><p><span style="font-size:20px;"><strong>执行测试</strong></span></p>
<pre>
<code>
root@myir-yg2lx:~# framebuffer_test
The framebuffer device was opened successfully.
vinfo.xres=800
vinfo.yres=480
vinfo.bits_per_bits=32
vinfo.xoffset=0
vinfo.yoffset=0
red.offset=16
green.offset=8
blue.offset=0
transp.offset=0
finfo.line_length=3200
finfo.type = PACKED_PIXELS
The framebuffer device was mapped to memory successfully.
color: red rgb_val: 00FF0000
color: green rgb_val: 0000FF00
color: blue rgb_val: 000000FF
color: r & g rgb_val: 00FFFF00
color: g & b rgb_val: 0000FFFF
color: r & b rgb_val: 00FF00FF
color: white rgb_val: 00FFFFFF
color: black rgb_val: 00000000
</code></pre>
<p><strong><span style="font-size:18px;"> 注意</span></strong> 如果有上述输出,但是屏没有显示,是因为设备树没有更新,需要进入uboot执行:</p>
<p>```<br />
=> setenv fdt_file myb-rzg2l-disp.dtb<br />
=> saveenv<br />
```</p>
<p><span style="font-size:20px;"><strong>触摸测试</strong></span></p>
<p>需要连接带触摸的屏,我这里是MY-TFT070-K</p>
<p>终端执行行“evtest”进入测试界面</p>
<pre>
<code>
root@myir-yg2lx:~# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: keyboard
/dev/input/event1: generic ft5x06 (79)
/dev/input/event2: A4TECH USB Device 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 :
</code></pre>
<p>从结果我看到,触摸屏ft5x06为event1。我们输入1</p>
<pre>
<code>
Select the device event number : 1
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
Input device name: "generic ft5x06 (79)"
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 155
Min 0
Max 799
Event code 1 (ABS_Y)
Value 476
Min 0
Max 479
Event code 47 (ABS_MT_SLOT)
Value 0
Min 0
Max 4
Event code 53 (ABS_MT_POSITION_X)
Value 0
Min 0
Max 799
Event code 54 (ABS_MT_POSITION_Y)
Value 0
Min 0
Max 479
Event code 57 (ABS_MT_TRACKING_ID)
Value 0
Min 0
Max 65535
Properties:
Property type 1 (INPUT_PROP_DIRECT)
Testing ... (interrupt to exit)
</code></pre>
<p>然后我们点击屏就有相应的输出:</p>
<p>```<br />
Event: time 3029532101.3029532101, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 34<br />
Event: time 3029532101.3029532101, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 486<br />
Event: time 3029532101.3029532101, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 172<br />
Event: time 3029532101.3029532101, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1<br />
Event: time 3029532101.3029532101, type 3 (EV_ABS), code 0 (ABS_X), value 486<br />
Event: time 3029532101.3029532101, type 3 (EV_ABS), code 1 (ABS_Y), value 172<br />
Event: time 3029532101.3029532101, -------------- SYN_REPORT ------------<br />
Event: time 3029532101.3029532101, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 485<br />
Event: time 3029532101.3029532101, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 171<br />
Event: time 3029532101.3029532101, type 3 (EV_ABS), code 0 (ABS_X), value 485<br />
Event: time 3029532101.3029532101, type 3 (EV_ABS), code 1 (ABS_Y), value 171<br />
Event: time 3029532101.3029532101, -------------- SYN_REPORT ------------<br />
Event: time 3029532101.3029532101, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 484<br />
Event: time 3029532101.3029532101, type 3 (EV_ABS), code 0 (ABS_X), value 484<br />
Event: time 3029532101.3029532101, -------------- SYN_REPORT ------------<br />
Event: time 3029532101.3029532101, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 485<br />
Event: time 3029532101.30295322<br />
Event: time 3029532101.3029532101, -------------- SYN_REPORT ------------<br />
Event: time 3029532101.3029532101, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value -1<br />
Event: time 3029532101.3029532101, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0<br />
Event: time 3029532101.3029532101, -------------- SYN_REPORT ------------<br />
```</p>
<p>由上面可知,主要显示坐标值、键值,具体信息如下:</p>
<p>EV_SYN:同步事件</p>
<p>EV_KEY:按键事件,如 BTN_TOUCH 表示是触摸按键</p>
<p>EV_ABS:绝对坐标,如触摸屏上报的坐标</p>
<p>BTN_TOUCH:触摸按键</p>
<p>ABS_MT_SLOT:事件中对应的 value</p>
<p>ABS_MT_TRACKING_ID 表示采集信息开始</p>
<p>单点触摸信息是以 ABS 承载并按一定顺序发送,如:</p>
<p>ABS_X:是相对于屏幕绝对坐标 X</p>
<p>ABS_Y:是相对于屏幕绝对坐标 Y</p>
<p>而多点触摸信息则是以 ABS_MT 承载并按一定顺序发送,如:</p>
<p>ABS_MT_POSITION_X:表示屏幕接触面的中心点 x 坐标位置.</p>
<p>ABS_MT_POSITION_Y:表示屏幕接触面的中心点 Y 坐标位置<br />
【小结】</p>
<p>这组测试可以测试LCD的各种 单 色显示以及测试触摸是否正常</p>
</div><script> var loginstr = '<div class="locked">查看本帖全部内容,请<a href="javascript:;" style="color:#e60000" class="loginf">登录</a>或者<a href="https://bbs.eeworld.com.cn/member.php?mod=register_eeworld.php&action=wechat" style="color:#e60000" target="_blank">注册</a></div>';
if(parseInt(discuz_uid)==0){
(function($){
var postHeight = getTextHeight(400);
$(".showpostmsg").html($(".showpostmsg").html());
$(".showpostmsg").after(loginstr);
$(".showpostmsg").css({height:postHeight,overflow:"hidden"});
})(jQuery);
} </script><script type="text/javascript">(function(d,c){var a=d.createElement("script"),m=d.getElementsByTagName("script"),eewurl="//counter.eeworld.com.cn/pv/count/";a.src=eewurl+c;m.parentNode.insertBefore(a,m)})(document,523)</script> <p>这里面直接就有驱动文件吗? </p>
秦天qintian0303 发表于 2023-5-24 21:18
这里面直接就有驱动文件吗?
<p>对的,官方有驱动的设备树了的。</p>
<p>Linux测试有驱动就太好使了,直接调用就可以了 </p>
<p>看着好像还行,他是一直检测的吗?</p>
wangerxian 发表于 2023-5-30 10:35
看着好像还行,他是一直检测的吗?
<p>应该有个任务来检测的,他是通过i2c来能信的。我原来用lvgl是有个任务的,不知道linux是用中断还是有个轮询任务。</p>
lugl4313820 发表于 2023-5-30 11:21
应该有个任务来检测的,他是通过i2c来能信的。我原来用lvgl是有个任务的,不知道linux是用中断还是有个轮 ...
<p>touchGFX用的是中断,刷新一帧获取一次触摸的坐标。</p>
wangerxian 发表于 2023-5-30 11:39
touchGFX用的是中断,刷新一帧获取一次触摸的坐标。
<p>多谢大佬指点了,我的linux还得继续加强学习呀,我还没有入门。</p>
wangerxian 发表于 2023-5-30 11:39
touchGFX用的是中断,刷新一帧获取一次触摸的坐标。
多谢大佬指点了,我的linux还得继续加强学习呀,我还没有入门。
一起学习,我也在入门学习!<img height="48" src="//bbs.eeworld.com.cn/static/editor/plugins/hkemoji/sticker/facebook/smile.gif" height="48" /> aisniangle 发表于 2023-9-1 08:24
小白还是看不懂,一起学习,我也在入门学习!加油加油加油加油加油加油加油
<p>加油,你可以的!</p>
页:
[1]