arduino-audio-tools
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
USBDeviceAudioAPI Class Reference

Classes

struct  audiod_function_t
 

Public Member Functions

bool audiod_control_xfer_cb (uint8_t rhport, uint8_t stage, tusb_control_request_t const *request)
 
bool audiod_deinit (void)
 
void audiod_init ()
 
uint16_t audiod_open (uint8_t rhport, tusb_desc_interface_t const *itf_desc, uint16_t max_len)
 
void audiod_reset (uint8_t rhport)
 
void audiod_sof_isr (uint8_t rhport, uint32_t frame_count)
 
bool audiod_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes)
 
void begin (USBAudioCB *cb, USBAudioConfig config)
 
USBAudioConfigconfig ()
 
bool tud_audio_buffer_and_schedule_control_xfer (uint8_t rhport, tusb_control_request_t const *p_request, void *data, uint16_t len)
 
bool tud_audio_int_n_write (uint8_t func_id, const audio_interrupt_data_t *data)
 
uint16_t tud_audio_n_available (uint8_t func_id)
 
bool tud_audio_n_clear_ep_in_ff (uint8_t func_id)
 
bool tud_audio_n_clear_ep_out_ff (uint8_t func_id)
 
bool tud_audio_n_fb_set (uint8_t func_id, uint32_t feedback)
 
tu_fifo_t * tud_audio_n_get_ep_in_ff (uint8_t func_id)
 
tu_fifo_t * tud_audio_n_get_ep_out_ff (uint8_t func_id)
 
bool tud_audio_n_mounted (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)
 Write data to EP in buffer. More...
 

Protected Member Functions

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_completeX (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_fb_send (uint8_t rhport, 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)
 
uint8_t audiod_get_audio_fct_idx (audiod_function_t *audio)
 
bool audiod_get_interface (uint8_t rhport, tusb_control_request_t const *p_request)
 
void audiod_parse_for_AS_params (audiod_function_t *audio, uint8_t const *p_desc, uint8_t const *p_desc_end, uint8_t const as_itf)
 
bool audiod_rx_done_cb (uint8_t rhport, audiod_function_t *audio, uint16_t n_bytes_received)
 
bool audiod_set_interface (uint8_t rhport, tusb_control_request_t const *p_request)
 
bool audiod_tx_done_cb (uint8_t rhport, audiod_function_t *audio)
 
uint16_t audiod_tx_packet_size (const uint16_t *norminal_size, uint16_t data_count, uint16_t fifo_depth, uint16_t max_depth)
 
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 set_fb_params_freq (audiod_function_t *audio, uint32_t sample_freq, uint32_t mclk_freq)
 
uint8_t tu_desc_subtype (void const *desc)
 
uint32_t tud_audio_feedback_update (uint8_t func_id, uint32_t cycles)
 

Protected Attributes

std::vector< CFG_TUD_MEM_SECTION audiod_function_t_audiod_fct
 
std::vector< uint8_t > alt_setting_1
 
std::vector< uint8_t > audio_ep_in_sw_buf_1
 
std::vector< uint8_t > audio_ep_out_sw_buf_1
 
USBAudioConfig cfg
 
std::vector< CFG_TUD_MEM_SECTION uint8_t > ctrl_buf_1
 
std::vector< uint8_t > descriptor
 
osal_mutex_def_t ep_in_ff_mutex_wr_1
 
osal_mutex_def_t ep_out_ff_mutex_rd_1
 
std::vector< CFG_TUD_MEM_SECTION uint8_t > lin_buf_in_1
 
std::vector< CFG_TUD_MEM_SECTION uint8_t > lin_buf_out_1
 
USBAudioCBp_cb = nullptr
 

Member Function Documentation

◆ tud_audio_n_write()

uint16_t tud_audio_n_write ( uint8_t  func_id,
const void *  data,
uint16_t  len 
)
inline

Write data to EP in buffer.

Write data to buffer. If it is full, new data can be inserted once a transmit was scheduled. See audiod_tx_done_cb(). If TX FIFOs are used, this function is not available in order to not let the user mess up the encoding process.

Parameters
[in]func_idIndex of audio function interface
[in]dataPointer to data array to be copied from
[in]len# of array elements to copy
Returns
Number of bytes actually written

The documentation for this class was generated from the following file: