summaryrefslogtreecommitdiff
path: root/src/class/midi/midi_device.h
AgeCommit message (Collapse)Author
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-03-12refactor(config): separate endpoint buffer sizes into RX and TX definitions ↵hathach
for clarity and flexibility
2026-02-25midi device: add cable-aware stream read (tud_midi_n_demux_stream_read)Saulo Veríssimo
The existing tud_midi_n_stream_read() accepts a cable_num parameter but ignores it — all cables share a single FIFO and stream parser state, so data from different virtual cables is silently mixed together. Add tud_midi_n_demux_stream_read() which returns the cable number of the data that was actually read. It peeks at each USB-MIDI event packet header before consuming it and stops when the next packet belongs to a different cable, allowing callers to dispatch per-cable without losing data. Implementation details: - Mirrors the host-side tuh_midi_stream_read() approach: tu_edpt_stream_peek for cable inspection, CIN-based byte count (USB MIDI 1.0 Table 4-1), leftover handling via existing midi_driver_stream_t - *p_cable_num initialized to 0xff sentinel so callers can detect "no data" even when return value is 0 - Cable-change check (total_read > 0 guard) covers both leftover-originated reads and freshly consumed packets - TU_VERIFY uses explicit != NULL comparisons, consistent with codebase style - Note: shares stream->buffer with tud_midi_n_stream_read(); do not mix calls on the same interface - Adds single-interface convenience wrapper tud_midi_demux_stream_read() Closes #1838
2025-11-12migrate midi_device to use edpt stream APIhathach
also add tud_midi_n_packet_write/read_n()
2025-10-28fix Identifiers that start with '__' or '_[A-Z]' are reserved.hathach
fix compiling with nuc family
2025-09-17Update weak callbacks to new syntaxHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2024-04-08add class driver deinithathach
2023-03-17fix trailing space and new linehathach
temporarily disable codespell
2021-05-27include clean uphathach
2021-04-02rename midi write()/read() to stream_write() stream_read()hathach
also add deprecated for warning and rename hint
2021-04-02removed tud_midi_write24()hathach
2021-04-02fix midi tx fifo overflow cause data corruptionhathach
rename
2021-03-30remove tud_midi_read_flush()hathach
2021-03-30rename tud_midi_receive/send to tud_midi_packet_read/writehathach
2021-02-19fix tud_midi_write24 typohathach
rename jack_id to cable_num in function argument
2020-11-20migrate midi device to new control xfer cbhathach
2020-08-24improve midihathach
- fix #436 tud_midi_rx_cb() not invoked - fix xfer_cb() not handle ep in - add ZLP if needed
2020-07-17add new name warning to cdc and midi (skip msc, hid warning for now)hathach
2020-07-16add fs & hs config for cdc_msc_freertos, midi_test, msc_dual_lunhathach
2020-05-28update midi open()hathach
2020-01-16MIDI: Add packet interfaceKay Sievers
This changes the internal buffering to the raw 4-byte messages. The conversion of the messages to a byte-stream moved to the read/write methods. It adds a raw packet interface to send and retrieve the raw 4-byte USB MIDI message: static inline bool tud_midi_receive (uint8_t packet[4]); static inline bool tud_midi_send (uint8_t const packet[4]); MIDI USB packets carry virtual cable/wire/plug data in the packet header, which cannot be exported in the byte-stream interface. The raw packet interface allows to send and and receive the complete USB message.
2020-01-15Normalize line endingsNathan Conrad
2019-07-19more house keepinghathach
2019-07-12clean up, rename internal driver control_request_complete to simply ↵hathach
control_complete
2019-07-04clean uphathach
2019-07-04remove tud_midi_write_flush() send asap. rename tud_midi_connected() to ↵hathach
tud_midi_mounted()
2019-07-03fix midi_write prototypehathach
2019-07-03tested midi examplehathach
2019-07-02clean uphathach
2019-07-02clean uphathach
2019-07-01fix compilinghathach
2019-06-06add TU_ prefix to compiler ATTR to prevent name conflict with applicationhathach
2019-05-14update license year to 2019hathach
2019-03-27cleanup, remove the use of _TINY_USB_SOURCE_FILE_hathach
2019-03-20migrate license from BSD 3 clause to MIThathach
2019-01-04Add USB Midi support.Scott Shawcroft
It also introduces a txbuffer which copies data into it but passes the buffer straight to the USB rather than another copy.