Fixed AVRISP PDI race condition where the guard time between direction changes could...
[pub/USBasp.git] / Demos / Device / ClassDriver / AudioInput / Descriptors.c
index 6697cfe..6498c5f 100644 (file)
@@ -9,13 +9,13 @@
 /*\r
   Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
 \r
 /*\r
   Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
 \r
-  Permission to use, copy, modify, and distribute this software\r
-  and its documentation for any purpose and without fee is hereby\r
-  granted, provided that the above copyright notice appear in all\r
-  copies and that both that the copyright notice and this\r
-  permission notice and warranty disclaimer appear in supporting\r
-  documentation, and that the name of the author not be used in\r
-  advertising or publicity pertaining to distribution of the\r
+  Permission to use, copy, modify, distribute, and sell this \r
+  software and its documentation for any purpose is hereby granted\r
+  without fee, provided that the above copyright notice appear in \r
+  all copies and that both that the copyright notice and this\r
+  permission notice and warranty disclaimer appear in supporting \r
+  documentation, and that the name of the author not be used in \r
+  advertising or publicity pertaining to distribution of the \r
   software without specific, written prior permission.\r
 \r
   The author disclaim all warranties with regard to this\r
   software without specific, written prior permission.\r
 \r
   The author disclaim all warranties with regard to this\r
 USB_Descriptor_Device_t PROGMEM DeviceDescriptor =\r
 {\r
        .Header                 = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},\r
 USB_Descriptor_Device_t PROGMEM DeviceDescriptor =\r
 {\r
        .Header                 = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},\r
-               \r
+\r
        .USBSpecification       = VERSION_BCD(02.00),\r
        .Class                  = 0x00,\r
        .SubClass               = 0x00,\r
        .Protocol               = 0x00,\r
        .USBSpecification       = VERSION_BCD(02.00),\r
        .Class                  = 0x00,\r
        .SubClass               = 0x00,\r
        .Protocol               = 0x00,\r
-                               \r
+\r
        .Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,\r
        .Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,\r
-               \r
+\r
        .VendorID               = 0x03EB,\r
        .ProductID              = 0x2047,\r
        .ReleaseNumber          = 0x0000,\r
        .VendorID               = 0x03EB,\r
        .ProductID              = 0x2047,\r
        .ReleaseNumber          = 0x0000,\r
-               \r
+\r
        .ManufacturerStrIndex   = 0x01,\r
        .ProductStrIndex        = 0x02,\r
        .SerialNumStrIndex      = NO_DESCRIPTOR,\r
        .ManufacturerStrIndex   = 0x01,\r
        .ProductStrIndex        = 0x02,\r
        .SerialNumStrIndex      = NO_DESCRIPTOR,\r
-               \r
-       .NumberOfConfigurations = 1\r
+\r
+       .NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS\r
 };\r
 \r
 /** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage\r
 };\r
 \r
 /** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage\r
@@ -80,12 +80,12 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 \r
                        .ConfigurationNumber      = 1,\r
                        .ConfigurationStrIndex    = NO_DESCRIPTOR,\r
 \r
                        .ConfigurationNumber      = 1,\r
                        .ConfigurationStrIndex    = NO_DESCRIPTOR,\r
-                               \r
+\r
                        .ConfigAttributes         = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),\r
                        .ConfigAttributes         = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),\r
-                       \r
+\r
                        .MaxPowerConsumption      = USB_CONFIG_POWER_MA(100)\r
                },\r
                        .MaxPowerConsumption      = USB_CONFIG_POWER_MA(100)\r
                },\r
-               \r
+\r
        .AudioControlInterface = \r
                {\r
                        .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},\r
        .AudioControlInterface = \r
                {\r
                        .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},\r
@@ -94,56 +94,56 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .AlternateSetting         = 0,\r
                        \r
                        .TotalEndpoints           = 0,\r
                        .AlternateSetting         = 0,\r
                        \r
                        .TotalEndpoints           = 0,\r
-                               \r
+\r
                        .Class                    = 0x01,\r
                        .SubClass                 = 0x01,\r
                        .Protocol                 = 0x00,\r
                        .Class                    = 0x01,\r
                        .SubClass                 = 0x01,\r
                        .Protocol                 = 0x00,\r
-                               \r
-                       .InterfaceStrIndex        = NO_DESCRIPTOR                       \r
+\r
+                       .InterfaceStrIndex        = NO_DESCRIPTOR\r
                },\r
                },\r
-       \r
+\r
        .AudioControlInterface_SPC = \r
                {\r
        .AudioControlInterface_SPC = \r
                {\r
-                       .Header                   = {.Size = sizeof(USB_AudioInterface_AC_t), .Type = DTYPE_AudioInterface},\r
+                       .Header                   = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_AudioInterface},\r
                        .Subtype                  = DSUBTYPE_Header,\r
                        .Subtype                  = DSUBTYPE_Header,\r
-                       \r
+\r
                        .ACSpecification          = VERSION_BCD(01.00),\r
                        .ACSpecification          = VERSION_BCD(01.00),\r
-                       .TotalLength              = (sizeof(USB_AudioInterface_AC_t) +\r
-                                                    sizeof(USB_AudioInputTerminal_t) +\r
-                                                                            sizeof(USB_AudioOutputTerminal_t)),\r
+                       .TotalLength              = (sizeof(USB_Audio_Interface_AC_t) +\r
+                                                    sizeof(USB_Audio_InputTerminal_t) +\r
+                                                    sizeof(USB_Audio_OutputTerminal_t)),\r
                        \r
                        .InCollection             = 1,\r
                        \r
                        .InCollection             = 1,\r
-                       .InterfaceNumbers         = {1},                        \r
+                       .InterfaceNumbers         = {1},\r
                },\r
 \r
        .InputTerminal = \r
                {\r
                },\r
 \r
        .InputTerminal = \r
                {\r
-                       .Header                   = {.Size = sizeof(USB_AudioInputTerminal_t), .Type = DTYPE_AudioInterface},\r
+                       .Header                   = {.Size = sizeof(USB_Audio_InputTerminal_t), .Type = DTYPE_AudioInterface},\r
                        .Subtype                  = DSUBTYPE_InputTerminal,\r
                        .Subtype                  = DSUBTYPE_InputTerminal,\r
-               \r
+\r
                        .TerminalID               = 0x01,\r
                        .TerminalType             = TERMINAL_IN_MIC,\r
                        .AssociatedOutputTerminal = 0x00,\r
                        .TerminalID               = 0x01,\r
                        .TerminalType             = TERMINAL_IN_MIC,\r
                        .AssociatedOutputTerminal = 0x00,\r
-                       \r
+\r
                        .TotalChannels            = 1,\r
                        .ChannelConfig            = 0,\r
                        .TotalChannels            = 1,\r
                        .ChannelConfig            = 0,\r
-                       \r
+\r
                        .ChannelStrIndex          = NO_DESCRIPTOR,\r
                        .TerminalStrIndex         = NO_DESCRIPTOR\r
                },\r
 \r
        .OutputTerminal = \r
                {\r
                        .ChannelStrIndex          = NO_DESCRIPTOR,\r
                        .TerminalStrIndex         = NO_DESCRIPTOR\r
                },\r
 \r
        .OutputTerminal = \r
                {\r
-                       .Header                   = {.Size = sizeof(USB_AudioOutputTerminal_t), .Type = DTYPE_AudioInterface},\r
+                       .Header                   = {.Size = sizeof(USB_Audio_OutputTerminal_t), .Type = DTYPE_AudioInterface},\r
                        .Subtype                  = DSUBTYPE_OutputTerminal,\r
                        .Subtype                  = DSUBTYPE_OutputTerminal,\r
-               \r
+\r
                        .TerminalID               = 0x02,\r
                        .TerminalType             = TERMINAL_STREAMING,\r
                        .AssociatedInputTerminal  = 0x00,\r
                        .TerminalID               = 0x02,\r
                        .TerminalType             = TERMINAL_STREAMING,\r
                        .AssociatedInputTerminal  = 0x00,\r
-                       \r
+\r
                        .SourceID                 = 0x01,\r
                        .SourceID                 = 0x01,\r
-                       \r
-                       .TerminalStrIndex         = NO_DESCRIPTOR                       \r
+\r
+                       .TerminalStrIndex         = NO_DESCRIPTOR\r
                },\r
 \r
        .AudioStreamInterface_Alt0 = \r
                },\r
 \r
        .AudioStreamInterface_Alt0 = \r
@@ -152,13 +152,13 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 \r
                        .InterfaceNumber          = 1,\r
                        .AlternateSetting         = 0,\r
 \r
                        .InterfaceNumber          = 1,\r
                        .AlternateSetting         = 0,\r
-                       \r
+\r
                        .TotalEndpoints           = 0,\r
                        .TotalEndpoints           = 0,\r
-                               \r
+\r
                        .Class                    = 0x01,\r
                        .SubClass                 = 0x02,\r
                        .Protocol                 = 0x00,\r
                        .Class                    = 0x01,\r
                        .SubClass                 = 0x02,\r
                        .Protocol                 = 0x00,\r
-                               \r
+\r
                        .InterfaceStrIndex        = NO_DESCRIPTOR\r
                },\r
 \r
                        .InterfaceStrIndex        = NO_DESCRIPTOR\r
                },\r
 \r
@@ -168,30 +168,30 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 \r
                        .InterfaceNumber          = 1,\r
                        .AlternateSetting         = 1,\r
 \r
                        .InterfaceNumber          = 1,\r
                        .AlternateSetting         = 1,\r
-                       \r
+\r
                        .TotalEndpoints           = 1,\r
                        .TotalEndpoints           = 1,\r
-                               \r
+\r
                        .Class                    = 0x01,\r
                        .SubClass                 = 0x02,\r
                        .Protocol                 = 0x00,\r
                        .Class                    = 0x01,\r
                        .SubClass                 = 0x02,\r
                        .Protocol                 = 0x00,\r
-                               \r
+\r
                        .InterfaceStrIndex        = NO_DESCRIPTOR\r
                },\r
                        .InterfaceStrIndex        = NO_DESCRIPTOR\r
                },\r
-               \r
+\r
        .AudioStreamInterface_SPC = \r
                {\r
        .AudioStreamInterface_SPC = \r
                {\r
-                       .Header                   = {.Size = sizeof(USB_AudioInterface_AS_t), .Type = DTYPE_AudioInterface},\r
+                       .Header                   = {.Size = sizeof(USB_Audio_Interface_AS_t), .Type = DTYPE_AudioInterface},\r
                        .Subtype                  = DSUBTYPE_General,\r
                        .Subtype                  = DSUBTYPE_General,\r
-                       \r
+\r
                        .TerminalLink             = 0x02,\r
                        .TerminalLink             = 0x02,\r
-                       \r
+\r
                        .FrameDelay               = 1,\r
                        .AudioFormat              = 0x0001\r
                },\r
                        .FrameDelay               = 1,\r
                        .AudioFormat              = 0x0001\r
                },\r
-               \r
+\r
        .AudioFormat = \r
                {\r
        .AudioFormat = \r
                {\r
-                       .Header                   = {.Size = sizeof(USB_AudioFormat_t), .Type = DTYPE_AudioInterface},\r
+                       .Header                   = {.Size = sizeof(USB_Audio_Format_t), .Type = DTYPE_AudioInterface},\r
                        .Subtype                  = DSUBTYPE_Format,\r
 \r
                        .FormatType               = 0x01,\r
                        .Subtype                  = DSUBTYPE_Format,\r
 \r
                        .FormatType               = 0x01,\r
@@ -199,7 +199,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        \r
                        .SubFrameSize             = 0x02,\r
                        .BitResolution            = 16,\r
                        \r
                        .SubFrameSize             = 0x02,\r
                        .BitResolution            = 16,\r
-                       .SampleFrequencyType      = (sizeof(ConfigurationDescriptor.AudioFormat.SampleFrequencies) / sizeof(AudioSampleFreq_t)),\r
+                       .SampleFrequencyType      = AUDIO_TOTAL_SAMPLE_RATES,\r
                \r
                        .SampleFrequencies        = {AUDIO_SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)}\r
                },\r
                \r
                        .SampleFrequencies        = {AUDIO_SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)}\r
                },\r
@@ -208,7 +208,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {\r
                        .Endpoint = \r
                                {\r
                {\r
                        .Endpoint = \r
                                {\r
-                                       .Header              = {.Size = sizeof(USB_AudioStreamEndpoint_Std_t), .Type = DTYPE_Endpoint},\r
+                                       .Header              = {.Size = sizeof(USB_Audio_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},\r
 \r
                                        .EndpointAddress     = (ENDPOINT_DESCRIPTOR_DIR_IN | AUDIO_STREAM_EPNUM),\r
                                        .Attributes          = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),\r
 \r
                                        .EndpointAddress     = (ENDPOINT_DESCRIPTOR_DIR_IN | AUDIO_STREAM_EPNUM),\r
                                        .Attributes          = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),\r
@@ -222,7 +222,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                \r
        .AudioEndpoint_SPC = \r
                {\r
                \r
        .AudioEndpoint_SPC = \r
                {\r
-                       .Header                   = {.Size = sizeof(USB_AudioStreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint},\r
+                       .Header                   = {.Size = sizeof(USB_Audio_StreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint},\r
                        .Subtype                  = DSUBTYPE_General,\r
                        \r
                        .Attributes               = 0x00,\r
                        .Subtype                  = DSUBTYPE_General,\r
                        \r
                        .Attributes               = 0x00,\r
@@ -239,7 +239,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 USB_Descriptor_String_t PROGMEM LanguageString =\r
 {\r
        .Header                 = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},\r
 USB_Descriptor_String_t PROGMEM LanguageString =\r
 {\r
        .Header                 = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},\r
-               \r
+\r
        .UnicodeString          = {LANGUAGE_ID_ENG}\r
 };\r
 \r
        .UnicodeString          = {LANGUAGE_ID_ENG}\r
 };\r
 \r
@@ -250,7 +250,7 @@ USB_Descriptor_String_t PROGMEM LanguageString =
 USB_Descriptor_String_t PROGMEM ManufacturerString =\r
 {\r
        .Header                 = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},\r
 USB_Descriptor_String_t PROGMEM ManufacturerString =\r
 {\r
        .Header                 = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},\r
-               \r
+\r
        .UnicodeString          = L"Dean Camera"\r
 };\r
 \r
        .UnicodeString          = L"Dean Camera"\r
 };\r
 \r
@@ -261,7 +261,7 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
 USB_Descriptor_String_t PROGMEM ProductString =\r
 {\r
        .Header                 = {.Size = USB_STRING_LEN(18), .Type = DTYPE_String},\r
 USB_Descriptor_String_t PROGMEM ProductString =\r
 {\r
        .Header                 = {.Size = USB_STRING_LEN(18), .Type = DTYPE_String},\r
-               \r
+\r
        .UnicodeString          = L"LUFA Audio In Demo"\r
 };\r
 \r
        .UnicodeString          = L"LUFA Audio In Demo"\r
 };\r
 \r