S3C2440 linux2.6.32.2 tslib1.4 移植

1,下载源码

tslib-1.4.tar.gz

http://download.csdn.net/download/zhang7772239/1520955

2,编译tslib

tslib是电阻式触摸屏用于校准的一个软件库,是一个开源的程序,能够为触摸屏驱动获得的采样提供诸如滤波、去抖、校准等功能,通常作为触摸屏驱动的适配层,为上层的应用提供了一个统一的接口。因此这里先编译安装tslib。

安装工具包:

root@ubuntu:~# sudo apt-get install autoconf automake libtool autogen

root@ubuntu:/home/sxbg/Documents/tslib# ./autogen.sh

root@ubuntu:/home/sxbg/Documents/tslib# echo "ac_cv_func_malloc_0_nonnull=yes">arm-linux.cache

root@ubuntu:/home/sxbg/Documents/tslib# ./configure --host=arm-linux --cache-file=arm-linux.cache --enable-inputapi=no --prefix=/home/sxbg/tslib

出现以下警告:

configure: WARNING: unrecognized options: --enable-inputapi
configure: WARNING: if you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used
configure: loading cache arm-linux.cache
checking for a BSD-compatible install... /usr/bin/install -c

.......................................

configure: WARNING: unrecognized options: --enable-inputapi

初步分析--enable-inputapi命令不识别,查看help

root@ubuntu:/home/sxbg/Documents/tslib# ./configure --help

没有--enable-inputapi命令

学习过程中逐渐积累why?

其中ac_cv_func_malloc_0_nonnull=yes 是为解决如下编译错误设置的,欺骗configure让他不检查这一项

ts_test.o: In function `main':
ts_test.c:(.text+0x1d8): undefined reference to `rpl_malloc'
fbutils.o: In function `open_framebuffer':
fbutils.c:(.text+0xa20): undefined reference to `rpl_malloc'
collect2: ld returned 1 exit status

--enable-inputapi=no. 是为了解决运行中提示 ts_open:Inappropriate ioctol for device,它表示
即不使用ioctl来控制触摸屏。

root@ubuntu:/home/sxbg/Documents/tslib# make

root@ubuntu:/home/sxbg/Documents/tslib# make install

这时在安装路径下/home/sxbg/tslib出现 bin  include  lib etc目录

编辑etc/ts.conf去掉# module_raw input前面的注释,一定要注意中间的空格也去掉,module顶格。

3,将库文件复制到开发板文件系统

将bin下ts_calibrate、ts_test复制到rootfs/usr/bin

将lib 下tc目录和*.so全部复制到 rootfs/lib

将etc下 ts.conf       复制到 rootfs/etc

编辑文件系统 rootfs/etc/profile

#add for touch screen
export TSLIB_TSDEVICE=/dev/event0
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/lib/ts
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0

在rootfs/etc下建立pointercal文件存储校正信息

使环境变量立即生效

root@FZ:# source /etc/profile

4,测试

root@FZ:/usr/bin# ./ts_calibrate 

出现校准界面

root@FZ:/usr/bin# ./ts_test

 

发现屏幕的左上角出现闪烁的光标,应该是控制台的光标提示,去掉的方法:

在drivers/video/console/fbcon.c文件中将static void fb_flashcursor(void *private)和 static void fbcon_cursor(struct vc_data *vc, int mode)的内容注释掉

内核移植后液晶屏会出现10分钟黑屏,查资料找到对应的解决办法:

将/linux/drivers/char/vt.c

static int blankinterval = 10*60;

修改为

static int blankinterval = 0;

至此液晶屏触屏驱动及触屏库建立完毕,五一在电脑前宅了三天,触屏驱动的移植花了很长时间,触屏驱动的移植过程在下篇讲述。






  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值