当前位置: 首页 > news >正文

招生网站模版南昌网站开发培训学校

招生网站模版,南昌网站开发培训学校,寻找郑州网站建设公司,整合营销理论一、整体调试思路 tp外设属于比较常见且比较简单的外设,今天以ti,tsc2046这款为例简述下tp外设的调试。 整体思路 1、配置设备树----驱动调试的device部分 2、tp驱动编译及匹配—driver部分 3、驱动整体调试 二、配置设备树 对于ti,tsc2046我们可以参考内核Docum…

一、整体调试思路

tp外设属于比较常见且比较简单的外设,今天以ti,tsc2046这款为例简述下tp外设的调试。
整体思路
1、配置设备树----驱动调试的device部分
2、tp驱动编译及匹配—driver部分
3、驱动整体调试

二、配置设备树

对于ti,tsc2046我们可以参考内核Documentation/devicetree/bindings/input/ads7846.txt
内核文档还是讲的比较详细,必选参数可选参数以及各个参数的含义都有讲到,可以参考。

Device tree bindings for TI's ADS7843, ADS7845, ADS7846, ADS7873, TSC2046
SPI driven touch screen controllers.The node for this driver must be a child node of a SPI controller, hence
all mandatory properties described inDocumentation/devicetree/bindings/spi/spi-bus.txtmust be specified.Additional required properties:compatible		Must be one of the following, depending on themodel:"ti,tsc2046""ti,ads7843""ti,ads7845""ti,ads7846""ti,ads7873"interrupt-parentinterrupts		An interrupt node describing the IRQ line the chip's!PENIRQ pin is connected to.vcc-supply		A regulator node for the supply voltage.Optional properties:ti,vref-delay-usecs		vref supply delay in usecs, 0 forexternal vref (u16).ti,vref-mv			The VREF voltage, in millivolts (u16).Set to 0 to use internal references(ADS7846).ti,keep-vref-on			set to keep vref on for differentialmeasurements as wellti,swap-xy			swap x and y axisti,settle-delay-usec		Settling time of the analog signals;a function of Vcc and the capacitanceon the X/Y drivers.  If set to non-zero,two samples are taken with settle_delayus apart, and the second one is used.~150 uSec with 0.01uF caps (u16).ti,penirq-recheck-delay-usecs	If set to non-zero, after samples aretaken this delay is applied and penirqis rechecked, to help avoid falseevents.  This value is affected by thematerial used to build the touch layer(u16).ti,x-plate-ohms			Resistance of the X-plate,in Ohms (u16).ti,y-plate-ohms			Resistance of the Y-plate,in Ohms (u16).ti,x-min			Minimum value on the X axis (u16).ti,y-min			Minimum value on the Y axis (u16).ti,x-max			Maximum value on the X axis (u16).ti,y-max			Minimum value on the Y axis (u16).ti,pressure-min			Minimum reported pressure value(threshold) - u16.ti,pressure-max			Maximum reported pressure value (u16).ti,debounce-max			Max number of additional readings persample (u16).ti,debounce-tol			Tolerance used for filtering (u16).ti,debounce-rep			Additional consecutive good readingsrequired after the first two (u16).ti,pendown-gpio-debounce	Platform specific debounce time for thependown-gpio (u32).pendown-gpio			GPIO handle describing the pin the !PENIRQline is connected to.wakeup-source			use any event on touchscreen as wakeup event.(Legacy property support: "linux,wakeup")Example for a TSC2046 chip connected to an McSPI controller of an OMAP SoC::spi_controller {tsc2046@0 {reg = <0>;	/* CS0 */compatible = "ti,tsc2046";interrupt-parent = <&gpio1>;interrupts = <8 0>;	/* BOOT6 / GPIO 8 */spi-max-frequency = <1000000>;pendown-gpio = <&gpio1 8 0>;vcc-supply = <&reg_vcc3>;ti,x-min = /bits/ 16 <0>;ti,x-max = /bits/ 16 <8000>;ti,y-min = /bits/ 16 <0>;ti,y-max = /bits/ 16 <4800>;ti,x-plate-ohms = /bits/ 16 <40>;ti,pressure-max = /bits/ 16 <255>;wakeup-source;};};

