亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? combi.c

?? V44BoII試驗(yàn)板usb接口鼠標(biāo)驅(qū)動(dòng)源代碼
?? C
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
		return;
	}
    XmtBuff.bLength = 1;								//set length of protocol
    XmtBuff.p=&DeviceStatus.bProtocol;					//aim XmtBuff at it
    USB_control_read();									//initiate transfer
}


/*
**
** FUNCTION:		GetConfiguration
**
** PURPOSE:			Implements the Get Configuration command
**
** PARAMETERS:		none
**
** DESCRIPTION:	 
**					This routine is entered whenever a Get Configuration Request is received.
**					
*/

void GetConfiguration(void)
{
 	if (ENDPOINT_A0_FIFO[USB_bmRequestType] != DEVICE_TO_HOST | STANDARD | DEVICE)
	{
		SET_EP0_MODE(USB_MODE_STALL_IN_OUT);
		return;
	}
	XmtBuff.bLength = 1;								//configuration is 1-byte long
    XmtBuff.p=&DeviceStatus.bConfiguration;				//point at it
    USB_control_read();									//initiate transfer
}


/*
**
** FUNCTION:		USB_Stall_In_Out
**
** PURPOSE:			sets the SIE mode to stall IN/OUT packets on endpoint 0
**
** PARAMETERS:		none
**
** DESCRIPTION:	 
**					
**					
*/

void USB_Stall_In_Out(void)
{
    SET_EP0_MODE(USB_MODE_STALL_IN_OUT);
}



#pragma memory ORG @ 0x880

const void (* StandardFunctionTable[])(void)= 
{
   GetStatus,ClearFeature,USB_Stall_In_Out,SetFeature,
   USB_Stall_In_Out,SetAddress,GetDescriptor,USB_Stall_In_Out,
   GetConfiguration,SetConfiguration,GetStatus
};
/*
** define a lookup table of function pointers to class requests
*/
const void (* ClassFunctionTable[])(void)= 
{
  USB_Stall_In_Out, GetReport, GetIdle,GetProtocol,
  USB_Stall_In_Out, USB_Stall_In_Out, USB_Stall_In_Out,USB_Stall_In_Out,
  USB_Stall_In_Out, USB_Stall_In_Out, SetIdle,SetProtocol
};


/*
**
** FUNCTION:		HandleSetup
**
** PURPOSE:			Services Setup packets 
**
** PARAMETERS:		none
**
** DESCRIPTION:	 
**					This routine is entered whenever an SETUP packet has come in on endpoint 0.
**					it performss some preliminary validation on the packet, then
**					parses the packet and calls the appropriate routine to handle the packet.
**					
*/

void HandleSetup(void)

{
	EP_A0_MODE = USB_MODE_NAK_IN_OUT;						//unlock mode register
	/*
	** Setups are always 10 bytes, with DATAVALID = 1 and DATATOGGLE = 0
	*/
	if ( (EP_A0_COUNTER & (DATAVALID | DATATOGGLE | COUNT_MASK)) ==
		  (DATAVALID | 10))
	{
		if (ENDPOINT_A0_FIFO[USB_bmRequestType] & CLASS)
		{	
								
			if (ENDPOINT_A0_FIFO[USB_bRequest] <= USB_SET_PROTOCOL)				//class request, use class table
			{
				(*ClassFunctionTable[ENDPOINT_A0_FIFO[USB_bRequest]])();
				return;
			}
		}
		else
		{
			if (ENDPOINT_A0_FIFO[USB_bRequest] <= USB_GET_INTERFACE)			//standard request, use standard table
			{
				(*StandardFunctionTable[ENDPOINT_A0_FIFO[USB_bRequest]])();
				return;
			}
		}
	}
	SET_EP0_MODE(USB_MODE_STALL_IN_OUT);										//invalid request, stall
}


//**************************************************************************************8
//PS2 routines

/*
**
** FUNCTION:		ps2main
**
** PURPOSE:			main processing loop for PS/2 
**
** PARAMETERS:		none
**
** DESCRIPTION:	 
**					ps2main spins in an infinite loop waiting for an event that needs servicing.
*/

void ps2main(void)
{

	char bInputByte;			//storage for byte received from host
    ReInitialize();				//reinitialize all ps2 variables to default states
    SetDefault();				//set the host-settable parameters to the default states
	EI();						//enable interrupts
	ps2BAT();					//send the BAT code
	/*
	** only now can we enable the 128 usec interrupt, which will start filling the optics queue
	** with data.  ProcessOptics must be called at regular intervals from this point on, to prevent
	** the optics queue from overflowing.
	*/
	GLOBAL_INTERRUPT = MILLISECOND_ENABLE | MICROSECOND_ENABLE;
	while (1)
	{
		RESET_COP();									//always tickle watchdog
		ProcessOptics();								//empty optics queue
		bInputByte = GetByte();							//see if host has sent us anything
		if (!(CC.C))									//if carry is clear, a byte indeed arrived)
		{
			ProcessCommand(bInputByte);					//so go handle it
			continue;
		}
		if (Ps2Xmt.bXmtLen)								//anything to send?
		{
			PutNextByte();								//send a byte.
			continue;
		}

		if (MsecStatus.b1msFlags & ONE_MSEC_FLAG)		//1 msec expired?
		{	
			MsecStatus.b1msFlags &= ~ONE_MSEC_FLAG;
			Ps2MouseTask();								//do mouse stuff
   		}
	}
}


/*
**
** FUNCTION:		Ps2MouseTask
**
** PURPOSE:			handles ps2 mouse data packet management 
**
** PARAMETERS:		none
**
** DESCRIPTION:	 
**					
*/

void Ps2MouseTask(void)
{
	if (!(MsecStatus.b1msCounter & 3))						//4 msec expired?
		Mouse.bChange |= DebounceButtons();					//yes, debounce switches
	if (!--bIntervalCount)									//if the mouse interval counter has expired,
	{
		ResetInterval();									//reset the interval
		if (MouseParms.bStream && MouseParms.bEnabled)

			SendMouseData();								//if the mouse is enabled and in stream mode, send a packet
	}
}


/*
**
** FUNCTION:		Reinitialize
**
** PURPOSE:			Reinitializes ps2 variables to their default states  
**
** PARAMETERS:		none
**
** DESCRIPTION:	 
**					
*/

void ReInitialize(void)
{
	DI();											//disable ints
	USB_STATUS = (PS2_PULLUP_MASK | PS2_INTERRUPT_MODE_MASK |FORCE_NEG_OPEN_POS_OPEN);
	RESET_COP();									//reset watchdog
	ClearRam();
	OpticsQueue.headP = bOpticsArray;
	OpticsQueue.tailP = bOpticsArray;
	PROCESSOR_STATUS &= ~(WATCHDOG_RESET_MASK		            //clear source of reset
		| POWER_ON_RESET_MASK | USB_BUS_RESET_MASK);
	USB_DEVICE_A = 0;											//reset device address
	EP_A0_MODE = USB_MODE_DISABLE;								//disable endpoints from responding
	EP_A1_MODE = USB_MODE_DISABLE;
	EP_A2_MODE = USB_MODE_DISABLE;
	GLOBAL_INTERRUPT = MILLISECOND_ENABLE;						//enable only 1msec interrupt
	return;
}


/*
**
** FUNCTION:		ResetInterval
**
** PURPOSE:			Resets the mouse report interval
**
** PARAMETERS:		none
**
** DESCRIPTION:		This routine resets the mouse's report interval to the value last
**					sent by the host.  The report interval is counted down in the main loop
**					to provide a time base for sending mouse data packets.
**					
*/

void ResetInterval(void)
{
	bIntervalCount = MouseParms.bReportInterval;
}


/*
**
** FUNCTION:	GetByte		
**
** PURPOSE:		tries to get a byte from the host	
**	
** PARAMETERS:		
**
** DESCRIPTION:	GetByte checks to see if the host is requesting-to-send data, and if so,
**				clocks in a data byte from the host.  It returns the received byte 
**				and implicitly sets the carry to 0 if the reception occurred without errors.
**				GetByte turns off the 1msec interrupt during ps2 clocking so as not to
**				impose the potential for clock jitter due to that interrupt.
**					
**					
*/

