资料介绍

Table of Contents
AD7873 Input Touch Screen Digitizer Linux Driver
Supported Devices
Description
The AD7843/AD7873 is a 12-bit successive-approximation ADC with a synchronous serial interface and low on resistance switches for driving touch screens. The parts operates from a single 2.2 V to 5.25 V power supply and features throughput rates greater than 125 kSPS. The external reference applied to the AD7843 can be varied from 1 V to +VCC, while the analog input range is from 0 V to VREF. The device includes a shutdown mode that reduces the current consumption to less than 1 µA.
The AD7873 is similar to the AD7843 but has added functionality such as an on-chip temperature sensor (-40°C to + 85°C), on-chip 2.5 V reference and direct battery and touch-pressure measurement.
See also: AD7877 Touchscreen Device Driver See also: AD7879 Touchscreen Device Driver
Configuration
Software configurable features
Source Code
Status
Files
| Function | File |
|---|---|
| driver | drivers/input/touchscreen/ads7846.c |
| include | include/linux/spi/ads7846.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/stamp.c:
#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) #includestatic struct bfin5xx_spi_chip ad7873_spi_chip_info = { .bits_per_word = 8, }; static int ads7873_get_pendown_state(void) { return gpio_get_value(GPIO_PF6); } static struct ads7846_platform_data __initdata ad7873_pdata = { .model = 7873, /* AD7873 */ .x_max = 0xfff, .y_max = 0xfff, .x_plate_ohms = 620, .debounce_max = 1, .debounce_rep = 0, .debounce_tol = (~0), .get_pendown_state = ads7873_get_pendown_state, }; #endif
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
static struct spi_board_info bfin_spi_board_info[] __initdata = { #if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) { .modalias = "ads7846", .max_speed_hz = 2000000, /* max spi clock (SCK) speed in HZ */ .bus_num = 0, .irq = IRQ_PF6, .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */ .controller_data = &ad7873_spi_chip_info, /* needed only on Blackfin */ .platform_data = &ad7873_pdata, .mode = SPI_MODE_0, }, #endif };
Adding Linux driver support
Configure kernel with “make menuconfig” (alternatively use “make xconfig” or “make qconfig”)
The AD7873 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
Driver testing
Driver compiled as a module
root:~> modprobe evdev root:~> modprobe ads7846 ads7846 spi0.18: touchscreen, irq 56 input: ADS7873 Touchscreen as /devices/platform/bfin-spi.0/spi0.18/input/input0
Driver compiled into the kernel
Your kernel startup messages should include something like this
ads7846 spi0.18: touchscreen, irq 56 input: ADS7873 Touchscreen as /devices/platform/bfin-spi.0/spi0.18/input/input0
Checking for proper installation
After the kernel boot your device folder should include at least one device node for the touchscreen
root:/> ls -al /dev/input/ drw-r--r-- 2 root root 0 Jan 1 00:03 . drwxr-xr-x 5 root root 0 Jan 1 00:03 .. crw-rw-r-- 1 root root 13, 64 Jan 1 00:03 event0 root:/>
Check that the interrupt is registered.
root:~> cat /proc/interrupts | grep ads7846 56: 16 GPIO ads7846
root:~> cat /sys/class/input/input0/name ADS7873 Touchscreen
Use the event_test utility to test proper function
root:/> event_test /dev/input/event0
Input driver version is 1.0.0
Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0
Input device name: "ADS7873 Touchscreen"
Supported events:
Event type 0 (Reset)
Event code 0 (Reset)
Event code 1 (Key)
Event code 3 (Absolute)
Event type 1 (Key)
Event type 3 (Absolute)
Event code 0 (X)
Value 760
Min 0
Max 4095
Event code 1 (Y)
Value 1973
Min 0
Max 4095
Event code 24 (Pressure)
Value 0
Min 0
Max 0
Testing ... (interrupt to exit)
Event: time 258292.823196, type 1 (Key), code 330 (Touch), value 1
Event: time 258292.823209, type 3 (Absolute), code 0 (X), value 776
Event: time 258292.823214, type 3 (Absolute), code 1 (Y), value 505
Event: time 258292.823220, type 3 (Absolute), code 24 (Pressure), value 491
Event: time 258292.823225, type 0 (Reset), code 0 (Reset), value 0
Event: time 258292.828643, type 3 (Absolute), code 0 (X), value 789
Event: time 258292.828653, type 3 (Absolute), code 1 (Y), value 489
Event: time 258292.828659, type 3 (Absolute), code 24 (Pressure), value 485
Event: time 258292.828664, type 0 (Reset), code 0 (Reset), value 0
Event: time 258292.834085, type 3 (Absolute), code 0 (X), value 790
Event: time 258292.834095, type 3 (Absolute), code 1 (Y), value 499
Event: time 258292.834101, type 3 (Absolute), code 24 (Pressure), value 482
Event: time 258292.834106, type 0 (Reset), code 0 (Reset), value 0
Event: time 258292.839527, type 3 (Absolute), code 0 (X), value 789
Event: time 258292.839538, type 3 (Absolute), code 1 (Y), value 502
Event: time 258292.839544, type 3 (Absolute), code 24 (Pressure), value 481
Event: time 258292.839549, type 0 (Reset), code 0 (Reset), value 0
In case you touch the surface and don't receive events, it's likely that something with your /PENIRQ Interrupt is wrong.
check irq number in your platform device file
More Information
扫码添加小助手
加入工程师交流群
- 信捷触摸屏实验程序 3次下载
- 4.3寸RGBLCD电容触摸屏模块ATK用户手册 13次下载
- AD7873:Touch Screen Digitizer数据Sheet
- AD7877输入触摸屏控制器Linux驱动
- UG-062:AD7843/AD7873电阻式触摸屏控制器评估板
- 触摸屏界面通用设计原则研究 26次下载
- 迪文DMT80480C070 15WT DGUS串口屏触摸屏的数据手册免费下载 41次下载
- Android的触摸屏进行校准的方法详细说明
- 如何提高触摸屏在Android系统上的稳定性和整体性能 14次下载
- AD7873触摸屏数字化数据表 3次下载
- 基于有限状态机的Linux多点触摸屏驱动设计刘斌 0次下载
- 触摸屏应用集锦 0次下载
- 触摸屏控制器辅助输入的应用
- 嵌入式Linux触摸屏在漆包线检测系统中的应用
- 嵌入式Linux下一种新的触摸屏定标方法的研究
- 手机触摸屏失灵的原因及解决方法 手机触摸屏失灵怎么关机 3w次阅读
- 电容触摸屏原理 电容触摸屏和电阻触摸屏有什么区别 8.6k次阅读
- 电阻式触摸屏控制器ADCAD7873应对 2.3k次阅读
- 电容式触摸屏参数_电容式触摸屏分类 1.7w次阅读
- 多点触摸屏是什么意思_多点触摸屏原理 1.8w次阅读
- 电阻触摸屏和电容触摸屏哪个更具有优势 1.6w次阅读
- 基于触摸屏的LED驱动电路设计 5.1k次阅读
- 基于嵌入式linux系统下的AD7873触摸屏驱动系统设计详解 2.1k次阅读
- 一文看懂三菱触摸屏型号价格与选择技巧 2.2w次阅读
- 一文看懂触摸屏和显示屏的区别 10.1w次阅读
- 电阻触摸屏的校准算法 2w次阅读
- 电阻式触摸屏校准算法的优化_电阻式触摸屏工作原理 1.2w次阅读
- 触摸屏技术是谁发明的_触摸屏技术的发展历程 3.1w次阅读
- 基于MeeGo的电容式触摸屏驱动设计 1.6k次阅读
- 触摸屏之电阻屏、电容屏详解 4.6k次阅读
下载排行
本周
- 1新一代网络可视化(NPB 2.0)
- 3.40 MB | 1次下载 | 免费
- 2MDD品牌三极管MMBT3906数据手册
- 2.33 MB | 次下载 | 免费
- 3MDD品牌三极管S9012数据手册
- 2.62 MB | 次下载 | 免费
- 4联想flex2-14D/15D说明书
- 4.92 MB | 次下载 | 免费
- 5收音环绕扩音机 AVR-1507手册
- 2.50 MB | 次下载 | 免费
- 624Pin Type-C连接器设计报告
- 1.06 MB | 次下载 | 免费
- 7MS1000TA 超声波测量模拟前端芯片技术手册
- 0.60 MB | 次下载 | 免费
- 8MS1022高精度时间测量(TDC)电路数据手册
- 1.81 MB | 次下载 | 免费
本月
- 1爱华AIWA HS-J202维修手册
- 3.34 MB | 37次下载 | 免费
- 2PC5502负载均流控制电路数据手册
- 1.63 MB | 23次下载 | 免费
- 3NB-IoT芯片厂商的资料说明
- 0.31 MB | 22次下载 | 1 积分
- 4H110主板CPU PWM芯片ISL95858HRZ-T核心供电电路图资料
- 0.63 MB | 6次下载 | 1 积分
- 5UWB653Pro USB口测距通信定位模块规格书
- 838.47 KB | 5次下载 | 免费
- 6技嘉H110主板IT8628E_BX IO电路图资料
- 2.61 MB | 4次下载 | 1 积分
- 7苏泊尔DCL6907(即CHK-S007)单芯片电磁炉原理图资料
- 0.04 MB | 4次下载 | 1 积分
- 8100W准谐振反激式恒流电源电路图资料
- 0.09 MB | 2次下载 | 1 积分
总榜
- 1matlab软件下载入口
- 未知 | 935137次下载 | 10 积分
- 2开源硬件-PMP21529.1-4 开关降压/升压双向直流/直流转换器 PCB layout 设计
- 1.48MB | 420064次下载 | 10 积分
- 3Altium DXP2002下载入口
- 未知 | 233089次下载 | 10 积分
- 4电路仿真软件multisim 10.0免费下载
- 340992 | 191439次下载 | 10 积分
- 5十天学会AVR单片机与C语言视频教程 下载
- 158M | 183353次下载 | 10 积分
- 6labview8.5下载
- 未知 | 81602次下载 | 10 积分
- 7Keil工具MDK-Arm免费下载
- 0.02 MB | 73822次下载 | 10 积分
- 8LabVIEW 8.6下载
- 未知 | 65991次下载 | 10 积分
电子发烧友App





创作
发文章
发帖
提问
发资料
发视频

上传资料赚积分
评论