Control Surface
stm32
MIDI Control Surface library for Arduino
src
MIDI_Interfaces
USBMIDI
USBMIDI_RP2040.hpp
Go to the documentation of this file.
1
#include <
AH/Containers/Array.hpp
>
2
#include <Settings/NamespaceSettings.hpp>
3
4
#include "
mbed-m0/PluggableUSBMIDI.hpp
"
5
6
BEGIN_CS_NAMESPACE
7
8
struct
USBDeviceMIDIBackend
{
9
using
MIDIUSBPacket_t
=
AH::Array<uint8_t, 4>
;
10
MIDIUSBPacket_t
read
() {
return
u32_to_bytes
(
backend
.read()); }
11
void
write
(
MIDIUSBPacket_t
data) {
backend
.write(
bytes_to_u32
(data)); }
12
void
sendNow
() {
backend
.send_now(); }
13
bool
preferImmediateSend
() {
return
false
; }
// TODO
14
15
PluggableUSBMIDI
backend
;
16
};
17
18
END_CS_NAMESPACE
Array.hpp
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition:
Settings/NamespaceSettings.hpp:10
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition:
Settings/NamespaceSettings.hpp:9
u32_to_bytes
AH::Array< uint8_t, 4 > u32_to_bytes(uint32_t u)
Definition:
USBMIDI.hpp:9
bytes_to_u32
uint32_t bytes_to_u32(uint8_t b0, uint8_t b1, uint8_t b2, uint8_t b3)
Definition:
USBMIDI.hpp:18
PluggableUSBMIDI
Definition:
mbed-m0/PluggableUSBMIDI.hpp:18
PluggableUSBMIDI.hpp
AH::Array< uint8_t, 4 >
USBDeviceMIDIBackend
Definition:
USBMIDI_Adafruit_TinyUSB.hpp:8
USBDeviceMIDIBackend::sendNow
void sendNow()
Definition:
USBMIDI_RP2040.hpp:12
USBDeviceMIDIBackend::read
MIDIUSBPacket_t read()
Definition:
USBMIDI_RP2040.hpp:10
USBDeviceMIDIBackend::write
void write(MIDIUSBPacket_t data)
Definition:
USBMIDI_RP2040.hpp:11
USBDeviceMIDIBackend::preferImmediateSend
bool preferImmediateSend()
Definition:
USBMIDI_RP2040.hpp:13
USBDeviceMIDIBackend::backend
Adafruit_USBD_MIDI backend
Definition:
USBMIDI_Adafruit_TinyUSB.hpp:26
Generated by
1.9.4