char GetByte (void)
{
    char dummy;
	if (HOST_RTS)	                        				//host not requesting to send
	{
		GLOBAL_INTERRUPT = MICROSECOND_ENABLE;				//shut off msec interrupt
		dummy = ps2_receive();								//get data. ps2_receive sets the carry
															//to 1 if there was a problem in reception.
															
		GLOBAL_INTERRUPT = MILLISECOND_ENABLE | MICROSECOND_ENABLE;
		return(dummy);										//return data (and carry bit too)
	}
	CC.C = 1;												//couldn't get data, so set carry to one and exit
	return(0);
}


/*
**
** FUNCTION: ps2BAT		
**
** PURPOSE:	 delays for 500 msec, then sends the AA 00 initialization string	
**	
** PARAMETERS: none		
**
** DESCRIPTION:	 
**					
**					
*/

void ps2BAT(void)
{
	while (bBatDelay--)									//count down number of msec in bBatDelay
	{
		while (!(MsecStatus.b1msFlags & ONE_MSEC_FLAG))	//eat up a msec
			RESET_COP();
		MsecStatus.b1msFlags &= ~ONE_MSEC_FLAG;
	}
	Ps2Xmt.bMsgBuff[0] = 0xAA;							//send AA 00 to host
	Ps2Xmt.bMsgBuff[1] = 00;
	Ps2Xmt.bMsgLen = 2;
	Ps2Xmt.bXmtLen = 2;
}


/*
**
** FUNCTION:	PutNextByte		
**
** PURPOSE:		attempts to send  the next byte in the transmit queue to the host
**	
** PARAMETERS:  none		
**
** DESCRIPTION:	This routine sends the next byte  of the message buffer to the host.
**					
**					
*/

void PutNextByte(void)
{
	if (HOST_RTS || HOST_INHIBIT)								//host is requesting to send data, quit
		return;
	GLOBAL_INTERRUPT = MICROSECOND_ENABLE;
	ps2_send(Ps2Xmt.bMsgBuff[Ps2Xmt.bMsgLen-Ps2Xmt.bXmtLen]);							//send the byte
	GLOBAL_INTERRUPT = MILLISECOND_ENABLE | MICROSECOND_ENABLE;
	if (!CC.C)
		Ps2Xmt.bXmtLen--;
}


/*
**
** FUNCTION:	Put	
**
** PURPOSE:		sends a byte to the host
**	
** PARAMETERS:	data -- byte to send	
**
** DESCRIPTION:	Put attempts to send a byte to the host. It is called to send an ACK, ERROR, or RESEND
**				to the host. In accordance with the IBM spec, these responses are not held for retransmission
**				in the event that the  host requests to send a byte before we can send the response itself.
**				Thus, this routine waits for host inhibit to go away, then sends the byte.  If the host
**				requests-to-send before this happens, it simply returns without sending the byte.
**					
**					
*/

void Put(char data)
{
	if(HOST_RTS)
		return;

	while (!HOST_RTS)
	{
		//we could sit in this loop for a long time, if the host is inhibiting us.  This is ok.
		//the 128 us interrupt is running and the optics queue might overflow, but that will
		//be fixed up upon return to the main loop (see code in ProcessOptics).  This is harmless --
		//the mouse is supposed to be disabled by the host prior to executing commands, so
		//we aren't required to be accumulating samples at this point, anyway.
		if (!HOST_INHIBIT)
		{
			GLOBAL_INTERRUPT = MICROSECOND_ENABLE;
			ps2_send(data);							//send the byte
			GLOBAL_INTERRUPT = MILLISECOND_ENABLE | MICROSECOND_ENABLE;
			return;									//ps2_send will set carry for us
		}
		RESET_COP();
	}
}


/*
**
** FUNCTION:	Reset		
**
** PURPOSE:		executes a reset 	
**	
** PARAMETERS:		
**
** DESCRIPTION:	 Reset simply gets into a loop waiting for the watchdog to perform a reset.
**					
**					
*/

