17constexpr uint8_t CABLE_NUM = 0;
20constexpr uint8_t OUT_PORTS = 1;
27 if (!tud_midi_mounted()) {
30 return tud_midi_stream_read(buf, max_len);
34 if (port != 0 || !tud_midi_mounted()) {
39 uint8_t len =
event.to_bytes(msg);
44 return tud_midi_stream_write(CABLE_NUM, msg, len) == len;
48 if (port != 0 || !tud_midi_mounted()) {
51 return tud_midi_stream_write(CABLE_NUM, data, len);
static bool connected()
Check if USB MIDI interface is mounted by host.
static uint32_t write(const uint8_t *data, uint32_t len, uint8_t port=0)
Write raw MIDI bytes to USB MIDI (TX)
static uint8_t out_port_count()
How many output ports this target has.
static uint32_t read(uint8_t *buf, uint32_t max_len)
Read decoded MIDI bytes from USB (RX)
static bool send(const sbl::midi::MidiEvent &event, uint8_t port=0)
Send a MidiEvent over USB MIDI (TX)
USB MIDI device interface.