色哟哟视频在线观看-色哟哟视频在线-色哟哟欧美15最新在线-色哟哟免费在线观看-国产l精品国产亚洲区在线观看-国产l精品国产亚洲区久久

電子發燒友App

硬聲App

0
  • 聊天消息
  • 系統消息
  • 評論與回復
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術視頻
  • 寫文章/發帖/加入社區
會員中心
創作中心

完善資料讓更多小伙伴認識你,還能領取20積分哦,立即完善>

3天內不再提示
電子發燒友網>電子資料下載>類型>參考設計>AD7877輸入觸摸屏控制器Linux驅動

AD7877輸入觸摸屏控制器Linux驅動

2021-04-20 | pdf | 246.0KB | 次下載 | 2積分

資料介紹

This version (11 Feb 2016 21:11) was approved by Lars-Peter Clausen.The Previously approved version (05 Sep 2012 14:11) is available.Diff

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

Source Mainlined?
git Yes

Files

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.

21 Oct 2010 16:10

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

21 Oct 2010 16:10

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

下載該資料的人也在下載 下載該資料的人還在閱讀
更多 >

評論

查看更多

下載排行

本周

  1. 1AN-1267: 使用ADSP-CM408F ADC控制器的電機控制反饋采樣時序
  2. 1.41MB   |  3次下載  |  免費
  3. 2AN158 GD32VW553 Wi-Fi開發指南
  4. 1.51MB   |  2次下載  |  免費
  5. 3AN148 GD32VW553射頻硬件開發指南
  6. 2.07MB   |  1次下載  |  免費
  7. 4AN-1154: 采用恒定負滲漏電流優化ADF4157和ADF4158 PLL的相位噪聲和雜散性能
  8. 199.28KB   |  次下載  |  免費
  9. 5AN-960: RS-485/RS-422電路實施指南
  10. 380.8KB   |  次下載  |  免費
  11. 6EE-249:使用VisualDSP在ADSP-218x DSP上實現軟件疊加
  12. 60.02KB   |  次下載  |  免費
  13. 7AN-1111: 使用ADuCM360/ADuCM361時的降低功耗選項
  14. 306.09KB   |  次下載  |  免費
  15. 8AN-904: ADuC7028評估板參考指南
  16. 815.82KB   |  次下載  |  免費

本月

  1. 1ADI高性能電源管理解決方案
  2. 2.43 MB   |  450次下載  |  免費
  3. 2免費開源CC3D飛控資料(電路圖&PCB源文件、BOM、
  4. 5.67 MB   |  138次下載  |  1 積分
  5. 3基于STM32單片機智能手環心率計步器體溫顯示設計
  6. 0.10 MB   |  130次下載  |  免費
  7. 4使用單片機實現七人表決器的程序和仿真資料免費下載
  8. 2.96 MB   |  44次下載  |  免費
  9. 5美的電磁爐維修手冊大全
  10. 1.56 MB   |  24次下載  |  5 積分
  11. 6如何正確測試電源的紋波
  12. 0.36 MB   |  18次下載  |  免費
  13. 7感應筆電路圖
  14. 0.06 MB   |  10次下載  |  免費
  15. 8萬用表UT58A原理圖
  16. 0.09 MB   |  9次下載  |  5 積分

總榜

  1. 1matlab軟件下載入口
  2. 未知  |  935121次下載  |  10 積分
  3. 2開源硬件-PMP21529.1-4 開關降壓/升壓雙向直流/直流轉換器 PCB layout 設計
  4. 1.48MB  |  420062次下載  |  10 積分
  5. 3Altium DXP2002下載入口
  6. 未知  |  233088次下載  |  10 積分
  7. 4電路仿真軟件multisim 10.0免費下載
  8. 340992  |  191367次下載  |  10 積分
  9. 5十天學會AVR單片機與C語言視頻教程 下載
  10. 158M  |  183335次下載  |  10 積分
  11. 6labview8.5下載
  12. 未知  |  81581次下載  |  10 積分
  13. 7Keil工具MDK-Arm免費下載
  14. 0.02 MB  |  73810次下載  |  10 積分
  15. 8LabVIEW 8.6下載
  16. 未知  |  65988次下載  |  10 積分
主站蜘蛛池模板: 回复术士勇者免费观看全集 | 亚洲日韩天堂在线中文字幕 | 久久精品天天爽夜夜爽 | 日本三区四区免费高清不卡 | 羞羞漫画在线播放 | 精品午夜中文字幕熟女人妻在线 | 黑人开嫩苞 | 一本久道久久综合婷婷五月 | 福利社的阿姨 | 老师破女学生特级毛片 | 中文无码乱人伦中文视频播放 | 99re5久久热在线 | 国产精品青草久久福利不卡 | 国产免费阿v精品视频网址 国产免费69成人精品视频 | 我的家庭女教师 | 国产性夜夜性夜夜爽91 | av天堂影音先锋在线 | 亚洲综合中文 | 国产成人精品三级在线 | 久久综合丁香激情久久 | 2020国产成人精品免费视频 | xxxxxl荷兰 | 亚洲精品高清AV在线播放 | 亚洲精品久久AV无码蜜桃 | xxx日本免费| 美女内射视频WWW网站午夜 | 午夜国产羞羞视频免费网站 | 国产乱码免费卡1卡二卡3卡四卡 | 最新国产在线视频在线 | 捏揉舔水插按摩师 | 69精品人妻一区二区三区蜜桃 | 国产一区二区三区国产精品 | 40岁东北老阿姨无码 | 亚洲免费人成在线视频观看 | 国产精品福利电影 | 国产精品无码中文在线AV | 色中色入口2015 | 国产在线一区二区三区四区 | 伊人网中文字幕 | [高清无码] 波多野结衣| 青青草原社区 |