初中生
最后登录1970-1-1
在线时间 小时
注册时间2014-9-12
|
这下面是USB描述符,为什么我设置采样位32位,然后就不能用了。原来是16位的。
//Config_Descriptor
{
sizeof(Config_Descriptor),
CONFIGURATION, //.bDescriptorType
sizeof(USB_Config_Descriptor_Audio10), //.wTotalLength
INTERFACE_COUNT, //.bNumInterfaces
0x01, //.bConfigurationValue
0x00, //.iConfiguration
0x80, //.bmAttributes
MAX_POWER //.MaxPower
},
//Interface_Descriptor
{
sizeof(Interface_Descriptor),
INTERFACE, //bDescriptorType
INTERFACE_NUMBER_AUDIO_CONTROL, //.bInterfaceNumber
0x00, //.bAlternateSetting
0x00, //.bNumEndpoints
AUDIO, //.bInterfaceClass
AUDIOCONTROL, //.bInterfaceSubClass
0x00, //.bInterfaceProtocol
0x00 //.iInterface
},
//USB_Control_Interface_UAC10
{
//Class_Specific_AC_Interface_Descriptor_UAC10
{
sizeof(Class_Specific_AC_Interface_Descriptor_UAC10),
CS_INTERFACE, //.bDescriptorType
HEADER, //.bDescriptorSubtype
0x0100, //.bcdADC
sizeof(USB_Control_Interface_UAC10), //.wTotalLength
1, //.bInCollection
INTERFACE_NUMBER_AUDIO_INPUT, //.baInterfaceNr
},
#if(NUM_AUD_CHAN_IN > 0)
//Input_Terminal_Descriptor_UAC10
{
sizeof(Input_Terminal_Descriptor_UAC10),
CS_INTERFACE, //.bDescriptorType
INPUT_TERMINAL, //.bDescriptorSubtype
ID_IT_AUD, //.bTerminalID
Microphone, //.wTerminalType
0x00, //.bAssocTerminal
NUM_AUD_CHAN_IN, //.bNrChannels
0x0003, //.wChannelConfig
0x00, //.iChannelNames
0x00 //.iTerminal
},
#if(INPUT_VOLUME_CONTROL == 1)
{//Audio_FeatureUnit_In_Descriptor_UAC10
sizeof(Audio_FeatureUnit_In_Descriptor_UAC10), //.bDescriptorType
CS_INTERFACE, // .bDescriptorSubtype
FEATURE_UNIT, //.bDescriptorSubtype
FU_USBIN, //.bUnitID
ID_IT_AUD, //.bSourceID
0x04, //.bControlSize //ò»¸öí¨μàËùÕ¼μÄBytesêy
{ //bmaControls
0x00000001,
0x00000003,
0x00000003,
0x00000003,
0x00000003,
0x00000003,
0x00000003,
0x00000003,
0x00000003,
},
0x00 //.iFeature
},
#endif
{
//Output_Terminal_Descriptor_UAC10
sizeof(Output_Terminal_Descriptor_UAC10),
CS_INTERFACE,
OUTPUT_TERMINAL,
ID_OT_USB, //.bTerminalID
USB_streaming, //.wTerminalType
0x00, //.bAssocTerminal
#if(INPUT_VOLUME_CONTROL == 1)
FU_USBIN, //.bSourceID
#else
ID_IT_AUD,
#endif
0x00
},
#endif
},
#if(NUM_AUD_CHAN_IN > 0)
{
//Interface_Descriptor
sizeof(Interface_Descriptor),
INTERFACE,
INTERFACE_NUMBER_AUDIO_INPUT,
0x00,
0x00,
AUDIO,
AUDIOSTREAMING,
0x00,
0x00
},
{
//Interface_Descriptor
sizeof(Interface_Descriptor),
INTERFACE,
INTERFACE_NUMBER_AUDIO_INPUT,
0x01,
0x01,
AUDIO,
AUDIOSTREAMING,
0x00,
0x00,
},
//Class_Specific_AS_Interface_Descriptor_UAC10
{
sizeof(Class_Specific_AS_Interface_Descriptor_UAC10),
CS_INTERFACE,
AS_GENERAL,
ID_OT_USB, //.bTerminalLink
1, //.bDelay
TYPE_I_PCM //.wFormatTag
},
{
//Type_I_Format_Discrete_Descriptor_UAC10
sizeof(Type_I_Format_Discrete_Descriptor_UAC10),
CS_INTERFACE,
FORMAT_TYPE,
FORMAT_TYPE_I,
NUM_AUD_CHAN_IN, //.bNrChannels
SUBFRAMESIZE, //.bSubframeSize
SAMPLE_RESOLUTION, //bBitResolution
NUMBER_OF_DISCRETE_SAMPLING,
{
SAMPLE_FREQ_HZ(SAMPLERATE),
}
|
|
|