资料介绍
![Diff](/lib/images/diff.png)
Table of Contents
AD7877 Input Touch Screen Controller Linux Driver
Supported Devices
Description
The AD7877 is a 12-bit, successive approximation ADC with a synchronous serial interface and low on resistance switches for driving touch screens.
To reduce the effects of noise from LCDs, the acquisition phase of the on-board ADC is controlled via the STOPACQ pin. User-programmable conversion controls include variable acquisition time and first conversion delay. Up to 16 averages can be taken per conversion. There is also an on-board DAC for LCD back-light or contrast control. The AD7877 runs in either slave or master mode using a conversion sequencer and timer. It is ideal for battery-powered systems such as personal digital assistants with resistive touch screens and other portable equipment.
The AD7877 operates from a single 2.7 V to 5.25 V power supply, and features throughput rates of 125 kSPS. The AD7877 features direct battery measurement on two inputs, temperature and touch-pressure measurement.
The AD7877 also has an on-board reference of 2.5 V. When not in use, it can be shut down to conserve power. An external reference can also be applied and varied from 1 V to +VCC, with an analog input range of 0 V to VREF. The device includes a shutdown mode that reduces its current consumption to less than 1 μA.
See also: uclinux-dist:tslib
See also: AD7879 Touchscreen Device Driver
Software configurable features
Software configurable:
- STOPACQ Polarity (LOW, HIGH)
- First Conversion Delay (0.5us, 128us, 1ms, 8ms)
- Acquisition Time (2us, 4us, 8us, 16us)
- Number of Averages (1,4,8,16)
- Pen Down Acquisition Interval Timer (convert once, every 0.5ms, 1ms, 8ms)
Source Code
Status
Files
Function | File |
---|---|
driver | drivers/input/touchscreen/ad7877.c |
include | include/linux/spi/ad7877.h |
Example platform device initialization
For compile time configuration, it’s common Linux practice to keep board- and application-specific configuration out of the main driver file, instead putting it into the board support file.
For devices on custom boards, as typical of embedded and SoC-(system-on-chip) based hardware, Linux uses platform_data to point to board-specific structures describing devices and how they are connected to the SoC. This can include available ports, chip variants, preferred modes, default initialization, additional pin roles, and so on. This shrinks the board-support packages (BSPs) and minimizes board and application specific #ifdefs in drivers.
Touchscreen characteristics vary between boards and models. The platform_data for the device's “struct device” holds this information.
These snippets are all from the same file. arch/blackfin/mach-bf537/boards/pnav10.c
:
#include
Declaring SPI slave devices
Unlike PCI or USB devices, SPI devices are not enumerated at the hardware level. Instead, the software must know which devices are connected on each SPI bus segment, and what slave selects these devices are using. For this reason, the kernel code must instantiate SPI devices explicitly. The most common method is to declare the SPI devices by bus number.
This method is appropriate when the SPI bus is a system bus, as in many embedded systems, wherein each SPI bus has a number which is known in advance. It is thus possible to pre-declare the SPI devices that inhabit this bus. This is done with an array of struct spi_board_info, which is registered by calling spi_register_board_info().
For more information see: Documentation/spi/spi-summary
Adding Linux driver support
Configure kernel with “make menuconfig” (alternatively use “make xconfig” or “make qconfig”)
The AD7877 Driver depends on CONFIG_SPI
Input device support -*- Generic input layer (needed for keyboard, mouse, ...) < > Support for memoryless force-feedback devices < > Polled input device skeleton < > Sparse keymap support library *** Userland interfaces *** < > Mouse interface < > Joystick interface <*> Event interface < > Event debugging *** Input Device Drivers *** [ ] Keyboards ---> [ ] Mice ---> [ ] Joysticks/Gamepads ---> [ ] Tablets ---> [*] Touchscreens ---> --- Touchscreens < > ADS7846/TSC2046/AD7873 and AD(S)7843 based touchscreens (NEW) <*> AD7877 based touchscreens < > Analog Devices AD7879-1/AD7889-1 touchscreen interface (NEW) [ ] Miscellaneous devices ---> Hardware I/O ports --->
Hardware configuration
The AD7877 Linux Driver only uses the /DAV Data Available Interrupt. /PENIRQ is not used. STOPACQ can be used to reduce the effect of noise from an LCD screen on the touch screen measurements.
Driver testing
Driver compiled as a module
root:~> modprobe evdev root:~> modprobe ad7877 input: AD7877 Touchscreen as /class/input/input2 root:~>
Driver compiled into the kernel
Your kernel startup messages should include something like this
input: AD7877 Touchscreen as /class/input/input2
Use the evtest/event_test utility to test proper function
root:/> event_test /dev/input/event2 Input driver version is 1.0.0 Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 Input device name: "AD7877 Touchscreen" Supported events: Event type 0 (Sync) Event type 1 (Key) Event code 330 (Touch) Event type 3 (Absolute) Event code 0 (X) Value 1268 Min 0 Max 4095 Event code 1 (Y) Value 1250 Min 0 Max 4095 Event code 24 (Pressure) Value 0 Min 0 Max 1000 Testing ... (interrupt to exit) Event: time 67435.364000, type 1 (Key), code 330 (Touch), value 1 Event: time 67435.364000, type 3 (Absolute), code 0 (X), value 1624 Event: time 67435.364000, type 3 (Absolute), code 1 (Y), value 1514 Event: time 67435.364000, type 3 (Absolute), code 24 (Pressure), value 349 Event: time 67435.364000, -------------- Report Sync ------------ Event: time 67435.408000, type 3 (Absolute), code 0 (X), value 1626 Event: time 67435.408000, type 3 (Absolute), code 1 (Y), value 1516 Event: time 67435.408000, type 3 (Absolute), code 24 (Pressure), value 342 Event: time 67435.408000, -------------- Report Sync ------------ Event: time 67435.452000, type 3 (Absolute), code 1 (Y), value 1514 Event: time 67435.452000, type 3 (Absolute), code 24 (Pressure), value 339 Event: time 67435.452000, -------------- Report Sync ------------ Event: time 67435.496000, type 3 (Absolute), code 0 (X), value 1625 Event: time 67435.496000, type 3 (Absolute), code 24 (Pressure), value 343 Event: time 67435.496000, -------------- Report Sync ------------ Event: time 67435.596000, type 3 (Absolute), code 24 (Pressure), value 0 Event: time 67435.596000, type 1 (Key), code 330 (Touch), value 0 Event: time 67435.596000, -------------- Report Sync ------------
Common Problems
In case you see a message like this
spi0.2: Failed to probe AD7877 Touchscreen
This means that the SPI communication and initilaization with the AD7877 touchscreen controller/digitizer failed. check bus_num and chip_select in your platform device file
#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) { .modalias = "ad7877", .platform_data = &bfin_ad7877_ts_info, .irq = IRQ_PJ11, .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ .bus_num = 0, .chip_select = 2, .controller_data = &spi_ad7877_chip_info, }, #endif
Testing
See the uclinux-dist:tslib page for information on testing the touchscreen from userspace.
Interrupt
Check that the interrupt is registered.
root:~> grep ad7877 /proc/interrupts 258: 0 ad7877
In case you touch the surface and don't receive events, it's likely that something with your /DAV Interrupt is wrong.
check irq number in your platform device file
In case you get a message like: evtest: No such device
, it's likely that you have not install the necessary modules
Aux functions
Under the device folder there are auxiliary functions such as temperature, GPIO, DAC and ADC read backs and controls.
root:/sys/class/input/input2> cd device/ root:/sys/devices/platform/bfin-spi.0/spi0.2> ls -al drwxr-xr-x 3 root root 0 Jan 1 00:15 . drwxr-xr-x 4 root root 0 Jan 1 2007 .. -r--r--r-- 1 root root 4096 Jan 1 00:15 aux1 -r--r--r-- 1 root root 4096 Jan 1 00:15 aux2 -r--r--r-- 1 root root 4096 Jan 1 00:15 aux3 -r--r--r-- 1 root root 4096 Jan 1 00:15 bat1 -r--r--r-- 1 root root 4096 Jan 1 00:15 bat2 lrwxrwxrwx 1 root root 0 Jan 1 00:15 bus -> ../../../../bus/spi -rw-rw-r-- 1 root root 4096 Jan 1 00:15 dac -rw-rw-r-- 1 root root 4096 Jan 1 00:15 disable lrwxrwxrwx 1 root root 0 Jan 1 00:15 driver -> ../../../../bus/spi/drivers/ad7877 -rw-rw-r-- 1 root root 4096 Jan 1 00:15 gpio4 lrwxrwxrwx 1 root root 0 Jan 1 00:15 input:event2 -> ../../../../class/input/input2/event2 lrwxrwxrwx 1 root root 0 Jan 1 00:15 input:input2 -> ../../../../class/input/input2 -r--r--r-- 1 root root 4096 Jan 1 00:15 modalias drwxr-xr-x 2 root root 0 Jan 1 2007 power lrwxrwxrwx 1 root root 0 Jan 1 00:15 subsystem -> ../../../../bus/spi -r--r--r-- 1 root root 4096 Jan 1 00:15 temp1 -r--r--r-- 1 root root 4096 Jan 1 00:15 temp2 -rw-r--r-- 1 root root 4096 Jan 1 00:15 uevent root:/sys/devices/platform/bfin-spi.0/spi0.2> cat temp1 963 root:/sys/devices/platform/bfin-spi.0/spi0.2> cat temp1 960 root:/sys/devices/platform/bfin-spi.0/spi0.2> cat temp2 1167 root:/sys/devices/platform/bfin-spi.0/spi0.2> cat temp2 1167 root:/sys/devices/platform/bfin-spi.0/spi0.2> cat aux1 1929 root:/sys/devices/platform/bfin-spi.0/spi0.2> cat aux1 1929
More Information
- TSC2046低压输入/输出触摸屏控制器数据表
- TSC2046E低压输入/输出触摸屏控制器数据表
- 触摸屏控制器XPT2046数据手册下载 25次下载
- AN-753:配置AD7877
- AD7877:Touch Screen控制器数据Sheet
- AN-766:在AD7877上使用降噪功能
- 触摸屏控制器ADS7846的中文资料 22次下载
- 触摸屏控制器ADS7846的原理及应用 12次下载
- AN-738: 在Windows CE.NET下使用AD7877触摸屏控制器和Intel PXA250处理器
- Android的触摸屏进行校准的方法详细说明
- 触摸屏控制器ad7877数据表 2次下载
- XPT2046触摸屏控制器 19次下载
- 新一代TSC2046触摸屏控制器 10次下载
- 电阻式触摸屏控制器常见问题 0次下载
- 触摸屏控制器辅助输入的应用
- 电容触摸屏的分辨率怎么调 2062次阅读
- 电容触摸屏原理 电容触摸屏和电阻触摸屏有什么区别 5107次阅读
- 触摸屏系统中校准的简单易懂的说明 8340次阅读
- 基于EP7212处理器芯片实现LCD触摸屏控制器的应用方案 3229次阅读
- digilentArduino触摸屏叠加子板介绍 1734次阅读
- 基于I2C的嵌入式Linux多点触摸屏幕驱动系统设计 1238次阅读
- 基于触摸屏的LED驱动电路设计 4423次阅读
- 基于嵌入式linux系统下的AD7873触摸屏驱动系统设计详解 1706次阅读
- 一文详解工业触摸屏控制XPT7603 5895次阅读
- 触摸屏技术是谁发明的_触摸屏技术的发展历程 2.9w次阅读
- 触摸屏控制易能变频器方案 1w次阅读
- 技术干货:WinCE 7.0下的触摸屏驱动 3930次阅读
- 如何使用单片机去驱动控制触摸屏 1.2w次阅读
- PLC携手触摸屏控制系统的应用 6707次阅读
- 基于MeeGo的电容式触摸屏驱动设计 1393次阅读
下载排行
本周
- 1电子电路原理第七版PDF电子教材免费下载
- 0.00 MB | 1491次下载 | 免费
- 2单片机典型实例介绍
- 18.19 MB | 95次下载 | 1 积分
- 3S7-200PLC编程实例详细资料
- 1.17 MB | 27次下载 | 1 积分
- 4笔记本电脑主板的元件识别和讲解说明
- 4.28 MB | 18次下载 | 4 积分
- 5开关电源原理及各功能电路详解
- 0.38 MB | 11次下载 | 免费
- 6100W短波放大电路图
- 0.05 MB | 4次下载 | 3 积分
- 7基于单片机和 SG3525的程控开关电源设计
- 0.23 MB | 4次下载 | 免费
- 8基于AT89C2051/4051单片机编程器的实验
- 0.11 MB | 4次下载 | 免费
本月
- 1OrCAD10.5下载OrCAD10.5中文版软件
- 0.00 MB | 234313次下载 | 免费
- 2PADS 9.0 2009最新版 -下载
- 0.00 MB | 66304次下载 | 免费
- 3protel99下载protel99软件下载(中文版)
- 0.00 MB | 51209次下载 | 免费
- 4LabView 8.0 专业版下载 (3CD完整版)
- 0.00 MB | 51043次下载 | 免费
- 5555集成电路应用800例(新编版)
- 0.00 MB | 33562次下载 | 免费
- 6接口电路图大全
- 未知 | 30320次下载 | 免费
- 7Multisim 10下载Multisim 10 中文版
- 0.00 MB | 28588次下载 | 免费
- 8开关电源设计实例指南
- 未知 | 21539次下载 | 免费
总榜
- 1matlab软件下载入口
- 未知 | 935053次下载 | 免费
- 2protel99se软件下载(可英文版转中文版)
- 78.1 MB | 537793次下载 | 免费
- 3MATLAB 7.1 下载 (含软件介绍)
- 未知 | 420026次下载 | 免费
- 4OrCAD10.5下载OrCAD10.5中文版软件
- 0.00 MB | 234313次下载 | 免费
- 5Altium DXP2002下载入口
- 未知 | 233046次下载 | 免费
- 6电路仿真软件multisim 10.0免费下载
- 340992 | 191183次下载 | 免费
- 7十天学会AVR单片机与C语言视频教程 下载
- 158M | 183277次下载 | 免费
- 8proe5.0野火版下载(中文版免费下载)
- 未知 | 138039次下载 | 免费
评论