NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
Tslib
Contents
About[edit]
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[edit]
Visit tslib github
Cross compiling[edit]
- 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).[edit]
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[edit]
- 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[edit]
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.