| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Typedefs | Enumerations
AudioClassCommon.h File Reference
`#include "../../Core/StdDescriptors.h"`

Go to the source code of this file.

## Macros
#define | AUDIO_SAMPLE_FREQ(freq) {.Byte1 = ((uint32_t)freq & 0xFF), .Byte2 = (((uint32_t)freq >> 8) & 0xFF), .Byte3 = (((uint32_t)freq >> 16) & 0xFF)}
#define | AUDIO_EP_FULL_PACKETS_ONLY (1 << 7)
#define | AUDIO_EP_ACCEPTS_SMALL_PACKETS (0 << 7)
#define | AUDIO_EP_SAMPLE_FREQ_CONTROL (1 << 0)
#define | AUDIO_EP_PITCH_CONTROL (1 << 1)
Audio Channel Masks
#define | AUDIO_CHANNEL_LEFT_FRONT (1 << 0)
#define | AUDIO_CHANNEL_RIGHT_FRONT (1 << 1)
#define | AUDIO_CHANNEL_CENTER_FRONT (1 << 2)
#define | AUDIO_CHANNEL_LOW_FREQ_ENHANCE (1 << 3)
#define | AUDIO_CHANNEL_LEFT_SURROUND (1 << 4)
#define | AUDIO_CHANNEL_RIGHT_SURROUND (1 << 5)
#define | AUDIO_CHANNEL_LEFT_OF_CENTER (1 << 6)
#define | AUDIO_CHANNEL_RIGHT_OF_CENTER (1 << 7)
#define | AUDIO_CHANNEL_SURROUND (1 << 8)
#define | AUDIO_CHANNEL_SIDE_LEFT (1 << 9)
#define | AUDIO_CHANNEL_SIDE_RIGHT (1 << 10)
#define | AUDIO_CHANNEL_TOP (1 << 11)
Audio Feature Masks
#define | AUDIO_FEATURE_MUTE (1 << 0)
#define | AUDIO_FEATURE_VOLUME (1 << 1)
#define | AUDIO_FEATURE_BASS (1 << 2)
#define | AUDIO_FEATURE_MID (1 << 3)
#define | AUDIO_FEATURE_TREBLE (1 << 4)
#define | AUDIO_FEATURE_GRAPHIC_EQUALIZER (1 << 5)
#define | AUDIO_FEATURE_AUTOMATIC_GAIN (1 << 6)
#define | AUDIO_FEATURE_DELAY (1 << 7)
#define | AUDIO_FEATURE_BASS_BOOST (1 << 8)
#define | AUDIO_FEATURE_BASS_LOUDNESS (1 << 9)
Audio Terminal Types
#define | AUDIO_TERMINAL_UNDEFINED 0x0100
#define | AUDIO_TERMINAL_STREAMING 0x0101
#define | AUDIO_TERMINAL_VENDOR 0x01FF
#define | AUDIO_TERMINAL_IN_UNDEFINED 0x0200
#define | AUDIO_TERMINAL_IN_MIC 0x0201
#define | AUDIO_TERMINAL_IN_DESKTOP_MIC 0x0202
#define | AUDIO_TERMINAL_IN_PERSONAL_MIC 0x0203
#define | AUDIO_TERMINAL_IN_OMNIDIR_MIC 0x0204
#define | AUDIO_TERMINAL_IN_MIC_ARRAY 0x0205
#define | AUDIO_TERMINAL_IN_PROCESSING_MIC 0x0206
#define | AUDIO_TERMINAL_IN_OUT_UNDEFINED 0x0300
#define | AUDIO_TERMINAL_OUT_SPEAKER 0x0301
#define | AUDIO_TERMINAL_OUT_HEADPHONES 0x0302
#define | AUDIO_TERMINAL_OUT_HEAD_MOUNTED 0x0303
#define | AUDIO_TERMINAL_OUT_DESKTOP 0x0304
#define | AUDIO_TERMINAL_OUT_ROOM 0x0305
#define | AUDIO_TERMINAL_OUT_COMMUNICATION 0x0306
#define | AUDIO_TERMINAL_OUT_LOWFREQ 0x0307

