Пример #1
0
		},
		
	.Audio_AudioFormat = 
		{
			.Header                   = {.Size = sizeof(USB_Audio_Format_t), .Type = DTYPE_CSInterface},
			.Subtype                  = DSUBTYPE_Format,

			.FormatType               = 0x01,
			.Channels                 = 0x02,
			
			.SubFrameSize             = 0x02,
			.BitResolution            = 16,

			.SampleFrequencyType      = (sizeof(ConfigurationDescriptor.Audio_AudioFormat.SampleFrequencies) /
			                             sizeof(Audio_SampleFreq_t)),		
			.SampleFrequencies        = {SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)}
		},
	
	.Audio_StreamEndpoint = 
		{
			.Endpoint = 
				{
					.Header              = {.Size = sizeof(USB_Audio_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},

					.EndpointAddress     = (ENDPOINT_DESCRIPTOR_DIR_OUT | AUDIO_STREAM_EPNUM),
					.Attributes          = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
					.EndpointSize        = AUDIO_STREAM_EPSIZE,
					.PollingIntervalMS   = 1
				},
			
			.Refresh                  = 0,
Пример #2
0
 0x01,                                 /* bTerminalLink */
 0x01,                                 /* bDelay */
 0x01,                                 /* wFormatTag AUDIO_FORMAT_PCM  0x0001*/
 0x00,
 /* 07 byte*/
 
 /* USB Speaker Audio Type III Format Interface Descriptor */
 0x0B,                                 /* bLength */
 AUDIO_INTERFACE_DESCRIPTOR_TYPE,      /* bDescriptorType */
 AUDIO_STREAMING_FORMAT_TYPE,          /* bDescriptorSubtype */
 AUDIO_FORMAT_TYPE_III,                /* bFormatType */ 
 0x02,                                 /* bNrChannels */
 0x02,                                 /* bSubFrameSize :  2 Bytes per frame (16bits) */
 16,                                   /* bBitResolution (16-bits per sample) */ 
 0x01,                                 /* bSamFreqType only one frequency supported */ 
 SAMPLE_FREQ(USBD_AUDIO_FREQ),         /* Audio sampling frequency coded on 3 bytes */
 /* 11 byte*/
 
 /* Endpoint 1 - Standard Descriptor */
 AUDIO_STANDARD_ENDPOINT_DESC_SIZE,    /* bLength */
 USB_ENDPOINT_DESCRIPTOR_TYPE,         /* bDescriptorType */
 AUDIO_OUT_EP,                         /* bEndpointAddress 1 out endpoint*/
 USB_ENDPOINT_TYPE_ISOCHRONOUS,        /* bmAttributes */
 AUDIO_PACKET_SZE(USBD_AUDIO_FREQ),    /* wMaxPacketSize in Bytes (Freq(Samples)*2(Stereo)*2(HalfWord)) */
 0x01,                                 /* bInterval */
 0x00,                                 /* bRefresh */
 0x00,                                 /* bSynchAddress */
 /* 09 byte*/
 
 /* Endpoint - Audio Streaming Descriptor*/
 AUDIO_STREAMING_ENDPOINT_DESC_SIZE,   /* bLength */