本文介绍了不能让tslib与FT5x06一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我有一个带有嵌入式linux的手臂板,我相信它有一个FT5x06触摸屏控制器,但似乎tslib在多点触控电容式触摸屏控制器方面有一些问题。
我用arm-linux-gcc4.5.1交叉编译tslib,当我运行ts_calibrate一个窗口显示并复制必需的文件并在目标上设置tslib的非常环境变量时,它显示:

  tslib:所选设备不是触摸屏(必须支持ABS_X和ABS_Y事件)

它不接受我的触动。
现在我想以某种方式,我应该让tslib与控制器一起使用,只是一个单一的触摸设备,但我不知道该怎么做或哪个文件要更改。我必须在内核中编辑驱动程序文件并重建它吗?



你有什么想法吗?



我想使用tslib作为我的Qt4程序的输入。

解决方案

Tslib 将需要设置几个文件和/或环境变量框。以下是一些环境变量的示例,

  TSLIB_CONSOLEDEVICE = none 
TSLIB_FBDEVICE = / dev / fb0
TSLIB_TSDEVICE = / dev / input / touch
TSLIB_CALIBFILE = / etc / pointercal
TSLIB_CONFFILE = / etc / ts.conf

使用 tslib 运行Qt时不需要许多变量。但是,您将需要 TSLIB_TSDEVICE TSLIB_CALIBFILE TSLIB_CONFFILE 与Qt一起使用。二进制文件 ts_calibrate 将使用 TSLIB_FBDEVICE 设备显示一些文本。然后,将会将配置写入 TSLIB_CALIBFILE



要确定正确的 TSLIB_TSDEVICE 可以检查文件 / sys / class / input / input * / name 名称应该类似于 FT5202触摸屏。我在启动时使用这些信息将上面的例子中的 / dev / input / inputX 链接到 / dev / input / touch inputX 文件可能随其他输入驱动程序插入系统(例如USB鼠标等)而改变。这些文件位置可能取决于udev的类型或 > mdev ,用于用户空间中的 / dev 目录。



>文件是要加载的模块的列表。这是Focal Tech设备的一个例子,

  module_raw input 
module linear

Tslib 的结构是在运行时动态加载的多个模块(共享库)。通常,这些模块需要加载到/ usr / lib / ts ,内核和文件系统(libc)需要支持共享库。具体来说,线性模块将使用 ts_calibrate 程序的输出将触摸坐标映射到屏幕坐标 EM>。这对于 x y ,包括剪切等。



注意:可以避免此校准步骤,如果您是



/ etc / pointercal 中的数字被读入数组a [0]→a [7]。公式就是这样,

  x'=(a2 + a0 * x + a1 * y)/ a6; 
y'=(a5 + a3 * x + a4 * y)/ a6;

对于电容式案例,不存在任何形式。此外,FocalTech设备的值似乎受到限制,因此屏幕位置(0,0)是触摸位置(0,0),所有设备都赋予相同的最大值(x,y)值。所以方程式减少到,

  x'=(a1 * x)/ a6; 
y'=(a4 * y)/ a6;

所以唯一的目的就是把触摸屏映射到屏幕每个设备的坐标 AND 相同。因此,当您解决最大屏幕位置的方程时,您可以手动十六进制编辑一个 pointercal 文件。您可以通过 ts_print_raw 二进制文件获取此信息。



最后,可以用来完全避免 tslib 。您只需要具有固定的三个常量的代码,这些常量将转换坐标。您完全避免了 tslib 包。


I have a arm based board with embedded linux on it and I believe it has a FT5x06 touch screen controller but seems like tslib has some problems with multitouch capacitive touch screen controllers.I cross compiled tslib with arm-linux-gcc4.5.1 and when after copying necessary files and setting necassary environmental variables for tslib on the target when I ran ts_calibrate a window shows up and it says that:

tslib: Selected device is not a touchscreen (must support ABS_X and ABS_Y events)

And it doesn't accept my touches.Now I think somehow I'm supposed to get tslib to work with the controller as a single touch device but I'm not sure how to do that or which file to change. Do I have to edit driver file in kernel and rebuild it too?

Do you have any ideas?

I want to use tslib as an input for my Qt4 program.

解决方案

Tslib will require the setup of several files and/or environment variables to work out of the box. Here is a sample of some environment variables,

 TSLIB_CONSOLEDEVICE=none
 TSLIB_FBDEVICE=/dev/fb0
 TSLIB_TSDEVICE=/dev/input/touch
 TSLIB_CALIBFILE=/etc/pointercal
 TSLIB_CONFFILE=/etc/ts.conf

Many variables are not needed to run Qt with tslib. However, you will need the TSLIB_TSDEVICE, TSLIB_CALIBFILE, and TSLIB_CONFFILE to use with Qt. The binaries ts_calibrate will use the TSLIB_FBDEVICE device to display some text. This will then write a configuration to the TSLIB_CALIBFILE.

To determine the correct TSLIB_TSDEVICE to use, the files /sys/class/input/input*/name can be examined. The name should be something like FT5202 Touchscreen. I use this information at boot time to soft link /dev/input/inputX to /dev/input/touch in the example above. The inputX file may change as other input drivers are plugged into a system, such as a USB mouse, etc. These file locations may depend on the type of udev or mdev you use for the /dev directory population in user space.

The ts.conf file is a list of modules to load. Here is an example for the 'Focal Tech' device,

module_raw input
module linear

Tslib is structured with several modules (shared libraries) which are loaded dynamically at run time. Typically, these modules need to be loaded to /usr/lib/ts and your kernel and filesystem (libc) need to support shared libraries. Specifically, the linear module will use the output of the ts_calibrate program to map touch co-ordinates to screen co-ordinates. This was much more useful with resistive touch technology where x and y parameters may inter-mix, including sheering, etc.

Note: it is possible to avoid this calibration step, which is highly desirable if you are manufacturing large quantities.

The numbers in the /etc/pointercal are read into an array a[0] -> a[7]. The formula is like this,

x' = (a2 + a0 *x + a1 * y) / a6;
y' = (a5 + a3 *x + a4 * y) / a6;

For the capacitive case, there is no sheer. Moreover, the values for the FocalTech devices seem to be restricted so that screen position (0,0) is touch position (0,0) and all the devices give the same maximum (x,y) values. So the equations reduce to,

x' = (a1 * x) / a6;
y' = (a4 * y) / a6;

So the only purpose of the pointercal file is to map touch to screen co-ordinates AND the same for each device. So you can manual hex-edit a pointercal file when you back solve the equations for the maximum screen positions. You can get this information via the ts_print_raw binary.

Finally, the Qt Mouse Calibration class can be used to completely avoid tslib. You only need code with the fixed three constants that will transform the co-ordinates. You avoid the tslib package entirely.

这篇关于不能让tslib与FT5x06一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 09:07