⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 reqcode.c

📁 周立功dp1581usb2.0实验仪
💻 C
📖 第 1 页 / 共 2 页
字号:
//***********************************************************************
//									     								                  *  
//                P H I L I P S   P R O P R I E T A R Y          		   *
//                                                                      *
//          COPYRIGHT (c)   1999 BY PHILIPS SINGAPORE (APIC).    		   *
//                    --  ALL RIGHTS RESERVED  --                 		*	
//                                                                      *
// 	File Name	:       RequestCode.c                                 *
// 	Author		:       Albert Goh					 					      *
// 	Created		:      	3 March 2000                               	*
//                  	                                                   *
//***********************************************************************
//***********************************************************************
//                                                                      *
// Debug.c file contain the location of the routine for debugging of    *
// the D14. It consist of PIO,USB,UDMA,MDMA,GDMA debugging location   	*
// It will branch to the respective routine via the UART or the CODE  	*
// definition                                                           *
//                                                                      *
//***********************************************************************
//***********************************************************************
//                                                                      *
//  Module History														            *
//  **************														            *
//																		                  *
//  Date   	Version			Author				Changes					      *  
//  ====	=======			======				=======					         *
//  030300	  0.1 			Albert				Created    				      *
//                                                                      *
//                                                                      *
//***********************************************************************

//***********************************************************************
//*																		               *
//*	                     Include Files Definition						   *
//*																		               *
//***********************************************************************

#include "standard.h"
#include "Usb.h"
#include "kernel.h"

//***********************************************************************
//*																		               *
//*	                     Variable Definition 							      *
//*																		               *
//***********************************************************************


//***********************************************************************
//*																		               *
//*	                     Routine Definition								   *
//*																		               *
//***********************************************************************


//***********************************************************************
//*										    							               *
//*	Routine 	:  Standard Device Descriptor                       		*
//*	Input		:  None              									         *
//*	Output   :  None                                					   *
//*	Function	:  None                                      			   *
//*																		               *
//***********************************************************************



DEVICE_DESCRIPTOR				code  	Standard_Device_Descriptor[] =
{
    
    sizeof(DEVICE_DESCRIPTOR),		/*        length	 */
		0x01,    						/*  1.    bDescriptorType            */
		SWAP(0x0110),   				/*  2.-3. Version 1.1 USB spec Word  */
		0x00,   	  					/*  4.    Class                      */
		0x00,    						/*  5.    bDeviceSubClass            */
		0x00,    						/*  6.    bDeviceProtocol            */
		0x40,							/*  7.    bMaxPacketSize0            */
		SWAP(0x04CC),					/* 8.-9.  idVendor                   */
		SWAP(0x1B49),   				/* a.-b.  idProduct for no Filter Driver      */	
		SWAP(0x0000),   				/* c.-d.  bcdDevice                  */
		0x01,   						/* e.	   iManufacturer             */
		0x02,    						/* f.	   iProduct				     */
		0x00,    						/* 10.    iSerialNumber              */
		0x01     						/* 11.    bNumConfigurations		 */
		
};


DEVICE_DESCRIPTOR	code 	HS_Device_Descriptor[] =
{
    
    sizeof(DEVICE_DESCRIPTOR),		/*        length	 */
		0x01,    						/*  1.    bDescriptorType            */
		SWAP(0x0200),   				/*  2.-3. Version 2.0 USB spec Word  */
		0x00,   	  					/*  4.    Class                      */
		0x00,    						/*  5.    bDeviceSubClass            */
		0x00,    						/*  6.    bDeviceProtocol            */
		0x40,							/*  7.    bMaxPacketSize0            */
		SWAP(0x04CC),					/* 8.-9.  idVendor                   */
		SWAP(0x1B49),   				/* a.-b.  idProduct                  */	
		SWAP(0x0000),   				/* c.-d.  bcdDevice                  */
		0x01,   						/* e.	   iManufacturer             */
		0x02,    						/* f.	   iProduct				     */
		0x00,    						/* 10.    iSerialNumber              */
		0x01     						/* 11.    bNumConfigurations		 */
		
};

//***********************************************************************
//*										    							               *
//*	Routine  :  HS Device Qualifier                              		*
//*	Input		:  None              									         *
//*	Output	:  None                                					   *
//*	Function	:  None                                      			   *
//*																		               *
//***********************************************************************


HS_DEVICE_QUALIFIER	code HS_Device_Qualifier[] =
{
	
	sizeof(HS_DEVICE_QUALIFIER),	//length of HS Device Descriptor
		0x06,							//HS Device Qualifier Type
		SWAP(0x0200),					// USB 2.0 version
		0x00,							//Device class
		0x00,							//Device SubClass
		0x00, 							//Device Protocol Code
		0x40,							//Maximum Packet SIze for other speed
		0x01,							//Number of Other speed configurations
		0x00							//Reserved
		
};


