关于Linux下触摸屏驱动的若干问题

hedynasty 2010-07-19 09:16:46
各位前辈:如题,小弟现在在搞一个Linux下的触摸屏驱动,现有如下几个问题请教,恳请指点,谢谢!

要求:触摸屏通过USB口接到开发板(S3C2440为主芯片的)上,当用笔在触摸屏上滑动时,有一个鼠标箭头在开发板屏幕的相应位置显示;

问题:
1.要实现要求的功能需要哪些驱动?除了USB驱动,触摸屏驱动外还有吗?
2.要在开发板的屏幕显示一个鼠标,那就必须要在Qt或别的图形界面下显示对吗?
3.如果要在Qt下显示鼠标,是不是将触摸屏的数据作为Qt的鼠标输入来实现?
4.看了宋宝华的《Linux设备驱动开发详解》中的“触摸屏的设备驱动”那节内容,其中的结果是将触点的位置(X,Y坐标)数据读出来,是不是要将这个坐标数据送到Qt的相关函数中经过处理实现一个鼠标箭头的显示?
...全文
2701 95 打赏 收藏 转发到动态 举报
写回复
用AI写文章
95 条回复
切换为时间正序
请发表友善的回复…
发表回复
sodwell 2012-10-17
  • 打赏
  • 举报
回复
mark一下,质量贴!热心贴!
姜博业 2012-08-11
  • 打赏
  • 举报
回复
QTE在linux下使用qvfb方式显示APP。这样的方式使用USB或串口触摸屏要在触摸屏驱动、linux系统环境变量设置、tslib校准等方面做修改,tslib官网的驱动不能直接校准。这个开发过程需要对整个架构都非常熟悉才能调出来,而且触摸屏驱动要触摸屏控制器厂家支持才行,而且支持这种非X11方式的驱动厂家很少。touchqvfb@163.com 有一家的控制器支持。在工控领域qte图形界面比X-windows下显示图形界面APP要稳定的多,因为多次非法关机后会使linux系统文件损坏而导致x11启动不起来,使用QVFB方式显示不依赖与系统配置,所以在高可靠领域一般都是使用这种方式显示
alishco 2012-01-11
  • 打赏
  • 举报
回复
楼主你好,买了一台联想C325触摸一体电脑,用的是WIN7系统,在里面装了一个VMware虚拟机,虚拟机装的时linux系统,出现了一个问题,在虚拟机外部用手指触摸电脑正常,点虚拟机的时候,触摸的地方跟里面的鼠标指针位置不一,怀疑可能是不是驱动问题,所以想向楼主请教怎么办。谢谢了!
JuanA1 2011-08-17
  • 打赏
  • 举报
回复
帮顶,有高手在啊
wolf937 2011-08-03
  • 打赏
  • 举报
回复
好主题,wwwunix很强大,佩服
wzb56 2011-07-22
  • 打赏
  • 举报
回复
mark!!!!!!
ppt060984 2011-06-02
  • 打赏
  • 举报
回复
mark一下,后续可能会用到
chenyuanman 2011-05-04
  • 打赏
  • 举报
回复
好环境!大家都能好好学习交流下!
z350231547 2010-11-05
  • 打赏
  • 举报
回复
好环境!大家都能好好学习交流下!
hedynasty 2010-08-23
  • 打赏
  • 举报
回复
汗啊!!!

