arduino-audio-tools
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
USBDeviceAudioAdafruit Class Reference
Inheritance diagram for USBDeviceAudioAdafruit:
USBDeviceAudio USBAudioCB

Public Member Functions

bool active (void)
 
uint8_t allocEndpoint (uint8_t in) override
 
uint8_t allocInterface (uint8_t count=1) override
 
USBDeviceAudioAPIapi ()
 
bool begin (USBAudioConfig config) override
 
int channels ()
 
USBAudioConfig defaultConfig ()
 
void end ()
 
virtual void fb_done_cb (uint8_t func_id)
 
virtual void feedback_interval_isr (uint8_t func_id, uint32_t frame_number, uint8_t interval_shift)
 
void feedback_params_cb (uint8_t func_id, uint8_t alt_itf, audio_feedback_params_t *feedback_param) override
 
bool get_req_entity_cb (uint8_t rhport, tusb_control_request_t const *p_request) override
 
bool get_req_ep_cb (uint8_t rhport, tusb_control_request_t const *p_request) override
 
bool get_req_itf_cb (uint8_t rhport, tusb_control_request_t const *p_request) override
 
virtual uint8_t getFeatureUnitLength ()
 
uint16_t getInterfaceDescriptor (uint8_t *buf, uint16_t bufsize)
 
uint16_t getInterfaceDescriptor (uint8_t itfnum, uint8_t *buf, uint16_t bufsize) override
 
size_t getInterfaceDescriptorLength (uint8_t itfnum) override
 Determine the interface descriptor length.
 
virtual uint16_t getIOSize ()
 
virtual uint16_t getMaxEPSize ()
 
virtual void int_done_cb (uint8_t rhport)
 
bool isHeadset ()
 
bool isMicrophone ()
 
bool isMute (int channel)
 
bool isSpeaker ()
 
 operator bool ()
 
uint32_t rate ()
 
bool rx_done_post_read_cb (uint8_t rhport, uint16_t n_bytes_received, uint8_t func_id, uint8_t ep_out, uint8_t cur_alt_setting) override
 
bool rx_done_pre_read_cb (uint8_t rhport, uint16_t n_bytes_received, uint8_t func_id, uint8_t ep_out, uint8_t cur_alt_setting) override
 
bool set_itf_cb (uint8_t rhport, tusb_control_request_t const *p_request) override
 
bool set_itf_close_EP_cb (uint8_t rhport, tusb_control_request_t const *p_request) override
 
bool set_req_entity_cb (uint8_t rhport, tusb_control_request_t const *p_request, uint8_t *buf) override
 
bool set_req_ep_cb (uint8_t rhport, tusb_control_request_t const *p_request, uint8_t *pBuff) override
 
bool set_req_itf_cb (uint8_t rhport, tusb_control_request_t const *p_request, uint8_t *pBuff) override
 
void setInput (Stream &in)
 Alternaive to setReadCallback.
 
void setOutput (Print &out)
 Alternative to setWriteCallback.
 
void setReadCallback (size_t(*read_cb)(uint8_t *data, size_t len, USBDeviceAudio &ref))
 
void setWriteCallback (size_t(*write_cb)(const uint8_t *data, size_t len, USBDeviceAudio &ref))
 
AudioProcessingStatus status ()
 Provide the actual status.
 
bool tx_done_post_load_cb (uint8_t rhport, uint16_t n_bytes_copied, uint8_t itf, uint8_t ep_in, uint8_t cur_alt_setting) override
 
bool tx_done_pre_load_cb (uint8_t rhport, uint8_t itf, uint8_t ep_in, uint8_t cur_alt_setting) override
 
bool updateLED (int pin)
 Call from loop to blink led.
 
uint16_t volume (int channel)
 

Public Attributes

int func_id = 0
 

Protected Member Functions

void append (uint8_t *to, uint8_t *str, int len)
 
virtual bool clock_get_request (uint8_t rhport, tusb_control_request_t const *p_request)
 
virtual bool clock_set_request (uint8_t rhport, tusb_control_request_t const *p_request, uint8_t const *buf)
 
virtual bool feature_unit_get_request (uint8_t rhport, tusb_control_request_t const *p_request)
 
virtual bool feature_unit_set_request (uint8_t rhport, tusb_control_request_t const *p_request, uint8_t const *buf)
 
uint16_t interfaceDescriptor (uint8_t *buf, uint16_t bufsize)
 
void interfaceDescriptorHeader (uint8_t *buf, uint8_t total_len, uint8_t category)
 
void interfaceDescriptorHeadset (uint8_t *buf, uint8_t total_len)
 
void interfaceDescriptorMicrophone (uint8_t *buf, uint8_t total_len)
 
void interfaceDescriptorSpeaker (uint8_t *buf, uint8_t total_len)
 
void setStatus (AudioProcessingStatus status)
 Define the led delay.
 
void setupDebugPins ()
 

Static Protected Member Functions

static size_t defaultReadCB (uint8_t *data, size_t len, USBDeviceAudio &ref)
 
static size_t defaultWriteCB (const uint8_t *data, size_t len, USBDeviceAudio &ref)
 

Protected Attributes

USBDeviceAudioAPI _api
 
uint8_t _clk_is_valid = true
 
int _desc_append_pos = 0
 
int _desc_len = 0
 
uint8_t _ep_ctl = 0
 
uint8_t _ep_fb = 0
 
uint8_t _ep_int = 0
 
uint8_t _ep_mic = 0
 
uint8_t _ep_spk = 0
 
ByteBuffer _in_buffer
 
bool _is_led_setup = true
 
uint8_t _itf_number_total = 0
 
uint8_t _itfnum_ctl = 0
 
uint8_t _itfnum_mic = 0
 
uint8_t _itfnum_spk = 0
 
bool _led_active = false
 
uint64_t _led_timeout = 0
 
std::vector< bool > _mute
 
ByteBuffer _out_buffer
 
AudioProcessingStatus _processing_status = AudioProcessingStatus::INACTIVE
 
uint8_t _stridx = 0
 
std::vector< uint16_t > _volume
 
USBAudioConfig cfg
 
std::vector< uint8_t > interface_descriptor
 
Print * p_print = nullptr
 
Stream * p_stream = nullptr
 

Member Function Documentation

◆ setReadCallback()

void setReadCallback ( size_t(*)(uint8_t *data, size_t len, USBDeviceAudio &ref)  read_cb)
inlineinherited

callback for audio source (microphone): we provide the audio data e.g. from the adc

◆ setupDebugPins()

void setupDebugPins ( )
inlineprotectedinherited

We can use 8 debug pins with a logic analyser We can use 8 debug pins with a logic analyser

◆ setWriteCallback()

void setWriteCallback ( size_t(*)(const uint8_t *data, size_t len, USBDeviceAudio &ref)  write_cb)
inlineinherited

callback for audio sink (speaker): we write out the received data e.g. to a dac


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