This is an automated email from the ASF dual-hosted git repository.

kasjer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 8e56daa56cf8ed029a29f88e70e5a71ab2ad7d22
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Thu Oct 8 07:57:16 2026 +0200

    tinyusb: Move audio endpoint defaults to port tusb_hw.h
    
    Audio isochronous endpoint defaults lived in std_descriptors
    tusb_config.h as 1/0x81 (8 on nRF5x) and collided with CDC defaults
    of every port as soon as USB console was enabled together with audio.
    
    Define USBD_AUDIO_OUT_EP, USBD_AUDIO_IN_EP and USBD_AUDIO_FEEDBACK_EP
    in each port's tusb_hw.h next to CDC, HID and MSC endpoints, with
    numbers that stay clear of those where the controller has enough
    endpoints:
    
     - stm32_fsdev, pic32mz: 0x04/0x84/0x85
     - synopsys, lpc55: 0x03/0x83/0x84, OTG_FS and LPC55 full speed
       controllers have too few endpoints to avoid HID and MSC defaults
     - da146xx: 0x03/0x83, feedback endpoint shares the IN endpoint
     - nrf5x, nrf53: 0x08/0x88, the only isochronous endpoint pair
    
    Syscfg values are now full endpoint addresses (0x8n for IN), same as
    for other classes, and std_descriptors fails the build when a port
    does not provide the defaults.
    
    Assisted-by: Claude:claude-fable-5-1
    Signed-off-by: Jerzy Kasenberg <[email protected]>
---
 hw/usb/tinyusb/da146xx/include/tusb_hw.h           | 23 ++++++++++++++
 hw/usb/tinyusb/lpc55/include/tusb_hw.h             | 22 ++++++++++++++
 hw/usb/tinyusb/nrf53/include/tusb_hw.h             | 23 ++++++++++++++
 hw/usb/tinyusb/nrf5x/include/tusb_hw.h             | 23 ++++++++++++++
 hw/usb/tinyusb/pic32mz/include/tusb_hw.h           | 22 ++++++++++++++
 .../tinyusb/std_descriptors/include/tusb_config.h  | 35 ++++++----------------
 hw/usb/tinyusb/std_descriptors/syscfg.yml          | 21 +++++++------
 hw/usb/tinyusb/stm32_fsdev/include/tusb_hw.h       | 22 ++++++++++++++
 .../tinyusb/stm32_fsdev/stm32f3/include/tusb_hw.h  | 22 ++++++++++++++
 .../tinyusb/stm32_fsdev/stm32g0/include/tusb_hw.h  | 22 ++++++++++++++
 .../tinyusb/stm32_fsdev/stm32g4/include/tusb_hw.h  | 22 ++++++++++++++
 .../tinyusb/stm32_fsdev/stm32h5/include/tusb_hw.h  | 22 ++++++++++++++
 .../tinyusb/stm32_fsdev/stm32l0/include/tusb_hw.h  | 22 ++++++++++++++
 .../stm32_fsdev/stm32wb55/include/tusb_hw.h        | 22 ++++++++++++++
 hw/usb/tinyusb/synopsys/include/tusb_hw.h          | 24 +++++++++++++++
 15 files changed, 310 insertions(+), 37 deletions(-)

diff --git a/hw/usb/tinyusb/da146xx/include/tusb_hw.h 
b/hw/usb/tinyusb/da146xx/include/tusb_hw.h
index 54c48602f..518ecc819 100644
--- a/hw/usb/tinyusb/da146xx/include/tusb_hw.h
+++ b/hw/usb/tinyusb/da146xx/include/tusb_hw.h
@@ -126,4 +126,27 @@ void tusb_vbus_changed(bool present);
 #define USBD_BTH_DATA_EP_SIZE   0x40
 #endif
 
