Control Surface 2.1.2
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
USBMIDI_ESP32.hpp
Go to the documentation of this file.
3
4#include <USB.h>
5#include <USBMIDI.h>
6
8
13 void begin() {
14 backend.begin();
15 USB.begin();
16 }
17
19 midiEventPacket_t packet {0, 0, 0, 0};
20 backend.readPacket(&packet);
21 return {packet.header, packet.byte1, packet.byte2, packet.byte3};
22 }
23
25 midiEventPacket_t packet {p[0], p[1], p[2], p[3]};
26 backend.writePacket(&packet);
27 }
28
29 void sendNow() {}
31 bool preferImmediateSend() { return false; }
33 USBMIDI backend;
34};
35
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
An array wrapper for easy copying, comparing, and iterating.
Definition Array.hpp:32
void sendNow()
Transmit the output buffer immediately (not implemented).
MIDIUSBPacket_t read()
Read a single packet. Return a packet of all zeros if there is no packet.
void write(MIDIUSBPacket_t p)
Write a single packet to the output buffer.
bool preferImmediateSend()
No explicit call to sendNow is required.
USBMIDI backend
The actual low-level USB MIDI backend provided by the core libraries.
void begin()
Called once upon initialization.
AH::Array< uint8_t, 4 > MIDIUSBPacket_t
USB MIDI packages are 4 bytes.