Zephyr Project API 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
USB MIDI 2.0 Class device API

USB MIDI 2.0 class device API. More...

Data Structures

struct  usbd_midi_ops
 MIDI2 application event handlers. More...
 

Functions

int usbd_midi_send (const struct device *dev, const struct midi_ump ump)
 Send a Universal MIDI Packet to the host.
 
void usbd_midi_set_ops (const struct device *dev, const struct usbd_midi_ops *ops)
 Set the application event handlers on a USB MIDI device.
 

Detailed Description

USB MIDI 2.0 class device API.

Since
4.1
Version
0.1.0
See also
midi20: "Universal Serial Bus Device Class Definition for MIDI Devices" Document Release 2.0 (May 5, 2020)

Function Documentation

◆ usbd_midi_send()

int usbd_midi_send ( const struct device dev,
const struct midi_ump  ump 
)

#include <include/zephyr/usb/class/usbd_midi2.h>

Send a Universal MIDI Packet to the host.

Parameters
[in]devThe MIDI2 device
[in]umpThe packet to send, in Universal MIDI Packet format
Returns
0 on success, all other values should be treated as error -EIO if USB MIDI 2.0 is not enabled by the host -ENOBUFS if there is no space in the TX buffer

◆ usbd_midi_set_ops()

void usbd_midi_set_ops ( const struct device dev,
const struct usbd_midi_ops ops 
)

#include <include/zephyr/usb/class/usbd_midi2.h>

Set the application event handlers on a USB MIDI device.

Parameters
[in]devThe MIDI2 device
[in]opsThe event handlers. Pass NULL to reset all callbacks