欢迎来到天天文库
浏览记录
ID:61515610
大小:586.00 KB
页数:8页
时间:2021-02-09
《触摸屏驱动开发文档.doc》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、S3C2410TouchScreenDriver实验平台:北京博创科技的up-star2410开发板,此开发板带有四线的电阻式触摸屏实验目的:编写能在up-star2410开发板上运行的触摸屏驱动程序并测试,采用最原始的字符设备驱动模式。实验原理分析:⑴硬件上分析:①开发板上触摸屏接口分析在开发板的硬件原理图上我们可以看到触摸屏的四个接口(XP,XM,YP,YM)是通过LCD槽引出的,如图1所示,图1开发板LCD槽触摸屏接口开发板通过这四个引脚来和触摸屏硬件相连,触摸屏的控制器和相关寄存器是集成在ARM920TCPU内部的。②s3c2410datasheet关于触摸屏的描述
2、s3c2410A是具有8通道模拟输入的10位CMOS模数转换器(ADC)。图2是cpu内部有关ADC和触摸屏接口的图。图2ADC和触摸屏结构①触摸屏接口举例(也是up-star2410开发板采用的连接方式)AIN[7]连接触摸屏的X+引脚,而AIN[5]则连接触摸屏的Y+引脚。要控制触摸屏的引脚(Y+,X+,Y-,X-),就要用4个晶体管,并采用控制信号nYPON,YMON,nXPON,XMON来控制触摸屏的打开和关闭。图3是典型的连接方式图3触摸屏的典型连接图①触摸屏工作模式1.NormalConversionModeNormalConversionMode(AUTO_P
3、ST=0,XY_PST=0)isgenerallyusedforGeneralPurposeADCConversion.ThismodecanbeinitializedbysettingtheADCCONandADCTSCandcompletedwithareadtheXPDATA(NormalADC)valueofADCDAT0(ADCDataRegister0).2.SeparateX/YPositionConversionModeSeparateX/YPositionConversionModeisconsistoftwoConversionModes:X-Posit
4、ionModeandY-PositionMode.Thefirstmodeisoperatedinthefollowingway:X-PositionMode(AUTO_PST=0andXY_PST=1)writesX-positionconversiondatatoXPDATAofADCDAT0register.Afterconversion,TheTouchScreenInterfacegeneratestheInterruptsource(INT_ADC)toInterruptController.Y-PositionMode(AUTO_PST=0andXY_PST=
5、2)writesY-positionconversiondatatoYPDATAofADCDAT1.Aftertheconversion,theTouchScreenInterfacealsogeneratestheInterruptsource(INT_ADC)toInterruptController3.Auto(Sequential)X/YPositionConversionMode.Auto(Sequential)X/YPositionConversionMode(AUTO_PST=1andXY_PST=0)isoperatedinthefollowingway:T
6、heTouchScreenControllerautomaticallyconvertsX-positionandY-position.TheTouchScreenControllerwritesX-measurementdatatoXPDATAofADCDAT0,andthenwritesY-measurementdatatoYPDATAofADCDAT1.AfterAuto(Sequential)PositionConversion,TheTouchScreenControllergeneratesInterruptsource(INT_ADC)toInterruptC
7、ontroller.4.WaitingforInterruptMode.WhenTouchScreenControllerisinWaitingforInterruptMode,itwaitsforStylusdown.ThecontrollergeneratesInterrupt(INT_TC)signalswhentheStylusisdownonTouchScreenPanel.Afteraninterruptoccurs,XandYpositioncanbereadbytheproperconversion
此文档下载收益归作者所有