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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? usb_processor.c

?? 使用FREESCALE的16位增強型芯片實現的USB2.0通信的代碼
?? C
字號:
/******************************************************************************
*                                                  
*  (c) copyright Freescale Semiconductor Hong Kong Ltd 2004
*  ALL RIGHTS RESERVED
*                                                                       
*******************************************************************************  
** THIS  CODE IS ONLY INTENDED AS AN EXAMPLE FOR DEMONSTRATING THE FREESCALE **
** MICROCONTROLLERS.  IT  HAS ONLY BEEN GIVEN A MIMIMUM LEVEL OF TEST. IT IS **
** PROVIDED  'AS  SEEN'  WITH  NO  GUARANTEES  AND  NO  PROMISE  OF SUPPORT. **
*******************************************************************************  
*                                                                           
* FILE:        usb_processor.c	 REVISION 0.1
*  
* DESCRIPTION: This module handles the USB state machine & command processor
*              applicaton tasks for the system
*
* NOTES:       All modules remain at their reset addresses
*                                                  
* UPDATED HISTORY:
*
* REV   YYYY.MM.DD  AUTHOR        DESCRIPTION OF CHANGE
* ---   ----------  ------        --------------------- 
* 0.0   2003.03.01  Vincent Ko    Initial version
* 0.1   2004.04.12  Derek Lau     Demo version
*
******************************************************************************/                                                                        
/* Freescale  is  not  obligated  to  provide  any  support, upgrades or new */
/* releases  of  the Software. Freescale may make changes to the Software at */
/* any time, without any obligation to notify or provide updated versions of */
/* the  Software  to you. Freescale expressly disclaims any warranty for the */
/* Software.  The  Software is provided as is, without warranty of any kind, */
/* either  express  or  implied,  including, without limitation, the implied */
/* warranties  of  merchantability,  fitness  for  a  particular purpose, or */
/* non-infringement.  You  assume  the entire risk arising out of the use or */
/* performance of the Software, or any systems you design using the software */
/* (if  any).  Nothing  may  be construed as a warranty or representation by */
/* Freescale  that  the  Software  or  any derivative work developed with or */
/* incorporating  the  Software  will  be  free  from  infringement  of  the */
/* intellectual property rights of third parties. In no event will Freescale */
/* be  liable,  whether in contract, tort, or otherwise, for any incidental, */
/* special,  indirect, consequential or punitive damages, including, but not */
/* limited  to,  damages  for  any loss of use, loss of time, inconvenience, */
/* commercial loss, or lost profits, savings, or revenues to the full extent */
/* such  may be disclaimed by law. The Software is not fault tolerant and is */
/* not  designed,  manufactured  or  intended by Freescale for incorporation */
/* into  products intended for use or resale in on-line control equipment in */
/* hazardous, dangerous to life or potentially life-threatening environments */
/* requiring  fail-safe  performance,  such  as  in the operation of nuclear */
/* facilities,  aircraft  navigation  or  communication systems, air traffic */
/* control,  direct  life  support machines or weapons systems, in which the */
/* failure  of  products  could  lead  directly to death, personal injury or */
/* severe  physical  or  environmental  damage  (High  Risk Activities). You */
/* specifically  represent and warrant that you will not use the Software or */
/* any  derivative  work of the Software for High Risk Activities.           */
/* Freescale  and the Freescale logos are registered trademarks of Freescale */
/* Semiconductor Inc.                                                        */ 
/*****************************************************************************/

#include	"FreescaleDef.h"			// Get my definitions (Constants & Macros)
#include	"UF32reg.h"			// Get the UF32 registers.
#include	"mk_extern.h"		// Get Mini-Kernel global prototypes
#include	"usb_includes.h"	// Get USB module Configuration
#include	"usb_extern.h"		// Get External variable
#include	"usb_descriptor.h"	// Get USB Descriptor


// code is placed in the main code area.
#pragma CODE_SEG	DEFAULT
//#pragma CODE_SEG	CodeForceToPseudo_ROM2									 

// ===========================================================
//   Recipient() -
//  
//		Decode the recipient
//
// ===========================================================
muint8 Recipient(muint8 bmRequest) {

	return bmRequest&0x0f; 
};

