Thanks Jan.
Here is the config descriptor definition:
Audio Streaming OUT interface #1 -> IT6 -> OT7 -> speaker
Mic -> IT8 -> OT9 -> Audio Streaming IN interface #2
const uint8_t USB_HSConfigDescriptor[] = {
USB_CONFIGUARTION_DESC_SIZE, /* bLength */
USB_CONFIGURATION_DESCRIPTOR_TYPE, /* bDescriptorType */
WBVAL( /* wTotalLength */
USB_CONFIGUARTION_DESC_SIZE +
USB_INTERFACE_ASSOCIATION_DESC_SIZE +
USB_INTERFACE_DESC_SIZE + //interface 0
AUDIO_CONTROL_INTERFACE_DESC_SZ(2) +
2*AUDIO_INPUT_TERMINAL_DESC_SIZE +
2*AUDIO_OUTPUT_TERMINAL_DESC_SIZE +
USB_INTERFACE_DESC_SIZE + //interface 1
USB_INTERFACE_DESC_SIZE +
AUDIO_STREAMING_INTERFACE_DESC_SIZE +
AUDIO_FORMAT_TYPE_I_DESC_SZ(1) +
AUDIO_STANDARD_ENDPOINT_DESC_SIZE +
AUDIO_STREAMING_ENDPOINT_DESC_SIZE +
USB_INTERFACE_DESC_SIZE + //interface 2
USB_INTERFACE_DESC_SIZE +
AUDIO_STREAMING_INTERFACE_DESC_SIZE +
AUDIO_FORMAT_TYPE_I_DESC_SZ(1) +
AUDIO_STANDARD_ENDPOINT_DESC_SIZE +
AUDIO_STREAMING_ENDPOINT_DESC_SIZE
// USB_INTERFACE_DESC_SIZE + // Interface 3
// HID_DESC_SIZE +
// USB_ENDPOINT_DESC_SIZE
),
0x03, /* bNumInterfaces */
0x01, /* bConfigurationValue */
0x00, /* iConfiguration */
USB_CONFIG_BUS_POWERED | /* bmAttributes */
USB_CONFIG_REMOTE_WAKEUP,
USB_CONFIG_POWER_MA(50), /* bMaxPower, device power consumption is 100 mA */
/* Interface Association Descriptor (IAD) */
USB_INTERFACE_ASSOCIATION_DESC_SIZE, /* bLength */
USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE, /* bDescriptorType */
0x00, /* bFirstInterface */
0x03, /* bInterfaceCount */
USB_DEVICE_CLASS_AUDIO, /* bFunctionClass */
AUDIO_SUBCLASS_MIDISTREAMING, /* bFunctionSubClass */
AUDIO_PROTOCOL_UNDEFINED, /* bFunctionProtocol */
0x00, /* iFunction */
/* Interface 0, Alternate Setting 0, Audio Control */
USB_INTERFACE_DESC_SIZE, /* bLength */
USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */
0x00, /* bInterfaceNumber */
0x00, /* bAlternateSetting */
0x00, /* bNumEndpoints */
USB_DEVICE_CLASS_AUDIO, /* bInterfaceClass */
AUDIO_SUBCLASS_AUDIOCONTROL, /* bInterfaceSubClass */
AUDIO_PROTOCOL_UNDEFINED, /* bInterfaceProtocol */
0x00, /* iInterface */
/* Audio Control Interface */
AUDIO_CONTROL_INTERFACE_DESC_SZ(2),/* bLength */
AUDIO_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */
AUDIO_CONTROL_HEADER, /* bDescriptorSubtype */
WBVAL(0x0100), /* 1.00 */ /* bcdADC */
WBVAL( /* wTotalLength */
AUDIO_CONTROL_INTERFACE_DESC_SZ(2) +
2*AUDIO_INPUT_TERMINAL_DESC_SIZE +
2*AUDIO_OUTPUT_TERMINAL_DESC_SIZE
),
0x02, /* bInCollection */
0x01, /* baInterfaceNr */
0x02, /* baInterfaceNr */
/* Audio Input Terminal: Speaker */
AUDIO_INPUT_TERMINAL_DESC_SIZE, /* bLength */
AUDIO_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */
AUDIO_CONTROL_INPUT_TERMINAL, /* bDescriptorSubtype */
0x06, /* bTerminalID */
WBVAL(AUDIO_TERMINAL_USB_STREAMING),/* wTerminalType */
0x00, /* bAssocTerminal */
0x01, /* bNrChannels */
WBVAL(AUDIO_CHANNEL_M), /* wChannelConfig */
0x00, /* iChannelNames */
0x00, /* iTerminal */
/* Audio Output Terminal */
AUDIO_OUTPUT_TERMINAL_DESC_SIZE, /* bLength */
AUDIO_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */
AUDIO_CONTROL_OUTPUT_TERMINAL, /* bDescriptorSubtype */
0x07, /* bTerminalID */
WBVAL(AUDIO_TERMINAL_SPEAKERPHONE), /* wTerminalType */
0x00, /* bAssocTerminal */
0x06, /* bSourceID */
0x00, /* iTerminal */
/* Audio Input Terminal:Microphone */
AUDIO_INPUT_TERMINAL_DESC_SIZE, /* bLength */
AUDIO_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */
AUDIO_CONTROL_INPUT_TERMINAL, /* bDescriptorSubtype */
0x08, /* bTerminalID */
WBVAL(AUDIO_TERMINAL_DESKTOP_MICROPHONE),/* wTerminalType */
0x00, /* bAssocTerminal */
0x01, /* bNrChannels */
WBVAL(AUDIO_CHANNEL_M), /* wChannelConfig */
0x00, /* iChannelNames */
0x00, /* iTerminal */
/* Audio Output Terminal */
AUDIO_OUTPUT_TERMINAL_DESC_SIZE, /* bLength */
AUDIO_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */
AUDIO_CONTROL_OUTPUT_TERMINAL, /* bDescriptorSubtype */
0x09, /* bTerminalID */
WBVAL(AUDIO_TERMINAL_USB_STREAMING), /* wTerminalType */
0x00, /* bAssocTerminal */
0x08, /* bSourceID */
0x00, /* iTerminal */
/* Interface 1, Alternate Setting 0, Audio Streaming - Zero Bandwith */
USB_INTERFACE_DESC_SIZE, /* bLength */
USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */
0x01, /* bInterfaceNumber */
0x00, /* bAlternateSetting */
0x00, /* bNumEndpoints */
USB_DEVICE_CLASS_AUDIO, /* bInterfaceClass */
AUDIO_SUBCLASS_AUDIOSTREAMING, /* bInterfaceSubClass */
AUDIO_PROTOCOL_UNDEFINED, /* bInterfaceProtocol */
0x00, /* iInterface */
/* Interface 1, Alternate Setting 1, Audio Streaming - Operational */
USB_INTERFACE_DESC_SIZE, /* bLength */
USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */
0x01, /* bInterfaceNumber */
0x01, /* bAlternateSetting */
0x01, /* bNumEndpoints */
USB_DEVICE_CLASS_AUDIO, /* bInterfaceClass */
AUDIO_SUBCLASS_AUDIOSTREAMING, /* bInterfaceSubClass */
AUDIO_PROTOCOL_UNDEFINED, /* bInterfaceProtocol */
0x00, /* iInterface */
/* Audio Streaming Interface */
AUDIO_STREAMING_INTERFACE_DESC_SIZE,/* bLength */
AUDIO_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */
AUDIO_STREAMING_GENERAL, /* bDescriptorSubtype */
0x06, /* bTerminalLink */
0x01, /* bDelay */
WBVAL(AUDIO_FORMAT_PCM), /* wFormatTag */
/* Audio Type I Format */
AUDIO_FORMAT_TYPE_I_DESC_SZ(1), /* bLength */
AUDIO_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */
AUDIO_STREAMING_FORMAT_TYPE, /* bDescriptorSubtype */
AUDIO_FORMAT_TYPE_I, /* bFormatType */
0x01, /* bNrChannels */
0x02, /* bSubFrameSize */
16, /* bBitResolution */
0x01, /* bSamFreqType */
B3VAL(32000), /* tSamFreq */
/* Endpoint, EP2 ISO OUT - Standard Descriptor */
AUDIO_STANDARD_ENDPOINT_DESC_SIZE, /* bLength */
USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType */
USB_ENDPOINT_OUT(2), /* bEndpointAddress */
USB_ENDPOINT_TYPE_ISOCHRONOUS, /* bmAttributes */
WBVAL(64), /* wMaxPacketSize */
0x01, /* bInterval */
0x00, /* bRefresh */
0x00, /* bSynchAddress */
/* Endpoint - Audio Streaming */
AUDIO_STREAMING_ENDPOINT_DESC_SIZE,/* bLength */
AUDIO_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType */
AUDIO_ENDPOINT_GENERAL, /* bDescriptor */
0x00, /* bmAttributes */
0x00, /* bLockDelayUnits */
WBVAL(0x0000), /* wLockDelay */
/* Interface 2, Alternate Setting 0, Audio Streaming - Zero Bandwith */
USB_INTERFACE_DESC_SIZE, /* bLength */
USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */
0x02, /* bInterfaceNumber */
0x00, /* bAlternateSetting */
0x00, /* bNumEndpoints */
USB_DEVICE_CLASS_AUDIO, /* bInterfaceClass */
AUDIO_SUBCLASS_AUDIOSTREAMING, /* bInterfaceSubClass */
AUDIO_PROTOCOL_UNDEFINED, /* bInterfaceProtocol */
0x00, /* iInterface Microphone */
/* Interface 2, Alternate Setting 1, Audio Streaming - Operational */
USB_INTERFACE_DESC_SIZE, /* bLength */
USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */
0x02, /* bInterfaceNumber */
0x01, /* bAlternateSetting */
0x01, /* bNumEndpoints */
USB_DEVICE_CLASS_AUDIO, /* bInterfaceClass */
AUDIO_SUBCLASS_AUDIOSTREAMING, /* bInterfaceSubClass */
AUDIO_PROTOCOL_UNDEFINED, /* bInterfaceProtocol */
0x00, /* iInterface Microphone */
/* Audio Streaming Interface */
AUDIO_STREAMING_INTERFACE_DESC_SIZE,/* bLength */
AUDIO_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */
AUDIO_STREAMING_GENERAL, /* bDescriptorSubtype */
0x09, /* bTerminalLink */
0x01, /* bDelay */
WBVAL(AUDIO_FORMAT_PCM), /* wFormatTag */
/* Audio Type I Format */
AUDIO_FORMAT_TYPE_I_DESC_SZ(1), /* bLength */
AUDIO_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */
AUDIO_STREAMING_FORMAT_TYPE, /* bDescriptorSubtype */
AUDIO_FORMAT_TYPE_I, /* bFormatType */
0x01, /* bNrChannels */
0x02, /* bSubFrameSize */
0x10, /* bBitResolution */
0x01, /* bSamFreqType */
B3VAL(16000), /* tSamFreq */
/* Endpoint, EP3 ISO IN - Standard Descriptor */
AUDIO_STANDARD_ENDPOINT_DESC_SIZE, /* bLength */
USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType */
USB_ENDPOINT_IN(3), /* bEndpointAddress */
USB_ENDPOINT_TYPE_ISOCHRONOUS, /* bmAttributes */
WBVAL(32), /* wMaxPacketSize */
0x01, /* bInterval */
0x00, /* bRefresh */
0x00, /* bSynchAddress */
/* Endpoint - Audio Streaming */
AUDIO_STREAMING_ENDPOINT_DESC_SIZE,/* bLength */
AUDIO_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType */
AUDIO_ENDPOINT_GENERAL, /* bDescriptor */
0x00, /* bmAttributes */
0x00, /* bLockDelayUnits */
WBVAL(0x0000), /* wLockDelay */
/* Terminator */
0 /* bLength */
};
Thanks,
Andy