Difference between revisions of "Tslib"
From ArmadeusWiki
m (beautifying) |
(Simplify config) |
||
Line 49: | Line 49: | ||
$ make tslib | $ make tslib | ||
− | ==Configuration details | + | ==Configuration details== |
+ | Most are now automatically done in recent Armadeus SDK releases. If you are interested, history is kept [[Talk:Tslib|here]]. | ||
===Config file=== | ===Config file=== | ||
− | * | + | * Tslib plugins can be tuned with ''/etc/ts.conf''. A default one is provided in all rootfs: |
<pre class="apf"> | <pre class="apf"> | ||
# cat /etc/ts.conf | # cat /etc/ts.conf | ||
Line 64: | Line 65: | ||
===Envt variables=== | ===Envt variables=== | ||
− | * | + | * Some ENVT variables are needed too. By default they are defined in ''/etc/profile'': |
<pre class="apf"> | <pre class="apf"> | ||
export TSLIB_TSDEVICE=/dev/input/event0 | export TSLIB_TSDEVICE=/dev/input/event0 | ||
Line 70: | Line 71: | ||
export TSLIB_CONFFILE=/etc/ts.conf | export TSLIB_CONFFILE=/etc/ts.conf | ||
export TSLIB_CALIBFILE=/etc/pointercal | export TSLIB_CALIBFILE=/etc/pointercal | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</pre> | </pre> | ||
===Calibration=== | ===Calibration=== | ||
− | * ''/etc/pointercal'' is created when running Tslib calibration tool: | + | * When starting Tslib will look at ''/etc/pointercal'' to get calibration data. This file is created when running Tslib's calibration tool: |
<pre class="apf"> | <pre class="apf"> | ||
# /usr/bin/ts_calibrate | # /usr/bin/ts_calibrate |
Revision as of 17:26, 15 June 2009
Library which provides a common interface to touchscreen and allows touchscreen events filtering or calibrating...
Contents
Compiling
Preliminaries checks
Warning:
This part is required on: Ubuntu 6.04, KUbuntu 6.10 or more |
- Be sure to have libtool package installed (tested with 1.5.22-4 & 1.5.24-1 versions).
Otherwise you will have following errors:
configure.ac:25: error: possibly undefined macro: AC_DISABLE_STATIC If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. configure.ac:26: error: possibly undefined macro: AC_ENABLE_SHARED configure.ac:27: error: possibly undefined macro: AC_LIBTOOL_DLOPEN configure.ac:28: error: possibly undefined macro: AC_PROG_LIBTOOL
- Be sure to have automake-1.6 or higher package installed (tested with 1.7 version -> working, 1.9.6 -> not working & 1.10 -> working !).
After automake package installation don't forget to update your /etc/alternatives/automake and /etc/alternatives/aclocal symlinks (tested on Ubuntu).
$ sudo ln -sf /usr/bin/automake-1.7 /etc/alternatives/automake $ sudo ln -sf /usr/bin/aclocal-1.7 /etc/alternatives/aclocal --> lrwxrwxrwx 1 root root 20 2007-06-27 21:43 /etc/alternatives/aclocal -> /usr/bin/aclocal-1.7 lrwxrwxrwx 1 root root 21 2007-06-27 21:39 /etc/alternatives/automake -> /usr/bin/automake-1.7
- In Buildroot, if you don't have configured the C++ cross-compiler yet (done in default configuration), then:
$ make menuconfig
Toolchain Options ---> [*] Build/install c++ compiler and libstdc++? [*] Build/install a shared libgcc?
Config
- After all these checks, activate libts package in Buildroot configuration:
$ make menuconfig
$ make
- Or compile it directly:
$ make tslib
Configuration details
Most are now automatically done in recent Armadeus SDK releases. If you are interested, history is kept here.
Config file
- Tslib plugins can be tuned with /etc/ts.conf. A default one is provided in all rootfs:
# cat /etc/ts.conf module_raw input module pthres pmin=1 module variance delta=30 module dejitter delta=100 module linear
Envt variables
- Some ENVT variables are needed too. By default they are defined in /etc/profile:
export TSLIB_TSDEVICE=/dev/input/event0 export TSLIB_TSEVENTTYPE=INPUT export TSLIB_CONFFILE=/etc/ts.conf export TSLIB_CALIBFILE=/etc/pointercal
Calibration
- When starting Tslib will look at /etc/pointercal to get calibration data. This file is created when running Tslib's calibration tool:
# /usr/bin/ts_calibrate
Testing it
# /usr/bin/ts_test
Adding Tslib support to SDL
SDL is by default compiled with Tslib support in current Buildroot distribution. You just have to make SDL knows the presence of Tslib when launching your application:
export SDL_MOUSEDRV=TSLIB export SDL_MOUSEDEV=$TSLIB_TSDEVICE export SDL_NOMOUSE=1
To have an example of a SDL application using Tslib, look at target/demos/backlight_control/ sources.
Adding Tslib support to Qt
Work in progress...