nRF52840 only: Descriptors used in the USB Audio class. More...
Macros |
|
| #define | APP_USBD_AUDIO_INTERFACE_DSC (interface_number, alt_setting, ep_num, subclass) |
|
Initializer of interface descriptor for AUDIO class.
More...
|
|
| #define | APP_USBD_AUDIO_ISO_EP_DSC (ep, ep_size, interval, refresh, synch_addr) |
|
Initializer of isochronous endpoint descriptors for audio class.
More...
|
|
| #define | APP_USBD_AUDIO_ISO_EP_IN_DSC (ep_size) APP_USBD_AUDIO_ISO_EP_DSC ( NRF_DRV_USBD_EPIN8 , ep_size, 1, 0, 0) |
|
Simplified version of
APP_USBD_AUDIO_ISO_EP_DSC
for ISO IN endpoint.
|
|
| #define | APP_USBD_AUDIO_ISO_EP_OUT_DSC (ep_size) APP_USBD_AUDIO_ISO_EP_DSC ( NRF_DRV_USBD_EPOUT8 , ep_size, 1, 0, 0) |
|
Simplified version of
APP_USBD_AUDIO_ISO_EP_DSC
for ISO OUT endpoint.
|
|
| #define | APP_USBD_AUDIO_AC_IFACE_HEADER_DSC (descriptor_list,...) |
|
Initializer of
app_usbd_audio_ac_iface_header_desc_t
.
More...
|
|
| #define | APP_USBD_AUDIO_INPUT_TERMINAL_DSC (terminal_id, terminal_type, nr_channels, ch_config) |
|
Initializer of
app_usbd_audio_input_terminal_desc_t
.
More...
|
|
| #define | APP_USBD_AUDIO_OUTPUT_TERMINAL_DSC (terminal_id, terminal_type, source_id) |
|
Initializer of
app_usbd_audio_output_terminal_desc_t
.
More...
|
|
| #define | APP_USBD_AUDIO_FEATURE_UNIT_DSC (unit_id, source_id,...) |
|
Initializer of
app_usbd_audio_feature_unit_desc_t
.
More...
|
|
| #define | APP_USBD_AUDIO_AS_IFACE_DSC (terminal_link, delay, format_tag) |
|
Initializer of
app_usbd_audio_as_iface_desc_t
.
More...
|
|
| #define | APP_USBD_AUDIO_AS_FORMAT_I_DSC (nr_channels, subframe_size, resolution, freq_type,...) |
|
Initializer of
app_usbd_audio_as_format_type_one_desc_t
.
More...
|
|
| #define | APP_USBD_AUDIO_AS_FORMAT_II_DSC (max_bitrate, samples_per_frame, freq_type,...) |
|
Initializer of
app_usbd_audio_as_format_type_two_desc_t
.
More...
|
|
| #define | APP_USBD_AUDIO_AS_FORMAT_III_DSC (nr_channels, subframe_size, resolution, freq_type,...) |
|
Initializer of
app_usbd_audio_as_format_type_three_desc_t
.
More...
|
|
| #define | APP_USBD_AUDIO_EP_GENERAL_DSC (attributes, lock_delay_units, lock_delay) |
|
Initializer of
app_usbd_audio_as_endpoint_desc_t
.
More...
|
|
| #define | APP_USBD_AUDIO_CONTROL_DSC (interface_number, descriptor_list, interface_list) |
|
Macro to configure Audio Class control descriptor.
More...
|
|
| #define | APP_USBD_AUDIO_STREAMING_DSC (interface_number, alt_setting, ep_num) |
|
Macro to configure Audio Class streaming descriptor.
More...
|
|
| #define | APP_USBD_AUDIO_MIDI_STREAMING_DSC (interface_number, alt_setting, ep_num) |
|
Macro to configure Audio Class MIDI streaming descriptor.
More...
|
|
Detailed Description
nRF52840 only: Descriptors used in the USB Audio class.
Macro Definition Documentation
| #define APP_USBD_AUDIO_AC_IFACE_HEADER_DSC | ( | descriptor_list, | |
| ... | |||
| ) |
(NUM_VA_ARGS(__VA_ARGS__)), \
/*.bDescriptorType = */ APP_USBD_AUDIO_DESCRIPTOR_INTERFACE, \
/*.bDescriptorSubtype = */ APP_USBD_AUDIO_AC_IFACE_SUBTYPE_HEADER, \
/*.bcdADC = */ APP_USBD_U16_TO_RAW_DSC(0x0100), \
/*.wTotalLength = */ APP_USBD_U16_TO_RAW_DSC( \
sizeof((uint8_t[]){BRACKET_EXTRACT(descriptor_list)}) + \
sizeof(app_usbd_audio_ac_iface_header_desc_t) + \
(NUM_VA_ARGS(__VA_ARGS__))), \
/*.bInCollection = */ (NUM_VA_ARGS(__VA_ARGS__)), \
/*.baInterfaceNr[] = */ __VA_ARGS__, \
Initializer of app_usbd_audio_ac_iface_header_desc_t .
- Parameters
-
descriptor_list Descriptor list following audio interface header descriptor. ... List of interfaces following audio control interface.
| #define APP_USBD_AUDIO_AS_FORMAT_I_DSC | ( | nr_channels, | |
| subframe_size, | |||
| resolution, | |||
| freq_type, | |||
| ... | |||
| ) |
(NUM_VA_ARGS(__VA_ARGS__)), \
/*.bDescriptorType = */ APP_USBD_AUDIO_DESCRIPTOR_INTERFACE, \
/*.bDescriptorSubtype = */ APP_USBD_AUDIO_AS_IFACE_SUBTYPE_FORMAT_TYPE, \
/*.bFormatType = */ (1), \
/*.bNrChannels = */ (nr_channels), \
/*.bSubFrameSize = */ (subframe_size), \
/*.bBitResolution = */ (resolution), \
/*.bSamFreqType = */ (freq_type), \
/*.tSamFreq = */ __VA_ARGS__, \
Initializer of app_usbd_audio_as_format_type_one_desc_t .
- Parameters
-
nr_channels Number of channels. subframe_size Subframe size. resolution Bit resolution. freq_type Frequency type. ... List of frequencies.
| #define APP_USBD_AUDIO_AS_FORMAT_II_DSC | ( | max_bitrate, | |
| samples_per_frame, | |||
| freq_type, | |||
| ... | |||
| ) |
(NUM_VA_ARGS(__VA_ARGS__)), \
/*.bDescriptorType = */ APP_USBD_AUDIO_DESCRIPTOR_INTERFACE, \
/*.bDescriptorSubtype = */ APP_USBD_AUDIO_AS_IFACE_SUBTYPE_FORMAT_TYPE, \
/*.bFormatType = */ (2), \
/*.wMaxBitRate = */ APP_USBD_U16_TO_RAW_DSC(max_bitrate), \
/*.wSamplesPerFrame = */ APP_USBD_U16_TO_RAW_DSC(samples_per_frame), \
/*.bSamFreqType = */ (freq_type), \
/*.tSamFreq = */ __VA_ARGS__, \
Initializer of app_usbd_audio_as_format_type_two_desc_t .
- Parameters
-
max_bitrate Maximum bitrate. samples_per_frame Samples per frame. freq_type Frequency type. ... List of frequencies.
| #define APP_USBD_AUDIO_AS_FORMAT_III_DSC | ( | nr_channels, | |
| subframe_size, | |||
| resolution, | |||
| freq_type, | |||
| ... | |||
| ) |
(NUM_VA_ARGS(__VA_ARGS__)), \
/*.bDescriptorType = */ APP_USBD_AUDIO_DESCRIPTOR_INTERFACE, \
/*.bDescriptorSubtype = */ APP_USBD_AUDIO_AS_IFACE_SUBTYPE_FORMAT_TYPE, \
/*.bFormatType = */ (3), \
/*.bNrChannels = */ (nr_channels), \
/*.bSubFrameSize = */ (subframe_size), \
/*.bBitResolution = */ (resolution), \
/*.bSamFreqType = */ (freq_type), \
/*.tSamFreq = */ __VA_ARGS__, \
Initializer of app_usbd_audio_as_format_type_three_desc_t .
- Parameters
-
nr_channels Number of channels. subframe_size Subframe size. resolution Bit resolution. freq_type Frequency type. ... List of frequencies.
| #define APP_USBD_AUDIO_AS_IFACE_DSC | ( | terminal_link, | |
| delay, | |||
| format_tag | |||
| ) |
/*.bDescriptorType = */ APP_USBD_AUDIO_DESCRIPTOR_INTERFACE, \
/*.bDescriptorSubtype = */ APP_USBD_AUDIO_AS_IFACE_SUBTYPE_GENERAL, \
/*.bTerminalLink = */ (terminal_link), \
/*.bDelay = */ (delay), \
/*.wFormatTag = */ APP_USBD_U16_TO_RAW_DSC(format_tag), \
Initializer of app_usbd_audio_as_iface_desc_t .
- Parameters
-
terminal_link Terminal link. delay Delay. format_tag Format TAG.
| #define APP_USBD_AUDIO_CONTROL_DSC | ( | interface_number, | |
| descriptor_list, | |||
| interface_list | |||
| ) |
APP_USBD_AUDIO_INTERFACE_DSC(interface_number, 0, 0, APP_USBD_AUDIO_SUBCLASS_AUDIOCONTROL) \
APP_USBD_AUDIO_AC_IFACE_HEADER_DSC(descriptor_list, BRACKET_EXTRACT(interface_list)) \
BRACKET_EXTRACT(descriptor_list)
Macro to configure Audio Class control descriptor.
- Parameters
-
interface_number Interface number. descriptor_list List of descriptors after Audio interface header descriptor. interface_list List of interfaces passed to APP_USBD_AUDIO_AC_IFACE_HEADER_DSC
| #define APP_USBD_AUDIO_EP_GENERAL_DSC | ( | attributes, | |
| lock_delay_units, | |||
| lock_delay | |||
| ) |
/*.bDescriptorType = */ APP_USBD_AUDIO_DESCRIPTOR_ENDPOINT, \
/*.bDescriptorSubtype = */ APP_USBD_AUDIO_EP_SUBTYPE_GENERAL, \
/*.bmAttributes = */ (attributes), \
/*.bLockDelayUnits = */ (lock_delay_units), \
/*.wLockDelay = */ APP_USBD_U16_TO_RAW_DSC(lock_delay), \
Initializer of app_usbd_audio_as_endpoint_desc_t .
- Parameters
-
attributes Endpoint attributes. lock_delay_units Lock delay units. lock_delay Lock delay.
| #define APP_USBD_AUDIO_FEATURE_UNIT_DSC | ( | unit_id, | |
| source_id, | |||
| ... | |||
| ) |
1 + (NUM_VA_ARGS(__VA_ARGS__)), \
/*.bDescriptorType = */ APP_USBD_AUDIO_DESCRIPTOR_INTERFACE, \
/*.bDescriptorSubtype = */ APP_USBD_AUDIO_AC_IFACE_SUBTYPE_FEATURE_UNIT, \
/*.bUnitID = */ (unit_id), \
/*.bSourceID = */ (source_id), \
/*.bControlSize = */ sizeof(uint16_t), \
/*.bmaControls[] = */ __VA_ARGS__, \
/*.iFeature = */ 0, \
Initializer of app_usbd_audio_feature_unit_desc_t .
- Parameters
-
unit_id Unit ID. source_id Source ID. ... List of controls.
| #define APP_USBD_AUDIO_INPUT_TERMINAL_DSC | ( | terminal_id, | |
| terminal_type, | |||
| nr_channels, | |||
| ch_config | |||
| ) |
/*.bDescriptorType = */ APP_USBD_AUDIO_DESCRIPTOR_INTERFACE, \
/*.bDescriptorSubtype = */ APP_USBD_AUDIO_AC_IFACE_SUBTYPE_INPUT_TERMINAL, \
/*.bTerminalID = */ (terminal_id), \
/*.wTerminalType = */ APP_USBD_U16_TO_RAW_DSC(terminal_type), \
/*.bAssocTerminal = */ 0, \
/*.bNrChannels = */ (nr_channels), \
/*.wChannelConfig = */ APP_USBD_U16_TO_RAW_DSC(ch_config), \
/*.iChannelNames = */ 0, \
/*.iTerminal = */ 0, \
Initializer of app_usbd_audio_input_terminal_desc_t .
- Parameters
-
terminal_id Terminal ID. terminal_type Terminal type app_usbd_audio_terminal_type_t nr_channels Number of channels. ch_config Channel config bitmask.
| #define APP_USBD_AUDIO_INTERFACE_DSC | ( | interface_number, | |
| alt_setting, | |||
| ep_num, | |||
| subclass | |||
| ) |
/*.bDescriptorType = */ APP_USBD_DESCRIPTOR_INTERFACE, \
/*.bInterfaceNumber = */ (interface_number), \
/*.bAlternateSetting = */ (alt_setting), \
/*.bNumEndpoints = */ (ep_num), \
/*.bInterfaceClass = */ APP_USBD_AUDIO_CLASS, \
/*.bInterfaceSubClass = */ (subclass), \
/*.bInterfaceProtocol = */ APP_USBD_AUDIO_CLASS_PROTOCOL_UNDEFINED, \
/*.iInterface = 0, */ 0x00, \
Initializer of interface descriptor for AUDIO class.
- Parameters
-
interface_number Interface number. alt_setting Interface alternate setting. ep_num Number of endpoints. subclass Audio subclass app_usbd_audio_subclass_t
| #define APP_USBD_AUDIO_ISO_EP_DSC | ( | ep, | |
| ep_size, | |||
| interval, | |||
| refresh, | |||
| synch_addr | |||
| ) |
/*.bDescriptorType = */ APP_USBD_DESCRIPTOR_ENDPOINT, \
/*.bEndpointAddress = */ ep, \
/*.bmAttributes = */ APP_USBD_DESCRIPTOR_EP_ATTR_TYPE_ISOCHRONOUS, \
/*.wMaxPacketSize = */ APP_USBD_U16_TO_RAW_DSC(ep_size), \
/*.bInterval = */ (interval), \
/*.bRefresh = */ (refresh), \
/*.bInterval = */ (synch_addr), \
Initializer of isochronous endpoint descriptors for audio class.
- Parameters
-
ep ISO endpoint id: NRF_DRV_USBD_EPIN8 , NRF_DRV_USBD_EPOUT8 ep_size Endpoint size (bytes). interval Endpoint interval (milliseconds). refresh Refresh value (usually 0). synch_addr Synch address (usually 0).
| #define APP_USBD_AUDIO_MIDI_STREAMING_DSC | ( | interface_number, | |
| alt_setting, | |||
| ep_num | |||
| ) |
APP_USBD_AUDIO_INTERFACE_DSC(interface_number, alt_setting, ep_num, \
Macro to configure Audio Class MIDI streaming descriptor.
- Parameters
-
interface_number Interface number. alt_setting Alternate interface setting. ep_num Number of endpoints.
| #define APP_USBD_AUDIO_OUTPUT_TERMINAL_DSC | ( | terminal_id, | |
| terminal_type, | |||
| source_id | |||
| ) |
/*.bDescriptorType = */ APP_USBD_AUDIO_DESCRIPTOR_INTERFACE, \
/*.bDescriptorSubtype = */ APP_USBD_AUDIO_AC_IFACE_SUBTYPE_OUTPUT_TERMINAL, \
/*.bTerminalID = */ (terminal_id), \
/*.wTerminalType = */ APP_USBD_U16_TO_RAW_DSC(terminal_type), \
/*.bAssocTerminal = */ 0, \
/*.bSourceID = */ (source_id), \
/*.iTerminal = */ 0, \
Initializer of app_usbd_audio_output_terminal_desc_t .
- Parameters
-
terminal_id Terminal ID. terminal_type Terminal type app_usbd_audio_terminal_type_t source_id Source ID.
| #define APP_USBD_AUDIO_STREAMING_DSC | ( | interface_number, | |
| alt_setting, | |||
| ep_num | |||
| ) |
APP_USBD_AUDIO_INTERFACE_DSC(interface_number, alt_setting, ep_num, \
Macro to configure Audio Class streaming descriptor.
- Parameters
-
interface_number Interface number. alt_setting Alternate interface setting. ep_num Number of endpoints.