// ===========================================================
//   USB_DecodeSETUP() -
//  
//		Decode the setup packet
//
// ===========================================================
void USB_DecodeSETUP(volatile muint8 *p_Packet) {
 
	muint8 Type; 
	muint8 Index; 
	muint16 Length, ThisLen;
//	muint8 This_Config=0;					// Current active Configuration
//	muint8 This_Interface=1;				// Current active Interface
//	muint8 This_AS=1;						// Current active Alternative Setting
//	muint8 This_EP;							// Current active Endpoint

	
	Length = (muint16)(*(p_Packet+wLength_h) <<8) + *(p_Packet+wLength_l);		// Decode wLength
	switch (p_Packet[bRequest])
	{ 
		case GET_DESCRIPTOR:
			Type = p_Packet[wValue_h];
			Index = p_Packet[wValue_l];
			switch (Type) 
			{
				case DEVICE:
					ThisLen = USB_GetMin(Device_Descriptor[0],Length);
					USB_Move2LocalBuffer((muint8*) Device_Descriptor,(muint8*)USB_SetBufferPtr(PHY1IN),ThisLen);
					break;
				case CONFIGURATION:
					ThisLen = USB_GetMin(((muint16) Configuration_DescriptorHS[3] << 8) | Configuration_DescriptorHS[2],Length);
					USB_Move2LocalBuffer((muint8*)Configuration_Table[gUSBFullSpeed][Index],(muint8*)USB_SetBufferPtr(PHY1IN),ThisLen);
					break;
				case STRING:
					ThisLen = USB_GetMin(String_Table[Index][0],Length);
					USB_Move2LocalBuffer((muint8*)String_Table[Index],(muint8*)USB_SetBufferPtr(PHY1IN),ThisLen);						
					break;
				case INTERFACE:
					ThisLen = USB_GetMin(Interface_Table[Index-1][0],Length);
					USB_Move2LocalBuffer((muint8*)Interface_Table[Index-1],(muint8*)USB_SetBufferPtr(PHY1IN),ThisLen);						
					break;
				case ENDPOINT:
					ThisLen = USB_GetMin(Endpoint_Table[gUSBFullSpeed][Index-1][0],Length);
					USB_Move2LocalBuffer((muint8*)Endpoint_Table[gUSBFullSpeed][Index-1],(muint8*)USB_SetBufferPtr(PHY1IN),ThisLen);
					break;
				case DEVICE_QUALIFIER:
					ThisLen = USB_GetMin(Device_Qualifier[0],Length);
					USB_Move2LocalBuffer((muint8*)Device_Qualifier,(muint8*)USB_SetBufferPtr(PHY1IN),ThisLen);
					break;
				case OTHER_SPEED_CONFIGURATION:
					ThisLen = USB_GetMin((((muint16) Other_Speed_Descriptor[3]) << 8) | (muint16) Other_Speed_Descriptor[2],Length);
					USB_Move2LocalBuffer((muint8*)Configuration_DescriptorFS,(muint8*)USB_SetBufferPtr(PHY1IN),ThisLen);
					USB_Move2LocalBuffer((muint8*)Other_Speed_Descriptor,(muint8*)USB_SetBufferPtr(PHY1IN),2);
					break;
				};
				do
				{
					UEPCSR0 = 0x5000 | ThisLen;
				}
				while (!(UEPCSR0 & 0x4000));			// Enable DAVLID bit
				break;

		case GETMAXLUN:
				*(USB_SetBufferPtr(PHY1IN)) =  (kNumberOfDevice-1);	// Return the value of LUN
				do
				{
					UEPCSR0 = 0x5000 | 0x01;				// wLength = 1
				}
				while (!(UEPCSR0 & 0x4000));
				break;
//		case BOMS_RESET:
//				break;
//		case SET_DESCRIPTOR:
//				break;

//		case SYNCH_FRAME:
//				break;
		default:
				break;

//		SET_ADDRESS, 
//		GET_STATUS:
//		GET_CONFIGURATION:
//		SET_CONFIGURATION:
//		GET_INTERFACE:
//		SET_INTERFACE:


	};		
};


