...
The audio class provides several structures that can be used to build an audio function topology. These structures relate to units, terminals and streams. They will be declared and initialized in usbd_audio_dev_cfg.h
and usbd_audio_dev_cfg.c
files. Table - User Configurable Structures for Creating Audio Function Topology presents all configurable structures and the associated function that will use the structure. Functions are described in Class Instance Configuration section.
Panel |
---|
borderWidth | 0 |
---|
title | Table - User Configurable Structures for Creating Audio Function Topology |
---|
|
|
...
- Two Inputs terminals
- Two Ouput terminals
- Two Feature units
- Two AudioStreaming interfaces
Figure - usbd_audio_decdev_cfg.c - Typical Topologies Example gives a visual representation of the possible topologies that can be built with the 6 terminals and units.
Anchor |
---|
| Figure - usbd_audio_decdev_cfg.c - Typical Topologies Example |
---|
| Figure - usbd_audio_decdev_cfg.c - Typical Topologies Example |
---|
|
...
Info |
---|
All terminals must have a unique ID within a given audio function. The terminals ID assignment is handled by the audio class using the functions USBD_Audio_IT_Assoc and USBD_Audio_OT_Assoc . |
Input Terminal
Table - USBD_AUDIO_IT_CFG Structure Fields Description presents the Input terminal structure. Refer to audio 1.0 specification, section "4.3.2.1 Input Terminal Descriptor" for more details about certain fields.
...
Panel |
---|
borderWidth | 0 |
---|
title | Table - USBD_AUDIO_IT_CFG Structure Fields Description |
---|
|
Field | Description | Example of value | Available Predefined Value |
---|
TerminalType | Terminal type. | USBD_AUDIO_TERMINAL_TYPE_MIC | There are many terminal type defined by Audio 1.0 Terminal Types specification. Thus, there are many predefined values available in usbd_audio.h . Some of them typical for IT are:
USBD_AUDIO_TERMINAL_TYPE_USB_STREAMING USBD_AUDIO_TERMINAL_TYPE_IT_UNDEFINED USBD_AUDIO_TERMINAL_TYPE_MIC USBD_AUDIO_TERMINAL_TYPE_DESKTOP_MIC USBD_AUDIO_TERMINAL_TYPE_OMNI_DIR_MIC USBD_AUDIO_TERMINAL_TYPE_PERSONAL_MIC USBD_AUDIO_TERMINAL_TYPE_MIC_ARRAY USBD_AUDIO_TERMINAL_TYPE_PROC_MIC_ARRAY Refer to usbd_audio.h for the complete list. | LogChNbr | Number of logical output channels in the terminal output. | USBD_AUDIO_MONO | USBD_AUDIO_MONO
USBD_AUDIO_STEREO
USBD_AUDIO_5_1
USBD_AUDIO_7_1 | LogChCfg | Spatial location of logical channel. | USBD_AUDIO_SPATIAL_LOCATION_LEFT_FRONT | A OR combination of:
USBD_AUDIO_SPATIAL_LOCATION_LEFT_FRONT
USBD_AUDIO_SPATIAL_LOCATION_RIGHT_FRONT
USBD_AUDIO_SPATIAL_LOCATION_CENTER_FRONT
USBD_AUDIO_SPATIAL_LOCATION_LFE
USBD_AUDIO_SPATIAL_LOCATION_LEFT_SURROUND
USBD_AUDIO_SPATIAL_LOCATION_RIGHT_SURROUND
USBD_AUDIO_SPATIAL_LOCATION_LEFT_CENTER
USBD_AUDIO_SPATIAL_LOCATION_RIGHT_CENTER
USBD_AUDIO_SPATIAL_LOCATION_SURROUND
USBD_AUDIO_SPATIAL_LOCATION_SIDE_LEFT
USBD_AUDIO_SPATIAL_LOCATION_SIDE_RIGHT
USBD_AUDIO_SPATIAL_LOCATION_TOP | CopyProtEn | Enables or disables Copy Protection. | DEF_DISABLED | DEF_DISABLED
DEF_ENABLED | CopyProtLevel | Copy Protection Level. | USBD_AUDIO_CPL_NONE | USBD_AUDIO_CPL_NONE
USBD_AUDIO_CPL0
USBD_AUDIO_CPL1
USBD_AUDIO_CPL2 | StrPtr | Pointer to a string describing the Input Terminal. | "IT Microphone" | - |
|
Output Terminal
Table - USBD_AUDIO_OT_CFG Structure Fields Description presents the Output terminal structure. Refer to audio 1.0 specification, section "4.3.2.2 Output Terminal Descriptor" for more details about certain fields.
...
Info |
---|
All units must have a unique ID within a given audio function. The units ID assignment is handled by the audio class using the functions USBD_Audio_FU_Assoc , USBD_Audio_MU_Assoc() and USBD_Audio_SU_Assoc. |
Feature Unit
Table - USBD_AUDIO_FU_CFG Structure Fields Description presents the Feature Unit structure. Refer to audio 1.0 specification, section "4.3.2.5 Feature Unit Descriptor" for more details about certain fields.
...
Info |
---|
A Mixer Unit can have programmable and non-programmable mixing controls. If you need to set some programmable mixing controls, you need to use the function USBD_Audio_MU_MixingCtrlSet during the audio function initialization. |
Selector Unit
Table - USBD_AUDIO_SU_CFG Structure Fields Description 106037317 presents the Selector Unit structure. Refer to audio 1.0 specification, section "4.3.2.4 Selector Unit Descriptor" for more details about certain fields.
...
General Stream Configuration
Table - USBD_AUDIO_STREAM_CFG Structure Fields Description presents the general stream configuration structure.
...
Panel |
---|
borderWidth | 0 |
---|
title | Table - USBD_AUDIO_STREAM_CFG Structure Fields Description |
---|
|
Field | Description | Example of value | Available Predefined Value |
---|
MaxBufNbr | Maximum number of buffers allocated for the given stream. | 40 | USBD_AUDIO_STREAM_NBR_BUF_6 USBD_AUDIO_STREAM_NBR_BUF_12 USBD_AUDIO_STREAM_NBR_BUF_18 USBD_AUDIO_STREAM_NBR_BUF_24 USBD_AUDIO_STREAM_NBR_BUF_30 USBD_AUDIO_STREAM_NBR_BUF_36 USBD_AUDIO_STREAM_NBR_BUF_42 | CorrPeriodMs | Period at which the built-in stream correction must be possibly applied. Expressed in milliseconds. For this field and the two followings, refer to section Stream Correction for more details about the built-in correction for playback and record streams. | 2 | - |
|
AudioStreaming Interface
Table - USBD_AUDIO_AS_ALT_CFG Structure Fields Description 106037317 presents the AudioStreaming interface configuration structure. Each AudioStreaming interface has one unique associated isochronous endpoint. Hence, there is a one-to-one relation between an AudioStreaming interface and its associated endpoint.
...
Code Block |
---|
language | cpp |
---|
linenumbers | true |
---|
|
CPU_INT32U AS_SamFreqTbl[] = {
USBD_AUDIO_FMT_TYPE_I_SAMFREQ_44_1KHZ,
USBD_AUDIO_FMT_TYPE_I_SAMFREQ_48KHZ
}; |
...
Panel |
---|
borderWidth | 0 |
---|
title | Table - USBD_AUDIO_AS_IF_CFG Structure Fields Description |
---|
|
|
...