+/*
+ * Audio class isochronous endpoints.  Controller has four endpoints,
+ * 3 is the last one free when CDC is present.  Feedback endpoint shares
+ * the IN endpoint, so it can not be used together with microphone.
+ */
+#if defined(MYNEWT_VAL_USBD_AUDIO_OUT_EP)
+#define USBD_AUDIO_OUT_EP       MYNEWT_VAL(USBD_AUDIO_OUT_EP)
+#else
+#define USBD_AUDIO_OUT_EP       0x03
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_IN_EP)
+#define USBD_AUDIO_IN_EP        MYNEWT_VAL(USBD_AUDIO_IN_EP)
+#else
+#define USBD_AUDIO_IN_EP        0x83
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_FEEDBACK_EP)
+#define USBD_AUDIO_FEEDBACK_EP  MYNEWT_VAL(USBD_AUDIO_FEEDBACK_EP)
+#else
+#define USBD_AUDIO_FEEDBACK_EP  0x83
+#endif
+
 #endif
diff --git a/hw/usb/tinyusb/lpc55/include/tusb_hw.h 
b/hw/usb/tinyusb/lpc55/include/tusb_hw.h
index 27aa2a67f..45ed8093c 100644
--- a/hw/usb/tinyusb/lpc55/include/tusb_hw.h
+++ b/hw/usb/tinyusb/lpc55/include/tusb_hw.h
@@ -89,4 +89,26 @@
 #define USBD_MSC_DATA_OUT_EP     0x04
 #endif
 
+/*
+ * Audio class isochronous endpoints.  Full speed controller has five
+ * endpoints, defaults are shared with HID (0x83) and MSC (0x84).
+ */
+#if defined(MYNEWT_VAL_USBD_AUDIO_OUT_EP)
+#define USBD_AUDIO_OUT_EP       MYNEWT_VAL(USBD_AUDIO_OUT_EP)
+#else
+#define USBD_AUDIO_OUT_EP       0x03
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_IN_EP)
+#define USBD_AUDIO_IN_EP        MYNEWT_VAL(USBD_AUDIO_IN_EP)
+#else
+#define USBD_AUDIO_IN_EP        0x83
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_FEEDBACK_EP)
+#define USBD_AUDIO_FEEDBACK_EP  MYNEWT_VAL(USBD_AUDIO_FEEDBACK_EP)
+#else
+#define USBD_AUDIO_FEEDBACK_EP  0x84
+#endif
+
 #endif
diff --git a/hw/usb/tinyusb/nrf53/include/tusb_hw.h 
b/hw/usb/tinyusb/nrf53/include/tusb_hw.h
index b7199e2cf..0268b592a 100644
--- a/hw/usb/tinyusb/nrf53/include/tusb_hw.h
+++ b/hw/usb/tinyusb/nrf53/include/tusb_hw.h
@@ -122,4 +122,27 @@
 #define USBD_BTH_DATA_EP_SIZE   0x40
 #endif
 
+/*
+ * Audio class isochronous endpoints, 8 is the only isochronous
+ * endpoint pair.  Feedback endpoint shares the IN endpoint, so it can
+ * not be used together with microphone.
+ */
+#if defined(MYNEWT_VAL_USBD_AUDIO_OUT_EP)
+#define USBD_AUDIO_OUT_EP       MYNEWT_VAL(USBD_AUDIO_OUT_EP)
+#else
+#define USBD_AUDIO_OUT_EP       0x08
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_IN_EP)
+#define USBD_AUDIO_IN_EP        MYNEWT_VAL(USBD_AUDIO_IN_EP)
+#else
+#define USBD_AUDIO_IN_EP        0x88
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_FEEDBACK_EP)
+#define USBD_AUDIO_FEEDBACK_EP  MYNEWT_VAL(USBD_AUDIO_FEEDBACK_EP)
+#else
+#define USBD_AUDIO_FEEDBACK_EP  0x88
+#endif
+
 #endif
diff --git a/hw/usb/tinyusb/nrf5x/include/tusb_hw.h 
b/hw/usb/tinyusb/nrf5x/include/tusb_hw.h
index f4af8be16..075445d57 100755
--- a/hw/usb/tinyusb/nrf5x/include/tusb_hw.h
+++ b/hw/usb/tinyusb/nrf5x/include/tusb_hw.h
@@ -140,4 +140,27 @@
 #define USBD_VENDOR_EP_SIZE     0x40
 #endif
 
