22 return tud_midi_mounted();
26 if (!tud_midi_mounted())
return 0;
27 return tud_midi_stream_read(buf, max_len);
31 if (!tud_midi_mounted())
return false;
34 uint8_t len =
event.to_bytes(msg);
35 if (len == 0)
return false;
37 return tud_midi_stream_write(CABLE_NUM, msg, len) == len;
41 if (!tud_midi_mounted())
return 0;
42 return tud_midi_stream_write(CABLE_NUM, data, len);
static bool connected()
Check if USB MIDI interface is mounted by host.
static bool send(const sbl::midi::MidiEvent &event)
Send a MidiEvent over USB MIDI (TX)
static uint32_t read(uint8_t *buf, uint32_t max_len)
Read decoded MIDI bytes from USB (RX)
static uint32_t write(const uint8_t *data, uint32_t len)
Write raw MIDI bytes to USB MIDI (TX)
constexpr uint8_t CABLE_NUM
Cable number for our single virtual MIDI cable.
USB MIDI device interface.