|
arduino-audio-tools
|
Abstract seam for every raw USB host stack call the UAC host class logic (USBAudioHostBase) needs. Concrete subclasses wrap TinyUSB host (USBAudioHostBackendTinyUSB) or the ESP-IDF usb_host library (USBAudioHostBackendESP32). More...
#include <USBAudioHostBackend.h>
Public Member Functions | |
| virtual | ~USBAudioHostBackend ()=default |
| virtual bool | begin (USBAudioHostEvents *events, const USBAudioConfig &cfg)=0 |
| Start the host stack and register the event receiver. | |
| virtual void | closeStream (uint8_t daddr, uint8_t ep_addr)=0 |
| Stop streaming the indicated endpoint. | |
| virtual bool | control (uint8_t daddr, const UsbSetupPacket &setup, uint8_t *data)=0 |
| virtual void | end ()=0 |
| Stop all streams (the host stack itself keeps running). | |
| virtual uint32_t | millis () const =0 |
| Milliseconds since start (for control request timeouts). | |
| virtual bool | openStream (uint8_t daddr, const UsbEndpointDescriptorView &ep, UsbHostStreamRole role)=0 |
| virtual bool | setInterface (uint8_t daddr, uint8_t itf, uint8_t alt)=0 |
| virtual UsbSpeed | speed () const |
| Bus speed of the attached device. | |
| virtual void | task ()=0 |
| Pump the host stack on platforms where the application drives it. | |
Abstract seam for every raw USB host stack call the UAC host class logic (USBAudioHostBase) needs. Concrete subclasses wrap TinyUSB host (USBAudioHostBackendTinyUSB) or the ESP-IDF usb_host library (USBAudioHostBackendESP32).
Control requests are asynchronous: the result is reported via USBAudioHostEvents::onControlComplete(), which may also be called before control()/setInterface() returns. Only one control request is in flight at any time. Streaming endpoints are kept running by the backend itself (resubmitting transfers) once openStream() was called.
|
virtualdefault |
|
pure virtual |
Start the host stack and register the event receiver.
Implemented in USBAudioHostBackendESP32, and USBAudioHostBackendTinyUSB.
|
pure virtual |
Stop streaming the indicated endpoint.
Implemented in USBAudioHostBackendESP32, and USBAudioHostBackendTinyUSB.
|
pure virtual |
Asynchronous control request on EP0. For IN requests data receives up to setup.wLength bytes; for OUT requests it holds the payload. data must stay valid until onControlComplete().
Implemented in USBAudioHostBackendESP32, and USBAudioHostBackendTinyUSB.
|
pure virtual |
Stop all streams (the host stack itself keeps running).
Implemented in USBAudioHostBackendESP32, and USBAudioHostBackendTinyUSB.
|
pure virtual |
Milliseconds since start (for control request timeouts).
Implemented in USBAudioHostBackendESP32, and USBAudioHostBackendTinyUSB.
|
pure virtual |
Open an isochronous endpoint of the currently selected alternate setting and start streaming it in the indicated role.
Implemented in USBAudioHostBackendESP32, and USBAudioHostBackendTinyUSB.
|
pure virtual |
Asynchronous SET_INTERFACE: select alternate setting alt of interface itf. Completion is reported via onControlComplete().
Implemented in USBAudioHostBackendESP32, and USBAudioHostBackendTinyUSB.
|
inlinevirtual |
Bus speed of the attached device.
Reimplemented in USBAudioHostBackendESP32, and USBAudioHostBackendTinyUSB.
|
pure virtual |
Pump the host stack on platforms where the application drives it.
Implemented in USBAudioHostBackendESP32, and USBAudioHostBackendTinyUSB.