|
arduino-audio-tools
|
USBAudioBackend implementation wrapping the real TinyUSB device stack. Injected by the ESP32, TinyUSB (RP2040/Adafruit), and TinyUSBFreeRTOS platform subclasses of USBAudioDeviceBase. More...
#include <USBAudioBackendTinyUSB.h>


Public Member Functions | |
| bool | claimEndpoint (uint8_t rhport, uint8_t ep_addr) override |
| bool | clearStall (uint8_t rhport, uint8_t ep_addr) override |
| Clear a halted/stalled condition on an endpoint. | |
| bool | closeEndpoint (uint8_t rhport, uint8_t ep_addr) override |
| bool | controlStatus (uint8_t rhport, const UsbSetupPacket &request) override |
| Send a zero-length-packet status acknowledgement. | |
| bool | controlTransfer (uint8_t rhport, const UsbSetupPacket &request, uint8_t *buffer, uint16_t length) override |
Complete a GET/SET control transfer's data stage with buffer. | |
| void | enableSof (uint8_t rhport, bool enable) override |
| bool | isFullSpeed () const |
| Convenience: speed() == UsbSpeed::Full. | |
| bool | isHighSpeed () const |
| Convenience: speed() == UsbSpeed::High. | |
| bool | isoActivateEndpoint (uint8_t rhport, const UsbEndpointDescriptorView &ep) override |
| bool | isoAllocEndpoint (uint8_t rhport, uint8_t ep_addr, uint16_t max_packet_size) override |
| bool | mounted () const override |
| True once the device has completed USB enumeration. | |
| bool | openEndpoint (uint8_t rhport, const UsbEndpointDescriptorView &ep) override |
| bool | releaseEndpoint (uint8_t rhport, uint8_t ep_addr) override |
| UsbSpeed | speed () const override |
| Current negotiated bus speed. | |
| bool | transfer (uint8_t rhport, uint8_t ep_addr, uint8_t *buffer, uint16_t length) override |
| bool | usesIsoAlloc () const override |
Static Public Member Functions | |
| static UsbInterfaceDescriptorView | fromTusbInterface (tusb_desc_interface_t const *d) |
| static UsbSetupPacket | fromTusbRequest (tusb_control_request_t const *r) |
| static tusb_desc_endpoint_t | toTusbDescriptor (const UsbEndpointDescriptorView &ep) |
| static tusb_control_request_t | toTusbRequest (const UsbSetupPacket &p) |
USBAudioBackend implementation wrapping the real TinyUSB device stack. Injected by the ESP32, TinyUSB (RP2040/Adafruit), and TinyUSBFreeRTOS platform subclasses of USBAudioDeviceBase.
True if the endpoint is currently free to accept a new transfer (used to gate feedback sends from the SOF ISR).
Implements USBAudioBackend.
Clear a halted/stalled condition on an endpoint.
Implements USBAudioBackend.
Close a previously opened endpoint. Only called when usesIsoAlloc() is false (backends using iso-alloc keep the endpoint reserved and just re-activate it on the next alt-setting).
Implements USBAudioBackend.
|
inlineoverridevirtual |
Send a zero-length-packet status acknowledgement.
Implements USBAudioBackend.
|
inlineoverridevirtual |
Complete a GET/SET control transfer's data stage with buffer.
Implements USBAudioBackend.
Enable/disable the start-of-frame interrupt for the audio feedback consumer. Backends without a SOF concept (e.g. one that polls instead) may implement this as a no-op, but must then drive the feedback-interval logic themselves — not a concern for the TinyUSB backend.
Implements USBAudioBackend.
|
inlinestatic |
|
inlinestatic |
|
inlineinherited |
Convenience: speed() == UsbSpeed::Full.
|
inlineinherited |
Convenience: speed() == UsbSpeed::High.
|
inlineoverridevirtual |
Activate a previously iso-allocated endpoint for the given descriptor (arms it to accept traffic at the given alt setting's packet size).
Implements USBAudioBackend.
|
inlineoverridevirtual |
Reserve buffer space for an isochronous endpoint. Only called when usesIsoAlloc() is true. Safe to call once per endpoint lifetime.
Implements USBAudioBackend.
|
inlineoverridevirtual |
True once the device has completed USB enumeration.
Implements USBAudioBackend.
|
inlineoverridevirtual |
Open a non-isochronous endpoint (used for the AC interrupt EP, and for data endpoints on backends where usesIsoAlloc() is false).
Implements USBAudioBackend.
Release the busy/claim flag on an iso endpoint without closing it (used right after a pre-activation during enumeration so a later transfer can arm normally).
Implements USBAudioBackend.
|
inlineoverridevirtual |
Current negotiated bus speed.
Implements USBAudioBackend.
|
inlinestatic |
|
inlinestatic |
|
inlineoverridevirtual |
Arm one linear-buffer IN or OUT transfer. buffer must stay valid until the transfer-complete callback fires. Returns false if the endpoint could not be armed (already busy, not open, etc).
Implements USBAudioBackend.
|
inlineoverridevirtual |
True if this backend must pre-allocate iso endpoint buffer space once (in audiod_open) and only (re)activate it on each SET_INTERFACE, rather than open/close per alt-setting (mirrors TinyUSB's TUP_DCD_EDPT_ISO_ALLOC platform capability). Lets the UAC2 driver pick one code path at runtime instead of branching on a preprocessor macro.
Implements USBAudioBackend.