天嵌 ARM开发社区

 找回密码
 注册
查看: 2550|回复: 3

tq210 触摸屏

[复制链接]
666 发表于 2014-9-15 21:43:09 | 显示全部楼层 |阅读模式
tq210的触摸屏 写触摸屏测试代码时,一直测试不到数据

    tfd = open("/dev/event5", O_RDONLY);
    if (tfd < 0) {
        printf("Error: cannot open /dev/digi device.errno=%d\n",errno);
        exit(1);
    }
   
    printf("Press Any Key to Exit\n");
    while(1)
    {
            iret = read(tfd,&ts,sizeof(ts_event_t));
            if(iret > 0)
            {

                    printf("iret(\t%d\t)tq210:X: %d Y: %d Press:%d ,oldx=%d,oldy=%d\n",iret,ts.x,ts.y,ts.pressure,oldx,oldy);
       
            }
        else
        {
                printf("err iret = %d\t\t",iret);
        }
           
    }
   
       
  
    close(tfd);


read的返回值一直为 -1.


请指点
TQ-lkp 发表于 2014-9-16 09:43:52 | 显示全部楼层
首先确认设备名是否正确,使用cat /proc/bus/input/devices来查看
其次点击触摸屏才会有事件出来
 楼主| 666 发表于 2014-9-16 12:58:00 | 显示全部楼层
TQ-lkp 发表于 2014-9-16 09:43
首先确认设备名是否正确,使用cat /proc/bus/input/devices来查看
其次点击触摸屏才会有事件出来

设备节点肯定是对的  我将触摸屏装上采用event5节点,  节点应该是对的

我在应用程序读的时候,手一直在不停的点击触摸屏,但是read还是 -1.

我试了原来你们自带的应用程序,触摸屏是可以使用的  你们可以提供下你们原开发板自带的那个应用程序的源码我做个参考吗?
谢谢!
 楼主| 666 发表于 2014-9-16 20:23:41 | 显示全部楼层
TQ-lkp 发表于 2014-9-16 09:43
首先确认设备名是否正确,使用cat /proc/bus/input/devices来查看
其次点击触摸屏才会有事件出来

[root@EmbedSky /mnt]# cat /proc/bus/input/devices
I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="gpio-keys"
P: Phys=gpio-keys/input0
S: Sysfs=/devices/platform/gpio-keys/input/input0
U: Uniq=
H: Handlers=kbd event0
B: PROP=0
B: EV=3
B: KEY=40000800 101680 0 0 10000000

I: Bus=0019 Vendor=abce Product=ecba Version=0100
N: Name="tq210_hs0038"
P: Phys=tq210_hs0038/input1
S: Sysfs=/devices/virtual/input/input1
U: Uniq=
H: Handlers=kbd event1
B: PROP=0
B: EV=3
B: KEY=80 100100 68 40000800 1c1ec0 0 2000800 1000dffc

I: Bus=0013 Vendor=dead Product=beef Version=0101
N: Name="Resistance_ts"
P: Phys=input(ts)
S: Sysfs=/devices/virtual/input/input2
U: Uniq=
H: Handlers=event2
B: PROP=0
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=1000003

I: Bus=0003 Vendor=058f Product=3841 Version=0003
N: Name="USB 2.0 PC Camera"
P: Phys=usb-s5p-ehci-1.4/button
S: Sysfs=/devices/platform/s5p-ehci/usb1/1-1/1-1.4/1-1.4:1.0/input/input3
U: Uniq=
H: Handlers=kbd event3
B: PROP=0
B: EV=3
B: KEY=100000 0 0 0 0 0 0

I: Bus=0018 Vendor=dead Product=beef Version=28bb
N: Name="Capacitance_ts"
P: Phys=input/ts
S: Sysfs=/devices/virtual/input/input4
U: Uniq=
H: Handlers=event4
B: PROP=0
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=1000003

I: Bus=0019 Vendor=1234 Product=0123 Version=0012
N: Name="Android Temperature Sensor"
P: Phys=
S: Sysfs=/devices/virtual/input/input5
U: Uniq=
H: Handlers=event5
B: PROP=0
B: EV=9
B: ABS=1000000

这个也看不出来触摸屏是哪组??  请老师指点! 非常的感谢!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号 )

GMT+8, 2024-5-19 03:05 , Processed in 1.062500 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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