/* USB HID&MSC device Configuration Descriptor */
static uint8 USBD_CfgDesc[USB_HIDMSC_CONFIG_DESC_SIZ] =
{
0x09, //bLength: Configuration Descriptor size
USB_CONFIGURATION_DESCRIPTOR_TYPE, //bDescriptorType: Configuration
USB_HIDMSC_CONFIG_DESC_SIZ, //wTotalLength: Bytes returned
0x00,
0x02, //bNumInterfaces: 1 interface
0x01, //bConfigurationValue: Configuration value
0x00, //iConfiguration: Index of string descriptor describing the configuration
0xC0, //bmAttributes: bus powered and NOT Support Remote Wake-up
0x00, //MaxPower 0 mA: this current is used for detecting Vbus
/** Mass Storage interface (09)**/
0x09, //bLength: Interface Descriptor size
0x04, //bDescriptorType:
0x00, //bInterfaceNumber: Number of Interface
0x00, //bAlternateSetting: Alternate setting
0x02, //bNumEndpoints*/
0x08, //bInterfaceClass: MSC Class
0x06, //bInterfaceSubClass : SCSI transparent
0x50, //nInterfaceProtocol
0x05, //iInterface:
/** Mass Storage IN Endpoints (18) **/
0x07, //Endpoint descriptor length = 7
0x05, //Endpoint descriptor type
MSC_IN_EP, //Endpoint address (IN, address 1)
0x02, //Bulk endpoint type
LOBYTE(MSC_MAX_PACKET),
HIBYTE(MSC_MAX_PACKET),
0x00, //Polling interval in milliseconds
/** Mass Storage OUT Endpoints (25) **/
0x07, //Endpoint descriptor length = 7
0x05, //Endpoint descriptor type
MSC_OUT_EP, //Endpoint address (OUT, address 1)
0x02, //Bulk endpoint type
LOBYTE(MSC_MAX_PACKET),
HIBYTE(MSC_MAX_PACKET),
0x00, //Polling interval in milliseconds
/* Descriptor of Custom HID interface (32)*/
0x09, //bLength: Interface Descriptor size
0x04, //bDescriptorType: Interface descriptor type
0x01, //bInterfaceNumber: Number of Interface
0x00, //bAlternateSetting: Alternate setting
0x02, //bNumEndpoints
0x03, //bInterfaceClass: HID
0x00, //bInterfaceSubClass : 1=BOOT, 0=no boot
0x00, //nInterfaceProtocol : 0=none, 1=keyboard, 2=mouse
0, //iInterface: Index of string descriptor
/** Descriptor of Custom HID (41) **/
0x09, //bLength: HID Descriptor size
HID_DESCRIPTOR_TYPE, //bDescriptorType: HID
0x10, //bcdHID: HID Class Spec release number
0x01,
0x00, //bCountryCode: Hardware target country
0x01, //bNumDescriptors: Number of HID class descriptors to follow
0x22, //bDescriptorType
HID_REPORT_DESC_SIZE,//wItemLength: Total length of Report descriptor
0x00,
/** Descriptor of IN endpoint(50) **/
0x07, //bLength: Endpoint Descriptor size
0x05, //bDescriptorType:
HID_IN_EP, //bEndpointAddress: Endpoint Address (IN)
0x03, //bmAttributes: Interrupt endpoint
HID_IN_PACKET,//wMaxPacketSize: 64 Byte max
0x00,
0x01, //bInterval: Polling Interval (1 ms)
/** Descriptor of OUT endpoint (57) **/
0x07, //bLength: Endpoint Descriptor size
0x05, //bDescriptorType:
HID_OUT_EP, //bEndpointAddress: Endpoint Address (IN)
0x03, //bmAttributes: Interrupt endpoint
HID_OUT_PACKET, //wMaxPacketSize: 64 Byte max
0x00,
0x01, //bInterval: Polling Interval (1 ms)
};