使用带有 tslib 的触摸屏的数据流是什么? [英] What is the dataflow of using touchscreen with tslib?
问题描述
我不明白 tslib 是如何工作的.假设我有一个串行触摸屏,根据我对数据流的理解如下:ts 按下 ->串口 ->ts 驱动程序 ->tslib ->设备文件(如/dev/input/eventX)
这样对吗?还是需要在 ts driver
和 tslib
之间插入一些代码,以便它们可以通信?
I don't understand how tslib works. Let's say I have a serial touchscreen, in my understanding the data flows in the following way:
ts press -> serial port -> ts driver -> tslib -> device file (like /dev/input/eventX)
Is it right? Or do I need to insert some code between ts driver
and tslib
so that they can communicate?
推荐答案
Tslib 不在触摸屏驱动程序和输入设备文件之间运行 - 它代表使用它的应用程序访问设备文件.使用tslib时的关键数据流是device file ->tslib ->应用程序
.
Tslib does not operate between the touch screen driver and the input device file - it accesses the device file on behalf of the application using it. The key data flow when using tslib is device file -> tslib -> application
.
应用程序指定(触摸设备的)输入设备文件 tslib 应与 ts_open()
函数一起使用,然后使用其他 tslib 函数获取触摸样本.
The application specifies the input device file (of the touch device) tslib should use with the ts_open()
function and then uses other tslib functions to obtain the touch samples.
tslib API 在 tslib.h 和tests
下的源代码中有许多使用示例,包括简单的 ts_print.c.
The tslib API is defined in tslib.h and there's a number of usage examples in the source under tests
including the simple ts_print.c.
这篇关于使用带有 tslib 的触摸屏的数据流是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!