libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
daisy::MidiUartTransport Class Reference

Transport layer for sending and receiving MIDI data over UART. More...

Detailed Description

Transport layer for sending and receiving MIDI data over UART.

This is the mode of communication used for TRS and DIN MIDI There is an additional 2kB of RAM data used within this class for processing bulk data from the UART peripheral

#include <midi.h>

Classes

struct  Config
 Configuration structure for UART MIDI. More...
 

Public Types

typedef void(* MidiRxParseCallback) (uint8_t *data, size_t size, void *context)
 

Public Member Functions

 MidiUartTransport ()
 
 ~MidiUartTransport ()
 
void Init (Config config)
 Initialization of UART using config struct.
 
void StartRx (MidiRxParseCallback parse_callback, void *context)
 Start the UART peripheral in listening mode. This will fill an internal data structure in the background.
 
bool RxActive ()
 returns whether the UART peripheral is actively listening in the background or not
 
void FlushRx ()
 This is a no-op for UART transport - Rx is via DMA callback with circular buffer.
 
void Tx (uint8_t *buff, size_t size)
 sends the buffer of bytes out of the UART peripheral
 

Member Typedef Documentation

◆ MidiRxParseCallback

typedef void(* daisy::MidiUartTransport::MidiRxParseCallback) (uint8_t *data, size_t size, void *context)

Constructor & Destructor Documentation

◆ MidiUartTransport()

daisy::MidiUartTransport::MidiUartTransport ( )
inline

◆ ~MidiUartTransport()

daisy::MidiUartTransport::~MidiUartTransport ( )
inline

Member Function Documentation

◆ FlushRx()

void daisy::MidiUartTransport::FlushRx ( )
inline

This is a no-op for UART transport - Rx is via DMA callback with circular buffer.

◆ Init()

void daisy::MidiUartTransport::Init ( Config  config)
inline

Initialization of UART using config struct.

zero the buffer to ensure emptiness regardless of source memory

◆ RxActive()

bool daisy::MidiUartTransport::RxActive ( )
inline

returns whether the UART peripheral is actively listening in the background or not

◆ StartRx()

void daisy::MidiUartTransport::StartRx ( MidiRxParseCallback  parse_callback,
void context 
)
inline

Start the UART peripheral in listening mode. This will fill an internal data structure in the background.

◆ Tx()

void daisy::MidiUartTransport::Tx ( uint8_t buff,
size_t  size 
)
inline

sends the buffer of bytes out of the UART peripheral


The documentation for this class was generated from the following file: