Tslib
From Texas Instruments Embedded Processors Wiki
Translate this page to
Contents |
About
Tslib is an abstraction layer for touchscreen panel events, as well as a filter stack for the manipulation of those events. It was created by Russell King, of arm.linux.org.uk. Tslib is generally used on embedded devices to provide a common user space interface to touchscreen functionality.
Source Download Location
Visit Download tslib source
Cross compiling
- Run ./configure --prefix=(Abosolute path on NFS) --host=arm-linux-gnu.
- Edit the file config.h and comment the line "#define malloc rpl_malloc" to avoid this option:"#define malloc rpl_malloc" -> "//#define malloc rpl_malloc"
- AC_FUNC_MALLOC in configure.ac seems to cause malloc to be defined to rpl_malloc, which is never implemented and therefore cause a link error.Removing this line from AC_FUNC_MALLOC is a workaround i got after browsing net.
- Issue make and make install.
- This will generate the ts_calibrate and ts_test executables.
Configuration(required for execution).
Make sure you have the following settings right(You can have them in your profile).
- export TSLIB_FBDEVICE=/dev/fb0
- This is for the Fbdev device node to be used for display.
- export TSLIB_TSDEVICE=/dev/input/touchscreen0
- export TSLIB_CONFFILE=/etc/ts.conf
Execution
- First run ts_calibrate to calibrate the touch screen.
- You can now run ts_test application. This application helps in moving a cross-hair pattern around the LCD touchscreen. The pattern moves with your stylus movements. Also there is a draw option supported. Using your stylus you can write/draw on touchscreen.
Execution logs
The logs of ts_calibrate,ts_test run is provided below-
TS_READ----> x = 4, y = 306, pressure = 673 416.280517: 4 306 673 TS_READ----> x = 4, y = 306, pressure = 679 416.286407: 4 306 679 TS_READ----> x = 5, y = 308, pressure = 0 416.291717: 5 308 0
The logs mainly print the coordinate positions and pressure values according to the stylus movements on the touchscreen.
Leave a CommentComments
Comments on Tslib

run "./configure --prefix=(Abosolute path on NFS) --host=arm-linux-gnu ac_cv_func_malloc_0_nonnull=yes" is also a workaround for "undefined reference to rpl_malloc" problem
--Htbegin 23:46, 11 January 2011 (CST)