aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2011-05-30 11:07:57 +0000
committerDean Camera <dean@fourwalledcubicle.com>2011-05-30 11:07:57 +0000
commit2a26efc6912badfff9e798f5dbac57ba85ce6dd1 (patch)
tree9510c38dc53bbf95489cd10c00d5685e4d97d70b /LUFA/Drivers/USB
parent78cfaac9b4fc9ae15652f18e9abb79dcedfcd4b5 (diff)
downloadlufa-2a26efc6912badfff9e798f5dbac57ba85ce6dd1.tar.gz
lufa-2a26efc6912badfff9e798f5dbac57ba85ce6dd1.tar.bz2
lufa-2a26efc6912badfff9e798f5dbac57ba85ce6dd1.zip
Altered the definition of the USB_Audio_Descriptor_Format_t descriptor so that the user is now responsible for supplying the supported audio sampling rates, to allow for multiple audio interfaces with different numbers of supported rates and/or continuous sample rates.
Diffstat (limited to 'LUFA/Drivers/USB')
-rw-r--r--LUFA/Drivers/USB/Class/Common/Audio.h27
-rw-r--r--LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c4
-rw-r--r--LUFA/Drivers/USB/Core/AVR8/Host_AVR8.h2
-rw-r--r--LUFA/Drivers/USB/Core/UC3/Host_UC3.c4
-rw-r--r--LUFA/Drivers/USB/Core/UC3/Host_UC3.h2
5 files changed, 22 insertions, 17 deletions
diff --git a/LUFA/Drivers/USB/Class/Common/Audio.h b/LUFA/Drivers/USB/Class/Common/Audio.h
index 713c96f7c..cc6e8e52d 100644
--- a/LUFA/Drivers/USB/Class/Common/Audio.h
+++ b/LUFA/Drivers/USB/Class/Common/Audio.h
@@ -64,13 +64,6 @@
#endif
/* Macros: */
- #if !defined(AUDIO_TOTAL_SAMPLE_RATES) || defined(__DOXYGEN__)
- /** Total number of discrete audio sample rates supported by the device. This value can be overridden by defining this
- * token in the project makefile to the desired value, and passing it to the compiler via the -D switch.
- */
- #define AUDIO_TOTAL_SAMPLE_RATES 1
- #endif
-
/** \name Audio Channel Masks */
//@{
/** Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details. */
@@ -563,6 +556,9 @@
* about the number of channels, the sample resolution, acceptable sample frequencies and encoding method used
* in the device's audio streams. See the USB Audio specification for more details.
*
+ * \note This descriptor <b>must</b> be followed by one or more \ref USB_Audio_SampleFreq_t elements containing
+ * the continuous or discrete sample frequencies.
+ *
* \see \ref USB_Audio_StdDescriptor_Format_t for the version of this type with standard element names.
*/
typedef struct
@@ -578,8 +574,11 @@
uint8_t SubFrameSize; /**< Size in bytes of each channel's sample data in the stream. */
uint8_t BitResolution; /**< Bits of resolution of each channel's samples in the stream. */
- uint8_t SampleFrequencyType; /**< Total number of sample frequencies supported by the device. */
- USB_Audio_SampleFreq_t SampleFrequencies[AUDIO_TOTAL_SAMPLE_RATES]; /**< Sample frequencies supported by the device (must be 24-bit). */
+ uint8_t TotalDiscreteSampleRates; /**< Total number of discrete sample frequencies supported by the device. When
+ * zero, this must be followed by the lower and upper continuous sampling
+ * frequencies supported by the device; otherwise, this must be followed
+ * by the given number of discrete sampling frequencies supported.
+ */
} ATTR_PACKED USB_Audio_Descriptor_Format_t;
/** \brief Audio class-specific Format Descriptor (USB-IF naming conventions).
@@ -588,6 +587,9 @@
* about the number of channels, the sample resolution, acceptable sample frequencies and encoding method used
* in the device's audio streams. See the USB Audio specification for more details.
*
+ * \note This descriptor <b>must</b> be followed by one or more 24-bit integer elements containing the continuous
+ * or discrete sample frequencies.
+ *
* \see \ref USB_Audio_Descriptor_Format_t for the version of this type with non-standard LUFA specific
* element names.
*/
@@ -608,8 +610,11 @@
uint8_t bSubFrameSize; /**< Size in bytes of each channel's sample data in the stream. */
uint8_t bBitResolution; /**< Bits of resolution of each channel's samples in the stream. */
- uint8_t bSampleFrequencyType; /**< Total number of sample frequencies supported by the device. */
- uint8_t SampleFrequencies[AUDIO_TOTAL_SAMPLE_RATES * 3]; /**< Sample frequencies supported by the device (must be 24-bit). */
+ uint8_t bSampleFrequencyType; /**< Total number of sample frequencies supported by the device. When
+ * zero, this must be followed by the lower and upper continuous sampling
+ * frequencies supported by the device; otherwise, this must be followed
+ * by the given number of discrete sampling frequencies supported.
+ */
} ATTR_PACKED USB_Audio_StdDescriptor_Format_t;
/** \brief Audio class-specific Streaming Endpoint Descriptor (LUFA naming conventions).
diff --git a/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c b/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c
index d18e023c7..5f475a1cc 100644
--- a/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c
+++ b/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c
@@ -351,7 +351,7 @@ uint8_t USB_Host_ClearPipeStall(const uint8_t EndpointNum)
return USB_Host_SendControlRequest(NULL);
}
-uint8_t USB_Host_SetInterfaceAltSetting(const uint8_t InterfaceNum,
+uint8_t USB_Host_SetInterfaceAltSetting(const uint8_t InterfaceIndex,
const uint8_t AltSetting)
{
USB_ControlRequest = (USB_Request_Header_t)
@@ -359,7 +359,7 @@ uint8_t USB_Host_SetInterfaceAltSetting(const uint8_t InterfaceNum,
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_INTERFACE),
.bRequest = REQ_SetInterface,
.wValue = AltSetting,
- .wIndex = InterfaceNum,
+ .wIndex = InterfaceIndex,
.wLength = 0,
};
diff --git a/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.h b/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.h
index 58d980442..2c2b5068e 100644
--- a/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.h
+++ b/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.h
@@ -340,7 +340,7 @@
*
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum to indicate the result.
*/
- uint8_t USB_Host_SetInterfaceAltSetting(const uint8_t InterfaceNum,
+ uint8_t USB_Host_SetInterfaceAltSetting(const uint8_t InterfaceIndex,
const uint8_t AltSetting);
/* Private Interface - For use in library only: */
diff --git a/LUFA/Drivers/USB/Core/UC3/Host_UC3.c b/LUFA/Drivers/USB/Core/UC3/Host_UC3.c
index 02cb1e68e..1dd2b578b 100644
--- a/LUFA/Drivers/USB/Core/UC3/Host_UC3.c
+++ b/LUFA/Drivers/USB/Core/UC3/Host_UC3.c
@@ -351,7 +351,7 @@ uint8_t USB_Host_ClearPipeStall(const uint8_t EndpointNum)
return USB_Host_SendControlRequest(NULL);
}
-uint8_t USB_Host_SetInterfaceAltSetting(const uint8_t InterfaceNum,
+uint8_t USB_Host_SetInterfaceAltSetting(const uint8_t InterfaceIndex,
const uint8_t AltSetting)
{
USB_ControlRequest = (USB_Request_Header_t)
@@ -359,7 +359,7 @@ uint8_t USB_Host_SetInterfaceAltSetting(const uint8_t InterfaceNum,
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_INTERFACE),
.bRequest = REQ_SetInterface,
.wValue = AltSetting,
- .wIndex = InterfaceNum,
+ .wIndex = InterfaceIndex,
.wLength = 0,
};
diff --git a/LUFA/Drivers/USB/Core/UC3/Host_UC3.h b/LUFA/Drivers/USB/Core/UC3/Host_UC3.h
index c5dfe76fd..65b8011c9 100644
--- a/LUFA/Drivers/USB/Core/UC3/Host_UC3.h
+++ b/LUFA/Drivers/USB/Core/UC3/Host_UC3.h
@@ -341,7 +341,7 @@
*
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum to indicate the result.
*/
- uint8_t USB_Host_SetInterfaceAltSetting(const uint8_t InterfaceNum,
+ uint8_t USB_Host_SetInterfaceAltSetting(const uint8_t InterfaceIndex,
const uint8_t AltSetting);
/* Private Interface - For use in library only: */