Continue working on descriptors.
This commit is contained in:
parent
12e177d375
commit
fbbc5da2a9
|
@ -2,7 +2,7 @@
|
||||||
#define USBD_DESCRIPTORS_H
|
#define USBD_DESCRIPTORS_H
|
||||||
|
|
||||||
UCHAR device_framework_fs[] = {
|
UCHAR device_framework_fs[] = {
|
||||||
/* Device descriptor */
|
/* Device descriptor, size=18 */
|
||||||
0x12, // bLength
|
0x12, // bLength
|
||||||
0x01, // bDescriptorType
|
0x01, // bDescriptorType
|
||||||
0x00, 0x02, // bcdUSB
|
0x00, 0x02, // bcdUSB
|
||||||
|
@ -10,25 +10,25 @@ UCHAR device_framework_fs[] = {
|
||||||
0x02, // bDeviceSubClass !! -^
|
0x02, // bDeviceSubClass !! -^
|
||||||
0x01, // bDeviceProtocol !! -^
|
0x01, // bDeviceProtocol !! -^
|
||||||
0x08, // bMaxPacketSize0
|
0x08, // bMaxPacketSize0
|
||||||
0x81, 0x07, // idVendor
|
0x83, 0x04, // idVendor !! 0x0483
|
||||||
0x00, 0x00, // idProduct
|
0x30, 0x57, // idProduct !! 0x5730
|
||||||
0x00, 0x00, // bcdDevice
|
0x00, 0x00, // bcdDevice
|
||||||
0x01, // iManufacturer
|
0x01, // iManufacturer
|
||||||
0x02, // iProduct
|
0x02, // iProduct
|
||||||
0x03, // iSerialNumber
|
0x03, // iSerialNumber
|
||||||
0x01, // bNumConfigurations
|
0x01, // bNumConfigurations
|
||||||
|
|
||||||
/* Configuration descriptor */
|
/* Configuration descriptor size=9 */
|
||||||
0x09, // bLength
|
0x09, // bLength
|
||||||
0x02, // bDescriptorType
|
0x02, // bDescriptorType
|
||||||
0x20, 0x00, // wTotalLength
|
0x41, 0x00, // wTotalLength !! 9 + 8 + 9 + 9 + 8 + 8 + 14 + ...
|
||||||
0x01, // bNumInterfaces
|
0x01, // bNumInterfaces
|
||||||
0x01, // bConfigurationValue
|
0x01, // bConfigurationValue
|
||||||
0x00, // iConfiguration
|
0x00, // iConfiguration
|
||||||
0xC0, // bmAttributes
|
0x80, // bmAttributes !! Bus powered
|
||||||
0x32, // bMaxPower
|
0x39, // bMaxPower
|
||||||
|
|
||||||
/* Interface Association descriptor <ECN> */
|
/* Interface Association descriptor <ECN> size=8 */
|
||||||
0x08, // bLength
|
0x08, // bLength
|
||||||
0x0B, // bDescriptorType !! IAD, See ECN
|
0x0B, // bDescriptorType !! IAD, See ECN
|
||||||
0x00, // bFirstInterface
|
0x00, // bFirstInterface
|
||||||
|
@ -38,11 +38,55 @@ UCHAR device_framework_fs[] = {
|
||||||
0x20, // bFunctionProtocol !! AF_VERSION_02_00
|
0x20, // bFunctionProtocol !! AF_VERSION_02_00
|
||||||
0x00, // iFunction
|
0x00, // iFunction
|
||||||
|
|
||||||
/* Audio Control Interface descriptor */
|
/* Audio Control Interface descriptor size=9 */
|
||||||
0x09, // bLength
|
0x09, // bLength
|
||||||
0x00, // bDescriptorType
|
0x04, // bDescriptorType
|
||||||
0x00, // bInterfaceNumber
|
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
|
||||||
|
0x27, 0x00, // wTotalLength !! UAC2 Table 4-5 9 + 8 + 8 + 14 + ...
|
||||||
|
0x00, // bmControls
|
||||||
|
|
||||||
|
/* Audio Control Clock Source descriptor clockid=0 size=8 */
|
||||||
|
0x08, // bLength
|
||||||
|
0x24, // bDescriptorType
|
||||||
|
0x0A, // bDescriptorSubType
|
||||||
|
0x00, // bClockID
|
||||||
|
0x01, // bmAttributes !! Internal fixed clock
|
||||||
|
0x01, // bmControls
|
||||||
|
0x00, // bAssocTerminal
|
||||||
|
0x00, // iClockSource
|
||||||
|
|
||||||
|
/* Audio Control Clock Source descriptor clockid=1 size=8 */
|
||||||
|
0x08, // bLength
|
||||||
|
0x24, // bDescriptorType
|
||||||
|
0x0A, // bDescriptorSubType
|
||||||
|
0x01, // bClockID
|
||||||
|
0x01, // bmAttributes !! Internal fixed clock
|
||||||
|
0x01, // bmControls
|
||||||
|
0x00, // bAssocTerminal
|
||||||
|
0x00, // iClockSource
|
||||||
|
|
||||||
|
/* Audio Control Feature Unit descriptor size=14 */
|
||||||
|
0x0E, // bLength !!
|
||||||
|
0x24, // bDescriptorType
|
||||||
|
0x06, // bDescriptorSubType
|
||||||
|
0x05, // bUnitID !!
|
||||||
|
0x04, // bSourceID !!
|
||||||
|
0x0F, 0x00, 0x00, 0x00, // bmaControls(0) !!
|
||||||
|
0x0F, 0x00, 0x00, 0x00, // bmaControls(1) !!
|
||||||
|
0x00, // iFeature
|
||||||
};
|
};
|
||||||
|
|
||||||
UCHAR device_framework_hs[] = {
|
UCHAR device_framework_hs[] = {
|
||||||
|
@ -119,53 +163,35 @@ UCHAR device_framework_hs[] = {
|
||||||
0x00,
|
0x00,
|
||||||
};
|
};
|
||||||
|
|
||||||
UCHAR string_device_framework[] = {
|
/* Note: this is not the standard string descriptor. */
|
||||||
|
UCHAR device_framework_string[] = {
|
||||||
/* Manufacturer string descriptor : Index 1 */
|
/* Manufacturer string descriptor : Index 1 */
|
||||||
0x09,
|
0x09, 0x04, // wLANGID
|
||||||
0x04,
|
0x01, // bIndex
|
||||||
0x01,
|
0x12, // bLength
|
||||||
0x0c,
|
'S', 'T', 'M', 'i', // ..DATA
|
||||||
0x45,
|
'c', 'r', 'o', 'e', // -^
|
||||||
0x78,
|
'l', 'e', 'c', 't', // -^
|
||||||
0x70,
|
'r', 'o', 'n', 'i', // -^
|
||||||
0x72,
|
'c', 's', // -^
|
||||||
0x65,
|
|
||||||
0x73,
|
|
||||||
0x20,
|
|
||||||
0x4c,
|
|
||||||
0x6f,
|
|
||||||
0x67,
|
|
||||||
0x69,
|
|
||||||
0x63,
|
|
||||||
|
|
||||||
/* Product string descriptor : Index 2 */
|
/* Product string descriptor : Index 2 */
|
||||||
0x09,
|
0x09, 0x04, // wLANGID
|
||||||
0x04,
|
0x02, // bIndex
|
||||||
0x02,
|
0x0a, // bLength
|
||||||
0x0a,
|
'L', 'o', '-', 'R', // ..DATA
|
||||||
0x46,
|
'e', 's', ' ', 'D', // -^
|
||||||
0x6c,
|
'A', 'C', // -^
|
||||||
0x61,
|
|
||||||
0x73,
|
|
||||||
0x68,
|
|
||||||
0x20,
|
|
||||||
0x44,
|
|
||||||
0x69,
|
|
||||||
0x73,
|
|
||||||
0x6b,
|
|
||||||
|
|
||||||
/* Serial Number string descriptor : Index 3 */
|
/* Serial Number string descriptor : Index 3 */
|
||||||
0x09,
|
0x09,
|
||||||
0x04,
|
0x04, // wLANGID
|
||||||
0x03,
|
0x03, // bIndex
|
||||||
0x04,
|
0x04, // bLength
|
||||||
0x30,
|
0x30, 0x30, 0x30, 0x31, // "0001"
|
||||||
0x30,
|
|
||||||
0x30,
|
|
||||||
0x31,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
UCHAR language_id_framework[] = {
|
UCHAR device_framework_lang_id[] = {
|
||||||
/* English. */
|
/* English. */
|
||||||
0x09,
|
0x09,
|
||||||
0x04,
|
0x04,
|
||||||
|
|
|
@ -132,11 +132,11 @@ void tx_application_define(void *first_unused_memory) {
|
||||||
|
|
||||||
memory_ptr += 32 * 1024;
|
memory_ptr += 32 * 1024;
|
||||||
|
|
||||||
_ux_device_stack_initialize(device_framework_hs, sizeof(device_framework_hs),
|
ux_device_stack_initialize(device_framework_hs, sizeof(device_framework_hs),
|
||||||
device_framework_fs, sizeof(device_framework_fs),
|
device_framework_fs, sizeof(device_framework_fs),
|
||||||
string_device_framework, sizeof(string_device_framework),
|
device_framework_string, sizeof(device_framework_string),
|
||||||
language_id_framework, sizeof(language_id_framework),
|
device_framework_lang_id, sizeof(device_framework_lang_id),
|
||||||
UX_NULL);
|
UX_NULL);
|
||||||
|
|
||||||
|
|
||||||
//_ux_device_stack_class_register(_ux_system_slave_class_audio_name, _ux_device_class_audio_entry, 1, 0, UX_NULL);
|
//_ux_device_stack_class_register(_ux_system_slave_class_audio_name, _ux_device_class_audio_entry, 1, 0, UX_NULL);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user