+/*
+ * Audio class isochronous endpoints, 8 is the only isochronous
+ * endpoint pair.  Feedback endpoint shares the IN endpoint, so it can
+ * not be used together with microphone.
+ */
+#if defined(MYNEWT_VAL_USBD_AUDIO_OUT_EP)
+#define USBD_AUDIO_OUT_EP       MYNEWT_VAL(USBD_AUDIO_OUT_EP)
+#else
+#define USBD_AUDIO_OUT_EP       0x08
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_IN_EP)
+#define USBD_AUDIO_IN_EP        MYNEWT_VAL(USBD_AUDIO_IN_EP)
+#else
+#define USBD_AUDIO_IN_EP        0x88
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_FEEDBACK_EP)
+#define USBD_AUDIO_FEEDBACK_EP  MYNEWT_VAL(USBD_AUDIO_FEEDBACK_EP)
+#else
+#define USBD_AUDIO_FEEDBACK_EP  0x88
+#endif
+
 #endif
diff --git a/hw/usb/tinyusb/pic32mz/include/tusb_hw.h 
b/hw/usb/tinyusb/pic32mz/include/tusb_hw.h
index 8a8ae0c07..9dc67b475 100644
--- a/hw/usb/tinyusb/pic32mz/include/tusb_hw.h
+++ b/hw/usb/tinyusb/pic32mz/include/tusb_hw.h
@@ -91,4 +91,26 @@
 #define USBD_MSC_DATA_OUT_EP     0x06
 #endif
 
+/*
+ * Audio class isochronous endpoints, default numbers do not collide
+ * with CDC, HID and MSC defaults.
+ */
+#if defined(MYNEWT_VAL_USBD_AUDIO_OUT_EP)
+#define USBD_AUDIO_OUT_EP       MYNEWT_VAL(USBD_AUDIO_OUT_EP)
+#else
+#define USBD_AUDIO_OUT_EP       0x04
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_IN_EP)
+#define USBD_AUDIO_IN_EP        MYNEWT_VAL(USBD_AUDIO_IN_EP)
+#else
+#define USBD_AUDIO_IN_EP        0x84
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_FEEDBACK_EP)
+#define USBD_AUDIO_FEEDBACK_EP  MYNEWT_VAL(USBD_AUDIO_FEEDBACK_EP)
+#else
+#define USBD_AUDIO_FEEDBACK_EP  0x85
+#endif
+
 #endif
