summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorSaulo VerĂ­ssimo <[email protected]>2026-03-24 23:37:48 -0300
committerSaulo VerĂ­ssimo <[email protected]>2026-05-12 11:07:44 -0300
commitbc8ce76ae800b312b4d3ef591cc42e8726e68d7f (patch)
treefcfe1ba4521bb949fc976cc64cd689fe9d83e7aa /hw
parent4e64f3e91cefab0993a837ac03476173eeeda854 (diff)
feat: add MIDI 2.0 Device class driver (USB-MIDI 2.0)
Add native USB-MIDI 2.0 Device class driver to TinyUSB. Implements the USB-MIDI 2.0 specification with both Alt Setting 0 (MIDI 1.0 fallback) and Alt Setting 1 (UMP native) descriptor support. Driver features: - UMP (Universal MIDI Packet) read/write with atomic message framing - Protocol negotiation: Endpoint Discovery, Config Request/Notify, Function Block Discovery (embedded in driver) - Group Terminal Block descriptor via GET_DESCRIPTOR - Alt Setting switch handler with endpoint re-arm - Static allocation, no dynamic memory, ISR-safe Build system: - Register midi2d_* in usbd.c driver table - Add TUD_MIDI2_DESCRIPTOR macros to usbd.h - Add config defaults (CFG_TUD_MIDI2_*) to tusb_option.h - Add midi2_ump_word_count() to midi.h (shared by Device and Host) - Add midi2_device.c/h to family.cmake and CMakeLists.txt - Add midi2_device.h include to tusb.h All changes guarded by #if CFG_TUD_MIDI2 (default 0). Zero impact on existing drivers and examples. Tested: Raspberry Pi Pico (RP2040), Linux ALSA, Windows MIDI Services
Diffstat (limited to 'hw')
-rw-r--r--hw/bsp/rp2040/family.cmake2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/bsp/rp2040/family.cmake b/hw/bsp/rp2040/family.cmake
index 075582554..aab9a4fae 100644
--- a/hw/bsp/rp2040/family.cmake
+++ b/hw/bsp/rp2040/family.cmake
@@ -99,6 +99,7 @@ target_sources(tinyusb_device_base INTERFACE
${TOP}/src/class/dfu/dfu_rt_device.c
${TOP}/src/class/hid/hid_device.c
${TOP}/src/class/midi/midi_device.c
+ ${TOP}/src/class/midi/midi2_device.c
${TOP}/src/class/msc/msc_device.c
${TOP}/src/class/mtp/mtp_device.c
${TOP}/src/class/net/ecm_rndis_device.c
@@ -121,6 +122,7 @@ target_sources(tinyusb_host_base INTERFACE
${TOP}/src/class/cdc/cdc_host.c
${TOP}/src/class/hid/hid_host.c
${TOP}/src/class/midi/midi_host.c
+ ${TOP}/src/class/midi/midi2_host.c
${TOP}/src/class/msc/msc_host.c
${TOP}/src/class/vendor/vendor_host.c
)