//***********************************************************************
//*										    							               *
//*	Routine 	:  Standard Configuration Descriptor                		*
//*	Input		:  None              									         *
//*	Output   :  None                                					   *
//*	Function	:  None                                      			   *
//*																		               *
//***********************************************************************

CONFIGURATION_DESCRIPTOR	code	Standard_Config_Descriptor[] =
{
	
	sizeof(CONFIGURATION_DESCRIPTOR),	//Length of the configuration Descriptor
		0x02,							 	//Configuration Descriptor
		SWAP(CONFIG_LENGTH),   			 	//Total length of the configurations,interface and class/endpoint
		0x01,							 	//No. of interface supported
		0x01,							 	//Configuration Value
		0x00,							 	//Index of string descriptor
		0xC0,							 	//Configurations Characteristic
		0x32							 	//Maximun Power
		
};


//***********************************************************************
//*										    							               *
//*	Routine 	:  Other speed Configuration Descriptor             		*
//*	Input		:  None              									         *
//*	Output	:  None                                					   *
//*	Function	:  None                                      			   *
//*																		               *
//***********************************************************************

OTHER_SPEED_CONFIG_DESCRIPTOR	code	Other_Speed_Config_Descriptor[] =
{
	
	sizeof(OTHER_SPEED_CONFIG_DESCRIPTOR),	//length of other speed configuration descriptor
		0x07,									//Other speed configuration Type
		SWAP(CONFIG_LENGTH),				//Total length
		0x01,									//No of interface supported
		0x01,									//Configuration Value
		0x00,									//Index of string descriptor
		0xC0,									//Configurations Characteristic
		0x32									//Maximun Power
		
};



//***********************************************************************
//*										    							               *
//*	Routine 	:  Standard Interface Descriptor                    		*
//*	Input		:  None              									         *
//*	Output	:  None                                					   *
//*	Function	:  None                                      			   *
//*																		               *
//***********************************************************************

INTERFACE_DESCRIPTOR	code	Bulk_Interface_Descriptor[] =
{
	
	sizeof(INTERFACE_DESCRIPTOR),	//Length of standard interface descriptor
		0x04,								//Standard Interface Type
		0x00,								//No of Interface
		0x00,								//Alternate Setting Selector
		0x04,								//No of Endpoints
		0x00,								//Interface Class
		0x00,								//ATAPI Interface Sub Class
		0x00,								//Bulk Only Interface Protocol
		0x00								//Index of interface string desriptor
};

INTERFACE_DESCRIPTOR	code	HS_Bulk_Interface_Descriptor[] =
{
	sizeof(INTERFACE_DESCRIPTOR),	//Length of standard interface descriptor
		0x04,								//Standard Interface Type
		0x00,								//No of Interface
		0x00,								//Alternate Setting Selector
		0x04,								//No of Endpoints
		0x00,								//Interface Class
		0x00,								//ATAPI Interface Sub Class
		0x00,								//Bulk Only Interface Protocol
		0x00								//Index of interface string desriptor
};


//***********************************************************************
//*										    							               *
//*	Routine 	:  Standard Endpoint Descriptor                    		*
//*	Input		:  None              									         *
//*	Output	:  None                                					   *
//*	Function	:  None                                      			   *
//*																		               *
//***********************************************************************

ENDPOINT_DESCRIPTOR	code	Bulk_Out_Descriptor[] =
{
	
	sizeof(ENDPOINT_DESCRIPTOR),	//Length of Standard Endpoint Descriptor
		0x05,								//Standard Endpoint Type
		0x02, 								//Set Bulk endpoint to 1 for ATAPI mode
		0x02,								//Endpoint Characteristic
		SWAP(0x0040),						//Endpoint Max Packet Size
		0x00								//Interval for Polling Endpoint for data transfer
		
};

ENDPOINT_DESCRIPTOR	code	Bulk_In_Descriptor[] =
{
	sizeof(ENDPOINT_DESCRIPTOR),	//Length of Standard Endpoint Descriptor
		0x05,								//Standard Endpoint Type
		0x82, 								//Set Bulk endpoint to 1 for ATAPI mode
		0x02,								//Endpoint Characteristic
		SWAP(0x0040),						//Endpoint Max Packet Size
		0x00								//Interval for Polling Endpoint for data transfer
		
};


ENDPOINT_DESCRIPTOR	code	HS_Bulk_Out_Descriptor[] =
{
	
	sizeof(ENDPOINT_DESCRIPTOR),	//Length of Standard Endpoint Descriptor
		0x05,								//Standard Endpoint Type
		0x02, 								//Set Bulk endpoint to 1 for ATAPI mode
		0x02,								//Endpoint Characteristic
		SWAP(0x0200),						//Endpoint Max Packet Size
		0x00								//Interval for Polling Endpoint for data transfer
		
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -