資料介紹
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
- 信捷觸摸屏實驗程序 2次下載
- 4.3寸RGBLCD電容觸摸屏模塊ATK用戶手冊 13次下載
- AD7873:Touch Screen Digitizer數(shù)據(jù)Sheet
- AD7877輸入觸摸屏控制器Linux驅(qū)動
- UG-062:AD7843/AD7873電阻式觸摸屏控制器評估板
- 觸摸屏界面通用設(shè)計原則研究 26次下載
- 迪文DMT80480C070 15WT DGUS串口屏觸摸屏的數(shù)據(jù)手冊免費下載 32次下載
- Android的觸摸屏進(jìn)行校準(zhǔn)的方法詳細(xì)說明
- 如何提高觸摸屏在Android系統(tǒng)上的穩(wěn)定性和整體性能 14次下載
- AD7873觸摸屏數(shù)字化數(shù)據(jù)表 3次下載
- 基于有限狀態(tài)機(jī)的Linux多點觸摸屏驅(qū)動設(shè)計劉斌 0次下載
- 觸摸屏應(yīng)用集錦 0次下載
- 觸摸屏控制器輔助輸入的應(yīng)用
- 嵌入式Linux觸摸屏在漆包線檢測系統(tǒng)中的應(yīng)用
- 嵌入式Linux下一種新的觸摸屏定標(biāo)方法的研究
- 手機(jī)觸摸屏失靈的原因及解決方法 手機(jī)觸摸屏失靈怎么關(guān)機(jī) 1.7w次閱讀
- 電容觸摸屏原理 電容觸摸屏和電阻觸摸屏有什么區(qū)別 2822次閱讀
- 電阻式觸摸屏控制器ADCAD7873應(yīng)對 1234次閱讀
- 電容式觸摸屏參數(shù)_電容式觸摸屏分類 1.3w次閱讀
- 多點觸摸屏是什么意思_多點觸摸屏原理 1.3w次閱讀
- 電阻觸摸屏和電容觸摸屏哪個更具有優(yōu)勢 1.5w次閱讀
- 基于觸摸屏的LED驅(qū)動電路設(shè)計 4168次閱讀
- 基于嵌入式linux系統(tǒng)下的AD7873觸摸屏驅(qū)動系統(tǒng)設(shè)計詳解 1613次閱讀
- 一文看懂三菱觸摸屏型號價格與選擇技巧 1.9w次閱讀
- 一文看懂觸摸屏和顯示屏的區(qū)別 8.9w次閱讀
- 電阻觸摸屏的校準(zhǔn)算法 1.8w次閱讀
- 電阻式觸摸屏校準(zhǔn)算法的優(yōu)化_電阻式觸摸屏工作原理 9509次閱讀
- 觸摸屏技術(shù)是誰發(fā)明的_觸摸屏技術(shù)的發(fā)展歷程 2.8w次閱讀
- 基于MeeGo的電容式觸摸屏驅(qū)動設(shè)計 1313次閱讀
- 觸摸屏之電阻屏、電容屏詳解 4068次閱讀
下載排行
本周
- 1電子電路原理第七版PDF電子教材免費下載
- 0.00 MB | 1491次下載 | 免費
- 2單片機(jī)典型實例介紹
- 18.19 MB | 95次下載 | 1 積分
- 3S7-200PLC編程實例詳細(xì)資料
- 1.17 MB | 27次下載 | 1 積分
- 4筆記本電腦主板的元件識別和講解說明
- 4.28 MB | 18次下載 | 4 積分
- 5開關(guān)電源原理及各功能電路詳解
- 0.38 MB | 11次下載 | 免費
- 6100W短波放大電路圖
- 0.05 MB | 4次下載 | 3 積分
- 7基于單片機(jī)和 SG3525的程控開關(guān)電源設(shè)計
- 0.23 MB | 4次下載 | 免費
- 8基于AT89C2051/4051單片機(jī)編程器的實驗
- 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 專業(yè)版下載 (3CD完整版)
- 0.00 MB | 51043次下載 | 免費
- 5555集成電路應(yīng)用800例(新編版)
- 0.00 MB | 33562次下載 | 免費
- 6接口電路圖大全
- 未知 | 30320次下載 | 免費
- 7Multisim 10下載Multisim 10 中文版
- 0.00 MB | 28588次下載 | 免費
- 8開關(guān)電源設(shè)計實例指南
- 未知 | 21539次下載 | 免費
總榜
- 1matlab軟件下載入口
- 未知 | 935053次下載 | 免費
- 2protel99se軟件下載(可英文版轉(zhuǎn)中文版)
- 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十天學(xué)會AVR單片機(jī)與C語言視頻教程 下載
- 158M | 183277次下載 | 免費
- 8proe5.0野火版下載(中文版免費下載)
- 未知 | 138039次下載 | 免費
評論
查看更多