📄 usb_desc.c
字号:
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
PROJECT : ARM USB: LOOPBACK Tutorial
MODULE : USB_desc.c
AUTHOR : MCD Application Team
CREATION DATE : 21/04/2004
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
DESCRIPTION : Descriptors for BULK Loopback USB
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
#include "USB_lib.h"
#include "USB_desc.h"
const BYTE BULK_Loop_DeviceDescriptor[] = {
0x12, /* bLength */
0x1, /* bDescriptorType */
0x0,
0x1, /* bcdUSB */
/************************************************/
0x00, /* bDeviceClass */
0x00, /* bDeviceSubClass */
0x0, /* bDeviceProtocol */
0x08, /* bMaxPacketSize0 */
0x83,
0x04, /* idVendor */
0x10,
0x56, /* idProduct = 0x9911 */
0x00,
0x01, /* bcdDevice */
4, /* Index of string descriptor describing manufacturer */
42, /* Index of string descriptor describing product */
0, /*88,*/ /* Index of string descriptor describing the device's serial number */
0x1 /* bNumConfigurations */
};
const BYTE BULK_Loop_StringDescriptor[] = {
0x04,
0x03,
0x09,
0x04, /* LangID = 0x0409: U.S. English */
/* 4 */
38, /* Size of manufaturer string */
0x03, /* bDescriptorType = String descriptor */
/* Manufacturer: "STMicroelectronics" */
'S',0, 'T',0, 'M',0, 'i',0, 'c',0, 'r',0, 'o',0, 'e',0,
'l',0, 'e',0, 'c',0, 't',0, 'r',0, 'o',0, 'n',0, 'i',0,
'c',0, 's',0,
/* 42 */
46,
0x03,
/* Product name: "ARM7 USB Bulk Test Demo" */
'A',0, 'R',0, 'M',0, '7',0, ' ',0, 'U',0, 'S',0, 'B',0,
'B',0, 'u',0, 'l',0, 'k',0, ' ',0, 'T',0, 'e',0, 's',0,
't',0, ' ',0, 'D',0, 'e',0, 'm',0, 'o',0,
/* 88 */
22,
0x03,
'1',0, '9',0, '/',0, '0',0, '7',0, '/',0, '2',0, '0',0,
'0',0, '0',0
};
const BYTE BULK_Loop_ConfigDescriptor[] = {
/*-------------------------- Configuation Descriptor ------------------------*/
0x9, /* bLength: Configuation Descriptor size */
0x2, /* bDescriptorType: Configuration */
/*********************** wTotalLength **********************/
BULK_LOOP_SIZ_CONFIG_DESC, /* wTotalLength:no of returned bytes */
0x0,
/*********************** 1 interface **********************/
0x1, /* bNumInterfaces: 1 interface */
/***********************************************************/
0x1, /* bConfigurationValue: Configuration value */
0x0, /* iConfiguration: Index of string descriptor describing the configuration */
0x40, /* bmAttributes: self powered */
0x00, /* MaxPower 0 mA */
/*-------------------------- Interface Descriptor ------------------------*/
0x09, /* bLength: Interface Descriptor size */
0x04, /* bDescriptorType: */
/* Interface descriptor type */
0x00, /* bInterfaceNumber: Number of Interface */
0x00, /* bAlternateSetting: Alternate setting */
0x03, /* bNumEndpoints: 3 endpoints used */
0xFF, /* bInterfaceClass: Vendor Specified */
0x00, /* bInterfaceSubClass: No subclass */
0x00, /* nInterfaceProtocol: None */
0x00, /* iInterface: */
/* Index of string descriptor */
/*----------------------- INTERRUPT Endpoint 1 Descriptor ---------------------*/
0x07, /* bLength: Endpoint Descriptor size */
0x05, /* bDescriptorType: */
/* Endpoint descriptor type */
0x81, /* bEndpointAddress: */
/* Endpoint Address (IN) */
0x03, /* bmAttributes: INTERRUPT endpoint */
0x02, /* wMaxPacketSize */
0x00,
0x80, /* bInterval: polling time */
/*----------------------- BULK OUT Endpoint 2 Descriptor ---------------------*/
0x07, /* bLength: Endpoint Descriptor size */
0x05, /* bDescriptorType: */
/* Endpoint descriptor type */
0x02, /* bEndpointAddress: */
/* Endpoint Address (OUT) */
0x02, /* bmAttributes: Bulk endpoint */
BULK_PAY_LOAD, /* wMaxPacketSize: Bulk endpoint maximum packet size is 64 bytes */
0x00,
0x00, /* bInterval: ignore for Bulk transfer */
/*----------------------- BULK IN Endpoint 3 Descriptor ----------------------*/
0x07, /* bLength: Endpoint Descriptor size */
0x05, /* bDescriptorType: */
/* Endpoint descriptor type */
0x83, /* bEndpointAddress: */
/* Endpoint Address (IN) */
0x02, /* bmAttributes: Bulk endpoint */
BULK_PAY_LOAD, /* wMaxPacketSize: Bulk endpoint maximum packet size is 64 bytes */
0x00,
0x00, /* bInterval: ignore for Bulk transfer */
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -