Control Surface master
MIDI Control Surface library for Arduino
USBHostMIDI_Interface.hpp
Go to the documentation of this file.
1#pragma once
2
5
7
9
12template <size_t MaxPacketSize = 512>
14 public:
15 USBHostMIDIBackend(USBHost &host) : backend(host) {}
16
17 public:
19 MIDIUSBPacket_t read() { return u32_to_bytes(backend.read()); }
20 void write(uint8_t cn_cin, uint8_t midi_0, uint8_t midi_1, uint8_t midi_2) {
21 backend.write(bytes_to_u32(cn_cin, midi_0, midi_1, midi_2));
22 }
23 void sendNow() { backend.send_now(); }
24 bool preferImmediateSend() { return false; }
25
26 public:
28};
29
45 : public GenericUSBMIDI_Interface<USBHostMIDIBackend<64>> {
46 public:
48};
49
65 : public GenericUSBMIDI_Interface<USBHostMIDIBackend<512>> {
66 public:
69};
70
72
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
AH::Array< uint8_t, 4 > u32_to_bytes(uint32_t u)
Definition: USBMIDI.hpp:9
uint32_t bytes_to_u32(uint8_t b0, uint8_t b1, uint8_t b2, uint8_t b3)
Definition: USBMIDI.hpp:18
#define AH_DIAGNOSTIC_POP()
Definition: Warnings.hpp:36
#define AH_DIAGNOSTIC_WERROR()
Definition: Warnings.hpp:35
A class for MIDI interfaces sending MIDI messages over a USB MIDI connection.
Teensy USB Host MIDI driver.
MIDI over USB backend for the Teensy USBHost_t36 library.
void write(uint8_t cn_cin, uint8_t midi_0, uint8_t midi_1, uint8_t midi_2)
USBHostMIDIBackend(USBHost &host)
TeensyHostMIDI< MaxPacketSize > backend
A class for MIDI interfaces sending MIDI messages to a MIDI USB device connected to a Teensy's USB ho...
A class for MIDI interfaces sending MIDI messages to a MIDI USB device connected to a Teensy's USB ho...
USBHostMIDI_Interface(USBHost &host)