Add new tag for the LUFA-120219-BETA release.
[pub/USBasp.git] / Demos / Device / LowLevel / AudioInput / Descriptors.c
index 6c8323c..0b16522 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2011.
+     Copyright (C) Dean Camera, 2012.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
-  Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2012  Dean Camera (dean [at] fourwalledcubicle [dot] com)
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
@@ -55,7 +55,7 @@ const USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
 
        .VendorID               = 0x03EB,
        .ProductID              = 0x2047,
 
        .VendorID               = 0x03EB,
        .ProductID              = 0x2047,
-       .ReleaseNumber          = VERSION_BCD(00.01),
+       .ReleaseNumber          = VERSION_BCD(00.02),
 
        .ManufacturerStrIndex   = 0x01,
        .ProductStrIndex        = 0x02,
 
        .ManufacturerStrIndex   = 0x01,
        .ProductStrIndex        = 0x02,
@@ -81,7 +81,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .ConfigurationNumber      = 1,
                        .ConfigurationStrIndex    = NO_DESCRIPTOR,
 
                        .ConfigurationNumber      = 1,
                        .ConfigurationStrIndex    = NO_DESCRIPTOR,
 
-                       .ConfigAttributes         = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
+                       .ConfigAttributes         = (USB_CONFIG_ATTR_RESERVED | USB_CONFIG_ATTR_SELFPOWERED),
 
                        .MaxPowerConsumption      = USB_CONFIG_POWER_MA(100)
                },
 
                        .MaxPowerConsumption      = USB_CONFIG_POWER_MA(100)
                },
@@ -191,7 +191,9 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
        .Audio_AudioFormat =
                {
 
        .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,
                        .Subtype                  = AUDIO_DSUBTYPE_CSInterface_FormatType,
 
                        .FormatType               = 0x01,
@@ -199,12 +201,17 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
                        .SubFrameSize             = 0x02,
                        .BitResolution            = 16,
 
                        .SubFrameSize             = 0x02,
                        .BitResolution            = 16,
-                       .TotalDiscreteSampleRates = 1,
+
+                       .TotalDiscreteSampleRates = (sizeof(ConfigurationDescriptor.Audio_AudioFormatSampleRates) / sizeof(USB_Audio_SampleFreq_t)),
                },
                },
-       
+
        .Audio_AudioFormatSampleRates =
                {
        .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 =
                },
 
        .Audio_StreamEndpoint =
@@ -213,7 +220,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                                {
                                        .Header              = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
 
                                {
                                        .Header              = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
 
-                                       .EndpointAddress     = (ENDPOINT_DESCRIPTOR_DIR_IN | AUDIO_STREAM_EPNUM),
+                                       .EndpointAddress     = (ENDPOINT_DIR_IN | AUDIO_STREAM_EPNUM),
                                        .Attributes          = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
                                        .EndpointSize        = AUDIO_STREAM_EPSIZE,
                                        .PollingIntervalMS   = 0x01
                                        .Attributes          = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
                                        .EndpointSize        = AUDIO_STREAM_EPSIZE,
                                        .PollingIntervalMS   = 0x01
@@ -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,
 
                        .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
 
                        .LockDelayUnits           = 0x00,
                        .LockDelay                = 0x0000