linux-3.4.2driversinput ouchscreens3c2410_ts.c(内核只带驱动)
触摸屏是有2440芯片中ADC控制器控制的,ADC有四种工作模式:
1、普通转换模式用于ADC转换;
2和3、用于触摸屏测试模式;
4、等待触摸笔按下模式
测试2th~7th:
1. make menuconfig 去掉原来的触摸屏驱动程序
-> Device Drivers
-> Input device support
-> Generic input layer
-> Touchscreens
<> S3C2410/S3C2440 touchscreens
make uImage
使用新内核启动
2. insmod s3c_ts.ko
按下/松开触摸笔
测试2th~7th:
1. ls /dev/event*
2. insmod s3c_ts.ko
3. ls /dev/event*
4. hexdump /dev/event0
秒 微秒 type code value
0000000 29a4 0000 8625 0008 0003 0000 0172 0000
0000010 29a4 0000 8631 0008 0003 0001 027c 0000
0000020 29a4 0000 8634 0008 0003 0018 0001 0000
0000030 29a4 0000 8638 0008 0001 014a 0001 0000
0000040 29a4 0000 863c 0008 0000 0000 0000 0000
0000050 29a4 0000 c85e 0008 0003 0000 0171 0000
0000060 29a4 0000 c874 0008 0003 0001 027d 0000
0000070 29a4 0000 c87b 0008 0000 0000 0000 0000
0000080 29a4 0000 ed37 0008 0003 0018 0000 0000
0000090 29a4 0000 ed48 0008 0001 014a 0000 0000
00000a0 29a4 0000 ed4a 0008 0000 0000 0000 0000
tslib使用:
sudo apt-get install autoconf
sudo apt-get install automake
sudo apt-get install libtool
编译:
tar xzf tslib-1.4.tar.gz
cd tslib
./autogen.sh
mkdir tmp
echo "ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache
./configure --host=arm-linux --cache-file=arm-linux.cache --prefix=$(pwd)/tmp
make
make install
安装:
cd tmp
cp * -rfd /nfsroot(考的开发板文件系统的根目录)
使用:
先安装s3c_ts.ko, lcd.ko
1.
修改 /etc/ts.conf第1行(去掉#号和第一个空格):
# module_raw input
改为:
module_raw input
2.
export TSLIB_TSDEVICE=/dev/event0
export TSLIB_CALIBFILE=/etc/pointercal //校验文件保存地址
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/lib/ts
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0 //触摸屏把校验信息显示到lcd上
ts_calibrate //校验
ts_test