diff --git a/hw/usb/tinyusb/std_descriptors/include/tusb_config.h 
b/hw/usb/tinyusb/std_descriptors/include/tusb_config.h
index e2dab3951..6df605298 100755
--- a/hw/usb/tinyusb/std_descriptors/include/tusb_config.h
+++ b/hw/usb/tinyusb/std_descriptors/include/tusb_config.h
@@ -273,30 +273,13 @@ extern "C" {
 #define USBD_AUDIO_IN_CHANNELS          MYNEWT_VAL(USBD_AUDIO_IN_CHANNELS)
 #define USBD_AUDIO_OUT_CHANNELS         MYNEWT_VAL(USBD_AUDIO_OUT_CHANNELS)
 
-/* Endpoint addresses, isochronous endpoints on nRF5x are fixed to 8 */
-#if MYNEWT_VAL(USBD_AUDIO_OUT_EP)
-#define USBD_AUDIO_OUT_EP               MYNEWT_VAL(USBD_AUDIO_OUT_EP)
-#elif CFG_TUSB_MCU == OPT_MCU_NRF5X
-#define USBD_AUDIO_OUT_EP               8
-#else
-#define USBD_AUDIO_OUT_EP               1
-#endif
-
-#if MYNEWT_VAL(USBD_AUDIO_IN_EP)
-#define USBD_AUDIO_IN_EP                (0x80 | MYNEWT_VAL(USBD_AUDIO_IN_EP))
-#elif CFG_TUSB_MCU == OPT_MCU_NRF5X
-#define USBD_AUDIO_IN_EP                (0x80 | 8)
-#else
-#define USBD_AUDIO_IN_EP                (0x80 | 1)
-#endif
-
-#if MYNEWT_VAL(USBD_AUDIO_FEEDBACK_EP)
-#define USBD_AUDIO_FEEDBACK_EP          \
-    (0x80 | MYNEWT_VAL(USBD_AUDIO_FEEDBACK_EP))
-#elif CFG_TUSB_MCU == OPT_MCU_NRF5X
-#define USBD_AUDIO_FEEDBACK_EP          (0x80 | 8)
-#else
-#define USBD_AUDIO_FEEDBACK_EP          (0x80 | 2)
+/*
+ * Isochronous endpoint addresses are selected in port specific tusb_hw.h,
+ * where they can be kept apart from other classes' defaults.
+ */
+#if !defined(USBD_AUDIO_OUT_EP) || !defined(USBD_AUDIO_IN_EP) || \
+    !defined(USBD_AUDIO_FEEDBACK_EP)
+#error "USB port tusb_hw.h does not define audio endpoints"
 #endif
 
 #if MYNEWT_VAL(USBD_AUDIO_FEEDBACK) && CFG_TUD_AUDIO_ENABLE_EP_OUT
@@ -305,9 +288,9 @@ extern "C" {
 #define CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP    0
 #endif
 
-#if MYNEWT_VAL(USBD_AUDIO_INT_EP)
+#if defined(MYNEWT_VAL_USBD_AUDIO_INT_EP)
 #define CFG_TUD_AUDIO_ENABLE_INTERRUPT_EP   1
-#define USBD_AUDIO_INT_EP               (0x80 | MYNEWT_VAL(USBD_AUDIO_INT_EP))
+#define USBD_AUDIO_INT_EP               MYNEWT_VAL(USBD_AUDIO_INT_EP)
 #else
 #define CFG_TUD_AUDIO_ENABLE_INTERRUPT_EP   0
 #endif
diff --git a/hw/usb/tinyusb/std_descriptors/syscfg.yml 
b/hw/usb/tinyusb/std_descriptors/syscfg.yml
index b0650215a..bd8ec07b3 100644
--- a/hw/usb/tinyusb/std_descriptors/syscfg.yml
+++ b/hw/usb/tinyusb/std_descriptors/syscfg.yml
@@ -307,26 +307,25 @@ syscfg.defs:
         value: 0
     USBD_AUDIO_OUT_EP:
         description: >
-            Speaker (OUT) isochronous endpoint number.
-            Empty for default: 8 on nRF5x (only isochronous endpoint),
-            1 otherwise.
+            Speaker (OUT) isochronous endpoint address (e.g. 0x04).
+            Empty for USB port default from tusb_hw.h.
         value:
     USBD_AUDIO_IN_EP:
         description: >
-            Microphone (IN) isochronous endpoint number.
-            Empty for default: 8 on nRF5x (only isochronous endpoint),
-            1 otherwise.
+            Microphone (IN) isochronous endpoint address (e.g. 0x84).
+            Empty for USB port default from tusb_hw.h.
         value:
     USBD_AUDIO_FEEDBACK_EP:
         description: >
-            Feedback (IN) isochronous endpoint number, must differ from
-            USBD_AUDIO_IN_EP when both are used.
-            Empty for default: 8 on nRF5x, 2 otherwise.
+            Feedback (IN) isochronous endpoint address (e.g. 0x85), must
+            differ from USBD_AUDIO_IN_EP when both are used.
+            Empty for USB port default from tusb_hw.h.
         value:
     USBD_AUDIO_INT_EP:
         description: >
-            Audio Control interrupt (IN) endpoint number used to notify host
-            about control changes.  Empty for no interrupt endpoint.
+            Audio Control interrupt (IN) endpoint address (e.g. 0x86) used
+            to notify host about control changes.  Empty for no interrupt
+            endpoint.
         value:
     USBD_AUDIO_IN_BUFFER_PACKETS:
         description: >
diff --git a/hw/usb/tinyusb/stm32_fsdev/include/tusb_hw.h 
b/hw/usb/tinyusb/stm32_fsdev/include/tusb_hw.h
index c13a4ca32..f94ed9d97 100755
--- a/hw/usb/tinyusb/stm32_fsdev/include/tusb_hw.h
+++ b/hw/usb/tinyusb/stm32_fsdev/include/tusb_hw.h
@@ -86,4 +86,26 @@
 #define USBD_MSC_DATA_OUT_EP     0x06
 #endif
 
+/*
+ * Audio class isochronous endpoints, default numbers do not collide
+ * with CDC, HID and MSC defaults.
+ */
+#if defined(MYNEWT_VAL_USBD_AUDIO_OUT_EP)
+#define USBD_AUDIO_OUT_EP       MYNEWT_VAL(USBD_AUDIO_OUT_EP)
+#else
+#define USBD_AUDIO_OUT_EP       0x04
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_IN_EP)
+#define USBD_AUDIO_IN_EP        MYNEWT_VAL(USBD_AUDIO_IN_EP)
+#else
+#define USBD_AUDIO_IN_EP        0x84
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_FEEDBACK_EP)
+#define USBD_AUDIO_FEEDBACK_EP  MYNEWT_VAL(USBD_AUDIO_FEEDBACK_EP)
+#else
+#define USBD_AUDIO_FEEDBACK_EP  0x85
+#endif
+
 #endif