## Typedefs
struct {
USB_Descriptor_Header_t Header
uint8_t Subtype
uint8_t TerminalID
uint16_t TerminalType
uint8_t AssociatedOutputTerminal
uint8_t TotalChannels
uint16_t ChannelConfig
uint8_t ChannelStrIndex
uint8_t TerminalStrIndex
} | USB_Audio_Descriptor_InputTerminal_t
struct {
uint8_t bLength
uint8_t bDescriptorType
uint8_t bDescriptorSubtype
uint8_t bTerminalID
uint16_t wTerminalType
uint8_t bAssocTerminal
uint8_t bNrChannels
uint16_t wChannelConfig
uint8_t iChannelNames
uint8_t iTerminal
} | USB_Audio_StdDescriptor_InputTerminal_t
struct {
USB_Descriptor_Header_t Header
uint8_t Subtype
uint8_t TerminalID
uint16_t TerminalType
uint8_t AssociatedInputTerminal
uint8_t SourceID
uint8_t TerminalStrIndex
} | USB_Audio_Descriptor_OutputTerminal_t
struct {
uint8_t bLength
uint8_t bDescriptorType
uint8_t bDescriptorSubtype
uint8_t bTerminalID
uint16_t wTerminalType
uint8_t bAssocTerminal
uint8_t bSourceID
uint8_t iTerminal
} | USB_Audio_StdDescriptor_OutputTerminal_t
struct {
USB_Descriptor_Header_t Header
uint8_t Subtype
uint16_t ACSpecification
uint16_t TotalLength
uint8_t InCollection
uint8_t InterfaceNumber
} | USB_Audio_Descriptor_Interface_AC_t
struct {
uint8_t bLength
uint8_t bDescriptorType
uint8_t bDescriptorSubtype
uint16_t bcdADC
uint16_t wTotalLength
uint8_t bInCollection
uint8_t bInterfaceNumbers
} | USB_Audio_StdDescriptor_Interface_AC_t
struct {
USB_Descriptor_Header_t Header
uint8_t Subtype
uint8_t UnitID
uint8_t SourceID
uint8_t ControlSize
uint8_t ChannelControls [3]
uint8_t FeatureUnitStrIndex
} | USB_Audio_Descriptor_FeatureUnit_t
struct {
uint8_t bLength
uint8_t bDescriptorType
uint8_t bDescriptorSubtype
uint8_t bUnitID
uint8_t bSourceID
uint8_t bControlSize
uint8_t bmaControls [3]
uint8_t iFeature
} | USB_Audio_StdDescriptor_FeatureUnit_t
struct {
USB_Descriptor_Header_t Header
uint8_t Subtype
uint8_t TerminalLink
uint8_t FrameDelay
uint16_t AudioFormat
} | USB_Audio_Descriptor_Interface_AS_t
struct {
uint8_t bLength
uint8_t bDescriptorType
uint8_t bDescriptorSubtype
uint8_t bTerminalLink
uint8_t bDelay
uint16_t wFormatTag
} | USB_Audio_StdDescriptor_Interface_AS_t
struct {
USB_Descriptor_Header_t Header
uint8_t Subtype
uint8_t FormatType
uint8_t Channels
uint8_t SubFrameSize
uint8_t BitResolution
uint8_t TotalDiscreteSampleRates
} | USB_Audio_Descriptor_Format_t
struct {
uint8_t Byte1
uint8_t Byte2
uint8_t Byte3
} | USB_Audio_SampleFreq_t
struct {
uint8_t bLength
uint8_t bDescriptorType
uint8_t bDescriptorSubtype
uint8_t bFormatType
uint8_t bNrChannels
uint8_t bSubFrameSize
uint8_t bBitResolution
uint8_t bSampleFrequencyType
} | USB_Audio_StdDescriptor_Format_t
struct {
USB_Descriptor_Endpoint_t Endpoint
uint8_t Refresh
uint8_t SyncEndpointNumber
} | USB_Audio_Descriptor_StreamEndpoint_Std_t
struct {
uint8_t bLength
uint8_t bDescriptorType
uint8_t bEndpointAddress
uint8_t bmAttributes
uint16_t wMaxPacketSize
uint8_t bInterval
uint8_t bRefresh
uint8_t bSynchAddress
} | USB_Audio_StdDescriptor_StreamEndpoint_Std_t
struct {
USB_Descriptor_Header_t Header
uint8_t Subtype
uint8_t Attributes
uint8_t LockDelayUnits
uint16_t LockDelay
} | USB_Audio_Descriptor_StreamEndpoint_Spc_t
struct {
uint8_t bLength
uint8_t bDescriptorType
uint8_t bDescriptorSubtype
uint8_t bmAttributes
uint8_t bLockDelayUnits
uint16_t wLockDelay
} | USB_Audio_StdDescriptor_StreamEndpoint_Spc_t

## Enumerations
enum | Audio_Descriptor_ClassSubclassProtocol_t { AUDIO_CSCP_AudioClass = 0x01, AUDIO_CSCP_ControlSubclass = 0x01, AUDIO_CSCP_ControlProtocol = 0x00, AUDIO_CSCP_AudioStreamingSubclass = 0x02, AUDIO_CSCP_MIDIStreamingSubclass = 0x03, AUDIO_CSCP_StreamingProtocol = 0x00 }
enum | Audio_CSInterface_AC_SubTypes_t { AUDIO_DSUBTYPE_CSInterface_Header = 0x01, AUDIO_DSUBTYPE_CSInterface_InputTerminal = 0x02, AUDIO_DSUBTYPE_CSInterface_OutputTerminal = 0x03, AUDIO_DSUBTYPE_CSInterface_Mixer = 0x04, AUDIO_DSUBTYPE_CSInterface_Selector = 0x05, AUDIO_DSUBTYPE_CSInterface_Feature = 0x06, AUDIO_DSUBTYPE_CSInterface_Processing = 0x07, AUDIO_DSUBTYPE_CSInterface_Extension = 0x08 }
enum | Audio_CSInterface_AS_SubTypes_t { AUDIO_DSUBTYPE_CSInterface_General = 0x01, AUDIO_DSUBTYPE_CSInterface_FormatType = 0x02, AUDIO_DSUBTYPE_CSInterface_FormatSpecific = 0x03 }
enum | Audio_CSEndpoint_SubTypes_t { AUDIO_DSUBTYPE_CSEndpoint_General = 0x01 }
enum | Audio_ClassRequests_t { AUDIO_REQ_SetCurrent = 0x01, AUDIO_REQ_SetMinimum = 0x02, AUDIO_REQ_SetMaximum = 0x03, AUDIO_REQ_SetResolution = 0x04, AUDIO_REQ_SetMemory = 0x05, AUDIO_REQ_GetCurrent = 0x81, AUDIO_REQ_GetMinimum = 0x82, AUDIO_REQ_GetMaximum = 0x83, AUDIO_REQ_GetResolution = 0x84, AUDIO_REQ_GetMemory = 0x85, AUDIO_REQ_GetStatus = 0xFF }
enum | Audio_EndpointControls_t { AUDIO_EPCONTROL_SamplingFreq = 0x01, AUDIO_EPCONTROL_Pitch = 0x02 }

## Variable Documentation

uint16_t ACSpecification

Binary coded decimal value, indicating the supported Audio Class specification version.

Definition at line 431 of file AudioClassCommon.h.

uint8_t AssociatedInputTerminal

ID of associated input terminal, for physically grouped terminals such as the speaker and microphone of a phone handset.

Definition at line 375 of file AudioClassCommon.h.

