247 lines
6.8 KiB
C
247 lines
6.8 KiB
C
#ifndef USBD_DESCRIPTORS_H
|
|
#define USBD_DESCRIPTORS_H
|
|
|
|
UCHAR device_framework_fs[] = {
|
|
/* Device descriptor, size=18 */
|
|
0x12, // bLength
|
|
0x01, // bDescriptorType
|
|
0x00, 0x02, // bcdUSB
|
|
0xEF, // bDeviceClass !! DESCRIBED IN IAD
|
|
0x02, // bDeviceSubClass !! -^
|
|
0x01, // bDeviceProtocol !! -^
|
|
0x08, // bMaxPacketSize0
|
|
0x83, 0x04, // idVendor !! 0x0483
|
|
0x30, 0x57, // idProduct !! 0x5730
|
|
0x00, 0x00, // bcdDevice
|
|
0x01, // iManufacturer
|
|
0x02, // iProduct
|
|
0x03, // iSerialNumber
|
|
0x01, // bNumConfigurations
|
|
|
|
/* Configuration descriptor size=9 */
|
|
0x09, // bLength
|
|
0x02, // bDescriptorType
|
|
0x6F, 0x00, // wTotalLength !! 9 + 8 + 9 + 9 + 8 + 8 + 8 + 9 + 14 + 17 + 12 + ...
|
|
0x01, // bNumInterfaces
|
|
0x01, // bConfigurationValue
|
|
0x00, // iConfiguration
|
|
0x80, // bmAttributes !! Bus powered
|
|
0x39, // bMaxPower
|
|
|
|
/* Interface Association descriptor <ECN> size=8 */
|
|
0x08, // bLength
|
|
0x0B, // bDescriptorType !! IAD, See ECN
|
|
0x00, // bFirstInterface
|
|
0x01, // bInterfaceCount
|
|
0x01, // bFunctionClass !! AUDIO_FUNCTION
|
|
0x00, // bFunctionSubClass !! FUNCTION_SUBCLASS_UNDEFINED
|
|
0x20, // bFunctionProtocol !! AF_VERSION_02_00
|
|
0x00, // iFunction
|
|
|
|
/* Audio Control Interface descriptor size=9 */
|
|
0x09, // bLength
|
|
0x04, // bDescriptorType
|
|
0x00, // bInterfaceNumber
|
|
0x00, // bAlternateSetting
|
|
0x00, // bNumEndpoints
|
|
0x01, // bInterfaceClass
|
|
0x01, // bInterfaceSubClass
|
|
0x20, // bInterfaceProtocol
|
|
0x00, // iInterface
|
|
|
|
/* Audio Control Interface Header descriptor size=9 */
|
|
0x09, // bLength
|
|
0x24, // bDescriptorType
|
|
0x01, // bDescriptorSubType
|
|
0x00, 0x02, // bcdADC !! 2.00
|
|
0x08, // bCategory
|
|
0x55, 0x00, // wTotalLength !! <UAC2 Table 4-5> 9 + 8 + 8 + 8 + 9 + 14 + 17 + 12 + ...
|
|
0x00, // bmControls
|
|
|
|
/* Audio Control Clock Source descriptor CID=0x10 size=8 */
|
|
0x08, // bLength
|
|
0x24, // bDescriptorType
|
|
0x0A, // bDescriptorSubType
|
|
0x10, // bClockID
|
|
0x01, // bmAttributes !! Internal fixed clock 1
|
|
0x01, // bmControls
|
|
0x00, // bAssocTerminal
|
|
0x00, // iClockSource
|
|
|
|
/* Audio Control Clock Source descriptor CID=0x11 size=8 */
|
|
0x08, // bLength
|
|
0x24, // bDescriptorType
|
|
0x0A, // bDescriptorSubType
|
|
0x11, // bClockID
|
|
0x01, // bmAttributes !! Internal fixed clock 2
|
|
0x01, // bmControls
|
|
0x00, // bAssocTerminal
|
|
0x00, // iClockSource
|
|
|
|
/* Audio Control Clock Source descriptor CID=0x12 size=8 */
|
|
0x08, // bLength
|
|
0x24, // bDescriptorType
|
|
0x0A, // bDescriptorSubType
|
|
0x11, // bClockID
|
|
0x05, // bmAttributes !! Sync to SOF
|
|
0x01, // bmControls
|
|
0x00, // bAssocTerminal
|
|
0x00, // iClockSource
|
|
|
|
/* Audio Control Clock Selector descriptor CID=0x18 size=9 */
|
|
0x09, // bLength
|
|
0x24, // bDescriptorType !! CS_INTERFACE
|
|
0x0B, // bDescriptorSubType !! CLOCK_SELECTOR
|
|
0x18, // bClockID !!
|
|
0x02, // bNrInPins !! 2 input pins
|
|
0x10, // baCSourceID(1) !! From Clock Source CID=0x10
|
|
0x11, // baCSourceID(2) !! From Clock Source CID=0x11
|
|
0x03, // bmControls !!
|
|
0x00, // iClockSelector
|
|
|
|
/* Audio Control Feature Unit descriptor UID=0 size=14 */
|
|
0x0E, // bLength !!
|
|
0x24, // bDescriptorType
|
|
0x06, // bDescriptorSubType
|
|
0x30, // bUnitID !!
|
|
0x20, // bSourceID !! From Input Terminal TID=0x20
|
|
0x0F, 0x00, 0x00, 0x00, // bmaControls(0) !!
|
|
0x0F, 0x00, 0x00, 0x00, // bmaControls(1) !!
|
|
0x00, // iFeature
|
|
|
|
/* Audio Control Input Terminal descriptor TID=0x20 size=17 */
|
|
0x11, // bLength
|
|
0x24, // bDescriptorType
|
|
0x02, // bDescriptorSubType
|
|
0x20, // bTerminalID !! TID=0x20
|
|
0x01, 0x01, // wTerminalType !! Should be an OUT EP
|
|
0x00, // bAssocTerminal !!
|
|
0x12, // bCSourceID !! From Clock Selector CID=0x12
|
|
0x02, // bNrChannels
|
|
0x00, 0x00, 0x00, 0x00, // bmChannelConfig
|
|
0x00, // iChannelNames
|
|
0x00, 0x00, // bmControls
|
|
0x00, // iTerminal
|
|
|
|
/* Audio Control Output Terminal descriptor TID=0x21 size=12 */
|
|
0x0C, // bLength
|
|
0x24, // bDescriptorType
|
|
0x03, // bDescriptorSubType
|
|
0x21, // bTerminalID !! TID=0x21
|
|
0x01, 0x03, // wTerminalType !! Should be a speaker
|
|
0x00, // bAssocTerminal
|
|
0x30, // bSourceID !! From Feature Unit UID=0x30
|
|
0x18, // bCSourceID !! Associate with Clock selector at id=0x18
|
|
0x00, 0x00, // bmControls !! TBD
|
|
0x00, // iTerminal
|
|
};
|
|
|
|
UCHAR device_framework_hs[] = {
|
|
/* Device descriptor */
|
|
0x12,
|
|
0x01,
|
|
0x00,
|
|
0x02,
|
|
0x00,
|
|
0x00,
|
|
0x00,
|
|
0x40,
|
|
0x81,
|
|
0x07,
|
|
0x00,
|
|
0x00,
|
|
0x01,
|
|
0x00,
|
|
0x01,
|
|
0x02,
|
|
0x03,
|
|
0x01,
|
|
|
|
/* Device qualifier descriptor */
|
|
0x0a,
|
|
0x06,
|
|
0x00,
|
|
0x02,
|
|
0x00,
|
|
0x00,
|
|
0x00,
|
|
0x40,
|
|
0x01,
|
|
0x00,
|
|
|
|
/* Configuration descriptor */
|
|
0x09,
|
|
0x02,
|
|
0x20,
|
|
0x00,
|
|
0x01,
|
|
0x01,
|
|
0x00,
|
|
0xc0,
|
|
0x32,
|
|
|
|
/* Interface descriptor */
|
|
0x09,
|
|
0x04,
|
|
0x00,
|
|
0x00,
|
|
0x02,
|
|
0x08,
|
|
0x06,
|
|
0x50,
|
|
0x00,
|
|
|
|
/* Endpoint descriptor (Bulk In) */
|
|
0x07,
|
|
0x05,
|
|
0x81,
|
|
0x02,
|
|
0x00,
|
|
0x02,
|
|
0x00,
|
|
|
|
/* Endpoint descriptor (Bulk Out) */
|
|
0x07,
|
|
0x05,
|
|
0x02,
|
|
0x02,
|
|
0x00,
|
|
0x02,
|
|
0x00,
|
|
};
|
|
|
|
/* Note: this is not the standard string descriptor. */
|
|
UCHAR device_framework_string[] = {
|
|
/* Manufacturer string descriptor : Index 1 */
|
|
0x09, 0x04, // wLANGID
|
|
0x01, // bIndex
|
|
0x12, // bLength
|
|
'S', 'T', 'M', 'a', // ..DATA
|
|
'c', 'r', 'o', 'e', // -^
|
|
'l', 'e', 'c', 't', // -^
|
|
'r', 'o', 'n', 'i', // -^
|
|
'c', 's', // -^
|
|
|
|
/* Product string descriptor : Index 2 */
|
|
0x09, 0x04, // wLANGID
|
|
0x02, // bIndex
|
|
0x0a, // bLength
|
|
'L', 'o', '-', 'R', // ..DATA
|
|
'e', 's', ' ', 'D', // -^
|
|
'A', 'C', // -^
|
|
|
|
/* Serial Number string descriptor : Index 3 */
|
|
0x09,
|
|
0x04, // wLANGID
|
|
0x03, // bIndex
|
|
0x04, // bLength
|
|
0x30, 0x30, 0x30, 0x31, // "0001"
|
|
};
|
|
|
|
UCHAR device_framework_lang_id[] = {
|
|
/* English. */
|
|
0x09,
|
|
0x04,
|
|
};
|
|
|
|
#endif |