tslib版本:tslib-1.4
交叉编译器版本: arm-linux-gcc 4.4.3
操作系统平台: ubuntu12.04
开发板平台: mini2440
tslib下载地址:
http://www.aiothome.net/read.php?tid-16105.html经测试其他的tslib库也可以:
http://download.csdn.net/download/liuqiqi677/3177449移植过程:
1,生成配置文件:
./autogen.sh
2,产生一个cache文件arm-linux.cache,欺骗configure,避免undefined reference to 'rpl_malloc'错误:
echo ac_cv_func_malloc_0_nonnull=yes>arm-linux.cache
3,配置:
./configure CC=/home/zhs/share/opt/FriendlyARM/toolschain/4.4.3/bin/arm-none-linux-gnueabi-gcc \
CXX=/home/zhs/share/opt/FriendlyARM/toolschain/4.4.3/bin/arm-none-linux-gnueabi-g++ \
--host=arm-linux --cache-file=arm-linux.cache --prefix=/home/zhs/mini2440/tslib
4,编译和安装
make
make install
5,将tslib文件夹拷贝到开发板/usr/local中。
6,设置环境变量开发板/etc/profile文件中:
export TSLIB_ROOT=/usr/local/tslib
export TSLIB_TSDEVICE=/dev/touchscreen-1wire
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_PLUGINDIR=/usr/local/tslib/lib/ts
export TSLIB_CONSOLEDEVICE=none
export TSLIB_CONFFILE=/usr/local/tslib/etc/ts.conf
export POINTERCAL_FILE=/etc/pointercal
export TSLIB_CALIBFILE=/etc/pointercal
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TSLIB_ROOT/lib
export TSLIB_TSDEVICE=/dev/touchscreen-1wire 指定触屏设备 可以通过cat /dev/touchscreen-1wire来测试触屏设备(点击触屏有反应)
export TSLIB_TSDEVICE=/dev/input/event0 指定触屏设备
export TSLIB_CALIBFILE=/etc/pointercal 指定触摸屏校准文件 pintercal 的存放位置
export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf 指定 TSLIB 配置文件的位置
export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts 指定触摸屏插件所在路径
export TSLIB_FBDEVICE=/dev/fb0 指定帧缓冲设备
export TSLIB_CONSOLEDEVICE=none 设定控制台设备为 none ,否则默认为 /dev/tty ,这样可以避免出现“ open consoledevice: No such file or directory KDSETMODE: Bad file descriptor ” 的错误
LD_LIBRARY_PATH 指定链接库的路径
7,修改tslib/etc/ts.conf的内容:
module_raw friendlyarm-ts-input
8,将友善之臂跟文件系统中/rootfs_qtopia_qt4/usr/local/lib/ts文件夹中的friendlyarm-ts-input.so拷贝到开发板文件系统相应目录。
usr/local/tslib/lib/ts
9,触摸屏校准:
./usr/local/bin/ts_calibrate
[ 此帖被huishun1314在2014-11-14 19:01重新编辑 ]