uint8_t AssociatedOutputTerminal

ID of associated output terminal, for physically grouped terminals such as the speaker and microphone of a phone handset.

Definition at line 313 of file AudioClassCommon.h.

uint8_t Attributes

Audio class-specific endpoint attributes, such as AUDIO_EP_FULL_PACKETS_ONLY.

Definition at line 725 of file AudioClassCommon.h.

uint16_t AudioFormat

Format of the audio stream, see Audio Device Formats specification.

Definition at line 543 of file AudioClassCommon.h.

uint8_t bAssocTerminal

ID of associated output terminal, for physically grouped terminals such as the speaker and microphone of a phone handset.

ID of associated input terminal, for physically grouped terminals such as the speaker and microphone of a phone handset.

Definition at line 346 of file AudioClassCommon.h.

uint8_t bBitResolution

Bits of resolution of each channel's samples in the stream.

Definition at line 649 of file AudioClassCommon.h.

uint16_t bcdADC

Binary coded decimal value, indicating the supported Audio Class specification version.

Definition at line 460 of file AudioClassCommon.h.

uint8_t bControlSize

Size of each element in the `ChannelControls` array.

Definition at line 518 of file AudioClassCommon.h.

uint8_t bDelay

Delay in frames resulting from the complete sample processing from input to output.

Definition at line 569 of file AudioClassCommon.h.

uint8_t bDescriptorSubtype

Sub type value used to distinguish between audio class-specific descriptors, must be AUDIO_DSUBTYPE_CSInterface_InputTerminal.

Sub type value used to distinguish between audio class-specific descriptors, a value from the Audio_CSInterface_AC_SubTypes_t enum.

Sub type value used to distinguish between audio class-specific descriptors, a value from the Audio_CSInterface_AS_SubTypes_t enum.

Sub type value used to distinguish between audio class-specific descriptors, must be AUDIO_DSUBTYPE_CSInterface_Feature.

Sub type value used to distinguish between audio class-specific descriptors, a value from the Audio_CSEndpoint_SubTypes_t enum.

Definition at line 341 of file AudioClassCommon.h.

uint8_t bDescriptorType

Type of the descriptor, either a value in USB_DescriptorTypes_t or a value given by the specific class.

Sub type value used to distinguish between audio class-specific descriptors, must be AUDIO_DSUBTYPE_CSInterface_OutputTerminal.

Sub type value used to distinguish between audio class-specific descriptors, must be AUDIO_DSUBTYPE_CSInterface_FormatType.

Definition at line 337 of file AudioClassCommon.h.

uint8_t bEndpointAddress

Logical address of the endpoint within the device for the current configuration, including direction mask.

Definition at line 691 of file AudioClassCommon.h.

uint8_t bFormatType

Format of the audio stream, see Audio Device Formats specification.

Definition at line 645 of file AudioClassCommon.h.

uint8_t bInCollection

Total number of Audio Streaming interfaces linked to this Audio Control interface (must be 1).

Definition at line 463 of file AudioClassCommon.h.

uint8_t bInterfaceNumbers

Interface number of the associated Audio Streaming interface.

Definition at line 464 of file AudioClassCommon.h.

uint8_t bInterval

Polling interval in milliseconds for the endpoint if it is an INTERRUPT or ISOCHRONOUS type.

Definition at line 700 of file AudioClassCommon.h.

uint8_t BitResolution

Bits of resolution of each channel's samples in the stream.

Definition at line 597 of file AudioClassCommon.h.

uint8_t bLength

Size of the descriptor, in bytes.

Definition at line 336 of file AudioClassCommon.h.

uint8_t bLockDelayUnits

Units used for the LockDelay field, see Audio class specification.

Definition at line 755 of file AudioClassCommon.h.

uint8_t bmaControls[3]

Feature masks for the control channel, and each separate audio channel.

Definition at line 519 of file AudioClassCommon.h.

uint8_t bmAttributes

