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

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

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Typedefs | Enumerations
Common Class Definitions
Audio 1.0 Class Driver

## Detailed Description

# Module Description

Constants, Types and Enum definitions that are common to both Device and Host modes for the USB Audio 1.0 Class.

## 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)

## 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 }

## Macro Definition Documentation

#define AUDIO_CHANNEL_CENTER_FRONT (1 << 2)

Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 69 of file AudioClassCommon.h.

#define AUDIO_CHANNEL_LEFT_FRONT (1 << 0)

Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 63 of file AudioClassCommon.h.

#define AUDIO_CHANNEL_LEFT_OF_CENTER (1 << 6)

Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 81 of file AudioClassCommon.h.

#define AUDIO_CHANNEL_LEFT_SURROUND (1 << 4)

Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 75 of file AudioClassCommon.h.

#define AUDIO_CHANNEL_LOW_FREQ_ENHANCE (1 << 3)

Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 72 of file AudioClassCommon.h.

#define AUDIO_CHANNEL_RIGHT_FRONT (1 << 1)

Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 66 of file AudioClassCommon.h.

#define AUDIO_CHANNEL_RIGHT_OF_CENTER (1 << 7)

Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 84 of file AudioClassCommon.h.

#define AUDIO_CHANNEL_RIGHT_SURROUND (1 << 5)

Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 78 of file AudioClassCommon.h.

#define AUDIO_CHANNEL_SIDE_LEFT (1 << 9)

Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 90 of file AudioClassCommon.h.

#define AUDIO_CHANNEL_SIDE_RIGHT (1 << 10)

Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 93 of file AudioClassCommon.h.

#define AUDIO_CHANNEL_SURROUND (1 << 8)

Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 87 of file AudioClassCommon.h.

#define AUDIO_CHANNEL_TOP (1 << 11)

Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 96 of file AudioClassCommon.h.

#define AUDIO_EP_ACCEPTS_SMALL_PACKETS (0 << 7)

Mask for the attributes parameter of an Audio class-specific Endpoint descriptor, indicating that the endpoint will accept partially filled endpoint packets of audio samples.

Definition at line 203 of file AudioClassCommon.h.

#define AUDIO_EP_FULL_PACKETS_ONLY (1 << 7)

Mask for the attributes parameter of an Audio class-specific Endpoint descriptor, indicating that the endpoint accepts only filled endpoint packets of audio samples.

Definition at line 198 of file AudioClassCommon.h.

#define AUDIO_EP_PITCH_CONTROL (1 << 1)

Mask for the attributes parameter of an Audio class-specific Endpoint descriptor, indicating that the endpoint allows for pitch adjustments to be made via control requests directed at the endpoint.

Definition at line 213 of file AudioClassCommon.h.

#define AUDIO_EP_SAMPLE_FREQ_CONTROL (1 << 0)

Mask for the attributes parameter of an Audio class-specific Endpoint descriptor, indicating that the endpoint allows for sampling frequency adjustments to be made via control requests directed at the endpoint.

Definition at line 208 of file AudioClassCommon.h.

#define AUDIO_FEATURE_AUTOMATIC_GAIN (1 << 6)

Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details.

Definition at line 120 of file AudioClassCommon.h.

#define AUDIO_FEATURE_BASS (1 << 2)

Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details.

Definition at line 108 of file AudioClassCommon.h.

#define AUDIO_FEATURE_BASS_BOOST (1 << 8)

Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details.

Definition at line 126 of file AudioClassCommon.h.

#define AUDIO_FEATURE_BASS_LOUDNESS (1 << 9)

Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details.

Definition at line 129 of file AudioClassCommon.h.

#define AUDIO_FEATURE_DELAY (1 << 7)

Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details.

Definition at line 123 of file AudioClassCommon.h.

#define AUDIO_FEATURE_GRAPHIC_EQUALIZER (1 << 5)

Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details.

Definition at line 117 of file AudioClassCommon.h.

#define AUDIO_FEATURE_MID (1 << 3)

Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details.

Definition at line 111 of file AudioClassCommon.h.

#define AUDIO_FEATURE_MUTE (1 << 0)

Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details.

Definition at line 102 of file AudioClassCommon.h.

#define AUDIO_FEATURE_TREBLE (1 << 4)

Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details.

Definition at line 114 of file AudioClassCommon.h.

#define AUDIO_FEATURE_VOLUME (1 << 1)

Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details.

Definition at line 105 of file AudioClassCommon.h.

