summaryrefslogtreecommitdiff
path: root/examples/device
diff options
context:
space:
mode:
authorZixun LI <[email protected]>2026-07-19 22:20:09 +0200
committerGitHub <[email protected]>2026-07-19 22:20:09 +0200
commit2555891761f771bd87504574c48096eb2d07c985 (patch)
treec8d936281847d5fd9e7185fe898ea1538a6367bf /examples/device
parent52e6ab7704ce2e57f41f70d6ba2bc5470c4b56c7 (diff)
parentb00b40da28285f67efd652e20cfe3877d42d2ff3 (diff)
Merge pull request #3694 from rhgndf/py32f0
Puya PY32F07x support
Diffstat (limited to 'examples/device')
-rw-r--r--examples/device/cdc_uac2/src/tusb_config.h8
-rw-r--r--examples/device/net_lwip_webserver/skip.txt1
-rw-r--r--examples/device/uac2_headset/src/usb_descriptors.c5
3 files changed, 11 insertions, 3 deletions
diff --git a/examples/device/cdc_uac2/src/tusb_config.h b/examples/device/cdc_uac2/src/tusb_config.h
index 358ff6747..f54a9b606 100644
--- a/examples/device/cdc_uac2/src/tusb_config.h
+++ b/examples/device/cdc_uac2/src/tusb_config.h
@@ -109,8 +109,10 @@ extern "C" {
#define CFG_TUD_AUDIO_FUNC_1_N_FORMATS 2
// Audio format type I specifications
-#if defined(__RX__)
-#define CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE 48000 // 16bit/48kHz is the best quality for Renesas RX
+#if defined(__RX__) || (CFG_TUSB_MCU == OPT_MCU_PY32F0)
+// RX : 16bit/48kHz is the best quality for Renesas RX
+// PY32F0 : 48kHz/16bit keeps ISO packets <= 98 B so both directions fit the fixed EP FIFOs (EP1 512 B, EP2 128 B)
+#define CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE 48000
#else
#define CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE 96000 // 24bit/96kHz is the best quality for full-speed, high-speed is needed beyond this
#endif
@@ -123,7 +125,7 @@ extern "C" {
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_1_N_BYTES_PER_SAMPLE_RX 2
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_1_RESOLUTION_RX 16
-#if defined(__RX__)
+#if defined(__RX__) || (CFG_TUSB_MCU == OPT_MCU_PY32F0)
// 8bit in 8bit slots
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_TX 1
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_RESOLUTION_TX 8
diff --git a/examples/device/net_lwip_webserver/skip.txt b/examples/device/net_lwip_webserver/skip.txt
index 5e5562087..c3df1ee4b 100644
--- a/examples/device/net_lwip_webserver/skip.txt
+++ b/examples/device/net_lwip_webserver/skip.txt
@@ -10,6 +10,7 @@ mcu:SAMD11
mcu:STM32L0
mcu:STM32F0
mcu:KINETIS_KL
+mcu:PY32F0
mcu:STM32H7RS
mcu:STM32N6
family:broadcom_64bit
diff --git a/examples/device/uac2_headset/src/usb_descriptors.c b/examples/device/uac2_headset/src/usb_descriptors.c
index 1615b92ec..27b6c930c 100644
--- a/examples/device/uac2_headset/src/usb_descriptors.c
+++ b/examples/device/uac2_headset/src/usb_descriptors.c
@@ -98,6 +98,11 @@ uint8_t const * tud_descriptor_device_cb(void)
#define EPNUM_AUDIO_OUT 0x0A
#define EPNUM_AUDIO_IN 0x0B
#define EPNUM_AUDIO_INT 0x01
+ #elif TU_CHECK_MCU(OPT_MCU_PY32F0)
+ // Speaker OUT (196 B) only fits EP1 (512 B FIFO); mic IN (98 B) fits EP2 (128 B)
+ #define EPNUM_AUDIO_OUT 0x01
+ #define EPNUM_AUDIO_IN 0x02
+ #define EPNUM_AUDIO_INT 0x03
#else
#define EPNUM_AUDIO_IN 0x01
#define EPNUM_AUDIO_OUT 0x02