Leapster Explorer: tslib Touchscreen Library
Tslib is an abstraction layer for touchscreen panel events, as well as a filter stack for the manipulation of those events. Examples of implemented filters include jitter smoothing and the calibration transform. Tslib is generally used on embedded devices to provide a common user space interface to touchscreen functionality.
Follow the steps below to build tslib for Leapster Explorer. (We leverage the existing event device)
Download tslib from the github repository:
git clone http://github.com/kergoth/tslib
In the tslib directory, create a folder called build:
cd tslib mkdir build
Set up your cross compiler's environment variables accordingly (ex: source crosscompile)
Configure the compilation:
./configure --build=i386-linux --host=arm-linux --target=arm --prefix=$PWD/build
Populate the build directory with the result
Copy the etc/ts.conf file to the LX in the /etc directory.
Copy the contents of lib to the LX in the /usr/lib directory.
Copy the contents of bin to the LX into a directory of your choosing.
Add the following lines to the LX file called /etc/profile:
export TSLIB_TSEVENTTYPE=INPUT export TSLIB_CONSOLEDEVICE=none export TSLIB_FBDEVICE=/dev/fb0 export TSLIB_TSDEVICE=/dev/input/event3 export TSLIB_CALIBFILE=/etc/pointercal export TSLIB_CONFFILE=/etc/ts.conf export TSLIB_PLUGINDIR=/usr/lib/ts
Then, 'source' the file:
Once that is done, boot the fbdev kernel, modprobe lf1000_ts, then run ts_calibrate and ts_test.
To include this library in your applications: Copy the contents of lib to your compiler's lib directory (in buildcross: sys-root/usr/lib) Copy the contents of include to your compiler's include directory (in buildcross: sys-root/usr/include)
Using tslib in your applications.