diff --git a/hw/usb/tinyusb/stm32_fsdev/stm32f3/include/tusb_hw.h 
b/hw/usb/tinyusb/stm32_fsdev/stm32f3/include/tusb_hw.h
index edc8aae55..94e4d8ab4 100644
--- a/hw/usb/tinyusb/stm32_fsdev/stm32f3/include/tusb_hw.h
+++ b/hw/usb/tinyusb/stm32_fsdev/stm32f3/include/tusb_hw.h
@@ -86,4 +86,26 @@
 #define USBD_MSC_DATA_OUT_EP     0x06
 #endif
 
+/*
+ * Audio class isochronous endpoints, default numbers do not collide
+ * with CDC, HID and MSC defaults.
+ */
+#if defined(MYNEWT_VAL_USBD_AUDIO_OUT_EP)
+#define USBD_AUDIO_OUT_EP       MYNEWT_VAL(USBD_AUDIO_OUT_EP)
+#else
+#define USBD_AUDIO_OUT_EP       0x04
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_IN_EP)
+#define USBD_AUDIO_IN_EP        MYNEWT_VAL(USBD_AUDIO_IN_EP)
+#else
+#define USBD_AUDIO_IN_EP        0x84
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_FEEDBACK_EP)
+#define USBD_AUDIO_FEEDBACK_EP  MYNEWT_VAL(USBD_AUDIO_FEEDBACK_EP)
+#else
+#define USBD_AUDIO_FEEDBACK_EP  0x85
+#endif
+
 #endif
diff --git a/hw/usb/tinyusb/stm32_fsdev/stm32g0/include/tusb_hw.h 
b/hw/usb/tinyusb/stm32_fsdev/stm32g0/include/tusb_hw.h
index 006253947..76e5cc65b 100644
--- a/hw/usb/tinyusb/stm32_fsdev/stm32g0/include/tusb_hw.h
+++ b/hw/usb/tinyusb/stm32_fsdev/stm32g0/include/tusb_hw.h
@@ -86,4 +86,26 @@
 #define USBD_MSC_DATA_OUT_EP     0x06
 #endif
 
+/*
+ * Audio class isochronous endpoints, default numbers do not collide
+ * with CDC, HID and MSC defaults.
+ */
+#if defined(MYNEWT_VAL_USBD_AUDIO_OUT_EP)
+#define USBD_AUDIO_OUT_EP       MYNEWT_VAL(USBD_AUDIO_OUT_EP)
+#else
+#define USBD_AUDIO_OUT_EP       0x04
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_IN_EP)
+#define USBD_AUDIO_IN_EP        MYNEWT_VAL(USBD_AUDIO_IN_EP)
+#else
+#define USBD_AUDIO_IN_EP        0x84
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_FEEDBACK_EP)
+#define USBD_AUDIO_FEEDBACK_EP  MYNEWT_VAL(USBD_AUDIO_FEEDBACK_EP)
+#else
+#define USBD_AUDIO_FEEDBACK_EP  0x85
+#endif
+
 #endif
