zephyr/doc
Titouan Christophe c525e7a0a5 usb: device_next: add new MIDI 2.0 device class
This adds a new USB device class (based on usb/device_next) that implements
revision 2.0 of the MIDIStreaming interface, a sub-class of the USB audio
device class. In practice, the MIDI interface is much more simple and has
little in common with Audio, so it makes sense to have it as a separate
class driver.

MIDI inputs and outputs are configured through the device tree, under a
node `compatible = "zephyr,usb-midi"`. As per the USB-MIDI2.0 spec,
a single usb-midi interface can convey up to 16 Universal MIDI groups,
comprising 16 channels each. Data is carried from/to the host via
so-called Group Terminals, that are organized in Group Terminal Blocks.
They are represented as children of the usb-midi interface in the device
tree.

From the Zephyr application programmer perspective, MIDI data is exchanged
with the host through the device associated with the `zephyr,usb-midi`
interface, using the following API:

* Send a Universal MIDI Packet to the host: `usb_midi_send(device, pkt)`
* Universal MIDI Packets from the host are delivered to the function passed
  in `usb_midi_set_ops(device, &{.rx_packet_cb = handler})`

Compliant USB-MIDI 2.0 devices are required to expose a USB-MIDI1.0
interface as alt setting 0, and the 2.0 interface on alt setting 1.
To avoid the extra complexity of generating backward compatible USB
descriptors and translating Universal MIDI Packets from/to the old
USB-MIDI1.0 format, this driver generates an empty MIDI1.0 interface
(without any input/output); and therefore will only be able to exchange
MIDI data when the host has explicitely enabled MIDI2.0 (alt setting 1).

This implementation is based on the following documents, which are referred
to in the inline comments:

* `midi20`:
    Universal Serial Bus Device Class Definition for MIDI Devices
    Release 2.0
    https://www.usb.org/sites/default/files/USB%20MIDI%20v2_0.pdf
* `ump112`:
    Universal MIDI Packet (UMP) Format and MIDI 2.0 Protocol
      With MIDI 1.0 Protocol in UMP Format
    Document Version 1.1.2
    https://midi.org/universal-midi-packet-ump-and-midi-2-0-protocol-specification

Signed-off-by: Titouan Christophe <moiandme@gmail.com>
2025-01-31 19:50:26 +01:00
..
_doxygen doc: kernel: define additional doxygen groups 2024-09-17 05:24:09 -04:00
_extensions/zephyr doc: boards: extensions: add link to board source to sidebar 2025-01-31 14:03:13 +01:00
_scripts doc: _scripts: gen_devicetree_rest: add individual files 2025-01-07 00:26:08 +01:00
_static doc: boards: extensions: add link to board source to sidebar 2025-01-31 14:03:13 +01:00
_templates doc: enable three-way dark-mode switch 2024-10-16 16:33:24 +01:00
build doc: style: move cmake into style guidelines 2025-01-31 16:10:06 +01:00
connectivity usb: device_next: add new MIDI 2.0 device class 2025-01-31 19:50:26 +01:00
contribute doc: contribute: remove bullet duplicating same message re bisectability 2025-01-31 16:10:06 +01:00
develop doc: Remove build type information 2025-01-30 16:19:57 +01:00
hardware drivers: firmware: scmi: add power domain protocol 2025-01-15 19:03:00 +01:00
images
introduction doc: clarify what a subsystem is 2024-05-14 10:55:55 +02:00
kernel kernel/pipe: implement direct-to-pending-readers data copy 2025-01-21 19:44:57 +01:00
project doc: review: switch labels to a definition list 2025-01-22 18:33:06 +01:00
releases drivers: adc: ads1x4s0x: Add ADS124S0X support into existing drivers 2025-01-31 09:39:07 +01:00
safety doc: coding guidelines: move safety related language to saftey section 2025-01-18 02:33:02 +01:00
security doc: security: Disclose CVE-2024-8798 2024-12-16 04:46:33 +01:00
services doc: services: retention: Fix device names 2025-01-30 11:15:41 +01:00
templates doc: boards: extensions: introduce zephyr:board role and directive 2024-10-22 14:11:27 +02:00
404.rst
CMakeLists.txt doc: get output folder from environment 2024-09-25 13:49:34 -05:00
conf.py doc: update copyright notice in the documentation 2025-01-10 14:56:01 +01:00
glossary.rst doc: sphinx-lint: fix bad usage of "default role" 2024-09-13 11:42:51 -05:00
index-tex.rst doc: pdf: Add Glossary of Terms to PDF output 2023-11-13 12:17:51 -05:00
index.rst doc: reorder tiles 2024-12-25 12:41:09 +01:00
kconfig.rst
LICENSING.rst doc: licensing: clarify the impact of the various files 2025-01-08 17:01:24 +01:00
Makefile doc: add make html-live and html-live-fast 2024-08-26 17:05:39 +02:00
requirements.txt doc: requirements: avoid using pygments v2.19.0 2025-01-05 22:09:44 +01:00
substitutions.txt
zephyr.doxyfile.in net: sockets: Remove deperecated CONFIG_NET_SOCKETS_POSIX_NAMES 2024-12-04 12:09:51 +01:00