Endpoint attributes, comprised of a mask of the endpoint type (`EP_TYPE_*`) and attributes (`ENDPOINT_ATTR_*`) masks.

Audio class-specific endpoint attributes, such as AUDIO_EP_FULL_PACKETS_ONLY.

Definition at line 694 of file AudioClassCommon.h.

uint8_t bNrChannels

Total number of separate audio channels within this interface (right, left, etc.)

Total number of discrete channels in the stream.

Definition at line 349 of file AudioClassCommon.h.

uint8_t bRefresh

Always set to zero for Audio class devices.

Definition at line 704 of file AudioClassCommon.h.

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.

Definition at line 651 of file AudioClassCommon.h.

uint8_t bSourceID

ID value of the unit this terminal's audio is sourced from.

Source ID value of the audio source input into this feature unit.

Definition at line 409 of file AudioClassCommon.h.

uint8_t bSubFrameSize

Size in bytes of each channel's sample data in the stream.

Definition at line 648 of file AudioClassCommon.h.

uint8_t bSynchAddress

Endpoint address to send synchronization information to, if needed (zero otherwise).

Definition at line 705 of file AudioClassCommon.h.

uint8_t bTerminalID

ID value of this terminal unit - must be a unique value within the device.

Definition at line 344 of file AudioClassCommon.h.

uint8_t bTerminalLink

ID value of the output terminal this descriptor is describing.

Definition at line 567 of file AudioClassCommon.h.

uint8_t bUnitID

ID value of this feature unit - must be a unique value within the device.

Definition at line 515 of file AudioClassCommon.h.

uint8_t Byte1

Lowest 8 bits of the 24-bit value.

Definition at line 615 of file AudioClassCommon.h.

uint8_t Byte2

Middle 8 bits of the 24-bit value.

Definition at line 616 of file AudioClassCommon.h.

uint8_t Byte3

Upper 8 bits of the 24-bit value.

Definition at line 617 of file AudioClassCommon.h.

uint16_t ChannelConfig

`CHANNEL_*` masks indicating what channel layout is supported by this terminal.

Definition at line 317 of file AudioClassCommon.h.

uint8_t ChannelControls[3]

Feature masks for the control channel, and each separate audio channel.

Definition at line 488 of file AudioClassCommon.h.

uint8_t Channels

Total number of discrete channels in the stream.

Definition at line 594 of file AudioClassCommon.h.

uint8_t ChannelStrIndex

Index of a string descriptor describing this channel within the device.

Definition at line 319 of file AudioClassCommon.h.

uint8_t ControlSize

Size of each element in the `ChannelControls` array.

Definition at line 487 of file AudioClassCommon.h.

USB_Descriptor_Endpoint_t Endpoint

Standard endpoint descriptor describing the audio endpoint.

Definition at line 669 of file AudioClassCommon.h.

uint8_t FeatureUnitStrIndex

Index of a string descriptor describing this descriptor within the device.

Definition at line 490 of file AudioClassCommon.h.

uint8_t FormatType

Format of the audio stream, see Audio Device Formats specification.

Definition at line 593 of file AudioClassCommon.h.

uint8_t FrameDelay

Delay in frames resulting from the complete sample processing from input to output.

Definition at line 542 of file AudioClassCommon.h.

USB_Descriptor_Header_t Header

Regular descriptor header containing the descriptor's type and length.

Definition at line 306 of file AudioClassCommon.h.

uint8_t iChannelNames

Index of a string descriptor describing this channel within the device.

Definition at line 352 of file AudioClassCommon.h.

uint8_t iFeature

Index of a string descriptor describing this descriptor within the device.

Definition at line 521 of file AudioClassCommon.h.

uint8_t InCollection

Total number of Audio Streaming interfaces linked to this Audio Control interface (must be 1).

Definition at line 434 of file AudioClassCommon.h.

uint8_t InterfaceNumber

Interface number of the associated Audio Streaming interface.

