arduino-audio-tools
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
USBAudioDeviceZephyr Class Reference

USB Audio 2.0 device backend for Zephyr RTOS. More...

#include <USBAudioDeviceZephyr.h>

Public Member Functions

 USBAudioDeviceZephyr ()=default
 
 USBAudioDeviceZephyr (USBAudioConfig cfg)
 
uint16_t audioPacketSize () const
 
bool begin ()
 
bool begin (const USBAudioConfig &cfg)
 
USBAudioConfig defaultConfig (RxTxMode mode=RXTX_MODE)
 
void end ()
 
bool mounted () const
 True while the USB host is actively streaming.
 
void process ()
 
void reenumerateUSBOnChange (const USBAudioConfig &cfg)
 
void setRxCallback (std::function< void(const uint8_t *, uint16_t)> cb)
 
void setTxCallback (std::function< uint16_t(uint8_t *, uint16_t)> cb)
 

Detailed Description

USB Audio 2.0 device backend for Zephyr RTOS.

Uses Zephyr's native usbd_uac2 API. The USB descriptor is fixed at build time via the board device tree; dynamic re-enumeration is not supported. Conforms to the duck-typing interface expected by USBAudioStream<Device> — no TinyUSB dependency.

DTS requirements:

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ USBAudioDeviceZephyr() [1/2]

USBAudioDeviceZephyr ( )
default

◆ USBAudioDeviceZephyr() [2/2]

Member Function Documentation

◆ audioPacketSize()

uint16_t audioPacketSize ( ) const
inline

◆ begin() [1/2]

bool begin ( )
inline

◆ begin() [2/2]

bool begin ( const USBAudioConfig cfg)
inline

◆ defaultConfig()

USBAudioConfig defaultConfig ( RxTxMode  mode = RXTX_MODE)
inline

◆ end()

void end ( )
inline

◆ mounted()

bool mounted ( ) const
inline

True while the USB host is actively streaming.

◆ process()

void process ( )
inline

◆ reenumerateUSBOnChange()

void reenumerateUSBOnChange ( const USBAudioConfig cfg)
inline

Zephyr UAC2 descriptors are fixed in the device tree at build time. This method logs a warning if the audio format changes and is otherwise a no-op.

◆ setRxCallback()

void setRxCallback ( std::function< void(const uint8_t *, uint16_t)>  cb)
inline

◆ setTxCallback()

void setTxCallback ( std::function< uint16_t(uint8_t *, uint16_t)>  cb)
inline

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