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

📄 descriptor.c

📁 基于TI 6416DSP 的USB读写程序
💻 C
字号:
/*******************************************************************************
	filename:	descriptor.c
	designer:	戴展波
	date:		2004/11/01
*******************************************************************************/

#include "descriptor.h"

unsigned char desc_table[] = {
	/*器件描述表*/
	DSCR_DEVICE_LEN,	//descriptor length
	DSCR_DEVICE,		//descriptor type
	0x00,0x02,		//specification version
	0x00,			//device class
	0x00,			//device sub-class
	0x00,			//device sub-sub-class
	0x40,			//maximum packer size
	0xb4,0x04,		//vendor ID
	0x82,0x00,		//product ID
	0x00,0x00,		//device ID
	0x01,			//manufacturer string index
	0x02,			//product string index
	0x00,			//serial number string index
	0x01,			//number of configurations
	
	/*devicequaldscr*/
	DSCR_DEVQUAL_LEN,	//descriptor length
	DSCR_DEVQUAL,		//descriptor type
	0x00,0x02,		//specification
	0x00,			//device class
	0x00,			//device sub-class
	0x00,			//device sub-sub-class
	0x40,			//maximum packer size
	0x01,			//number of configurations
	0x00,			//reserved
	
	//highspeedconfigdscr
	DSCR_CONFIG_LEN,	//descriptor length
	DSCR_CONFIG,		//descriptor type
	DSCR_CONFIG_LEN+DSCR_INTRFC_LEN+(4*DSCR_ENDPNT_LEN),	//total length(LSB)
	0x00,			//total length(MSB)
	0x01,			//number of interface
	0x01,			//configuration number
	0x00,			//configuration string
	0x40,			//attributes (b7-buspwr,b5-selfpwr,b5-rwu)
	0x32,			//Power requirement (div 2 ma)
	
	//interface descriptor
	DSCR_INTRFC_LEN,	//descriptor length
	DSCR_INTRFC,		//descriptor type
	0x00,			//zero-based index of this interface
	0x00,			//alternate setting
	0x04,			//number of end points
	0xff,			//interface class
	0x00,			//interface sub class
	0x00,			//interface sub-sub-class
	0x00,			//interface descriptor string index
	
	//endpoint 2 descriptor
	DSCR_ENDPNT_LEN,	//descriptor length
	DSCR_ENDPNT,		//descriptor type
	0x02,			//endpoint number,and direction out
	ET_BULK,		//endpoint type
	0x00,			//maximum packet size(LSB)
	0x02,			//max packet size(MSB)
	0x00,			//polling interval
	
	//Endpoint 4 descriptor
	DSCR_ENDPNT_LEN,	//descriptor length
	DSCR_ENDPNT,		//descriptor type
	0x04,			//endpoint number,and direction out
	ET_BULK,		//endpoint type
	0x00,			//maximum packet size(LSB)
	0x02,			//max packet size(MSB)
	0x00,			//polling interval
	
	//endpoint 6 descriptor
	DSCR_ENDPNT_LEN,	//descriptor length
	DSCR_ENDPNT,		//descriptor type
	0x86,			//endpoint number,and direction in
	ET_BULK,		//endpoint type
	0x00,			//maximum packet size(LSB)
	0x02,			//max packet size(MSB)
	0x00,			//polling interval
	
	//endpoint 8 descriptor
	DSCR_ENDPNT_LEN,	//descriptor length
	DSCR_ENDPNT,		//descriptor type
	0x88,			//endpoint number,and direction in
	ET_BULK,		//endpoint type
	0x00,			//maximum packet size(LSB)
	0x02,			//max packet size(MSB)
	0x00,			//polling interval
	/* End of High-Speed Configuration Descriptor */   
	
	//fullspeedconfigdscr
	DSCR_CONFIG_LEN,	//descriptor length
	DSCR_CONFIG,		//descriptor type
	DSCR_CONFIG_LEN+DSCR_INTRFC_LEN+(4*DSCR_ENDPNT_LEN),	//total length (LSB)
	0x00,			//total length (MSB)
	0x01,			//number of interfaces
	0x01,			//configuration number
	0x00,			//configuration string
	0x40,			//attributes (b7-buspwr,b6-selfpwr,b5-rwu)
	0x32,			//power requirement (div 2 ma)
	
	//interface descriptor
	DSCR_INTRFC_LEN,	//descriptor length
	DSCR_INTRFC,		//descriptor type
	0x00,			//zero-based index of this interface
	0x00,			//alternate setting
	0x04,			//number of end points
	0xff,			//interface class
	0x00,			//interface sub class
	0x00,			//interface sub sub class
	0x00,			//interface descriptor string index
	
	//endpoint 2 descriptor
	DSCR_ENDPNT_LEN,	//descriptor length
	DSCR_ENDPNT,		//descriptor type
	0x02,			//endpoint number,and direction
	ET_BULK,		//endpoint type
	0x40,			//maximum size (LSB)
	0x00,			//max packet size (MSB)
	0x00,			//polling interval
	
	//endpoint 4 descriptor
	DSCR_ENDPNT_LEN,	//descriptor length
	DSCR_ENDPNT,		//descriptor type
	0x04,			//endpoint number,and direction
	ET_BULK,		//endpoint type
	0x40,			//maximum size (LSB)
	0x00,			//max packet size (MSB)
	0x00,			//polling interval
	
	//endpoint 6 descriptor
	DSCR_ENDPNT_LEN,	//descriptor length
	DSCR_ENDPNT,		//descriptor type
	0x86,			//endpoint number,and direction in
	ET_BULK,		//endpoint type
	0x40,			//maximum packet size(LSB)
	0x00,			//max packet size(MSB)
	0x00,			//polling interval
	
	//endpoint 8 descriptor
	DSCR_ENDPNT_LEN,	//descriptor length
	DSCR_ENDPNT,		//descriptor type
	0x88,			//endpoint number,and direction in
	ET_BULK,		//endpoint type
	0x40,			//maximum packet size(LSB)
	0x00,			//max packet size(MSB)
	0x00,			//polling interval
	/* End of Full-Speed Configuration Descriptor */   
	
	//stringdscr
	//stringdscr0
	2+2,			//string descriptor length
	DSCR_STRING,		//string descriptor
	0x09,0x04,		//US LANGID CODE
	
	//stringdscr1
	2+(2*7),		//string descriptor length
	DSCR_STRING,		//string descriptor
	'C',0x00,		
	'y',0x00,
	'p',0x00,
	'r',0x00,
	'e',0x00,
	's',0x00,
	's',0x00,
	
	//stringdscr2
	2+(2*9),		//string descriptor length
	DSCR_STRING,		//string descriptor
	'C',0x00,
	'Y',0x00,
	'7',0x00,
	'C',0x00,
	'6',0x00,
	'8',0x00,
	'0',0x00,
	'0',0x00,
	'1',0x00
	};

⌨️ 快捷键说明

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