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?
Asked
Active
Viewed 1,950 times
2

beaver
- 550
- 1
- 9
- 23
-
`/dev/input/eventX` is an alternative to `/dev/ttyS0` or whatever your serial port is. A touch screen driver built into the kernel will have this type of name. `tslib` can handler either type, in the way [Chris](http://stackoverflow.com/users/1933019/chris-mcharg) describes. – artless noise Mar 31 '13 at 00:58
1 Answers
4
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
.
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.
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.

Chris McHarg
- 116
- 2