00001 /* ---------------------------------------------------------------------------- 00002 * SAM Software Package License 00003 * ---------------------------------------------------------------------------- 00004 * Copyright (c) 2014, Atmel Corporation 00005 * 00006 * All rights reserved. 00007 * 00008 * Redistribution and use in source and binary forms, with or without 00009 * modification, are permitted provided that the following conditions are met: 00010 * 00011 * - Redistributions of source code must retain the above copyright notice, 00012 * this list of conditions and the disclaimer below. 00013 * 00014 * Atmel's name may not be used to endorse or promote products derived from 00015 * this software without specific prior written permission. 00016 * 00017 * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR 00018 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00019 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 00020 * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, 00021 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00022 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 00023 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00024 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00025 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 00026 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00027 * ---------------------------------------------------------------------------- 00028 */ 00029 00030 /** \file 00031 * 00032 * Definitions and classes for USB Audio class descriptors. 00033 * 00034 * - For a USB %device: 00035 * -# When declaring an Audio-specific descriptor, use the descriptor types 00036 * and subtypes defined in this unit (see "USB Audio descriptor types" 00037 * and "USB Audio descriptor subtypes"). 00038 * -# When declaring the %device descriptor of a USB %audio %device, use 00039 * "USB Audio device descriptor values" defined here. 00040 * -# Declare an AUDStreamingInterfaceDescriptor instance as part of the 00041 * configuration descriptors returned by a USB %audio %device. 00042 * -# Declare a AUDHeaderDescriptor as part of the configuration 00043 * descriptors of the %device. 00044 * -# Declare an AUDFeatureUnitDescriptor instance as part of the 00045 * configuration descriptors returned by a USB %audio %device. 00046 * -# Declare an instance of AUDFormatTypeOneDescriptor as part of the 00047 * configuration descriptors of an audio device. 00048 */ 00049 00050 #ifndef _AUDDESCRIPTORS_H_ 00051 #define _AUDDESCRIPTORS_H_ 00052 /** \addtogroup usb_audio 00053 *@{ 00054 */ 00055 00056 /*---------------------------------------------------------------------------- 00057 * Includes 00058 *----------------------------------------------------------------------------*/ 00059 00060 #include <stdint.h> 00061 00062 /*---------------------------------------------------------------------------- 00063 * Definitions 00064 *----------------------------------------------------------------------------*/ 00065 00066 /** \addtogroup usb_audio_desc_type USB Audio descriptor types 00067 * @{ 00068 * This section lists the available types for USB audio-specific descriptors. 00069 * - \ref AUDGenericDescriptor_DEVICE 00070 * - \ref AUDGenericDescriptor_CONFIGURATION 00071 * - \ref AUDGenericDescriptor_STRING 00072 * - \ref AUDGenericDescriptor_INTERFACE 00073 * - \ref AUDGenericDescriptor_ENDPOINT 00074 */ 00075 00076 /** Descriptor gives detail about the whole device.*/ 00077 #define AUDGenericDescriptor_DEVICE 0x21 00078 /** Descriptor gives detail about a configuration.*/ 00079 #define AUDGenericDescriptor_CONFIGURATION 0x22 00080 /** Descriptor gives detail about a string.*/ 00081 #define AUDGenericDescriptor_STRING 0x23 00082 /** Descriptor gives detail about an interface.*/ 00083 #define AUDGenericDescriptor_INTERFACE 0x24 00084 /** Descriptor gives detail about an endpoint. */ 00085 #define AUDGenericDescriptor_ENDPOINT 0x25 00086 /** @}*/ 00087 00088 /** \addtogroup usb_audio_desc_subtype USB Audio descriptor subtypes 00089 * @{ 00090 * This section lists the possible subtypes for USB audio-specific descriptors. 00091 * - \ref AUDGenericDescriptor_HEADER 00092 * - \ref AUDGenericDescriptor_INPUTTERMINAL 00093 * - \ref AUDGenericDescriptor_OUTPUTTERMINAL 00094 * - \ref AUDGenericDescriptor_MIXERUNIT 00095 * - \ref AUDGenericDescriptor_SELECTORUNIT 00096 * - \ref AUDGenericDescriptor_FEATUREUNIT 00097 * - \ref AUDGenericDescriptor_PROCESSINGUNIT 00098 * - \ref AUDGenericDescriptor_EXTENSIONUNIT 00099 */ 00100 /** Header descriptor subtype.*/ 00101 #define AUDGenericDescriptor_HEADER 0x01 00102 /** Input terminal descriptor subtype.*/ 00103 #define AUDGenericDescriptor_INPUTTERMINAL 0x02 00104 /** Output terminal descriptor subtype.*/ 00105 #define AUDGenericDescriptor_OUTPUTTERMINAL 0x03 00106 /** Mixer unit descriptor subtype.*/ 00107 #define AUDGenericDescriptor_MIXERUNIT 0x04 00108 /** Selector unit descriptor subtype.*/ 00109 #define AUDGenericDescriptor_SELECTORUNIT 0x05 00110 /** Feature unit descriptor subtype.*/ 00111 #define AUDGenericDescriptor_FEATUREUNIT 0x06 00112 /** Processing unit descriptor subtype.*/ 00113 #define AUDGenericDescriptor_PROCESSINGUNIT 0x07 00114 /** Extension unit descriptor subtype.*/ 00115 #define AUDGenericDescriptor_EXTENSIONUNIT 0x08 00116 /** @}*/ 00117 00118 00119 /** \addtogroup usb_audio_desc USB Audio Descriptors 00120 * @{ 00121 * USB Audio device descriptor values 00122 * 00123 * This section lists the class, subclass & protocol codes that a USB audio 00124 * device should display in its device descriptor. 00125 * - \ref AUDDeviceDescriptor_CLASS 00126 * - \ref AUDDeviceDescriptor_SUBCLASS 00127 * - \ref AUDDeviceDescriptor_PROTOCOL 00128 */ 00129 /** Class code for a USB audio device. */ 00130 #define AUDDeviceDescriptor_CLASS 0x00 00131 /** Subclass code for a USB audio device. */ 00132 #define AUDDeviceDescriptor_SUBCLASS 0x00 00133 /** Protocol code for a USB audio device. */ 00134 #define AUDDeviceDescriptor_PROTOCOL 0x00 00135 /** @}*/ 00136 00137 00138 /** 00139 * \addtogroup usb_audio_stream_if USB Audio streaming interface codes 00140 * @{ 00141 * This section lists the class, subclass and protocol codes that an Audio 00142 * Streaming interface should display in its descriptor. 00143 * - \ref AUDStreamingInterfaceDescriptor_CLASS 00144 * - \ref AUDStreamingInterfaceDescriptor_SUBCLASS 00145 * - \ref AUDStreamingInterfaceDescriptor_PROTOCOL 00146 */ 00147 /** Class code for an USB audio streaming interface.*/ 00148 #define AUDStreamingInterfaceDescriptor_CLASS 0x01 00149 00150 /** Subclass code for an audio streaming interface.*/ 00151 #define AUDStreamingInterfaceDescriptor_SUBCLASS 0x02 00152 00153 /** Protocol code for an audio streaming interface.*/ 00154 #define AUDStreamingInterfaceDescriptor_PROTOCOL 0x00 00155 /** @}*/ 00156 00157 /** 00158 * \addtogroup usb_audio_stream_subtype USB Audio streaming descriptor subtypes 00159 * @{ 00160 * This section lists the possible subtypes for audio-specific descriptor 00161 * appended to an Audio Streaming interface. 00162 * - \ref AUDStreamingInterfaceDescriptor_GENERAL 00163 * - \ref AUDStreamingInterfaceDescriptor_FORMATTYPE 00164 * - \ref AUDStreamingInterfaceDescriptor_FORMATSPECIFIC 00165 */ 00166 /** General descriptor subtype.*/ 00167 #define AUDStreamingInterfaceDescriptor_GENERAL 0x01 00168 00169 /** Format type descriptor subtype.*/ 00170 #define AUDStreamingInterfaceDescriptor_FORMATTYPE 0x02 00171 00172 /** Format specific descriptor subtype.*/ 00173 #define AUDStreamingInterfaceDescriptor_FORMATSPECIFIC 0x03 00174 /** @}*/ 00175 00176 00177 /** \addtogroup usb_audio_ctrl_if USB Audio Control Interface 00178 * @{ 00179 * This section lists the class, subclass and protocol codes that a USB Audio 00180 * Control interface descriptor should display. 00181 * - \ref AUDControlInterfaceDescriptor_CLASS 00182 * - \ref AUDControlInterfaceDescriptor_SUBCLASS 00183 * - \ref AUDControlInterfaceDescriptor_PROTOCOL 00184 */ 00185 /** Class code for an audio control interface. */ 00186 #define AUDControlInterfaceDescriptor_CLASS 0x01 00187 /** Subclass code for an audio control interface. */ 00188 #define AUDControlInterfaceDescriptor_SUBCLASS 0x01 00189 /** Protocol code for an audio control interface. */ 00190 #define AUDControlInterfaceDescriptor_PROTOCOL 0x00 00191 /** @}*/ 00192 00193 00194 /** Descriptor subtype for an Audio data endpoint. */ 00195 #define AUDDataEndpointDescriptor_SUBTYPE 0x01 00196 00197 /** \addtogroup usb_audio_lock_delay USB Audio Lock delay units 00198 * @{ 00199 * This section lists the valid lock delay unit types. 00200 * - \ref AUDDataEndpointDescriptor_MILLISECONDS 00201 * - \ref AUDDataEndpointDescriptor_PCMSAMPLES 00202 */ 00203 /** Lock delay is expressed in milliseconds. */ 00204 #define AUDDataEndpointDescriptor_MILLISECONDS 1 00205 /** Lock delay is expressed in decoded PCM samples. */ 00206 #define AUDDataEndpointDescriptor_PCMSAMPLES 2 00207 /** @}*/ 00208 00209 00210 /** \addtogroup usb_audio_class_ver USB Audio class releases 00211 * @{ 00212 * This section lists the existing versions of the Audio class specification. 00213 * - \ref AUDHeaderDescriptor_AUD1_00 00214 */ 00215 00216 /** Identifies the USB audio specification release 1.00.*/ 00217 #define AUDHeaderDescriptor_AUD1_00 0x0100 00218 /** @}*/ 00219 00220 #define AUDTerminalDescriptor_USBSTREAMING 0x0101 00221 #define AUDTerminalDescriptor_MICROPHONE 0x0201 00222 #define AUDTerminalDescriptor_HANDSETIN 0x0401 00223 #define AUDTerminalDescriptor_SPEAKERPHONE 0x0403 00224 #define AUDTerminalDescriptor_LINEIN 0x0501 00225 00226 /** \addtogroup usb_audio_in_term USB Audio Input terminal types 00227 * @{ 00228 * This section lists the available types for an Input terminal. 00229 * - \ref AUDInputTerminalDescriptor_USBSTREAMING 00230 * - \ref AUDInputTerminalDescriptor_MICROPHONE 00231 * - \ref AUDInputTerminalDescriptor_SPEAKERPHONE 00232 * - \ref AUDInputTerminalDescriptor_LINEIN 00233 */ 00234 00235 /** A terminal receiving its data from a USB isochronous endpoint.*/ 00236 #define AUDInputTerminalDescriptor_USBSTREAMING 0x0101 00237 /** A terminal sampling data from a microphone.*/ 00238 #define AUDInputTerminalDescriptor_MICROPHONE 0x0201 00239 /** A terminal sampling data from a Handset In.*/ 00240 #define AUDInputTerminalDescriptor_HANDSETIN 0x0401 00241 /** A terminal sampling data from a speaker-phone*/ 00242 #define AUDInputTerminalDescriptor_SPEAKERPHONE 0x0403 00243 /** A terminal sampling data from a Phone Line In.*/ 00244 #define AUDInputTerminalDescriptor_LINEIN 0x0501 00245 /** @}*/ 00246 00247 /** \addtogroup usb_audio_ch_loc USB Audio Channel spatial locations 00248 * @{ 00249 * This section lists the possible spatial locations for audio channels. 00250 * - \ref AUDInputTerminalDescriptor_LEFTFRONT 00251 * - \ref AUDInputTerminalDescriptor_RIGHTFRONT 00252 * - \ref AUDInputTerminalDescriptor_CENTERFRONT 00253 */ 00254 /** Front left channel.*/ 00255 #define AUDInputTerminalDescriptor_LEFTFRONT (1 << 0) 00256 /** Front right channel.*/ 00257 #define AUDInputTerminalDescriptor_RIGHTFRONT (1 << 1) 00258 /** Front center channel.*/ 00259 #define AUDInputTerminalDescriptor_CENTERFRONT (1 << 2) 00260 /** @}*/ 00261 00262 00263 /** \addtogroup usb_audio_out_term USB Audio Output terminal types 00264 * @{ 00265 * This section lists the available types for an output terminal. 00266 * - \ref AUDOutputTerminalDescriptor_USBTREAMING 00267 * - \ref AUDOutputTerminalDescriptor_SPEAKER 00268 * - \ref AUDOutputTerminalDescriptor_HANDSETOUT 00269 * - \ref AUDOutputTerminalDescriptor_LINEOUT 00270 */ 00271 /** A terminal sending data through USB isochronous endpoint.*/ 00272 #define AUDOutputTerminalDescriptor_USBTREAMING 0x0101 00273 /** A terminal sending data to a USB host through an Isochronous endpoint.*/ 00274 #define AUDOutputTerminalDescriptor_SPEAKER 0x0301 00275 /** A terminal sending data to Handset Out.*/ 00276 #define AUDOutputTerminalDescriptor_HANDSETOUT 0x0401 00277 /** A terminal sending data to Phone Line Out.*/ 00278 #define AUDOutputTerminalDescriptor_LINEOUT 0x0501 00279 /** @}*/ 00280 00281 /** \addtogroup usb_audio_ch_ctrl USB Audio Channel controls 00282 * @{ 00283 * This section lists the available controls for each channel of the audio 00284 * interface. Each channel can have any control combination; simply perform 00285 * a bitwise OR ('|') to combine several values. 00286 * -# \ref AUDFeatureUnitDescriptor_MUTE 00287 * -# \ref AUDFeatureUnitDescriptor_VOLUME 00288 * -# \ref AUDFeatureUnitDescriptor_BASS 00289 * -# \ref AUDFeatureUnitDescriptor_MID 00290 * -# \ref AUDFeatureUnitDescriptor_TREBLE 00291 */ 00292 /** Channel mute control. */ 00293 #define AUDFeatureUnitDescriptor_MUTE (1 << 0) 00294 /** Channel volume control. */ 00295 #define AUDFeatureUnitDescriptor_VOLUME (1 << 1) 00296 /** Channel bass control. */ 00297 #define AUDFeatureUnitDescriptor_BASS (1 << 2) 00298 /** Channel middle control. */ 00299 #define AUDFeatureUnitDescriptor_MID (1 << 3) 00300 /** Channel treble control. */ 00301 #define AUDFeatureUnitDescriptor_TREBLE (1 << 4) 00302 /** @}*/ 00303 00304 00305 /** Format type for a format type I descriptor. */ 00306 #define AUDFormatTypeOneDescriptor_FORMATTYPEONE 0x01 00307 00308 /** AUDFormatTypeOneDescriptor_PCM - PCM format. */ 00309 #define AUDFormatTypeOneDescriptor_PCM 0x0001 00310 00311 /** Indicates the sampling frequency can have any value in the provided range. */ 00312 #define AUDFormatTypeOneDescriptor_CONTINUOUS 0 00313 00314 00315 /*---------------------------------------------------------------------------- 00316 * Types 00317 *----------------------------------------------------------------------------*/ 00318 #pragma pack(1) 00319 #if defined ( __CC_ARM ) /* Keil ¦̀Vision 4 */ 00320 #elif defined ( __ICCARM__ ) /* IAR Ewarm */ 00321 #define __attribute__(...) 00322 #define __packed__ packed 00323 #elif defined ( __GNUC__ ) /* GCC CS3 */ 00324 #define __packed__ aligned(1) 00325 #endif 00326 00327 /** 00328 * \typedef AUDStreamingInterfaceDescriptor 00329 * \brief Provides additional information about an audio streaming interface to 00330 * the USB host. 00331 */ 00332 typedef struct _AUDStreamingInterfaceDescriptor { 00333 00334 /** Size of descriptor in bytes.*/ 00335 uint8_t bLength; 00336 /** Descriptor type (AUDGenericDescriptor_INTERFACE).*/ 00337 uint8_t bDescriptorType; 00338 /** Descriptor subtype (AUDStreamingInterfaceDescriptor_GENERAL).*/ 00339 uint8_t bDescriptorSubType; 00340 /** Terminal ID to which the interface is connected.*/ 00341 uint8_t bTerminalLink; 00342 /** Delay introduced by the data path, in number of frames.*/ 00343 uint8_t bDelay; 00344 /** Audio data format used by this interface.*/ 00345 uint16_t wFormatTag; 00346 00347 } __attribute__ ((__packed__)) AUDStreamingInterfaceDescriptor; /* GCC */ 00348 00349 /** 00350 * \typedef AUDEndpointDescriptor 00351 * \brief Modified endpoint descriptor with two additional fields, with are 00352 * USB audio specific. 00353 */ 00354 typedef struct _AUDEndpointDescriptor { 00355 00356 /** Size of the descriptor in bytes. */ 00357 uint8_t bLength; 00358 /** Descriptor type (USBGenericDescriptor_ENDPOINT). */ 00359 uint8_t bDescriptorType; 00360 /** Address and direction of the endpoint. */ 00361 uint8_t bEndpointAddress; 00362 /** Endpoint type and additional characteristics (for isochronous endpoints). */ 00363 uint8_t bmAttributes; 00364 /** Maximum packet size (in bytes) of the endpoint. */ 00365 uint16_t wMaxPacketSize; 00366 /** Polling rate of the endpoint. */ 00367 uint8_t bInterval; 00368 /** Refresh rate for a feedback endpoint. */ 00369 uint8_t bRefresh; 00370 /** Address of the associated feedback endpoint if any. */ 00371 uint8_t bSyncAddress; 00372 00373 } __attribute__ ((__packed__)) AUDEndpointDescriptor; /* GCC */ 00374 00375 /** 00376 * \typedef AUDDataEndpointDescriptor 00377 * \brief Gives additional information about an USB endpoint used to transmit audio 00378 * data to or from the host. 00379 */ 00380 typedef struct _AUDDataEndpointDescriptor { 00381 00382 /** Size of descriptor in bytes. */ 00383 uint8_t bLength; 00384 /** Descriptor type 00385 (\ref AUDGenericDescriptor_ENDPOINT). */ 00386 uint8_t bDescriptorType; 00387 /** Descriptor subtype 00388 (\ref AUDDataEndpointDescriptor_SUBTYPE). */ 00389 uint8_t bDescriptorSubType; 00390 /** Indicates available controls and requirement on packet sizes. */ 00391 uint8_t bmAttributes; 00392 /** Indicates the units of the wLockDelay fields. 00393 \sa usb_audio_lock_delay USB Audio Lock delay units */ 00394 uint8_t bLockDelayUnits; 00395 /** Time it takes for the endpoint to lock its internal clock circuitry. */ 00396 uint16_t wLockDelay; 00397 00398 } __attribute__ ((__packed__)) AUDDataEndpointDescriptor; /* GCC */ 00399 00400 /** 00401 * \typedef AUDHeaderDescriptor 00402 * \brief Groups the various audio interfaces to display one single function to 00403 * the USB host. Subclass this structure to add a particular number of 00404 * slave interface descriptors. 00405 */ 00406 typedef struct _AUDHeaderDescriptor { 00407 00408 /** Size of descriptor in bytes.*/ 00409 uint8_t bLength; 00410 /** Descriptor type (\ref AUDGenericDescriptor_INTERFACE).*/ 00411 uint8_t bDescriptorType; 00412 /** Descriptor subtype (\ref AUDGenericDescriptor_HEADER).*/ 00413 uint8_t bDescriptorSubType; 00414 /** Audio class release number in BCD format 00415 * \sa usb_audio_class_ver USB Audio class releases */ 00416 uint16_t bcdADC; 00417 /** Length of all descriptors used to qualify the Audio Control interface.*/ 00418 uint16_t wTotalLength; 00419 /** Number of Streaming interfaces contained in this collection.*/ 00420 uint8_t bInCollection; 00421 00422 } __attribute__ ((__packed__)) AUDHeaderDescriptor; /* GCC */ 00423 00424 /** 00425 * \typedef AUDInputTerminalDescriptor 00426 * \brief Describes an input of a USB audio device. 00427 */ 00428 typedef struct _AUDInputTerminalDescriptor { 00429 00430 /** Size of descriptor in bytes.*/ 00431 uint8_t bLength; 00432 /** Descriptor type (AUDGenericDescriptor_INTERFACE).*/ 00433 uint8_t bDescriptorType; 00434 /** Descriptor subtype (AUDGenericDescriptor_INPUTTERMINAL).*/ 00435 uint8_t bDescriptorSubType; 00436 /** ID of the terminal in the audio function.*/ 00437 uint8_t bTerminalID; 00438 /** Terminal type. 00439 * \sa usb_audio_in_term USB Audio Input terminal types 00440 */ 00441 uint16_t wTerminalType; 00442 /** ID of the output terminal to which this input terminal is associated.*/ 00443 uint8_t bAssocTerminal; 00444 /** Number of logical output channels in this terminal.*/ 00445 uint8_t bNrChannels; 00446 /** Spatial configuration of the logical channels.*/ 00447 uint16_t wChannelConfig; 00448 /** Index of a string descriptor for the first logical channel.*/ 00449 uint8_t iChannelNames; 00450 /** Index of a string descriptor for this terminal. */ 00451 uint8_t iTerminal; 00452 00453 } __attribute__ ((__packed__)) AUDInputTerminalDescriptor; /* GCC */ 00454 00455 /** 00456 * \typedef AUDOutputTerminalDescriptor 00457 * \brief Describes an output of the USB audio function. 00458 */ 00459 typedef struct _AUDOutputTerminalDescriptor { 00460 00461 /** Size of descriptor in bytes.*/ 00462 uint8_t bLength; 00463 /** Descriptor type (\ref AUDGenericDescriptor_INTERFACE).*/ 00464 uint8_t bDescriptorType; 00465 /** Descriptor subtype (\ref AUDGenericDescriptor_OUTPUTTERMINAL). */ 00466 uint8_t bDescriptorSubType; 00467 /** Identifier for this terminal.*/ 00468 uint8_t bTerminalID; 00469 /** Terminal type. 00470 * \sa "USB Audio Output terminal types" */ 00471 uint16_t wTerminalType; 00472 /** Identifier of the associated input terminal.*/ 00473 uint8_t bAssocTerminal; 00474 /** Identifier of the unit or terminal to which this terminal 00475 * is connected.*/ 00476 uint8_t bSourceID; 00477 /** Index of a string descriptor for this terminal.*/ 00478 uint8_t iTerminal; 00479 00480 } __attribute__ ((__packed__)) AUDOutputTerminalDescriptor; /* GCC */ 00481 00482 /** 00483 * \typedef AUDFeatureUnitDescriptor 00484 * \brief Describes available controls for each channel of the unit or terminal 00485 * it is connected to. 00486 * 00487 * This type must be augmented with the relevant number 00488 * of bmaControls fields and the iFeature field. 00489 **/ 00490 typedef struct _AUDFeatureUnitDescriptor { 00491 00492 /** Size of descriptor in bytes.*/ 00493 uint8_t bLength; 00494 /** Descriptor type (AUDGenericDescriptor_INTERFACE). */ 00495 uint8_t bDescriptorType; 00496 /** Descriptor subtype (AUDGenericDescriptor_FEATURE). */ 00497 uint8_t bDescriptorSubType; 00498 /** Identifier of this feature unit. */ 00499 uint8_t bUnitID; 00500 /** Identifier of the unit or terminal this feature unit is connected to. */ 00501 uint8_t bSourceID; 00502 /** Size in bytes of a channel controls field. */ 00503 uint8_t bControlSize; 00504 00505 } __attribute__ ((__packed__)) AUDFeatureUnitDescriptor; /* GCC */ 00506 00507 /** 00508 * \typedef AUDFormatTypeOneDescriptor 00509 * \brief Describes an audio data stream that is constructed on a sample-by-sample 00510 * basis. 00511 * 00512 * This type must be augmented with either the continuous sampling frequency range 00513 * (if bSamFreqType = <\ref AUDFormatTypeOneDescriptor_CONTINUOUS>) 00514 * or with an array containing the possible discrete frequencies. 00515 */ 00516 typedef struct _AUDFormatTypeOneDescriptor { 00517 00518 /** Size of descriptor in bytes. */ 00519 uint8_t bLength; 00520 /** Descriptor type (\ref AUDGenericDescriptor_INTERFACE). */ 00521 uint8_t bDescriptorType; 00522 /** Descriptor subtype (\ref AUDStreamingInterfaceDescriptor_FORMATTYPE).*/ 00523 uint8_t bDescriptorSubType; 00524 /** Format type (\ref AUDFormatTypeOneDescriptor_FORMATTYPEONE).*/ 00525 uint8_t bFormatType; 00526 /** Number of physical channels in the audio stream.*/ 00527 uint8_t bNrChannels; 00528 /** Number of bytes occupied by one audio subframe.*/ 00529 uint8_t bSubFrameSize; 00530 /** Number of bits effectively used in an audio subframe.*/ 00531 uint8_t bBitResolution; 00532 /** Number of supported discrete sampling frequencies, or 00533 * \ref AUDFormatTypeOneDescriptor_CONTINUOUS.*/ 00534 uint8_t bSamFreqType; 00535 00536 } __attribute__ ((__packed__)) AUDFormatTypeOneDescriptor; /* GCC */ 00537 00538 #pragma pack() 00539 00540 /*---------------------------------------------------------------------------- 00541 * Functions 00542 *----------------------------------------------------------------------------*/ 00543 00544 00545 00546 /**@}*/ 00547 #endif /* _AUDDESCRIPTORS_H_ */