Definition at line 435 of file AudioClassCommon.h.

uint8_t iTerminal

Index of a string descriptor describing this descriptor within the device.

Definition at line 353 of file AudioClassCommon.h.

uint16_t LockDelay

Time required to internally lock endpoint's internal clock recovery circuitry.

Definition at line 728 of file AudioClassCommon.h.

uint8_t LockDelayUnits

Units used for the LockDelay field, see Audio class specification.

Definition at line 727 of file AudioClassCommon.h.

uint8_t Refresh

Always set to zero for Audio class devices.

Definition at line 671 of file AudioClassCommon.h.

uint8_t SourceID

ID value of the unit this terminal's audio is sourced from.

Source ID value of the audio source input into this feature unit.

Definition at line 378 of file AudioClassCommon.h.

uint8_t SubFrameSize

Size in bytes of each channel's sample data in the stream.

Definition at line 596 of file AudioClassCommon.h.

uint8_t Subtype

Sub type value used to distinguish between audio class-specific descriptors, must be AUDIO_DSUBTYPE_CSInterface_InputTerminal.

Sub type value used to distinguish between audio class-specific descriptors, must be AUDIO_DSUBTYPE_CSInterface_OutputTerminal.

Sub type value used to distinguish between audio class-specific descriptors, a value from the Audio_CSInterface_AS_SubTypes_t enum.

Sub type value used to distinguish between audio class-specific descriptors, must be AUDIO_DSUBTYPE_CSInterface_Feature.

Sub type value used to distinguish between audio class-specific descriptors, must be AUDIO_DSUBTYPE_CSInterface_FormatType.

Sub type value used to distinguish between audio class-specific descriptors, a value from the Audio_CSEndpoint_SubTypes_t enum.

Definition at line 307 of file AudioClassCommon.h.

uint8_t SyncEndpointNumber

Endpoint address to send synchronization information to, if needed (zero otherwise).

Definition at line 672 of file AudioClassCommon.h.

uint8_t TerminalID

ID value of this terminal unit - must be a unique value within the device.

Definition at line 311 of file AudioClassCommon.h.

uint8_t TerminalLink

ID value of the output terminal this descriptor is describing.

Definition at line 540 of file AudioClassCommon.h.

uint8_t TerminalStrIndex

Index of a string descriptor describing this descriptor within the device.

Definition at line 320 of file AudioClassCommon.h.

uint16_t TerminalType

Type of terminal, a `TERMINAL_*` mask.

Definition at line 312 of file AudioClassCommon.h.

uint8_t TotalChannels

Total number of separate audio channels within this interface (right, left, etc.)

Definition at line 316 of file AudioClassCommon.h.

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.

Definition at line 599 of file AudioClassCommon.h.

uint16_t TotalLength

Total length of the Audio class-specific descriptors, including this descriptor.

Definition at line 432 of file AudioClassCommon.h.

uint8_t UnitID

ID value of this feature unit - must be a unique value within the device.

Definition at line 484 of file AudioClassCommon.h.

uint16_t wChannelConfig

`CHANNEL_*` masks indicating what channel layout is supported by this terminal.

Definition at line 350 of file AudioClassCommon.h.

uint16_t wFormatTag

Format of the audio stream, see Audio Device Formats specification.

Definition at line 570 of file AudioClassCommon.h.

uint16_t wLockDelay

Time required to internally lock endpoint's internal clock recovery circuitry.

Definition at line 756 of file AudioClassCommon.h.

uint16_t wMaxPacketSize

Size of the endpoint bank, in bytes. This indicates the maximum packet size that the endpoint can receive at a time.

Definition at line 697 of file AudioClassCommon.h.

uint16_t wTerminalType

Type of terminal, a `TERMINAL_*` mask.

Definition at line 345 of file AudioClassCommon.h.

uint16_t wTotalLength

Total length of the Audio class-specific descriptors, including this descriptor.

Definition at line 461 of file AudioClassCommon.h.