@[TOC]
本使使用的是stm32F105开发,带USB OTG FS接口
一、USB Audio的配置描述符
__ALIGN_BEGIN static uint8_t USBD_AUDIO_CfgDesc[USB_AUDIO_CONFIG_DESC_SIZ] __ALIGN_END =
{
/* Configuration 1 */
0x09, /* bLength */
USB_DESC_TYPE_CONFIGURATION, /* bDescriptorType */
LOBYTE(USB_AUDIO_CONFIG_DESC_SIZ), /* wTotalLength 109 bytes*/
HIBYTE(USB_AUDIO_CONFIG_DESC_SIZ),
0x03, //NumInterfaces:3
0x01, //ConfigurationValue
0x00, //Configuration String
0x80, //Attributes:Bus Power
0xfa, //MaxPower = 0xfa*2ma
/**********************Audio Interface Descriptor(No.0):0x04**********************/
//第一个接口,控制接口
0x09, //Length
0x04, //DescriptorType:Inerface
0x00, //InterfaceNum:0
0x00, //AlternateSetting:0
0x00, //NumEndpoint:0
0x01, //InterfaceClass:audio
0x01, //InterfaceSubClass:audio ctl
0x00, //InterfaceProtocol
0x00, //Interface String
/*******************AC Header of Interface Descriptor:0x24 0x01*************************/
0x0a, //Length
0x24, //DescriptorType:audio interface descriptor
0x01, //DescriptorSubType:audio control header
0x00,
0x01, //bcdADC:audio Device Class v1.00
0x48,
0x00, //TotalLength:0x0048 (这个长度应该是特性单元跟Terminal描述符的总长度,包括自己 Total size of class specific descriptors.)
0x02, //InCollection:2 AudioStreaming interface
0x01, //InterfaceNr(2) - AS #1 id AudioStreaming interface 2 belongs to this AudioControl interface
0x02, //InterfaceNr(1) - AS #2 id AudioStreaming interface 1 belongs to this AudioControl interface
/******************* AC Specific type of Input Terminal:0x24 0x02*************************/
//ID1
0x0c, //Length
0x24, //DescriptorType:audio interface descriptor
0x02, //DescriptorSubType:Input Terminal
0x01, //TerminalID:0x01
0x01,
0x02, //TerminalType:USB Microphone
0x00, //AssocTerminal
0x02, //NrChannels:2 channel
0x03,
0x00, //ChannelConfig:Left Front,Right Front,
0x00, //ChannelName String