#define AUDIO_SAMPLE_FREQ | ( |  | freq | ) | {.Byte1 = ((uint32_t)freq & 0xFF), .Byte2 = (((uint32_t)freq >> 8) & 0xFF), .Byte3 = (((uint32_t)freq >> 16) & 0xFF)}

Convenience macro to fill a 24-bit USB_Audio_SampleFreq_t structure with the given sample rate as a 24-bit number.

Parameters

  freq | Required audio sampling frequency in HZ

Definition at line 193 of file AudioClassCommon.h.

#define AUDIO_TERMINAL_IN_DESKTOP_MIC 0x0202

Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 150 of file AudioClassCommon.h.

#define AUDIO_TERMINAL_IN_MIC 0x0201

Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 147 of file AudioClassCommon.h.

#define AUDIO_TERMINAL_IN_MIC_ARRAY 0x0205

Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 159 of file AudioClassCommon.h.

#define AUDIO_TERMINAL_IN_OMNIDIR_MIC 0x0204

Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 156 of file AudioClassCommon.h.

#define AUDIO_TERMINAL_IN_OUT_UNDEFINED 0x0300

Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 165 of file AudioClassCommon.h.

#define AUDIO_TERMINAL_IN_PERSONAL_MIC 0x0203

Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 153 of file AudioClassCommon.h.

#define AUDIO_TERMINAL_IN_PROCESSING_MIC 0x0206

Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 162 of file AudioClassCommon.h.

#define AUDIO_TERMINAL_IN_UNDEFINED 0x0200

Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 144 of file AudioClassCommon.h.

#define AUDIO_TERMINAL_OUT_COMMUNICATION 0x0306

Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 183 of file AudioClassCommon.h.

#define AUDIO_TERMINAL_OUT_DESKTOP 0x0304

Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 177 of file AudioClassCommon.h.

#define AUDIO_TERMINAL_OUT_HEAD_MOUNTED 0x0303

Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 174 of file AudioClassCommon.h.

#define AUDIO_TERMINAL_OUT_HEADPHONES 0x0302

Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 171 of file AudioClassCommon.h.

#define AUDIO_TERMINAL_OUT_LOWFREQ 0x0307

Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 186 of file AudioClassCommon.h.

#define AUDIO_TERMINAL_OUT_ROOM 0x0305

Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 180 of file AudioClassCommon.h.

#define AUDIO_TERMINAL_OUT_SPEAKER 0x0301

Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 168 of file AudioClassCommon.h.

#define AUDIO_TERMINAL_STREAMING 0x0101

Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 138 of file AudioClassCommon.h.

#define AUDIO_TERMINAL_UNDEFINED 0x0100

Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 135 of file AudioClassCommon.h.

#define AUDIO_TERMINAL_VENDOR 0x01FF

Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details.

Definition at line 141 of file AudioClassCommon.h.

## Typedef Documentation

typedef { ... } USB_Audio_Descriptor_FeatureUnit_t

typedef { ... } USB_Audio_Descriptor_Format_t

typedef { ... } USB_Audio_Descriptor_InputTerminal_t

typedef { ... } USB_Audio_Descriptor_Interface_AC_t

typedef { ... } USB_Audio_Descriptor_Interface_AS_t

typedef { ... } USB_Audio_Descriptor_OutputTerminal_t

typedef { ... } USB_Audio_Descriptor_StreamEndpoint_Spc_t

typedef { ... } USB_Audio_Descriptor_StreamEndpoint_Std_t

typedef { ... } USB_Audio_SampleFreq_t

typedef { ... } USB_Audio_StdDescriptor_FeatureUnit_t

typedef { ... } USB_Audio_StdDescriptor_Format_t

typedef { ... } USB_Audio_StdDescriptor_InputTerminal_t

typedef { ... } USB_Audio_StdDescriptor_Interface_AC_t

typedef { ... } USB_Audio_StdDescriptor_Interface_AS_t

typedef { ... } USB_Audio_StdDescriptor_OutputTerminal_t

typedef { ... } USB_Audio_StdDescriptor_StreamEndpoint_Spc_t

typedef { ... } USB_Audio_StdDescriptor_StreamEndpoint_Std_t

## Enumeration Type Documentation

enum Audio_ClassRequests_t

Enum for the Audio class specific control requests that can be issued by the USB bus host.

