|
|
bool | begin () |
| |
|
bool | begin (USBAudioConfig &cfg) |
| |
|
USBAudioConfig | defaultConfig (RxTxMode mode=RXTX_MODE) |
| |
|
uint8_t | getAudioCount () const |
| | Returns the number of audio functions configured.
|
| |
| const uint8_t * | getAudioDescriptors (uint8_t itf, uint8_t alt, uint16_t *out_length) |
| | Get the USB audio descriptors for the specified interface and alternate setting.
|
| |
|
bool | getEnableEpIn () const |
| | Returns true if the IN endpoint is enabled.
|
| |
|
bool | getEnableEpInFlowControl () const |
| | Returns true if IN endpoint flow control is enabled.
|
| |
|
bool | getEnableEpOut () const |
| | Returns true if the OUT endpoint is enabled.
|
| |
|
bool | getEnableFeedbackEp () const |
| | Returns true if the feedback endpoint is enabled.
|
| |
|
bool | getEnableFifoMutex () const |
| | Returns true if FIFO mutex is enabled.
|
| |
|
bool | getEnableInterruptEp () const |
| | Returns true if the interrupt endpoint is enabled.
|
| |
| bool | handleControlRequest (const tusb_control_request_t *request, void *buffer, uint16_t length) |
| | Handle a USB control request for the audio device.
|
| |
|
bool | mounted () const |
| | Returns true if the device is mounted by the USB host.
|
| |
| void | process () |
| | Main processing loop for USB audio streaming.
|
| |
| void | setAudiodTxDoneCallback (std::function< bool(USBAudioDevice *, uint8_t, audiod_function_t *)> cb) |
| | Register a callback for audio TX done events.
|
| |
| void | setAudioFeedbackFormatCorrectionCallback (std::function< bool(USBAudioDevice *, uint8_t)> cb) |
| | Register a callback for audio feedback format correction events.
|
| |
| void | setAudioFeedbackParamsCallback (std::function< void(USBAudioDevice *, uint8_t, uint8_t, audio_feedback_params_t *)> cb) |
| | Register a callback for audio feedback parameter events.
|
| |
| void | setConfig (USBAudioConfig &cfg) |
| | Set the USB audio configuration.
|
| |
| void | setFbDoneCallback (std::function< void(USBAudioDevice *, uint8_t)> cb) |
| | Register a callback for feedback done events.
|
| |
| void | setGetReqEntityCallback (std::function< bool(USBAudioDevice *, uint8_t, tusb_control_request_t const *)> cb) |
| | Register a callback for GET requests on an entity.
|
| |
| void | setGetReqEpCallback (std::function< bool(USBAudioDevice *, uint8_t, tusb_control_request_t const *)> cb) |
| | Register a callback for GET requests on an endpoint.
|
| |
| void | setGetReqItfCallback (std::function< bool(USBAudioDevice *, uint8_t, tusb_control_request_t const *)> cb) |
| | Register a callback for GET requests on the interface.
|
| |
| void | setIntDoneCallback (std::function< void(USBAudioDevice *, uint8_t)> cb) |
| | Register a callback for interrupt done events.
|
| |
| void | setItfCloseEpCallback (std::function< bool(USBAudioDevice *, uint8_t, tusb_control_request_t const *)> cb) |
| | Register a callback for interface close endpoint events.
|
| |
| void | setReqEntityCallback (std::function< bool(USBAudioDevice *, uint8_t)> cb) |
| | Register a callback for entity requests.
|
| |
| void | setReqEntityCallback (std::function< bool(USBAudioDevice *, uint8_t, tusb_control_request_t const *, uint8_t *)> cb) |
| | Register a callback for entity set requests.
|
| |
| void | setReqEpCallback (std::function< bool(USBAudioDevice *, uint8_t, tusb_control_request_t const *, uint8_t *)> cb) |
| | Register a callback for endpoint set requests.
|
| |
| void | setReqItfCallback (std::function< bool(USBAudioDevice *, uint8_t, tusb_control_request_t const *, uint8_t *)> cb) |
| | Register a callback for interface set requests.
|
| |
| void | setRxCallback (std::function< void(const uint8_t *, uint16_t)> cb) |
| | Register a callback for received audio data (OUT endpoint).
|
| |
| void | setRxDoneCallback (std::function< bool(USBAudioDevice *, uint8_t, audiod_function_t *, uint16_t)> cb) |
| | Register a callback for RX done events.
|
| |
| void | setTudAudioSetItfCallback (std::function< bool(USBAudioDevice *, uint8_t, tusb_control_request_t const *)> cb) |
| | Register a callback for interface set requests.
|
| |
| void | setTxCallback (std::function< uint16_t(const uint8_t *, uint16_t)> cb) |
| | Register a callback for transmitting audio data (IN endpoint).
|
| |
| void | setTxDoneCallback (std::function< bool(USBAudioDevice *, uint8_t, audiod_function_t *)> cb) |
| | Register a callback for TX done events.
|
| |
| usbd_class_driver_t const * | usbd_app_driver_get (uint8_t *count) |
| | Get the USB device class driver for TinyUSB integration.
|
| |
|
|
void | alloc_mutex () |
| |
|
bool | audiod_calc_tx_packet_sz (audiod_function_t *audio) |
| |
|
bool | audiod_control_complete (uint8_t rhport, tusb_control_request_t const *p_request) |
| |
|
bool | audiod_control_request (uint8_t rhport, tusb_control_request_t const *p_request) |
| |
|
bool | audiod_control_xfer_cb (uint8_t rhport, uint8_t stage, tusb_control_request_t const *request) |
| |
|
bool | audiod_deinit (void) |
| |
|
bool | audiod_fb_send (audiod_function_t *audio) |
| |
|
bool | audiod_get_AS_interface_index (uint8_t itf, audiod_function_t *audio, uint8_t *idxItf, uint8_t const **pp_desc_int) |
| |
|
bool | audiod_get_AS_interface_index_global (uint8_t itf, uint8_t *func_id, uint8_t *idxItf, uint8_t const **pp_desc_int) |
| |
|
bool | audiod_get_interface (uint8_t rhport, tusb_control_request_t const *p_request) |
| |
|
void | audiod_init (void) |
| |
|
uint16_t | audiod_open (uint8_t rhport, tusb_desc_interface_t const *itf_desc, uint16_t max_len) |
| |
|
void | audiod_parse_flow_control_params (audiod_function_t *audio, uint8_t const *p_desc) |
| |
|
void | audiod_reset (uint8_t rhport) |
| |
|
bool | audiod_set_fb_params_freq (audiod_function_t *audio, uint32_t sample_freq, uint32_t mclk_freq) |
| |
|
bool | audiod_set_interface (uint8_t rhport, tusb_control_request_t const *p_request) |
| |
|
TU_ATTR_FAST_FUNC void | audiod_sof_isr (uint8_t rhport, uint32_t frame_count) |
| |
|
bool | audiod_verify_entity_exists (uint8_t itf, uint8_t entityID, uint8_t *func_id) |
| |
|
bool | audiod_verify_ep_exists (uint8_t ep, uint8_t *func_id) |
| |
|
bool | audiod_verify_itf_exists (uint8_t itf, uint8_t *func_id) |
| |
|
bool | audiod_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes) |
| |
|
uint16_t | getCtrlBufSz (uint8_t fn) const |
| |
|
uint16_t | getDescLen (uint8_t fn) const |
| |
|
uint16_t | getEpInSwBufSz (uint8_t fn) const |
| |
|
uint16_t | getEpOutSwBufSz (uint8_t fn) const |
| |
|
bool | getUseLinearBufferRx () const |
| |
|
bool | getUseLinearBufferTx () const |
| |
|
uint16_t | read (void *buffer, uint16_t bufsize) |
| |
|
void | tud_audio_feedback_interval_isr (uint8_t func_id, uint32_t frame_count, uint8_t frame_shift) |
| |
|
uint16_t | tud_audio_n_available (uint8_t func_id) |
| |
|
uint16_t | tud_audio_n_read (uint8_t func_id, void *buffer, uint16_t bufsize) |
| |
|
uint16_t | tud_audio_n_write (uint8_t func_id, const void *data, uint16_t len) |
| |
|
uint16_t | write (const void *data, uint16_t len) |
| |
|
|
std::vector< audiod_function_t > | audiod_fct_ |
| |
|
std::function< bool(USBAudioDevice *, uint8_t rhport, audiod_function_t *audio)> | audiod_tx_done_cb_ |
| |
|
USBAudioConfig | config_ |
| |
|
std::vector< uint16_t > | ctrl_buf_sz_ |
| |
|
std::vector< uint16_t > | desc_len_ |
| |
|
USBAudio2DescriptorBuilder | descr_builder {config_} |
| |
|
std::vector< osal_mutex_def_t > | ep_in_ff_mutex_wr_ |
| |
|
std::vector< uint16_t > | ep_in_sw_buf_sz_ |
| |
|
std::vector< osal_mutex_def_t > | ep_out_ff_mutex_rd_ |
| |
|
std::vector< uint16_t > | ep_out_sw_buf_sz_ |
| |
|
std::function< void(USBAudioDevice *, uint8_t func_id)> | fb_done_cb_ |
| |
|
std::function< bool(USBAudioDevice *, uint8_t rhport, tusb_control_request_t const *)> | get_req_entity_cb_ |
| |
|
std::function< bool(USBAudioDevice *, uint8_t rhport, tusb_control_request_t const *)> | get_req_ep_cb_ |
| |
|
std::function< bool(USBAudioDevice *, uint8_t rhport, tusb_control_request_t const *)> | get_req_itf_cb_ |
| |
|
std::function< void(USBAudioDevice *, uint8_t rhport)> | int_done_cb_ |
| |
|
std::function< bool(USBAudioDevice *, uint8_t func_id)> | req_entity_cb_ |
| |
|
std::function< void(const uint8_t *, uint16_t)> | rx_callback_ |
| |
|
std::function< bool(USBAudioDevice *, uint8_t rhport, audiod_function_t *, uint16_t xferred_bytes)> | rx_done_cb_ |
| |
|
std::function< bool(USBAudioDevice *, uint8_t func_id)> | tud_audio_feedback_format_correction_cb_ |
| |
|
std::function< void(USBAudioDevice *, uint8_t func_id, uint8_t alt_itf, audio_feedback_params_t *feedback_param)> | tud_audio_feedback_params_cb_ |
| |
|
std::function< bool(USBAudioDevice *, uint8_t rhport, tusb_control_request_t const *p_request)> | tud_audio_set_itf_cb_ |
| |
|
std::function< bool(USBAudioDevice *, uint8_t rhport, tusb_control_request_t const *p_request)> | tud_audio_set_itf_close_EP_cb_ |
| |
|
std::function< bool(USBAudioDevice *, uint8_t rhport, tusb_control_request_t const *p_request, uint8_t *pBuff)> | tud_audio_set_req_entity_cb_ |
| |
|
std::function< bool(USBAudioDevice *, uint8_t rhport, tusb_control_request_t const *p_request, uint8_t *pBuff)> | tud_audio_set_req_ep_cb_ |
| |
|
std::function< bool(USBAudioDevice *, uint8_t rhport, tusb_control_request_t const *p_request, uint8_t *pBuff)> | tud_audio_set_req_itf_cb_ |
| |
|
std::function< uint16_t(const uint8_t *, uint16_t)> | tx_callback_ |
| |
|
std::function< bool(USBAudioDevice *, uint8_t rhport, audiod_function_t *)> | tx_done_cb_ |
| |
USB Audio Device class for audio streaming over USB.
This class implements a USB audio device, providing configuration, descriptor management, endpoint setup, and control request handling for audio streaming over USB. It supports multiple audio formats, feedback methods, and endpoint configurations, and is designed for use with TinyUSB or native USB on supported MCUs.