//
// The end of file usb_processor.c 
// *********************************************************************************

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧日韩精品视频| 亚洲另类色综合网站| 91色porny在线视频| 调教+趴+乳夹+国产+精品| 国产精品丝袜黑色高跟| 欧美一区二视频| 日本韩国精品一区二区在线观看| 国产黄色精品视频| 韩国女主播一区| 捆绑变态av一区二区三区| 亚洲成人自拍偷拍| 亚洲综合丝袜美腿| 亚洲人成在线播放网站岛国| 亚洲国产成人一区二区三区| 精品国产免费一区二区三区四区| 欧美日韩情趣电影| 欧美日韩小视频| 欧美日韩国产首页| 精品视频全国免费看| 99精品国产一区二区三区不卡| 国产精品77777竹菊影视小说| 精品一区二区三区免费播放| 免费精品视频在线| 蜜桃av一区二区三区| 婷婷成人综合网| 日韩中文欧美在线| 蜜臀久久99精品久久久画质超高清| 首页欧美精品中文字幕| 天堂蜜桃91精品| 天天做天天摸天天爽国产一区| 日本不卡一区二区三区| 麻豆成人免费电影| 精品一二线国产| 国产99久久久国产精品免费看| 国产精品一区二区男女羞羞无遮挡| 国产一区在线不卡| 大白屁股一区二区视频| 色婷婷综合久久久久中文| 日本韩国欧美国产| 91精品国产福利在线观看| 亚洲精品一线二线三线| 亚洲欧洲性图库| 亚洲va天堂va国产va久| 日韩激情视频网站| 国产麻豆视频一区| 色综合天天综合色综合av| 91精选在线观看| 久久久www成人免费毛片麻豆| 国产精品美女一区二区在线观看| 亚洲国产cao| 美女脱光内衣内裤视频久久影院| 国产不卡在线视频| 粉嫩蜜臀av国产精品网站| 日本高清成人免费播放| 国产精品久久久久影视| 日韩精品一区第一页| 91精品久久久久久蜜臀| 国产成人8x视频一区二区| av电影一区二区| 欧美疯狂性受xxxxx喷水图片| 国产偷国产偷精品高清尤物| 亚洲在线观看免费视频| 国产一区二区三区| 欧美日韩一区在线观看| 国产精品午夜在线| 首页国产欧美久久| eeuss影院一区二区三区| 日韩视频在线一区二区| 亚洲女同ⅹxx女同tv| 国产精品影视网| 欧美精三区欧美精三区| 中文字幕一区二区三区视频| 久久精品国产亚洲一区二区三区| 精品99一区二区| 日本乱人伦aⅴ精品| 国产精品1024| 天堂蜜桃91精品| 久久国产生活片100| 色综合天天综合网天天狠天天| 欧美伦理电影网| 一区二区欧美国产| 欧美一区二区三区播放老司机| 91免费国产在线观看| 91精品国产色综合久久不卡电影| 亚洲色图20p| 国产在线播放一区二区三区| 日韩美女一区二区三区| 亚洲国产日韩a在线播放| 在线观看国产精品网站| 亚洲人成伊人成综合网小说| 免费看日韩a级影片| 亚洲欧洲在线观看av| 精品久久99ma| 免费成人在线播放| 91精品国产91久久久久久一区二区 | 亚洲成年人网站在线观看| 久久9热精品视频| 91精品国产色综合久久久蜜香臀| 亚洲美女少妇撒尿| 91论坛在线播放| 一区二区三区四区五区视频在线观看| 99精品欧美一区二区三区小说 | 99视频国产精品| 蜜臀久久99精品久久久久宅男| 欧美熟乱第一页| 一区二区三区蜜桃| 欧美午夜精品免费| 中国av一区二区三区| 国内久久精品视频| 久久先锋影音av鲁色资源| 国产美女精品在线| 亚洲天堂精品在线观看| 91视频在线看| 香蕉成人伊视频在线观看| 日韩一级免费一区| 国产精品18久久久久久久久| 亚洲色图欧美在线| 欧美高清性hdvideosex| 韩国av一区二区三区在线观看| 国产亚洲一二三区| 成人91在线观看| 亚洲国产精品一区二区www在线| 欧美高清视频一二三区| 国产精品自拍在线| 亚洲一区中文日韩| 久久女同性恋中文字幕| 92国产精品观看| 日本aⅴ亚洲精品中文乱码| 久久精品视频在线看| 不卡的av电影| 蜜桃av一区二区| 综合激情成人伊人| 99久久久免费精品国产一区二区| 日韩理论电影院| 日韩欧美亚洲国产另类| 91色乱码一区二区三区| 久久电影国产免费久久电影| 亚洲男人天堂一区| 欧美tickling网站挠脚心| 91在线小视频| 国产尤物一区二区| 日日噜噜夜夜狠狠视频欧美人| 国产目拍亚洲精品99久久精品| 欧美蜜桃一区二区三区| 国产a级毛片一区| 久久精品国产秦先生| 日本一区二区三区dvd视频在线| 99精品视频在线播放观看| 奇米888四色在线精品| 一区二区三区四区不卡视频| 久久久不卡网国产精品一区| 欧美一级搡bbbb搡bbbb| 91麻豆国产福利在线观看| 国产激情视频一区二区在线观看 | 国产性做久久久久久| 欧美精品一二三| 91视频一区二区三区| 丁香六月综合激情| 国产综合久久久久久鬼色| 日韩在线一区二区| 亚洲三级电影网站| 精品国产不卡一区二区三区| 制服视频三区第一页精品| 欧美日韩视频在线第一区 | 欧美极品xxx| 国产精品久久久久久久午夜片| 国产精品久线观看视频| 综合久久国产九一剧情麻豆| 亚洲最新在线观看| 日韩成人一级片| 国产九色精品成人porny | 亚洲欧美aⅴ...| 亚洲成人tv网| 激情综合亚洲精品| 波多野结衣精品在线| 欧美怡红院视频| 精品久久久久久久久久久久久久久久久| 欧美精品一区二区三区高清aⅴ| 日本一区二区免费在线观看视频 | 久久er99热精品一区二区| 国产成人8x视频一区二区| 在线观看免费一区| 精品国产亚洲在线| 亚洲女同一区二区| 美女www一区二区| eeuss鲁一区二区三区| 91精品国产综合久久久久久久久久| 精品久久人人做人人爰| 亚洲色欲色欲www| 精品午夜久久福利影院| 色呦呦网站一区| 日韩午夜电影av| 夜夜爽夜夜爽精品视频| 国产在线观看一区二区| 欧美最猛性xxxxx直播| 国产午夜精品在线观看| 亚洲地区一二三色| 成人小视频在线| 精品免费一区二区三区| 亚洲成人av福利|