📄 usbaudio.h
字号:
/* USB_AUDIO_STATUS_WORD.statusType */#define USB_AUDIO_ST_AUDIO_CONTROL 0x00#define USB_AUDIO_ST_AUDIO_STREAMING_IF 0x01#define USB_AUDIO_ST_AUDIO_STREAMING_EP 0x02#define USB_AUDIO_ST_MEMORY_CHANGED 0x40#define USB_AUDIO_ST_INT_PENDING 0x80/* common audio descriptor header */typedef struct usb_audio_descr_header { UINT8 length; /* length of descriptor in bytes */ UINT8 descriptorType; /* descriptor type */ UINT8 descriptorSubType; /* descriptor sub type */ } USB_AUDIO_DESCR_HEADER, *pUSB_AUDIO_DESCR_HEADER;/* standard AC (AudioControl) interface descriptor. * * NOTE: This structure is identical to the standard USB interface descriptor, * except that interfaceClass is defined as the Audio interface class, * interfaceSubClass is defined as the audio interface subclass, and * interfaceProtocol is always 0. *//* class-specific AC interface descriptor */typedef struct usb_audio_ac_descr { UINT8 length; /* length of descriptor in bytes */ UINT8 descriptorType; /* descriptor type */ UINT8 descriptorSubType; /* descriptor sub type */ UINT8 bcdAdc [2]; /* release level in BCD */ UINT8 totalLength [2]; /* combined length of all descr */ UINT8 inCollection; /* number of streaming interfaces */ UINT8 interfaceNbr [1]; /* variable number of interface numbers */ } USB_AUDIO_AC_DESCR, *pUSB_AUDIO_AC_DESCR;/* header common to all AudioControl unit/terminal descriptors */typedef struct usb_audio_ac_common { UINT8 length; /* length of descriptor in bytes */ UINT8 descriptorType; /* descriptor type */ UINT8 descriptorSubType; /* descriptor sub type */ UINT8 unitId; /* unit/terminal ID */ } USB_AUDIO_AC_COMMON, *pUSB_AUDIO_AC_COMMON;/* input terminal descriptor */typedef struct usb_audio_input_term_descr { UINT8 length; /* length of descriptor in bytes */ UINT8 descriptorType; /* descriptor type */ UINT8 descriptorSubType; /* descriptor sub type */ UINT8 terminalId; /* ID of this terminal */ UINT8 terminalType [2]; /* type of terminal */ UINT8 assocTerminal; /* ID of associated output terminal */ UINT8 channels; /* count of channels */ UINT8 channelConfig [2]; /* see USB_AUDIO_LOC_xxxx */ UINT8 channelNamesIndex; /* index of first string descr */ UINT8 terminalNameIndex; /* index of string descr for this term */ } USB_AUDIO_INPUT_TERM_DESCR, *pUSB_AUDIO_INPUT_TERM_DESCR;/* output terminal descriptor */typedef struct usb_audio_output_term_descr { UINT8 length; /* length of descriptor in bytes */ UINT8 descriptorType; /* descriptor type */ UINT8 descriptorSubType; /* descriptor sub type */ UINT8 terminalId; /* ID of this terminal */ UINT8 terminalType [2]; /* type of terminal */ UINT8 assocTerminal; /* ID of associate input terminal */ UINT8 sourceId; /* ID of connected unit/terminal */ UINT8 terminalNameIndex; /* index of string desdr for this term */ } USB_AUDIO_OUTPUT_TERM_DESCR, *pUSB_AUDIO_OUTPUT_TERM_DESCR;/* mixer unit descriptor */typedef struct usb_audio_mixer_unit_descr { UINT8 length; /* length of descriptor in bytes */ UINT8 descriptorType; /* descriptor type */ UINT8 descriptorSubType; /* descriptor sub type */ UINT8 unitId; /* ID of this unit */ UINT8 nbrInPins; /* number of input pins */ UINT8 sourceId [1]; /* array of sources */ /* followed by a cluster descr */ /* followed by a controls byte */ /* followed by iMixer */ } USB_AUDIO_MIXER_UNIT_DESCR, *pUSB_AUDIO_MIXER_UNIT_DESCR;/* selector unit descriptor */typedef struct usb_audio_selector_unit_descr { UINT8 length; /* length of descriptor in bytes */ UINT8 descriptorType; /* descriptor type */ UINT8 descriptorSubType; /* descriptor sub type */ UINT8 unitId; /* ID of this unit */ UINT8 nbrInPins; /* number of input pins */ UINT8 sourceId [1]; /* array of sources */ /* followed by iMixer */ } USB_AUDIO_SELECTOR_UNIT_DESCR, *pUSB_AUDIO_SELECTOR_UNIT_DESCR;/* feature unit descriptor */typedef struct usb_audio_feature_unit_descr { UINT8 length; /* length of descriptor in bytes */ UINT8 descriptorType; /* descriptor type */ UINT8 descriptorSubType; /* descriptor sub type */ UINT8 unitId; /* unique ID of this unit */ UINT8 sourceId; /* ID of source unit/terminal */ UINT8 controlSize; /* size of entries in controls array */ UINT8 controls [1]; /* variable length, 1 + no. of channels */ /* iFeature byte follows controls array */ } USB_AUDIO_FEATURE_UNIT_DESCR, *pUSB_AUDIO_FEATURE_UNIT_DESCR;/* processing unit descriptor (common part) */typedef struct usb_audio_process_unit_descr { UINT8 length; /* length of descriptor in bytes */ UINT8 descriptorType; /* descriptor type */ UINT8 descriptorSubType; /* descriptor sub type */ UINT8 unitId; /* unique ID of this unit */ UINT8 processType [2]; /* type of process performed by unit */ UINT8 nbrInPins; /* number of input pins */ UINT8 sourceId [1]; /* array of sources */ /* ... */ } USB_AUDIO_PROCESS_UNIT_DESCR, *pUSB_AUDIO_PROCESS_UNIT_DESCR;/* extension unit descriptor */typedef struct usb_audio_ext_unit_descr { UINT8 length; /* length of descriptor in bytes */ UINT8 descriptorType; /* descriptor type */ UINT8 descriptorSubType; /* descriptor sub type */ UINT8 unitId; /* unique ID of this unit */ UINT8 extensionCode [2]; /* type of extension */ UINT8 nbrInPins; /* number of input pins */ UINT8 sourceId [1]; /* array of sources */ /* ... */ } USB_AUDIO_EXT_UNIT_DESCR, *pUSB_AUDIO_EXT_UNIT_DESCR;/* standard AC interrupt endpoint descriptor */typedef struct usb_audio_int_ep_descr { UINT8 length; /* bLength */ UINT8 descriptorType; /* bDescriptorType */ UINT8 endpointAddress; /* bEndpointAddress */ UINT8 attributes; /* bmAttributes */ UINT8 maxPacketSize [2]; /* wMaxPacketSize */ UINT8 interval; /* bInterval */ UINT8 refresh; /* reset to 0 */ UINT8 synchAddress; /* reset to 0 */ } USB_AUDIO_INT_EP_DESCR, *pUSB_AUDIO_INT_EP_DESCR;/* standard AS (AudioStreaming) interface descriptor * * NOTE: This structure is identical to the standard USB interface descriptor, * except that interfaceClass is defined as the Audio interface class, * interfaceSubClass is defined as the audio interface subclass, and * interfaceProtocol is always 0. *//* class-specific AS interface descriptor */typedef struct usb_audio_as_descr { UINT8 length; /* length of descriptor in bytes */ UINT8 descriptorType; /* descriptor type */ UINT8 descriptorSubType; /* descriptor sub type */ UINT8 terminalLink; /* ID of connected terminal */ UINT8 delay; /* delay introduced by data path */ UINT8 formatTag [2]; /* audio data format */ } USB_AUDIO_AS_DESCR, *pUSB_AUDIO_AS_DESCR;/* standard AS isochronous audio data endpoint descriptor */typedef struct usb_audio_std_isoch_ep_descr { UINT8 length; /* bLength */ UINT8 descriptorType; /* bDescriptorType */ UINT8 endpointAddress; /* bEndpointAddress */ UINT8 attributes; /* bmAttributes */ UINT8 maxPacketSize [2]; /* wMaxPacketSize */ UINT8 interval; /* bInterval */ UINT8 refresh; /* reset to 0 */ UINT8 synchAddress; /* address of synch endpoint */ } USB_AUDIO_STD_ISOCH_EP_DESCR, *pUSB_AUDIO_STD_ISOCH_EP_DESCR;/* class-specific isochronous audio data endpoint descriptor */typedef struct usb_audio_class_isoch_ep_descr { UINT8 length; /* length of descriptor in bytes */ UINT8 descriptorType; /* descriptor type */ UINT8 descriptorSubType; /* descriptor sub type */ UINT8 attributes; /* bmAttributes */ UINT8 lockDelayUnits; /* indicates units for lockDelay */ UINT8 lockDelay; /* internal clock lock time */ } USB_AUDIO_CLASS_ISOCH_EP_DESCR, *pUSB_AUDIO_CLASS_ISOCH_EP_DESCR;/* standard AS isoch synch endpoint descriptor */typedef struct usb_audio_isoch_synch_ep_descr { UINT8 length; /* bLength */ UINT8 descriptorType; /* bDescriptorType */ UINT8 endpointAddress; /* bEndpointAddress */ UINT8 attributes; /* bmAttributes */ UINT8 maxPacketSize [2]; /* wMaxPacketSize */ UINT8 interval; /* bInterval */ UINT8 refresh; /* synch refresh rate (pwr of 2) */ UINT8 synchAddress; /* reset to 0 */ } USB_AUDIO_ISOCH_SYNCH_EP_DESCR, *pUSB_AUDIO_ISOCH_SYNCH_EP_DESCR;/* common sampling frequency information */typedef UINT8 USB_AUDIO_SAM_FREQ [3];typedef struct usb_audio_sample_info { UINT8 freqType; /* how sampling freq. can be programmed */ union { struct { USB_AUDIO_SAM_FREQ lowerFreq; /* lower bound */ USB_AUDIO_SAM_FREQ upperFreq; /* upper bound */ } continous; struct { USB_AUDIO_SAM_FREQ freq [1]; /* discrete sampling frequency */ } discrete; } freq; } USB_AUDIO_SAMPLE_INFO, *pUSB_AUDIO_SAMPLE_INFO;/* type I format type descriptor */typedef struct usb_audio_type_1_type_descr { UINT8 length; /* length of descriptor in bytes */ UINT8 descriptorType; /* descriptor type */ UINT8 descriptorSubType; /* descriptor sub type */ UINT8 formatType; /* identifies format type */ UINT8 nbrChannels; /* number of channels */ UINT8 subFrameSize; /* number of bytes for one audio subframe */ UINT8 bitResolution; /* number of bits used per audio subframe */ USB_AUDIO_SAMPLE_INFO sample; /* sampling frequency info */ } USB_AUDIO_TYPE_1_TYPE_DESCR, *pUSB_AUDIO_TYPE_1_TYPE_DESCR;/* type II format type descriptor */typedef struct usb_audio_type_2_type_descr { UINT8 length; /* length of descriptor in bytes */ UINT8 descriptorType; /* descriptor type */ UINT8 descriptorSubType; /* descriptor sub type */ UINT8 formatType; /* identifies format type */ UINT8 maxBitRate [2]; /* max bits per second sup. by interface */ UINT8 samplesPerFrame [2]; /* nbr PCM audio samples in audio frame */ USB_AUDIO_SAMPLE_INFO sample; /* sampling frequency info */ } USB_AUDIO_TYPE_2_TYPE_DESCR, *pUSB_AUDIO_TYPE_2_TYPE_DESCR;/* type III format type descriptor */typedef struct usb_audio_type_3_type_descr { UINT8 length; /* length of descriptor in bytes */ UINT8 descriptorType; /* descriptor type */ UINT8 descriptorSubType; /* descriptor sub type */ UINT8 formatType; /* identifies format type */ UINT8 nbrChannels; /* number of channels */ UINT8 subFrameSize; /* number of bytes for one audio subframe */ UINT8 bitResolution; /* number of bits used per audio subframe */ USB_AUDIO_SAMPLE_INFO sample; /* sampling frequency info */ } USB_AUDIO_TYPE_3_TYPE_DESCR, *pUSB_AUDIO_TYPE_3_TYPE_DESCR;/* composite type descriptor */typedef struct usb_audio_type_descr { UINT8 length; /* length of descriptor in bytes */ UINT8 descriptorType; /* descriptor type */ UINT8 descriptorSubType; /* descriptor sub type */ UINT8 formatType; /* identifies format type */ union { struct { UINT8 nbrChannels; /* number of channels */ UINT8 subFrameSize; /* number of bytes for one audio subframe */ UINT8 bitResolution; /* number of bits used per audio subframe */ USB_AUDIO_SAMPLE_INFO sample; /* sampling frequency info */ } type1; struct { UINT8 maxBitRate [2]; /* max bits per second sup. by interface */ UINT8 samplesPerFrame [2]; /* nbr PCM audio samples in audio frame */ USB_AUDIO_SAMPLE_INFO sample; /* sampling frequency info */ } type2; struct { UINT8 nbrChannels; /* number of channels */ UINT8 subFrameSize; /* number of bytes for one audio subframe */ UINT8 bitResolution; /* number of bits used per audio subframe */ USB_AUDIO_SAMPLE_INFO sample; /* sampling frequency info */ } type3; } ts; } USB_AUDIO_TYPE_DESCR, *pUSB_AUDIO_TYPE_DESCR;#ifdef __cplusplus}#endif#endif /* __INCusbAudioh *//* End of file. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -