nRF52840 only: Module with types, definitions, and API used by USB Audio class.
More...
|
#define | APP_USBD_AUDIO_GLOBAL_DEF(instance_name,interfaces_configs,user_ev_handler,format_descriptor,input_descriptor,output_descriptor,feature_descriptor,delay,format,ep_size,type_str) |
| Global definition of app_usbd_audio_t class instance. More...
|
|
#define | APP_USBD_AUDIO_FORMAT_DESCRIPTOR(name,...) |
| Initializer of Audio Format descriptor. More...
|
|
#define | APP_USBD_AUDIO_INPUT_DESCRIPTOR(name,...) |
| Initializer of Audio Input descriptor. More...
|
|
#define | APP_USBD_AUDIO_OUTPUT_DESCRIPTOR(name,...) |
| Initializer of Audio Output descriptor. More...
|
|
#define | APP_USBD_AUDIO_FEATURE_DESCRIPTOR(name,...) |
| Initializer of Feture Output descriptor. More...
|
|
nRF52840 only: Module with types, definitions, and API used by USB Audio class.
Reference specifications:
- "Universal Serial Bus Device Class Definition for Audio Devices" Release 1.0, March 18, 1998.
- "Universal Serial Bus Device Class Definition for Audio Data Formats" Release 1.0, March 18, 1998.
- "Universal Serial Bus Device Class Definition for Terminal Types" Release 1.0, March 18, 1998.
#define APP_USBD_AUDIO_FEATURE_DESCRIPTOR |
( |
|
name, |
|
|
|
... |
|
) |
| |
Value:static uint8_t
const CONCAT_2(name, _data)[] = \
{ \
__VA_ARGS__ \
}; \
{ \
APP_USBD_AUDIO_AC_IFACE_SUBTYPE_FEATURE_UNIT,
\
}
Initializer of Feture Output descriptor.
- Parameters
-
name | Feture descriptor name. |
... | Feture descriptor data. |
#define APP_USBD_AUDIO_FORMAT_DESCRIPTOR |
( |
|
name, |
|
|
|
... |
|
) |
| |
Value:static uint8_t
const CONCAT_2(name, _data)[] = \
{ \
__VA_ARGS__ \
}; \
{ \
APP_USBD_AUDIO_AS_IFACE_SUBTYPE_FORMAT_TYPE,
\
}
Initializer of Audio Format descriptor.
- Parameters
-
name | Format descriptor name. |
... | Format descriptor data. |
#define APP_USBD_AUDIO_GLOBAL_DEF |
( |
|
instance_name, |
|
|
|
interfaces_configs, |
|
|
|
user_ev_handler, |
|
|
|
format_descriptor, |
|
|
|
input_descriptor, |
|
|
|
output_descriptor, |
|
|
|
feature_descriptor, |
|
|
|
delay, |
|
|
|
format, |
|
|
|
ep_size, |
|
|
|
type_str |
|
) |
| |
Value:
interfaces_configs, \
user_ev_handler, \
format_descriptor, \
input_descriptor, \
output_descriptor, \
feature_descriptor, \
delay, \
format, \
ep_size, \
type_str)
Global definition of app_usbd_audio_t class instance.
- Parameters
-
instance_name | Name of global instance. |
interfaces_configs | Interfaces configurations. |
user_ev_handler | User event handler. |
format_descriptor | Audio class Format descriptor. |
input_descriptor | Audio class Input Terminal descriptor. |
output_descriptor | Audio class Output Terminal descriptor. |
feature_descriptor | Audio class Feature Unit descriptor. |
delay | Streaming delay. |
format | FormatTag (app_usbd_audio_as_iface_format_tag_t). |
ep_size | Endpoint size. |
type_str | Streaming type MIDISTREAMING/AUDIOSTREAMING. |
- Note
- This macro is just simplified version of APP_USBD_AUDIO_GLOBAL_DEF_INTERNAL
#define APP_USBD_AUDIO_INPUT_DESCRIPTOR |
( |
|
name, |
|
|
|
... |
|
) |
| |
Value:static uint8_t
const CONCAT_2(name, _data)[] = \
{ \
__VA_ARGS__ \
}; \
{ \
APP_USBD_AUDIO_AC_IFACE_SUBTYPE_INPUT_TERMINAL,
\
}
Initializer of Audio Input descriptor.
- Parameters
-
name | Input descriptor name. |
... | Input descriptor data. |
#define APP_USBD_AUDIO_OUTPUT_DESCRIPTOR |
( |
|
name, |
|
|
|
... |
|
) |
| |
Value:static uint8_t
const CONCAT_2(name, _data)[] = \
{ \
__VA_ARGS__ \
}; \
{ \
APP_USBD_AUDIO_AC_IFACE_SUBTYPE_OUTPUT_TERNINAL,
\
}
Initializer of Audio Output descriptor.
- Parameters
-
name | Output descriptor name. |
... | Output descriptor data. |
Events passed to user event handler.
- Note
- Example prototype of user event handler:
Events passed to user event handler.
- Note
- Example prototype of user event handler:
Enumerator |
---|
APP_USBD_AUDIO_USER_EVT_CLASS_REQ |
User event CLASS_REQ
|
APP_USBD_AUDIO_USER_EVT_RX_DONE |
User event RX_DONE
|
APP_USBD_AUDIO_USER_EVT_TX_DONE |
User event TX_DONE
|
Helper function to get audio from base class instance.
- Parameters
-
[in] | p_inst | Base class instance. |
- Returns
- Audio class handle.
@brief Helper function to get class instance from Audio class.
- Parameters
-
- Returns
- Base class instance.
Helper function to get audio specific request from audio class.
- Parameters
-
- Returns
- Audio class specific request.
Get the size of last received transfer.
- Note
- Call this function in reaction to a SOF event to check if there is any data to process.
- Parameters
-
p_inst | Base class instance. |
- Returns
- Number of bytes received in the last transmission.
Start audio data copying from the endpoint buffer.
Function to be used to copy data from an audio OUT endpoint to a given buffer. When it finishes, an APP_USBD_AUDIO_USER_EVT_RX_DONE event is generated.
- Parameters
-
p_inst | Base class instance. |
p_buff | Target buffer. |
size | Size of the requested data. |
- Returns
- Result of the endpoint transmission start.
- See Also
- app_usbd_audio_class_rx_size_get
- Note
- This function should be called in reaction to a SOF event. Isochronous endpoints are double buffered and they are automatically switched at every SOF.
Start copying audio data to the endpoint buffer.
Function to be used to copy data to an audio IN endpoint from a given buffer. When it finishes, an APP_USBD_AUDIO_USER_EVT_TX_DONE event is generated.
- Parameters
-
p_inst | Base class instance. |
p_buff | Source buffer. |
size | Size of the data to be sent. |
- Returns
- Result of the endpoint transsmision start.
- Note
- This function should be called in reaction to a SOF event. Isochronous endpoints are double buffered and they are automatically switched at every SOF.
Register audio instance as the one that requires SOF events in interrupt.
This function should be called before appending the instance.
- Parameters
-
p_inst | Audio instance that requires SOF event. |
handler | Handler to SOF event |
- Return values
-
NRF_SUCCESS | Instance linked into SOF processing list. |
- See Also
- app_usbd_class_sof_interrupt_register