都怪我没认真按文章上面说的做,人家早就提醒了“可能报错 ts_test.c:(.text+0x200): undefined reference to `rpl_malloc',原因是在 tslib-1.4/config.h 中有一行定义 #define malloc rpl_malloc,直接注释掉这行定义即可,除非你自己实现了一个 malloc 版本。”

麻烦wwwunix了,不过又跟你学了几招,呵呵
hedynasty 2010-08-23
  • 打赏
  • 举报
回复
arm-linux-gcc -DGCC_HASCLASSVISIBILITY -O2 -Wall -W -o .libs/ts_test ts_test.o fbutils.o font_8x8.o font_8x16.o ../src/.libs/libts.so -ldl -Wl,--rpath -Wl,/opt/tslib/lib

弱弱的问一下:上面这句是一个命令还是...?
hedynasty 2010-08-23
  • 打赏
  • 举报
回复
结果如下,定义rpl_malloc的好像有autom4te.cache/output.1和autom4te.cache/output.2等好几个文件
[root@hyc tslib]# grep rpl_malloc * -r
autom4te.cache/output.1:@%:@define malloc rpl_malloc
autom4te.cache/output.1:/* malloc might have been renamed as rpl_malloc. */
autom4te.cache/traces.2:m4trace:configure.ac:46: -1- AH_OUTPUT([malloc], [/* Define to rpl_malloc if the replacement function should be used. */
autom4te.cache/output.2:@%:@define malloc rpl_malloc
autom4te.cache/output.2:/* malloc might have been renamed as rpl_malloc. */
autom4te.cache/traces.1:m4trace:configure.ac:46: -1- AH_OUTPUT([malloc], [/* Define to rpl_malloc if the replacement function should be used. */
autom4te.cache/output.0:@%:@define malloc rpl_malloc
autom4te.cache/output.0:/* malloc might have been renamed as rpl_malloc. */
config.h:/* Define to rpl_malloc if the replacement function should be used. */
config.h:#define malloc rpl_malloc
config.h.in:/* Define to rpl_malloc if the replacement function should be used. */
config.log:| #define malloc rpl_malloc
config.log:| #define malloc rpl_malloc
config.log:#define malloc rpl_malloc
config.status:s,^\([ #]*\)[^ ]*\([ ]*malloc\)[ (].*,\1define\2 rpl_malloc ,
configure:#define malloc rpl_malloc
configure:/* malloc might have been renamed as rpl_malloc. */
Binary file plugins/.libs/collie-raw.o matches
Binary file plugins/.libs/corgi.so matches
Binary file plugins/.libs/collie.so matches
Binary file plugins/.libs/corgi-raw.o matches
Binary file plugins/.libs/input-raw.o matches
Binary file plugins/.libs/h3600.so matches
Binary file plugins/.libs/mk712.so matches
Binary file plugins/.libs/arctic2-raw.o matches
Binary file plugins/.libs/h3600-raw.o matches
Binary file plugins/.libs/input.so matches
Binary file plugins/.libs/arctic2.so matches
Binary file plugins/.libs/ucb1x00-raw.o matches
Binary file plugins/.libs/ucb1x00.so matches
Binary file plugins/.libs/mk712-raw.o matches
Binary file src/.libs/libts-
wwwunix 2010-08-23
  • 打赏
  • 举报
回复
连接的时候没有找到rpl_malloc这个函数。
在源代码目录中用grep rpl_malloc * -r找找看这个函数在哪个文件中实现的。
然后看看
arm-linux-gcc -DGCC_HASCLASSVISIBILITY -O2 -Wall -W -o .libs/ts_test ts_test.o fbutils.o font_8x8.o font_8x16.o ../src/.libs/libts.so -ldl -Wl,--rpath -Wl,/opt/tslib/lib
这条语句中有没有包含这个文件的中间代码或动态库
hedynasty 2010-08-23
  • 打赏
  • 举报
回复
内容太长,接上面:
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for gfortran option to produce PIC... -fPIC
checking if gfortran PIC flag -fPIC works... yes
checking if gfortran static flag -static works... yes
checking if gfortran supports -c -o file.o... yes
checking whether the gfortran linker (/usr/local/arm/4.3.2/arm-none-linux-gnueabi/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for dlopen in -ldl... (cached) yes
checking for working alloca.h... yes
checking for alloca... yes
checking for ANSI C header files... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether arm-linux-gcc needs -traditional... no
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... no
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for getpagesize... yes
checking for working mmap... no
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking types of arguments for select... int,fd_set *,struct timeval *
checking return type of signal handlers... void
checking whether lstat dereferences a symlink specified with a trailing slash... no
checking whether stat accepts an empty string... yes
checking for vprintf... yes
checking for _doprnt... no
checking for bzero... yes
checking for gettimeofday... yes
checking for memmove... yes
checking for memset... yes
checking for munmap... yes
checking for select... yes
checking for strcasecmp... yes
checking for strchr... yes
checking for strdup... yes
checking for strtoul... yes
checking whether linear modules is requested... yes
checking whether dejitter module is requested... yes
checking whether linear-h2200 module is requested... yes
checking whether variance module is requested... yes
checking whether pthres module is requested... yes
checking whether ucb1x00 module is requested... yes
checking whether corgi module is requested... yes
checking whether collie module is requested... yes
checking whether h3600 module is requested... yes
checking whether mk712 module is requested... yes
checking whether arctic2 module is requested... yes
checking whether input module is requested... yes
checking where to place modules... ${libdir}/ts/
checking whether to enable debugging... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating etc/Makefile
config.status: creating plugins/Makefile
config.status: creating src/Makefile
config.status: creating tests/Makefile
config.status: creating tslib-0.0.pc
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands

编译
[root@hyc tslib]# make
make all-recursive
make[1]: Entering directory `/tmp/tslib'
Making all in etc
make[2]: Entering directory `/tmp/tslib/etc'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/tmp/tslib/etc'
Making all in src
make[2]: Entering directory `/tmp/tslib/src'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/tmp/tslib/src'
Making all in plugins
make[2]: Entering directory `/tmp/tslib/plugins'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/tmp/tslib/plugins'
Making all in tests
make[2]: Entering directory `/tmp/tslib/tests'
/bin/sh ../libtool --tag=CC --mode=link arm-linux-gcc -DGCC_HASCLASSVISIBILITY -O2 -Wall -W -o ts_test ts_test.o fbutils.o font_8x8.o font_8x16.o ../src/libts.la -ldl
arm-linux-gcc -DGCC_HASCLASSVISIBILITY -O2 -Wall -W -o .libs/ts_test ts_test.o fbutils.o font_8x8.o font_8x16.o ../src/.libs/libts.so -ldl -Wl,--rpath -Wl,/opt/tslib/lib
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

