实验环境:
单板:TQ210(S5PV210)
编译环境: ubuntu12.04
触摸屏: gt911(已移植好驱动)
移植步骤:
2.解压缩
tar -xvf tslib-1.4.tar.gz
3.配置
sudo apt-get install autoconf
sudo apt-get install libtool
cd tslib (该文件夹为tslib源码目录,具体放在哪个位置,以个人而定)
./autogen.sh
mkdir tmp
echo "ac_cv_func_mallo_0_nonnull=yes" > arm-none-linux-gnueabi.cache
./configure --host=arm-none-linux-gnueabi --prefix=$(pwd)/tmp --cache-file=arm-none-linux-gnueabi.cache
4.编译
make
make的时候会出现如下错误:
ts_test.c:(.text+0x1e4): undefined reference to `rpl_malloc'
解决方法:将config.h.in里的 #undef malloc屏蔽掉
5.安装
make install
6.复制编译好的链接库和测试程序到文件系统,我的NFS文件系统路径是/opt/rootfs,操作的时候以你自己的路径为准。
cd tmp //tmp目录里面有我们需要的测试程序和一些必要的配置文件,我们需要一个个的复制到我们自己已经制作好的文件系统中
cp -raf ./bin/* /opt/rootfs/bin //复制测试程序
cp ./etc/ts.conf /opt/rootfs/etc //复制配置文件
cp ./include/tslib.h /opt/rootfs/include //复制头文件
cp -raf ./lib/* /opt/rootfs/lib //复制库
cp -raf ./share/* /opt/rootfs/share
注:上面写的比较繁琐,其实就是把生成的文件都复制到你自己的文件系统中。
8. 进入到tslib的源码目录
cp -raf tslib/plugins /opt/rootfs/lib/ts
9.修改/nfsroot/etc/ts.conf第一行(去掉#号和第一个空格)
# module_raw input
该为
module_raw input
10.修改/opt/rootfs/etc/profile文件
vi /opt/rootfs/etc/profile
在其中添加如下代码
export TSLIB_TSDEVICE=/dev/event0
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/lib/ts
export TSLIB_CONSOLEDEVICE=/dev/tty
export TSLIB_FBDEVICE=/dev/fb0
11.启动开发板
运行ts_calibrate,并根据提示进行校准
运行ts_test,点击draw按钮,可以自由画图
如果要修改触摸屏输入设备节点 为/dev/event1
需要修改
1./opt/rootfs/etc/profile
2.tslib库 tests目录下的ts_test.c的源码