void Reset(void)
{
     GLOBAL_INTERRUPT = 0;
	while (1);									//death by watchdog
}


/*
**
** FUNCTION:	Resend		
**
** PURPOSE:		Resends the last  transmission from the mouse	
**	
** PARAMETERS:	None	
**
** DESCRIPTION:	A copy of the  last  transmission is always left intact in the message buffer.
**				To resend it , we simply need to reset the message length.
**					
**					
*/

void Resend(void)
{
	Ps2Xmt.bXmtLen = Ps2Xmt.bMsgLen;

}


/*
**
** FUNCTION:	SetDefault	
**
** PURPOSE:		Sets the mouse parameters to the default settings
**	
** PARAMETERS:		
**
** DESCRIPTION:	 
**					
**					
*/

void SetDefault(void)
{
	MouseParms.bReportRate = 100;						//100 reports per second
	MouseParms.bReportInterval = 10;					//is equal to a report every 10 msec
	MouseParms.bScale = SC_1_1;							//1-to-1 scaling
	MouseParms.bStream = 1;								//stream mode on
	MouseParms.bResolution = RES_4MM;					//4 MM resolution
	MouseParms.bEnabled = 0;							//not enabled
	MouseParms.bZmouse = 0;								//z-wheel off.
}


/*
**
** FUNCTION:	Disable		
**
** PURPOSE:		Disables the mouse	
**	
** PARAMETERS:		
**
** DESCRI

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美男同性恋视频网站| 国产午夜精品久久久久久免费视 | 老司机免费视频一区二区三区| 久久久久久久久蜜桃| 欧美视频完全免费看| 成人爽a毛片一区二区免费| 亚洲地区一二三色| 中文字幕中文字幕中文字幕亚洲无线| 欧美一区二区三区人| 在线免费av一区| 国产成人a级片| 蓝色福利精品导航| 亚洲第一主播视频| 一区二区三区在线观看网站| 欧美国产精品一区二区| 欧美一级午夜免费电影| 欧美三级视频在线播放| 色综合天天天天做夜夜夜夜做| 国产一区二区三区久久久| 琪琪一区二区三区| 午夜电影网一区| 亚洲一区二区在线免费观看视频| 国产精品网站在线| 久久久久九九视频| 精品国内二区三区| 精品国产一二三区| 日韩一区二区电影在线| 欧美日韩国产高清一区二区三区 | 色综合久久中文字幕| 国产69精品久久久久777| 麻豆高清免费国产一区| 免费人成在线不卡| 午夜激情久久久| 亚洲v中文字幕| 亚洲成人激情自拍| 婷婷久久综合九色综合绿巨人| 亚洲日本乱码在线观看| 国产精品国产三级国产普通话三级| 久久久蜜臀国产一区二区| 精品国一区二区三区| 精品国产一区二区三区久久影院 | 久久久久久日产精品| 精品国产乱码久久久久久免费| 日韩一级黄色大片| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 中国av一区二区三区| 国产精品久久夜| 亚洲乱码中文字幕综合| 一区二区成人在线观看| 视频在线观看一区二区三区| 亚洲国产视频在线| 日韩中文欧美在线| 精品亚洲porn| 丁香一区二区三区| 91色在线porny| 欧美日韩精品一区二区三区 | 国产精品一区二区男女羞羞无遮挡| 国内成+人亚洲+欧美+综合在线| 激情深爱一区二区| www.66久久| 欧美午夜精品一区二区三区| 91精品国产色综合久久不卡电影| 日韩一区二区三区视频在线 | 亚洲色图另类专区| 亚洲成人免费在线| 国产一区二区三区电影在线观看| 国产成人av一区| 一本大道综合伊人精品热热| 日本高清成人免费播放| 777亚洲妇女| 国产婷婷精品av在线| 亚洲视频免费在线| 免费一级片91| 99re66热这里只有精品3直播| 欧美在线高清视频| 2020国产精品| 一区二区免费看| 韩国女主播成人在线| 99久久99久久精品国产片果冻 | 中国av一区二区三区| 亚洲线精品一区二区三区 | 国产不卡一区视频| 欧美色成人综合| 精品国产在天天线2019| 亚洲激情图片小说视频| 精品一区二区三区香蕉蜜桃| 91在线无精精品入口| 欧美一级二级在线观看| 亚洲欧美电影一区二区| 精品一区二区在线看| 欧美伊人久久久久久久久影院| 欧美xxxxxxxx| 亚洲小少妇裸体bbw| 福利视频网站一区二区三区| 欧美精品一卡两卡| 中文字幕一区二区三区在线不卡| 免费成人在线观看| 在线国产电影不卡| 国产精品视频看| 男人的天堂久久精品| 91麻豆国产自产在线观看| 久久久综合视频| 日韩精品三区四区| 在线一区二区观看| 中文一区二区完整视频在线观看| 日日欢夜夜爽一区| 91网站最新地址| 久久久三级国产网站| 日本vs亚洲vs韩国一区三区二区| 91在线国产福利| 国产日韩欧美高清| 裸体一区二区三区| 精品视频色一区| 亚洲精品成人少妇| av电影在线不卡| 国产欧美一二三区| 国产麻豆精品视频| 精品国产一区二区三区忘忧草| 午夜不卡在线视频| 欧美丝袜丝交足nylons图片| 国产精品美女久久久久久久久久久| 激情欧美日韩一区二区| 日韩视频免费观看高清完整版 | 成人综合婷婷国产精品久久| 精品黑人一区二区三区久久 | 奇米色一区二区| 7799精品视频| 视频在线观看一区二区三区| 在线欧美日韩精品| 一区二区三区波多野结衣在线观看| av电影在线观看不卡| 国产精品久久一级| a级精品国产片在线观看| 国产精品嫩草影院av蜜臀| 国产福利视频一区二区三区| 久久综合给合久久狠狠狠97色69| 极品瑜伽女神91| 亚洲精品一区二区三区在线观看| 蜜桃视频在线一区| 精品久久国产字幕高潮| 蜜桃一区二区三区在线| 欧美不卡一区二区三区| 国产一区亚洲一区| 久久久欧美精品sm网站| 国产91富婆露脸刺激对白| 中文字幕欧美日韩一区| 99久久99久久精品免费看蜜桃| 亚洲品质自拍视频| 欧美亚洲日本一区| 喷白浆一区二区| 日韩免费高清电影| 国产精品亚洲综合一区在线观看| 国产亚洲欧美一区在线观看| 成人一区在线观看| 亚洲精品亚洲人成人网| 91官网在线免费观看| 日韩精品电影在线观看| 久久免费视频色| jvid福利写真一区二区三区| 亚洲一区二区三区在线| 91精品国产黑色紧身裤美女| 久久69国产一区二区蜜臀| 中文字幕欧美日本乱码一线二线 | 欧美日韩高清一区二区三区| 免费观看在线综合| 久久精品这里都是精品| 99精品热视频| 人妖欧美一区二区| 国产欧美日韩在线| 欧美性色综合网| 国内一区二区在线| 亚洲精品va在线观看| 日韩欧美美女一区二区三区| 成人免费毛片高清视频| 亚洲国产视频一区二区| 久久先锋资源网| 在线看国产日韩| 国产在线播精品第三| 亚洲精品免费看| 欧美va亚洲va国产综合| 97久久久精品综合88久久| 麻豆精品新av中文字幕| 亚洲欧洲成人自拍| 欧美一区二区播放| 99vv1com这只有精品| 久久国产精品一区二区| 亚洲精品日韩一| 2024国产精品| 欧美精品国产精品| 不卡一区在线观看| 久久精品国产精品亚洲红杏| 一区二区三区欧美在线观看| 亚洲精品一区二区精华| 在线国产电影不卡| 成人综合在线网站| 精品亚洲aⅴ乱码一区二区三区| 伊人色综合久久天天人手人婷| 国产亚洲午夜高清国产拍精品 | 国产一区二区三区在线观看免费 | 亚洲五码中文字幕|