From 89cc9f3774fbd8f3f6c9ba5c1166542c63740bd0 Mon Sep 17 00:00:00 2001 From: Dean Date: Fri, 3 Jun 2011 07:56:12 +0000 Subject: Added new callback to the Audio Class driver to allow for endpoint control manipulations such as data sample rates. Modified the Class Driver AudioInput and AudioOutput demos to support multiple sample rates. Fixed KeyboardHost and KeyboardHostWithParser demos displaying incorrect values when numerical keys were pressed. Fix broken LowLevel audio demo descriptors. Minor documentation fixes. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1779 d5102386-fcda-11dd-9fdb-3debd5008f28 --- Demos/Device/ClassDriver/AudioInput/Descriptors.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'Demos/Device/ClassDriver/AudioInput/Descriptors.c') diff --git a/Demos/Device/ClassDriver/AudioInput/Descriptors.c b/Demos/Device/ClassDriver/AudioInput/Descriptors.c index bd31bdb0..6fffd05d 100644 --- a/Demos/Device/ClassDriver/AudioInput/Descriptors.c +++ b/Demos/Device/ClassDriver/AudioInput/Descriptors.c @@ -54,7 +54,7 @@ const USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, .VendorID = 0x03EB, - .ProductID = 0x2047, + .ProductID = 0x206B, .ReleaseNumber = VERSION_BCD(00.01), .ManufacturerStrIndex = 0x01, @@ -191,7 +191,9 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Audio_AudioFormat = { - .Header = {.Size = sizeof(USB_Audio_Descriptor_Format_t), .Type = DTYPE_CSInterface}, + .Header = {.Size = sizeof(USB_Audio_Descriptor_Format_t) + + sizeof(ConfigurationDescriptor.Audio_AudioFormatSampleRates), + .Type = DTYPE_CSInterface}, .Subtype = AUDIO_DSUBTYPE_CSInterface_FormatType, .FormatType = 0x01, @@ -199,12 +201,17 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .SubFrameSize = 0x02, .BitResolution = 16, - .TotalDiscreteSampleRates = 1, + + .TotalDiscreteSampleRates = (sizeof(ConfigurationDescriptor.Audio_AudioFormatSampleRates) / sizeof(USB_Audio_SampleFreq_t)) }, .Audio_AudioFormatSampleRates = { - AUDIO_SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY) + AUDIO_SAMPLE_FREQ(8000), + AUDIO_SAMPLE_FREQ(11025), + AUDIO_SAMPLE_FREQ(22050), + AUDIO_SAMPLE_FREQ(44100), + AUDIO_SAMPLE_FREQ(48000), }, .Audio_StreamEndpoint = @@ -228,7 +235,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Spc_t), .Type = DTYPE_CSEndpoint}, .Subtype = AUDIO_DSUBTYPE_CSEndpoint_General, - .Attributes = AUDIO_EP_ACCEPTS_SMALL_PACKETS, + .Attributes = (AUDIO_EP_ACCEPTS_SMALL_PACKETS | AUDIO_EP_SAMPLE_FREQ_CONTROL), .LockDelayUnits = 0x00, .LockDelay = 0x0000 -- cgit v1.2.3