freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內容

觸摸屏實驗畢業(yè)設計論文)word格式-資料下載頁

2025-08-11 08:45本頁面
  

【正文】 conversiondefine PRSCEN_Enable 1 //prescaler Enabledefine PRSCVL 49 //A/D converter in processdefine SEL_MUX 7 // xpdefine STDBM_NORMAL 0 //normal modedefine STDBM_STANDBY 1 //Standby modedefine READ_START 0 //Disable start by read operationdefine ENABLE_START 0 //No operation/*ADC touch screen control register宏*/define YM_SEN_Hi_Z 0 //YM=HiZdefine YM_SEN_GND 1 //YM=GNDdefine YP_SEN_External_voltage 0 //YP=External voltagedefine YP_SEN_AIN5 1 //conntected with AIN5define XM_SEN_Hi_Z 0 define XM_SEN_GND 1define XP_SEN_External_voltage 0define xp_SEN_AIN7 1define PULL_UP_ENABLE 0 //ENABLEdefine PULL_UP_DISABLE 1 //DISABLEdefine AUTO_PST_Normal 0 //Normal ADC conversiondefine AUTO_PST_AUTO 1 //Auto(sequential) x/y positioin conversion modedefine XY_PST 0 //No operation modedefine XY_PST_INT 0x3 //waiting for interrupt Mode/*ADC start or interval delay register*/define DELAY /*ADC conversion data0 register*/define UPDOWN_DOWN_0 0define UPDOWN_UP_0 1define AUTO_PST_sequencing_0 1define XY_PST_0 0/*ADC conversion data1 register*/define UPDOWN_DOWN_1 0define UPDOWN_UP_1 1define AUTO_PST_sequencing_1 1define XY_PST_1 0define LCDWIDTH 320define LCDHEIGHT 240int TchScr_Xmin=200,TchScr_Xmax=580, TchScr_Ymin=700,TchScr_Ymax=800。 void TchScr_init(){ /*復用管腳功能定義*/ rGPGCON amp。= ~((0x03 30)|(0x03 28)|(0x03 26)|(0x03 24))。 rGPGCON|=(nYPON30)|(YMON28)|(nXPON26)|(XMON24)。 /*set ACDCON*/ rADCCON=(PRSCEN_Enable14)|(PRSCVL6)|(SEL_MUX3)。 /*ADC start or interval delay register*/ rADCDLY=0xff。 /*set ADC touch screen control register*/ rADCTSC = (08)|(17)|(16)|(05)|(14)|(03)|(02)|(3)。}define CLOCK_DELAY() do{int i。 for(i=0。 i20。 i++)。}while(0)void TchScr_GetScrXY(int *x, int *y){ int oldx,oldy。 rADCTSC|=(13)|(12)|(0)。 rADCCON|=1。 //CLOCK_DELAY()。 while(!(SUBSRCPNDamp。(110)))。 oldx=rADCDAT0amp。0x3ff。 oldy=rADCDAT1amp。0x3ff。 if(oldx!=0) { *x=oldx。 *y=oldy。 } rADCTSC = (08)|(17)|(16)|(05)|(14)|(03)|(02)|(3)。 SUBSRCPND|=(19)。 SUBSRCPND|=(110)。 //Uart_Printf(0,x=%d,\ty=%d\n,*x,*y)。 //rADCCON|=(12)。 /*unsigned int temp。 *x=(*xTchScr_Xmin)*LCDWIDTH/(TchScr_XmaxTchScr_Xmin)。 *y=(*yTchScr_Ymin)*LCDHEIGHT/(TchScr_YmaxTchScr_Ymin)。 */}//endif //鼠標功能的觸摸屏main函數(shù)include ../inc/include include inc/include uhal/pragma import(__use_no_semihosting_swi) // ensure no functions that use semihosting U32 TchScr_GetOSXY(int *x, int *y){//獲得觸摸點坐標并返回觸摸動作 static U32 mode=0。 static int oldx,oldy。 int i,j。 for(。){ if((mode!=TCHSCR_ACTION_DOWN) amp。amp。 (mode!=TCHSCR_ACTION_MOVE)){ if(!(rADCDAT0amp。(115))){//有觸摸動作 TchScr_GetScrXY(x, y)。//得到觸摸點坐標 oldx=*x。 oldy=*y。 for(i=0。i40。i++){ if(rADCDAT0amp。(115)){//抬起 break。 } hudelay(20)。 } if(i40){ //在規(guī)定的雙擊時間之內抬起,檢測是不是及時按下 for(i=0。i60。i++){ if(!(rADCDAT0amp。(115))){ SUBSRCPND|=(19)。 if (i10) {i=60。break。}//如果單擊后很短時間內按下,不視為雙擊 mode=TCHSCR_ACTION_DBCLICK。 for(j=0。j40。j++) hudelay(50)。//檢測到雙擊后延時,防止拖尾 break。 } hudelay(20)。 } if(i==60) //沒有在規(guī)定的時間內按下,視為單擊 mode=TCHSCR_ACTION_CLICK。 } else{ //沒有在規(guī)定的時間內抬起,視為按下 mode=TCHSCR_ACTION_DOWN。 } break。 } } else{ TchScr_GetScrXY(x, y)。//得到觸摸點坐標 if(rADCDAT0amp。(115)){ //抬起 mode=TCHSCR_ACTION_UP。 break。 } else{ if(ABS(oldx*x)25 ||ABS(oldy*y)25){//有移動動作 mode=TCHSCR_ACTION_MOVE。 break。 } } } hudelay(10)。 } oldx=*x。 oldy=*y。 return mode。}void TchScr_Test(){ U32 mode。 int x,y。 Uart_Printf(0,\nplease touch the screen\n)。 for(。){ mode=TchScr_GetOSXY(amp。x, amp。y)。 switch(mode){ case TCHSCR_ACTION_CLICK: Uart_Printf(0,Action=click:x=%d,\ty=%d\n,x,y)。 break。 case TCHSCR_ACTION_DBCLICK: Uart_Printf(0,Action=double click:x=%d,\ty=%d\n,x,y)。 break。 case TCHSCR_ACTION_DOWN: Uart_Printf(0,Action=down:x=%d,\ty=%d\n,x,y)。 break。 case TCHSCR_ACTION_UP: Uart_Printf(0,Action=up:x=%d,\ty=%d\n,x,y)。 break。 case TCHSCR_ACTION_MOVE: Uart_Printf(0,Action=move:x=%d,\ty=%d\n,x,y)。 break。 } hudelay(1000)。 }}///*****************事件定義*****************////////////////////////////////////////////////////////// Main function. //////////////////////////////////////////////////////int main(void){ ARMTargetInit()。 // do target (uHAL based ARM system) initialisation // TchScr_init()。 TchScr_Test()。} 還有部分的文件是s3c2410提供的。完成后就可以編譯、運行、測試了。
點擊復制文檔內容
高考資料相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1