Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Respond to UMP Stream message Endpoint or Function Block discovery. More...

Data Structures

struct  ump_block_dt_spec
 UMP Function Block specification. More...
struct  ump_endpoint_dt_spec
 UMP endpoint specification. More...
struct  ump_stream_responder_cfg
 Configuration for the UMP Stream responder. More...

Macros

#define UMP_BLOCK_DT_SPEC_GET(_node)
 Get a Universal MIDI Packet endpoint function block from its device-tree representation.
#define UMP_BLOCK_SEP_IF_OKAY(_node)
#define UMP_ENDPOINT_DT_SPEC_GET(_node)
 Get a Universal MIDI Packet endpoint description from the device-tree representation of a midi2 device.

Functions

int ump_stream_respond (const struct ump_stream_responder_cfg *cfg, const struct midi_ump pkt)
 Respond to an UMP Stream message.
const char * ump_product_instance_id (void)

Detailed Description

Respond to UMP Stream message Endpoint or Function Block discovery.

Since
4.3
Version
0.1.0
See also
Universal MIDI Packet (UMP) Format and MIDI 2.0 Protocol 7.1: UMP Stream Messages

Macro Definition Documentation

◆ UMP_BLOCK_DT_SPEC_GET

#define UMP_BLOCK_DT_SPEC_GET ( _node)

#include </__w/zephyr/zephyr/lib/midi2/ump_stream_responder.h>

Value:
{ \
.name = DT_PROP_OR(_node, label, NULL), \
.first_group = DT_REG_ADDR(_node), \
.groups_spanned = DT_REG_SIZE(_node), \
.is_input = !DT_ENUM_HAS_VALUE(_node, terminal_type, output_only), \
.is_output = !DT_ENUM_HAS_VALUE(_node, terminal_type, input_only), \
.is_midi1 = !DT_ENUM_HAS_VALUE(_node, protocol, midi2), \
.is_31250bps = DT_PROP(_node, serial_31250bps), \
}
#define DT_PROP_OR(node_id, prop, default_value)
Like DT_PROP(), but with a fallback to default_value.
Definition devicetree.h:935
#define DT_ENUM_HAS_VALUE(node_id, prop, value)
Does a node enumeration property have a given value?
Definition devicetree.h:1054
#define DT_PROP(node_id, prop)
Get a devicetree property value.
Definition devicetree.h:762
#define DT_REG_ADDR(node_id)
Get a node's (only) register block address.
Definition devicetree.h:2461
#define DT_REG_SIZE(node_id)
Get a node's (only) register block size.
Definition devicetree.h:2482
#define NULL
Definition iar_missing_defs.h:20

Get a Universal MIDI Packet endpoint function block from its device-tree representation.

Parameters
_nodeThe device tree node representing the midi2 block

◆ UMP_BLOCK_SEP_IF_OKAY

#define UMP_BLOCK_SEP_IF_OKAY ( _node)

#include </__w/zephyr/zephyr/lib/midi2/ump_stream_responder.h>

Value:
(UMP_BLOCK_DT_SPEC_GET(_node),), \
())
#define DT_NODE_HAS_STATUS_OKAY(node_id)
Does a node identifier refer to a node with a status okay?
Definition devicetree.h:3690
#define COND_CODE_1(_flag, _if_1_code, _else_code)
Insert code depending on whether _flag expands to 1 or not.
Definition util_macro.h:203
#define UMP_BLOCK_DT_SPEC_GET(_node)
Get a Universal MIDI Packet endpoint function block from its device-tree representation.
Definition ump_stream_responder.h:75

◆ UMP_ENDPOINT_DT_SPEC_GET

#define UMP_ENDPOINT_DT_SPEC_GET ( _node)

#include </__w/zephyr/zephyr/lib/midi2/ump_stream_responder.h>

Value:
{ \
.name = DT_PROP_OR(_node, label, NULL), \
.n_blocks = DT_FOREACH_CHILD_SEP(_node, DT_NODE_HAS_STATUS_OKAY, (+)), \
.blocks = {DT_FOREACH_CHILD(_node, UMP_BLOCK_SEP_IF_OKAY)}, \
}
#define DT_FOREACH_CHILD_SEP(node_id, fn, sep)
Invokes fn for each child of node_id with a separator.
Definition devicetree.h:3153
#define DT_FOREACH_CHILD(node_id, fn)
Invokes fn for each child of node_id.
Definition devicetree.h:3110
#define UMP_BLOCK_SEP_IF_OKAY(_node)
Definition ump_stream_responder.h:86

Get a Universal MIDI Packet endpoint description from the device-tree representation of a midi2 device.

Parameters
_nodeThe device tree node representing a midi2 device

Function Documentation

◆ ump_product_instance_id()

const char * ump_product_instance_id ( void )

#include </__w/zephyr/zephyr/lib/midi2/ump_stream_responder.h>

Returns
The UMP Product Instance ID of this device, based on the device hwinfo if available, otherwise an empty string

◆ ump_stream_respond()

int ump_stream_respond ( const struct ump_stream_responder_cfg * cfg,
const struct midi_ump pkt )

#include </__w/zephyr/zephyr/lib/midi2/ump_stream_responder.h>

Respond to an UMP Stream message.

Parameters
[in]cfgThe responder configuration
[in]pktThe message to respond to
Returns
The number of UMP packets sent as reply, or -errno in case of error