📄 usb_desc.c
字号:
/******************** (C) COPYRIGHT 2006 STMicroelectronics ********************
* File Name : main.c
* Author : wuyuhuai
* Date First Issued : 4/40/2008 : V1.0
* Description : str training demo main file
********************************************************************************
* History:
* 10/01/2006 : V1.0
********************************************************************************
* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
* CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*******************************************************************************/
/* Includes ------------------------------------------------------------------*/
#include "usb_lib.h"
#include "usb_desc.h"
const u8 MASS_DeviceDescriptor[MASS_SIZ_DEVICE_DESC] ={
0x12, /* bLength */
0x01, /* bDescriptorType */
0x10, /* bcdUSB, version 2.00 */
0x01, /* bcdUSB, version 1.1 */
0x00, /* bDeviceClass : each interface define the device class */
0x00, /* bDeviceSubClass */
0x00, /* bDeviceProtocol */
0x40, /* bMaxPacketSize0 0x40 = 64 */
0x5b, /* idVendor (0483) */
0x15,
0x13, /* idProduct */
0x43,
0x00, /* bcdDevice*/
0x01,
1, /* index of string Manufacturer */
/**/
2, /* index of string descriptor of product*/
/* */
3, /* */
/* */
/* */
0x01 /*bNumConfigurations */
};
const u8 MASS_ConfigDescriptor[MASS_SIZ_CONFIG_DESC] = {
0x09, /* bLength: Configuation Descriptor size */
0x02, /* bDescriptorType: Configuration */
MASS_SIZ_CONFIG_DESC,
0x00,
0x01, /* bNumInterfaces: 1 interface */
0x01, /* bConfigurationValue: */
/* Configuration value */
0x00, /* iConfiguration: */
/* Index of string descriptor */
/* describing the configuration */
0x80, /* bmAttributes: */
/* bus powered */
0x32, /* MaxPower 100 mA: this current is used for detecting Vbus */
/******************** Descriptor of Mass Storage interface ********************/
/* 09 */
0x09, /* bLength: Interface Descriptor size */
0x04,
0x00,
0x00,
0x03,
0x0B,
0x00, /* bInterfaceSubClass */
0x00,
4, /* iInterface: */
/* 18 */
0x07,
0x05,
0x81,
0x02,
0x40, /*Maximum packet size (64 bytes) */
0x00,
0x00, /*Polling interval in milliseconds */
/* 25 */
0x07, /*Endpoint descriptor length = 7 */
0x05,
0x02,
0x02,
0x40,
0x00,
0x00, /*Polling interval in milliseconds*/
/*32*/
0x07, /* bLength: Endpoint Descriptor size */
0x05, /* bDescriptorType: */
/* Endpoint descriptor type */
0x83, /* bEndpointAddress: */
/* Endpoint Address (IN) */
0x03, /* bmAttributes: Interrupt endpoint */
0x08, /* wMaxPacketSize: 4 Byte max */
0x00,
0x18,
};
const u8 MASS_StringLangID[MASS_SIZ_STRING_LANGID] = {
MASS_SIZ_STRING_LANGID,
0x03,
0x09,
0x04
}; /* LangID = 0x0409: U.S. English */
const u8 MASS_StringVendor[MASS_SIZ_STRING_VENDOR] = {
MASS_SIZ_STRING_VENDOR, /* Size of manufaturer string */
0x03, /* bDescriptorType = String descriptor */
'w',0, 'y',0, 'h',0, 'w',0, 'y',0, 'h',0, 'w',0, 'y',0,
'h',0, 'w',0, 'y',0, 'h',0, 'w',0, 'y',0
/* 'H',0, 'u',0, 'a',0, 'H',0, 'o',0, 'n',0, 'g',0, '_',0,
'D',0, 'e',0, 's',0, 'i',0, 'g',0, 'n',0*/
};
const u8 MASS_StringProduct[MASS_SIZ_STRING_PRODUCT] = {
MASS_SIZ_STRING_PRODUCT,
0x03,
/* Product name: "HHIC6301: ePassport Evaluation Kit" */
/*'S',0, 'H',0, 'H',0, 'I',0, 'C',0, '6',0, '3',0, '0',0,
'1',0, ':',0, 'e',0, 'P',0, 'a',0, 's',0, 's',0, 'p',0, 'o',0,
'r',0, 't',0, ' ',0, 'E',0, 'v',0, 'a',0, 'l',0, 'u',0, 'a',0,
't',0, 'i',0, 'o',0, 'n',0, ' ',0, 'K',0, 'i',0, 't',0*/
'w',0, 'y',0, 'h',0,'w',0, 'y',0, 'h',0, 'w',0, 'y',0,
'w',0, 'y',0, 'h',0, 'w',0, 'y',0, 'h',0, 'w',0, 'y',0, 'h',0,
'w',0, 'y',0, 'h',0, 'w',0, 'y',0, 'h',0, 'w',0, 'y',0, 'h',0,
'w',0, 'y',0, 'h',0, 'w',0, 'y',0, 'h',0, 'w',0, 'y',0
};
const u8 MASS_StringSerial[MASS_SIZ_STRING_SERIAL] = {
MASS_SIZ_STRING_SERIAL,
0x03,
/* Serial number: "0000000000001" */
'0',0,'0',0,'0',0,'0',0,'0',0,'0',0,'0',0,'0',0, '0',0,'0',0,'0',0, '1',0
};
const u8 MASS_StringInterface[MASS_SIZ_STRING_INTERFACE] = {
MASS_SIZ_STRING_INTERFACE,
0x03,
/* Interface 0: "ST Mass" */
'S',0, 'H',0, 'H',0, 'I',0, 'C',0
};
/******************* (C) COPYRIGHT 2006 STMicroelectronics *****END OF FILE****/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -