Skip to content

daisy::MidiUartTransport

Module: LIBDAISY / HUMAN_INTERFACE / MIDI

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

#include <midi.h>

Public Classes

Name
struct Config
Configuration structure for UART MIDI.

Public Types

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

Public Functions

Name
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

Detailed Description

class daisy::MidiUartTransport;

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

Public Types Documentation

typedef MidiRxParseCallback

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

Public Functions Documentation

function MidiUartTransport

inline MidiUartTransport()

function ~MidiUartTransport

inline ~MidiUartTransport()

function Init

inline void Init(
    Config config
)

Initialization of UART using config struct.

zero the buffer to ensure emptiness regardless of source memory


function StartRx

inline void StartRx(
    MidiRxParseCallback parse_callback,
    void * context
)

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


function RxActive

inline bool RxActive()

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


function FlushRx

inline void FlushRx()

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


function Tx

inline void Tx(
    uint8_t * buff,
    size_t size
)

sends the buffer of bytes out of the UART peripheral

---

Updated on 2024-01-03 at 19:41:01 +0000