这里需要注意的是,这是一款SPI总线的TP,所以对应设备树节点必选在SPI设备树目录下,如下图:

	spi_1: spi@78b5000 { compatible = "qcom,spi-qup-v2";#address-cells = <1>;#size-cells = <0>;reg-names = "spi_physical", "spi_bam_physical";reg = <0x78b5000 0x600>,<0x7884000 0x2b000>;interrupt-names = "spi_irq", "spi_bam_irq";interrupts = <0 95 0>, <0 238 0>;spi-max-frequency = <19200000>;pinctrl-names = "spi_default", "spi_sleep";pinctrl-0 = <&spi1_default &spi1_cs0_active>;pinctrl-1 = <&spi1_sleep &spi1_cs0_sleep>;clocks = <&clock_gcc clk_gcc_blsp1_ahb_clk>,<&clock_gcc clk_gcc_blsp1_qup1_spi_apps_clk>;clock-names = "iface_clk", "core_clk";qcom,infinite-mode = <0>;qcom,use-bam;qcom,use-pinctrl;qcom,ver-reg-exists;qcom,bam-consumer-pipe-index = <12>;qcom,bam-producer-pipe-index = <13>;qcom,master-id = <86>;tsc2046@0 {reg = <0>;	/* CS0 */compatible = "ti,tsc2046";interrupt-parent = <&tlmm_pinmux>;interrupts = <29 0x2>;	/* GPIO 29 */spi-max-frequency = <2000000>;pendown-gpio = <&tlmm_pinmux 29 0x02>;//vcc-supply = <&reg_vcc3>;ti,x-min = /bits/ 16 <0>;ti,x-max = /bits/ 16 <8000>;ti,y-min = /bits/ 16 <0>;ti,y-max = /bits/ 16 <4800>;ti,x-plate-ohms = /bits/ 16 <40>;ti,pressure-max = /bits/ 16 <255>;wakeup-source;};};

三、tp驱动编译及匹配

我们使用的驱动为内核原生驱动drivers/input/touchscreen/ads7846.c。
关于编译的问题我们需要从ads7846.c所在目录一层一层往上去看Makefile文件,保证ads7846.c参与到编译中来,我们注意到需要打开2个宏才可以,如下图:

CONFIG_TOUCHSCREEN_ADS7846=y
CONFIG_INPUT_TOUCHSCREEN=y

不同平台内核宏配置文件位置不一样,但是编译之后顶层会生成.config文件,我们可以查看对应的宏是否有修改,另外可以看编译目录有没有ads7846.o这些都是一些辅助判断技巧。
另外关于匹配问题我们可以看到驱动文件与设备树都函数compatible = “ti,tsc2046”,所以理论上只要SPI没有问题(SPI是基础),就会正常匹配,我们也可以在驱动文件probe函数中添加打印以辅助判断或者阅读代码通过驱动文件所建立的节点以及对应打印进行判断。

四、驱动整体调试

经过上面几步,如果一帆风顺的话可以看到/dev/input下面会产生新的event节点,使用手指点击TP,然后查看有无数值变化,如下图我们点击发现event可以正常上报且有变化产生,证明驱动整体是ok。
tp上报事件
驱动我们使用原生的,很多参数可能需要根据实际tp厂商的进行调整及优化,另外刚才也说了一帆风顺的时候可以走到第4步,大概率第一步是走不到第4步的,我们需要排查的重点有以下几点:
1、tp硬件是否ok
2、平台的spi是否ok,使用示波器配合spi测试程序验证总线是否有clk
3、tp的中断是否可以正常收到
4、软件层面节点是否出来,驱动probe是否正常完整的处理完
5、有节点但是上报不对,说明驱动匹配基本没有问题大概率还是1~3的问题,继续重点排查。

http://www.yayakq.cn/news/96979/

相关文章:

  • 福州市建设局职改办门户网站可以看图片的地图什么软件
  • 网络营销知识做搜狗网站优化
  • 河南有名的做网站公司wordpress 发布视频
  • 旅行社网站开发天津企业展厅设计公司
  • 奉新网站制作个人博客建站wordpress
  • 网站模板加后台宝安网站优化
  • 免费建站微信js常用网页特效
  • 哪个网站可以做教师招聘题目新开传奇最大网站999
  • 网站建设运维情况自查报告仿快法务网站开发模板
  • 包头网站建设推广手机淘宝客网站怎么做的
  • 高端网站建设公司成都欧派全屋定制联系电话
  • 长春火车站到龙嘉机场怎么走wordpress 手机 模板制作
  • 中国最好的网络营销公司网站排名优化在线培训
  • 响应式手机网站怎么做个人网站可以做什么
  • 西宁建设网站企业网站网络推广
  • 做器材的网站梓潼县住房和城乡建设局网站
  • 淘宝客必须做网站吗网络营销工程师
  • 张家港做网站收费标准怎么样做团购网站
  • 网站建设论文html格式建设网站的准备工作分为
  • 点瑞网络网站建设机械加工网上接单流程
  • 网文网站开发方案如何进行网上品牌建设
  • 网站防止机器注册应用公园收费标准
  • 网站开发评分标准wordpress国外主题安装
  • 营销型类型网站多少钱些诺尔诺达网站建设
  • 阿里云服务器怎么发布网站运营和广告投放的区别
  • 企业网站建设可行性做英语翻译赚钱的网站
  • 东莞网站开发培训哪里有企业建设网站的资金策划
  • 展示型网站建设的建议怎么给公司做微网站
  • 中企动力网站建设方案手机网站格局
  • 六安网站建设六安小程序赚钱吗