错误:
make[2]: *** [ts_test] Error 1
make[2]: Leaving directory `/tmp/tslib/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/tslib'
make: *** [all] Error 2
[root@hyc tslib]#
hedynasty 2010-08-23
  • 打赏
  • 举报
回复
从配置开始
[root@hyc tslib]# ./configure --host=arm-linux --prefix=/opt/tslib
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.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for arm-linux-strip... arm-linux-strip
checking for arm-linux-g++... arm-linux-g++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether arm-linux-g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of arm-linux-g++... gcc3
checking for arm-linux-gcc... arm-linux-gcc
checking whether we are using the GNU C compiler... yes
checking whether arm-linux-gcc accepts -g... yes
checking for arm-linux-gcc option to accept ISO C89... none needed
checking dependency style of arm-linux-gcc... gcc3
checking how to run the C preprocessor... arm-linux-gcc -E
checking whether the C compiler supports -fvisibility=hidden... yes
checking whether to use -fvisibility=hidden... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking build system type... i686-pc-linux-gnu
checking host system type... arm-unknown-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ld used by arm-linux-gcc... /usr/local/arm/4.3.2/arm-none-linux-gnueabi/bin/ld
checking if the linker (/usr/local/arm/4.3.2/arm-none-linux-gnueabi/bin/ld) is GNU ld... yes
checking for /usr/local/arm/4.3.2/arm-none-linux-gnueabi/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/local/arm/4.3.2/bin/arm-linux-nm -B
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... arm-linux-g++ -E
checking for arm-linux-g77... no
checking for arm-linux-xlf... no
checking for arm-linux-f77... no
checking for arm-linux-frt... no
checking for arm-linux-pgf77... no
checking for arm-linux-cf77... no
checking for arm-linux-fort77... no
checking for arm-linux-fl32... no
checking for arm-linux-af77... no
checking for arm-linux-xlf90... no
checking for arm-linux-f90... no
checking for arm-linux-pgf90... no
checking for arm-linux-pghpf... no
checking for arm-linux-epcf90... no
checking for arm-linux-gfortran... no
checking for arm-linux-g95... no
checking for arm-linux-xlf95... no
checking for arm-linux-f95... no
checking for arm-linux-fort... no
checking for arm-linux-ifort... no
checking for arm-linux-ifc... no
checking for arm-linux-efc... no
checking for arm-linux-pgf95... no
checking for arm-linux-lf95... no
checking for arm-linux-ftn... no
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... gfortran
configure: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org.
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether gfortran accepts -g... yes
checking the maximum length of command line arguments... 1966080
checking command to parse /usr/local/arm/4.3.2/bin/arm-linux-nm -B output from arm-linux-gcc object... ok
checking for objdir... .libs
checking for arm-linux-ar... arm-linux-ar
checking for arm-linux-ranlib... arm-linux-ranlib
checking for arm-linux-strip... (cached) arm-linux-strip
checking if arm-linux-gcc supports -fno-rtti -fno-exceptions... no
checking for arm-linux-gcc option to produce PIC... -fPIC
checking if arm-linux-gcc PIC flag -fPIC works... yes
checking if arm-linux-gcc static flag -static works... yes
checking if arm-linux-gcc supports -c -o file.o... yes
checking whether the arm-linux-gcc linker (/usr/local/arm/4.3.2/arm-none-linux-gnueabi/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking for shl_load... no
checking for shl_load in -ldld... no
checking for dlopen... no
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... cross
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by arm-linux-g++... /usr/local/arm/4.3.2/arm-none-linux-gnueabi/bin/ld
checking if the linker (/usr/local/arm/4.3.2/arm-none-linux-gnueabi/bin/ld) is GNU ld... yes
checking whether the arm-linux-g++ linker (/usr/local/arm/4.3.2/arm-none-linux-gnueabi/bin/ld) supports shared libraries... yes
checking for arm-linux-g++ option to produce PIC... -fPIC
checking if arm-linux-g++ PIC flag -fPIC works... yes
checking if arm-linux-g++ static flag -static works... yes
checking if arm-linux-g++ supports -c -o file.o... yes
checking whether the arm-linux-g++ linker (/usr/local/arm/4.3.2/arm-none-linux-gnueabi/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking if libtool supports shared libraries... yes



wwwunix 2010-08-23
  • 打赏
  • 举报
回复
把你的错误代码都贴出来。
具体的报错在前面。
hedynasty 2010-08-23
  • 打赏
  • 举报
回复
wwwunix,在我的装有Qt2的开发板上能按照这篇文章《移植触摸屏库tslib》最后那样运行触摸屏校正吗? http://blog.chinaunix.net/u3/104564/showart_2094901.html

我按他的步骤做的,结果在make编译的时候总是出现两个错误,

make[2]: ***[ts_test] Error 1
make[2]: Leaving directory '/tmp/tslib/tests'
make[1]: ***[all-recursive] Error 1
make[1]: Leaving directory '/tmp/tslib'
make: *** [all] Error 2

不知道是不是这两个编译错误导致的,结果后面在make install命令之后,我的tslib目录下只有:
etc include lib 三个文件夹,而唯独缺少装有触摸屏校正程序ts_calibrate的 bin 文件夹,麻烦帮小弟分析一下,是什么原因?
wwwunix 2010-08-23
  • 打赏
  • 举报
回复
http://blog.csdn.net/yang_dk/archive/2008/04/14/2290038.aspx
http://www.cediy.com/webHtml/Article/inset/1266620090825154700.html
hedynasty 2010-08-23
  • 打赏
  • 举报
回复
wwwunix,不好意思,又要麻烦你了,能不能推荐一个在mini2440开发板上移植Qt4的有详细步骤的文章,我在网上找了几个,感觉都不全面,到现在还没移植成功,多谢了!
wwwunix 2010-08-20
  • 打赏
  • 举报
回复
1、export LD_LIBRARY_PATH=$T_ROOT/lib:$QTDIR/lib:$LD_LIBRARY_PATH
2、你说的是flash的大小吧?那RAM的大小呢?
加载更多回复(71)
2012-06-13 12:51 688 显示板块正在浏览的会员数量.rar 2012-06-13 13:24 1,451 marquee基本语法的全解释.txt 2012-06-13 12:49 4,414 C语言实现BMP转换JPG.txt 2012-06-13 12:50 5,627 QQ.txt 2011-03-15 22:50 6,868 人品测试.c 2012-06-13 12:46 7,808 CppSQLite3U.zip 2012-06-13 12:49 9,515 人品测试程序(含代码).rar 2012-06-13 13:21 10,160 类似google搜索提示源码.rar 2012-06-13 13:20 14,643 模煳算法 C 程序.rar 2012-06-13 12:52 19,651 拦截网络数据的小玩意.txt 2012-06-13 13:11 26,323 隐藏进程.rar 2011-03-15 22:51 27,510 人品测试.exe 2012-06-13 13:37 41,984 熊猫烧香病毒源代码.doc 2012-06-13 13:11 42,760 系统监视工具.rar 2012-06-13 12:49 50,422 系统强力优化优化.cmd 2012-06-13 13:18 50,688 BP神经网络C实现.doc 2012-06-13 13:47 75,311 IBM-PC汇编语言程序设计(第五版)书中源码.rar 2012-06-13 12:48 107,488 【随书附盘】Excel高级报表宝典.rar 2012-06-13 12:48 123,645 【数据文件】商务智能与数据挖掘Microsoft SQL Server应用.rar 2012-06-13 12:46 143,886 asp制作时钟.rar 2012-06-13 12:51 168,726 UCOS-Keil.rar 2012-06-13 12:53 169,265 12.FTP上传下载文件演示.rar 2012-06-13 13:46 194,132 200个小游戏原源代码Code.zip 2012-06-13 12:54 257,602 《html深入浅出》源代码.rar 2012-06-13 12:47 306,755 Graphics32 Canny Edge Detect.rar 2012-06-13 13:37 371,200 C++矩阵类.doc 2012-06-13 12:49 418,042 250个Java实例源代码.rar 2012-06-13 13:30 590,473 坦克大战游戏源码.素材.文档.zip 2012-06-13 12:53 656,958 nginx源码剖析.pdf 2012-06-13 12:52 720,948 STM32中断.RAR 2012-06-13 13:30 1,124,527 图像模式识别--VC++技术实现.zip 2012-06-13 13:07 2,173,078 14123166.bmp 2012-06-13 13:47 2,189,856 27个全屏触摸屏版JAVA游戏打包下载.rar 2012-06-13 13:40 2,410,554 [瞬间放松法七日通].(英)霍尔.(英)利德利尔.扫描版.pdf 2012-06-13 13:23 3,283,597 MathGL应用实践_例程_vs2003.rar 2012-06-13 13:15 3,670,884 关键词分析工具(支持批量查询).zip 2012-06-13 13:16 4,782,225 STM32F_ARM微处理器固件库说明文档.pdf 2012-06-13 13:37 5,738,216 象棋游戏.zip 2012-06-13 13:32 6,340,651 C++开发的股票分析系统的原代码程序.rar 2012-06-13 13:11 8,506,521 76个qt例子非常适合学习qt编程.rar 2012-06-13 13:38 9,178,682 Lucene 3.0 原理与代码分析完整版.pdf 2012-06-13 13:46 10,582,426 姚晨屏保(宽屏).exe 2012-06-13 13:10 23,625,694 Visual.C.系统开发实例精粹(源代码).7z 2012-06-13 13:46 25,062,737 linux设备驱动开发详解的光盘源码,里面有很多linux设备驱动的经典例子linuxdriver_code_tool.RAR 2012-06-13 13:38 27,307,573 VC++6.0+MSDN+(精简版+大小:74.87M).part2.rar 2012-06-13 13:44 39,433,034 [自己动手写操作系统].于渊.无水印影印版(《Orange's一个操作系统的实现》的第一版).pdf

4,463

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