Enumerator:

  AUDIO_REQ_SetCurrent | Audio class-specific request to set the current value of a parameter within the device.
  AUDIO_REQ_SetMinimum | Audio class-specific request to set the minimum value of a parameter within the device.
  AUDIO_REQ_SetMaximum | Audio class-specific request to set the maximum value of a parameter within the device.
  AUDIO_REQ_SetResolution | Audio class-specific request to set the resolution value of a parameter within the device.
  AUDIO_REQ_SetMemory | Audio class-specific request to set the memory value of a parameter within the device.
  AUDIO_REQ_GetCurrent | Audio class-specific request to get the current value of a parameter within the device.
  AUDIO_REQ_GetMinimum | Audio class-specific request to get the minimum value of a parameter within the device.
  AUDIO_REQ_GetMaximum | Audio class-specific request to get the maximum value of a parameter within the device.
  AUDIO_REQ_GetResolution | Audio class-specific request to get the resolution value of a parameter within the device.
  AUDIO_REQ_GetMemory | Audio class-specific request to get the memory value of a parameter within the device.
  AUDIO_REQ_GetStatus | Audio class-specific request to get the device status.

Definition at line 269 of file AudioClassCommon.h.

enum Audio_CSEndpoint_SubTypes_t

Audio class specific endpoint description subtypes, for the Audio Streaming interface.

Enumerator:

  AUDIO_DSUBTYPE_CSEndpoint_General | Audio class specific endpoint general descriptor.

Definition at line 263 of file AudioClassCommon.h.

enum Audio_CSInterface_AC_SubTypes_t

Audio class specific interface description subtypes, for the Audio Control interface.

Enumerator:

  AUDIO_DSUBTYPE_CSInterface_Header | Audio class specific control interface header.
  AUDIO_DSUBTYPE_CSInterface_InputTerminal | Audio class specific control interface Input Terminal.
  AUDIO_DSUBTYPE_CSInterface_OutputTerminal | Audio class specific control interface Output Terminal.
  AUDIO_DSUBTYPE_CSInterface_Mixer | Audio class specific control interface Mixer Unit.
  AUDIO_DSUBTYPE_CSInterface_Selector | Audio class specific control interface Selector Unit.
  AUDIO_DSUBTYPE_CSInterface_Feature | Audio class specific control interface Feature Unit.
  AUDIO_DSUBTYPE_CSInterface_Processing | Audio class specific control interface Processing Unit.
  AUDIO_DSUBTYPE_CSInterface_Extension | Audio class specific control interface Extension Unit.

Definition at line 242 of file AudioClassCommon.h.

enum Audio_CSInterface_AS_SubTypes_t

Audio class specific interface description subtypes, for the Audio Streaming interface.

Enumerator:

  AUDIO_DSUBTYPE_CSInterface_General | Audio class specific streaming interface general descriptor.
  AUDIO_DSUBTYPE_CSInterface_FormatType | Audio class specific streaming interface format type descriptor.
  AUDIO_DSUBTYPE_CSInterface_FormatSpecific | Audio class specific streaming interface format information descriptor.

Definition at line 255 of file AudioClassCommon.h.

enum Audio_Descriptor_ClassSubclassProtocol_t

Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the Audio device class.

Enumerator:

  AUDIO_CSCP_AudioClass | Descriptor Class value indicating that the device or interface belongs to the USB Audio 1.0 class.
  AUDIO_CSCP_ControlSubclass | Descriptor Subclass value indicating that the device or interface belongs to the Audio Control subclass.
  AUDIO_CSCP_ControlProtocol | Descriptor Protocol value indicating that the device or interface belongs to the Audio Control protocol.
  AUDIO_CSCP_AudioStreamingSubclass | Descriptor Subclass value indicating that the device or interface belongs to the MIDI Streaming subclass.
  AUDIO_CSCP_MIDIStreamingSubclass | Descriptor Subclass value indicating that the device or interface belongs to the Audio streaming subclass.
  AUDIO_CSCP_StreamingProtocol | Descriptor Protocol value indicating that the device or interface belongs to the Streaming Audio protocol.

Definition at line 219 of file AudioClassCommon.h.

enum Audio_EndpointControls_t

Enum for Audio class specific Endpoint control modifiers which can be set and retrieved by a USB host, if the corresponding endpoint control is indicated to be supported in the Endpoint's Audio-class specific endpoint descriptor.

Enumerator:

  AUDIO_EPCONTROL_SamplingFreq | Sampling frequency adjustment of the endpoint.
  AUDIO_EPCONTROL_Pitch | Pitch adjustment of the endpoint.

Definition at line 287 of file AudioClassCommon.h.