diff --git a/hw/usb/tinyusb/stm32_fsdev/stm32g4/include/tusb_hw.h 
b/hw/usb/tinyusb/stm32_fsdev/stm32g4/include/tusb_hw.h
index 8d2c6c1ce..a27bbc38c 100644
--- a/hw/usb/tinyusb/stm32_fsdev/stm32g4/include/tusb_hw.h
+++ b/hw/usb/tinyusb/stm32_fsdev/stm32g4/include/tusb_hw.h
@@ -86,4 +86,26 @@
 #define USBD_MSC_DATA_OUT_EP     0x06
 #endif
 
+/*
+ * Audio class isochronous endpoints, default numbers do not collide
+ * with CDC, HID and MSC defaults.
+ */
+#if defined(MYNEWT_VAL_USBD_AUDIO_OUT_EP)
+#define USBD_AUDIO_OUT_EP       MYNEWT_VAL(USBD_AUDIO_OUT_EP)
+#else
+#define USBD_AUDIO_OUT_EP       0x04
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_IN_EP)
+#define USBD_AUDIO_IN_EP        MYNEWT_VAL(USBD_AUDIO_IN_EP)
+#else
+#define USBD_AUDIO_IN_EP        0x84
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_FEEDBACK_EP)
+#define USBD_AUDIO_FEEDBACK_EP  MYNEWT_VAL(USBD_AUDIO_FEEDBACK_EP)
+#else
+#define USBD_AUDIO_FEEDBACK_EP  0x85
+#endif
+
 #endif
diff --git a/hw/usb/tinyusb/stm32_fsdev/stm32h5/include/tusb_hw.h 
b/hw/usb/tinyusb/stm32_fsdev/stm32h5/include/tusb_hw.h
index 163c7bebc..2043dfe5c 100644
--- a/hw/usb/tinyusb/stm32_fsdev/stm32h5/include/tusb_hw.h
+++ b/hw/usb/tinyusb/stm32_fsdev/stm32h5/include/tusb_hw.h
@@ -86,4 +86,26 @@
 #define USBD_MSC_DATA_OUT_EP 0x06
 #endif
 
+/*
+ * Audio class isochronous endpoints, default numbers do not collide
+ * with CDC, HID and MSC defaults.
+ */
+#if defined(MYNEWT_VAL_USBD_AUDIO_OUT_EP)
+#define USBD_AUDIO_OUT_EP MYNEWT_VAL(USBD_AUDIO_OUT_EP)
+#else
+#define USBD_AUDIO_OUT_EP 0x04
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_IN_EP)
+#define USBD_AUDIO_IN_EP MYNEWT_VAL(USBD_AUDIO_IN_EP)
+#else
+#define USBD_AUDIO_IN_EP 0x84
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_FEEDBACK_EP)
+#define USBD_AUDIO_FEEDBACK_EP MYNEWT_VAL(USBD_AUDIO_FEEDBACK_EP)
+#else
+#define USBD_AUDIO_FEEDBACK_EP 0x85
+#endif
+
 #endif
diff --git a/hw/usb/tinyusb/stm32_fsdev/stm32l0/include/tusb_hw.h 
b/hw/usb/tinyusb/stm32_fsdev/stm32l0/include/tusb_hw.h
index 889c02e50..6079f0999 100644
--- a/hw/usb/tinyusb/stm32_fsdev/stm32l0/include/tusb_hw.h
+++ b/hw/usb/tinyusb/stm32_fsdev/stm32l0/include/tusb_hw.h
@@ -86,4 +86,26 @@
 #define USBD_MSC_DATA_OUT_EP     0x06
 #endif
 
