User Tools

Site Tools


Sidebar

* [[start]] * [[som|System on module]] * [[usomiq-beaglebone|Mentorel Beaglebone uSomIQ]] * [[usomiq|uSomIQ AM335x]] * [[somiq|SomIQ family]] * [[blueshark|BlueShark family]] * [[devkit|DevKits]] * [[usomiq-bone-cape|uSomIQ Bone Cape]] * [[somiqboard|Somiqboard]] * [[atoll|Atoll]] * [[expansion|Expansion boards]] * [[somiq-wlan|SomIQ-WLAN]] * [[os|OS support]] * [[ubuntu|Ubuntu Linux]] * [[sw-hints|SW hints]] * [[tslib|Tslib]] * [[qt-embedded|Qt embedded]] Follow us * [[http://twitter.com/mentorel|Twitter]] * [[http://www.linkedin.com/company/mentorel|LinkedIn]] * [[https://www.facebook.com/mentorel.company|Facebook]] * [[https://plus.google.com/105868322858146792212/posts|Google+]] * [[http://www.mentorel.com|MENTOREL home page]]

tslib

Tslib

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. 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. It is supported by Kdrive (aka TinyX) and OPIE as well as being used on a number of commercial Linux devices including the Nokia 770.

Tslib downloads and source code are now being hosted at github.

Tslib compilation on a host

Tested on a Ubuntu 12.04 host

Download the tslib sources:

git clone git://github.com/kergoth/tslib.git

Cross-compile them and install to default destinations as per tslib configuration:

./autogen.sh
./configure --host=arm-linux-gnueabihf
make && sudo make install

From now you can link your application or libraries agains the tslib but it is not possible to run ts_ - utilites like ts_calibrate because they are arm-binaries, not for x86 architecture.

Default destinations are:

  • include folder for gcc include path -I<path> is '/usr/local/include'
  • lib folder for gcc link path -L<path> is '/usr/local/lib'

Tslib compilation on a target

This tutorial was tested on a Ubuntu ARM Core distribution installed on a Somiqboard.

1) download sources to a host as described in the previous paragraph and upload them to the target

2) compile sources by a native gcc compiler installed on the ARM Ubuntu distribution:

./autogen.sh
./configure
make && make install

You can now run ts_* utilities like ts_calibrate or ts_test.

Default destinations are:

  • ts.conf is in '/usr/local/etc'
  • pointercal file is in '/usr/local/etc'

If you want to use a calibrated touchscreen with your Qt application you need to specify where Tslib files are:

export QWS_MOUSE_PROTO=tslib:/dev/input/event0
export TSLIB_CALIBFILE=/usr/local/etc/pointercal
export TSLIB_CONFFILE=/usr/local/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/local/lib/ts
tslib.txt · Last modified: 2013/06/11 02:13 by maxx