9#ifndef SBL_HW_MIDI_INPUT_HPP_
10#define SBL_HW_MIDI_INPUT_HPP_
14#if defined(SBL_HAS_USB) && defined(SBL_HAS_USB_MIDI)
29template<
typename UartDriver>
31 while (UartDriver::available()) {
32 parser.
push(UartDriver::read_byte());
36#if defined(SBL_HAS_USB) && defined(SBL_HAS_USB_MIDI)
46inline void poll_usb(Parser& parser) {
50 parser.push(buf,
static_cast<uint16_t
>(n));
MIDI byte stream parser — state machine with running status.
void push(uint8_t byte)
Feed one byte from UART RX.
static uint32_t read(uint8_t *buf, uint32_t max_len)
Read decoded MIDI bytes from USB (RX)
USB MIDI device interface.
MIDI parser, encoder, SMF and sequencer.
void poll(Parser &parser)
Poll UART for MIDI bytes and feed them to the parser.