nRF52840 only: Module with types, definitions, and API used by USB Audio class.
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_GLOBAL_DEF |
( |
|
instance_name, |
|
|
|
interfaces_configs, |
|
|
|
user_ev_handler, |
|
|
|
raw_descriptors |
|
) |
| |
Value:
interfaces_configs, \
user_ev_handler, \
raw_descriptors)
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 (optional) |
raw_descriptors | Raw descriptor table |
- Note
- This macro is just simplified version of APP_USBD_AUDIO_GLOBAL_DEF_INTERNAL
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.