6#ifndef ZEPHYR_LIB_MIDI2_UMP_STREAM_RESPONDER_H_
7#define ZEPHYR_LIB_MIDI2_UMP_STREAM_RESPONDER_H_
73#define UMP_STREAM_RESPONDER(_dev, _send, _ep_spec) \
76 .send = (ump_send_func) _send, \
77 .ep_spec = _ep_spec, \
97#define UMP_BLOCK_DT_SPEC_GET(_node) \
99 .name = DT_PROP_OR(_node, label, NULL), \
100 .first_group = DT_REG_ADDR(_node), \
101 .groups_spanned = DT_REG_SIZE(_node), \
102 .is_input = !DT_ENUM_HAS_VALUE(_node, terminal_type, output_only), \
103 .is_output = !DT_ENUM_HAS_VALUE(_node, terminal_type, input_only), \
104 .is_midi1 = !DT_ENUM_HAS_VALUE(_node, protocol, midi2), \
105 .is_31250bps = DT_PROP(_node, serial_31250bps), \
108#define UMP_BLOCK_SEP_IF_OKAY(_node) \
109 COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(_node), \
110 (UMP_BLOCK_DT_SPEC_GET(_node),), \
118#define UMP_ENDPOINT_DT_SPEC_GET(_node) \
120 .name = DT_PROP_OR(_node, label, NULL), \
121 .n_blocks = DT_FOREACH_CHILD_SEP(_node, DT_NODE_HAS_STATUS_OKAY, (+)), \
122 .blocks = {DT_FOREACH_CHILD(_node, UMP_BLOCK_SEP_IF_OKAY)}, \
const char * ump_product_instance_id(void)
Definition ump_stream_responder.c:235
void(* ump_send_func)(const void *, const struct midi_ump)
A function to send a UMP.
Definition ump_stream_responder.h:65
int ump_stream_respond(const struct ump_stream_responder_cfg *cfg, const struct midi_ump pkt)
Respond to an UMP Stream message.
Definition ump_stream_responder.c:265
Header file for MIDI 2.0 Universal MIDI Packet (UMP) definitions.
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Universal MIDI Packet container.
Definition midi.h:47
UMP Function Block specification.
Definition ump_stream_responder.h:30
const char * name
Name of this function block, or NULL if unnamed.
Definition ump_stream_responder.h:32
bool is_midi1
True if this function block carries MIDI1 data only.
Definition ump_stream_responder.h:42
bool is_input
True if this function block is an input.
Definition ump_stream_responder.h:38
uint8_t first_group
Number of the first UMP group in this block.
Definition ump_stream_responder.h:34
bool is_output
True if this function block is an output.
Definition ump_stream_responder.h:40
bool is_31250bps
True if this function block is physically wired to a (MIDI1) serial interface, where data is transmit...
Definition ump_stream_responder.h:47
uint8_t groups_spanned
Number of (contiguous) UMP groups spanned by this block.
Definition ump_stream_responder.h:36
UMP endpoint specification.
Definition ump_stream_responder.h:53
size_t n_blocks
Number of function blocks in this endpoint.
Definition ump_stream_responder.h:57
struct ump_block_dt_spec blocks[]
Function blocks in this endpoint.
Definition ump_stream_responder.h:59
const char * name
Name of this endpoint, or NULL if unnamed.
Definition ump_stream_responder.h:55
Configuration for the UMP Stream responder.
Definition ump_stream_responder.h:83
const void * dev
The device to send reply packets.
Definition ump_stream_responder.h:85
ump_send_func send
The function to call to send a reply packet.
Definition ump_stream_responder.h:87
const struct ump_endpoint_dt_spec * ep_spec
The UMP endpoint specification.
Definition ump_stream_responder.h:89