+/*
+ * Audio class isochronous endpoints, default numbers do not collide
+ * with CDC, HID and MSC defaults.
+ */
+#if defined(MYNEWT_VAL_USBD_AUDIO_OUT_EP)
+#define USBD_AUDIO_OUT_EP       MYNEWT_VAL(USBD_AUDIO_OUT_EP)
+#else
+#define USBD_AUDIO_OUT_EP       0x04
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_IN_EP)
+#define USBD_AUDIO_IN_EP        MYNEWT_VAL(USBD_AUDIO_IN_EP)
+#else
+#define USBD_AUDIO_IN_EP        0x84
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_FEEDBACK_EP)
+#define USBD_AUDIO_FEEDBACK_EP  MYNEWT_VAL(USBD_AUDIO_FEEDBACK_EP)
+#else
+#define USBD_AUDIO_FEEDBACK_EP  0x85
+#endif
+
 #endif
diff --git a/hw/usb/tinyusb/stm32_fsdev/stm32wb55/include/tusb_hw.h 
b/hw/usb/tinyusb/stm32_fsdev/stm32wb55/include/tusb_hw.h
index 7de145950..9200c851e 100644
--- a/hw/usb/tinyusb/stm32_fsdev/stm32wb55/include/tusb_hw.h
+++ b/hw/usb/tinyusb/stm32_fsdev/stm32wb55/include/tusb_hw.h
@@ -86,4 +86,26 @@
 #define USBD_MSC_DATA_OUT_EP     0x06
 #endif
 
+/*
+ * Audio class isochronous endpoints, default numbers do not collide
+ * with CDC, HID and MSC defaults.
+ */
+#if defined(MYNEWT_VAL_USBD_AUDIO_OUT_EP)
+#define USBD_AUDIO_OUT_EP       MYNEWT_VAL(USBD_AUDIO_OUT_EP)
+#else
+#define USBD_AUDIO_OUT_EP       0x04
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_IN_EP)
+#define USBD_AUDIO_IN_EP        MYNEWT_VAL(USBD_AUDIO_IN_EP)
+#else
+#define USBD_AUDIO_IN_EP        0x84
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_FEEDBACK_EP)
+#define USBD_AUDIO_FEEDBACK_EP  MYNEWT_VAL(USBD_AUDIO_FEEDBACK_EP)
+#else
+#define USBD_AUDIO_FEEDBACK_EP  0x85
+#endif
+
 #endif
diff --git a/hw/usb/tinyusb/synopsys/include/tusb_hw.h 
b/hw/usb/tinyusb/synopsys/include/tusb_hw.h
index 7cd7ccb9e..325fc7600 100755
--- a/hw/usb/tinyusb/synopsys/include/tusb_hw.h
+++ b/hw/usb/tinyusb/synopsys/include/tusb_hw.h
@@ -100,4 +100,28 @@
 #define USBD_MSC_DATA_OUT_EP     0x03
 #endif
 
+/*
+ * Audio class isochronous endpoints.  OTG_FS cores have only four
+ * endpoints, 3 is the last one free when CDC is present and IN endpoint
+ * is shared with HID and MSC defaults.  Feedback endpoint default
+ * requires OTG_HS core.
+ */
+#if defined(MYNEWT_VAL_USBD_AUDIO_OUT_EP)
+#define USBD_AUDIO_OUT_EP       MYNEWT_VAL(USBD_AUDIO_OUT_EP)
+#else
+#define USBD_AUDIO_OUT_EP       0x03
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_IN_EP)
+#define USBD_AUDIO_IN_EP        MYNEWT_VAL(USBD_AUDIO_IN_EP)
+#else
+#define USBD_AUDIO_IN_EP        0x83
+#endif
+
+#if defined(MYNEWT_VAL_USBD_AUDIO_FEEDBACK_EP)
+#define USBD_AUDIO_FEEDBACK_EP  MYNEWT_VAL(USBD_AUDIO_FEEDBACK_EP)
+#else
+#define USBD_AUDIO_FEEDBACK_EP  0x84
+#endif
+
 #endif

Reply via email to