|
arduino-audio-tools
|
Abstract seam for every raw USB-stack call the UAC2 driver (USBAudioDeviceBase) needs. Concrete subclasses wrap TinyUSB (USBAudioBackendTinyUSB, today) or a native peripheral driver (STM32 HAL / Renesas USBFS — future work). More...
#include <USBAudioBackend.h>

Public Member Functions | |
| virtual | ~USBAudioBackend ()=default |
| virtual bool | claimEndpoint (uint8_t rhport, uint8_t ep_addr)=0 |
| virtual bool | clearStall (uint8_t rhport, uint8_t ep_addr)=0 |
| Clear a halted/stalled condition on an endpoint. | |
| virtual bool | closeEndpoint (uint8_t rhport, uint8_t ep_addr)=0 |
| virtual bool | controlStatus (uint8_t rhport, const UsbSetupPacket &request)=0 |
| Send a zero-length-packet status acknowledgement. | |
| virtual bool | controlTransfer (uint8_t rhport, const UsbSetupPacket &request, uint8_t *buffer, uint16_t length)=0 |
Complete a GET/SET control transfer's data stage with buffer. | |
| virtual void | enableSof (uint8_t rhport, bool enable)=0 |
| bool | isFullSpeed () const |
| Convenience: speed() == UsbSpeed::Full. | |
| bool | isHighSpeed () const |
| Convenience: speed() == UsbSpeed::High. | |
| virtual bool | isoActivateEndpoint (uint8_t rhport, const UsbEndpointDescriptorView &ep)=0 |
| virtual bool | isoAllocEndpoint (uint8_t rhport, uint8_t ep_addr, uint16_t max_packet_size)=0 |
| virtual bool | mounted () const =0 |
| True once the device has completed USB enumeration. | |
| virtual bool | openEndpoint (uint8_t rhport, const UsbEndpointDescriptorView &ep)=0 |
| virtual bool | releaseEndpoint (uint8_t rhport, uint8_t ep_addr)=0 |
| virtual UsbSpeed | speed () const =0 |
| Current negotiated bus speed. | |
| virtual bool | transfer (uint8_t rhport, uint8_t ep_addr, uint8_t *buffer, uint16_t length)=0 |
| virtual bool | usesIsoAlloc () const =0 |
Abstract seam for every raw USB-stack call the UAC2 driver (USBAudioDeviceBase) needs. Concrete subclasses wrap TinyUSB (USBAudioBackendTinyUSB, today) or a native peripheral driver (STM32 HAL / Renesas USBFS — future work).
Only linear-buffer transfers are supported — there is no FIFO-mode transfer API.
|
virtualdefault |
True if the endpoint is currently free to accept a new transfer (used to gate feedback sends from the SOF ISR).
Implemented in USBAudioBackendTinyUSB.
Clear a halted/stalled condition on an endpoint.
Implemented in USBAudioBackendTinyUSB.
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).
Implemented in USBAudioBackendTinyUSB.
|
pure virtual |
Send a zero-length-packet status acknowledgement.
Implemented in USBAudioBackendTinyUSB.
|
pure virtual |
Complete a GET/SET control transfer's data stage with buffer.
Implemented in USBAudioBackendTinyUSB.
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.
Implemented in USBAudioBackendTinyUSB.
|
inline |
Convenience: speed() == UsbSpeed::Full.
|
inline |
Convenience: speed() == UsbSpeed::High.
|
pure virtual |
Activate a previously iso-allocated endpoint for the given descriptor (arms it to accept traffic at the given alt setting's packet size).
Implemented in USBAudioBackendTinyUSB.
|
pure virtual |
Reserve buffer space for an isochronous endpoint. Only called when usesIsoAlloc() is true. Safe to call once per endpoint lifetime.
Implemented in USBAudioBackendTinyUSB.
|
pure virtual |
True once the device has completed USB enumeration.
Implemented in USBAudioBackendTinyUSB.
|
pure virtual |
Open a non-isochronous endpoint (used for the AC interrupt EP, and for data endpoints on backends where usesIsoAlloc() is false).
Implemented in USBAudioBackendTinyUSB.
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).
Implemented in USBAudioBackendTinyUSB.
|
pure virtual |
Current negotiated bus speed.
Implemented in USBAudioBackendTinyUSB.
|
pure virtual |
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).
Implemented in USBAudioBackendTinyUSB.
|
pure virtual |
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.
Implemented in USBAudioBackendTinyUSB.