summaryrefslogtreecommitdiff
path: root/src/host
diff options
context:
space:
mode:
authorZhang, Zhenjiang <[email protected]>2026-07-16 15:03:31 +0800
committerZhang, Zhenjiang <[email protected]>2026-07-16 15:03:31 +0800
commit439015377976bb51f6d9ae6c3101b72385ecfb1a (patch)
treee46d50ca08ff79923eac2fdcb218fd4006d1185f /src/host
parentac595bc5cf64949332347a2b9d901de507a744a6 (diff)
feat(audio): add USB Audio Host (UAC 1.0) support
Add TinyUSB Host Audio class driver supporting UAC 1.0 devices. Features: - Support multiple Audio Streaming (AS) interfaces with independent format storage - Support both IN (Microphone) and OUT (Speaker) endpoints - Per-AS interface format info: channels, sample rate, bit resolution - Support Feature Unit volume control - Support sampling frequency get/set - Add host/audio_host example for STM32F407 discovery board - Support mono-to-stereo conversion for loopback Changes: - Add src/class/audio/audio_host.c and audio_host.h - Register AUDIO driver in usbh.c - Add CFG_TUH_AUDIO macro in tusb_option.h - Add host/audio_host example with CMake and Makefile build support Tested with Jabra USB headset (stereo speaker + mono microphone) on STM32F407 disco.
Diffstat (limited to 'src/host')
-rw-r--r--src/host/usbh.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c
index e307bb5e5..6e16c0b72 100644
--- a/src/host/usbh.c
+++ b/src/host/usbh.c
@@ -258,6 +258,18 @@ static usbh_class_driver_t const usbh_class_drivers[] = {
},
#endif
+ #if CFG_TUH_AUDIO
+ {
+ .name = DRIVER_NAME("AUDIO"),
+ .init = audioh_init,
+ .deinit = audioh_deinit,
+ .open = audioh_open,
+ .set_config = audioh_set_config,
+ .xfer_cb = audioh_xfer_cb,
+ .close = audioh_close
+ },
+ #endif
+
#if CFG_TUH_HID
{
.name = DRIVER_NAME("HID"),