summaryrefslogtreecommitdiff
path: root/src/class/midi/midi2_device.h
AgeCommit message (Collapse)Author
2026-07-05Merge pull request #3738 from sauloverissimo/fix/midi2-fb-directionZixun LI
feat(midi2): derive function blocks from the GTB descriptor
2026-07-02license: use SPDX identifiers for src/ headers (#3749)Ha Thach
* license: use SPDX identifiers for src/ headers Replace the full ~20-line MIT license boilerplate on every src/ file with a two-line SPDX tag (SPDX-FileCopyrightText + SPDX-License-Identifier), following the REUSE convention used by CircuitPython and the Linux kernel. Removes ~3500 lines of duplicated boilerplate.
2026-06-28feat(midi2): derive function blocks from the GTB descriptorSaulo Veríssimo
Function Block Info (direction, group span, name) is derived from the GTB descriptor as the single source of truth, so a device can expose multiple Group Terminal Blocks with independent directions. Adds Function Block Name notifications (tud_midi2_fb_name_cb) and an opt-in callback to answer UMP Stream messages from the application (tud_midi2_stream_msg_cb). Ref #3571
2026-05-18midi2: convert to raw Tx FIFO for better segmentation handling, add count to ↵HiFiPhile
packet api Signed-off-by: HiFiPhile <[email protected]>
2026-05-17midi2: drain pattern for RX FIFOSaulo Veríssimo
Default RX/TX buffers to EPSIZE for both device and host. Document drain-in-loop on ump_read; example device callback drains until empty.
2026-05-17midi2: scale device buffers with EPSIZESaulo Veríssimo
Match midi2_host pattern. Literal 256 underran HS endpoints (512B).
2026-05-17midi2: per-interface weak callbacks for UMP Stream configSaulo Veríssimo
Lets each instance return different NUM_GROUPS, NUM_FUNCTION_BLOCKS, EP_NAME and PRODUCT_ID. Defaults fall back to the macros.
2026-05-17midi2: peek 4 bytes for MT, restore 256 buffersSaulo Veríssimo
MT is in byte 3 of the UMP word in LE memory, not byte 0. Buffers at mps blocked RX xfer re-arm on partial packets.
2026-05-17midi2: move config to class headerHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-16midi2: reject UMP read/write API on alt setting 0Saulo Veríssimo
Alt 0 carries USB-MIDI 1.0 32-bit Event Packets, not UMP words; calling the UMP API there would misinterpret the stream. Expose MIDI_PROTOCOL_MIDI1 and MIDI_PROTOCOL_MIDI2 in the public header so applications can branch on the negotiated protocol. Ref #3571
2026-05-12feat: add MIDI 2.0 Device class driver (USB-MIDI 2.0)Saulo Veríssimo
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