Control Surface main
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(MIDIUSBPacket_t data) { backend.write(bytes_to_u32(data)); }
21 void sendNow() { backend.send_now(); }
22 bool preferImmediateSend() { return false; }
23
24 public:
26};
27
43 : public GenericUSBMIDI_Interface<USBHostMIDIBackend<64>> {
44 public:
46};
47
63 : public GenericUSBMIDI_Interface<USBHostMIDIBackend<512>> {
64 public:
67};
68
70
#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:37
#define AH_DIAGNOSTIC_WERROR()
Definition: Warnings.hpp:36
A class for MIDI interfaces sending MIDI messages over a USB MIDI connection.
MIDI over USB backend for the Teensy USBHost_t36 library.
void write(MIDIUSBPacket_t data)
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)