@@ -63,7 +63,10 @@ struct midi_ump {
6363#define UMP_MT_DATA_128 0x05
6464/** Flex Data Messages */
6565#define UMP_MT_FLEX_DATA 0x0d
66- /** UMP Stream Message */
66+ /**
67+ * UMP Stream Message
68+ * @see midi_ump_stream
69+ */
6770#define UMP_MT_UMP_STREAM 0x0f
6871/** @} */
6972
@@ -208,6 +211,149 @@ struct midi_ump {
208211#define UMP_SYS_RESET 0xff /**< Reset (no param) */
209212/** @} */
210213
214+
215+ /**
216+ * @defgroup midi_ump_stream UMP Stream specific fields
217+ * @ingroup midi_ump
218+ * @see ump112: 7.1 UMP Stream Messages
219+ *
220+ * @{
221+ */
222+
223+ /**
224+ * @brief Format of a UMP Stream message
225+ * @param[in] ump Universal MIDI Packet (containing a UMP Stream message)
226+ * @see midi_ump_stream_format
227+ */
228+ #define UMP_STREAM_FORMAT (ump ) \
229+ (((ump).data[0] >> 26) & BIT_MASK(2))
230+
231+ /**
232+ * @defgroup midi_ump_stream_format UMP Stream format
233+ * @ingroup midi_ump_stream
234+ * @see ump112: 7.1 UMP Stream Messages: Format
235+ * @remark When UMP_MT(x)=UMP_MT_UMP_STREAM,
236+ * then UMP_STREAM_FORMAT(x) may be one of:
237+ * @{
238+ */
239+
240+ /** Complete message in one UMP */
241+ #define UMP_STREAM_FORMAT_COMPLETE 0x00
242+ /** Start of a message which spans two or more UMPs */
243+ #define UMP_STREAM_FORMAT_START 0x01
244+ /** Continuing a message which spans three or more UMPs.
245+ * There might be multiple Continue UMPs in a single message
246+ */
247+ #define UMP_STREAM_FORMAT_CONTINUE 0x02
248+ /** End of message which spans two or more UMPs */
249+ #define UMP_STREAM_FORMAT_END 0x03
250+
251+ /** @} */
252+
253+ /**
254+ * @brief Status field of a UMP Stream message
255+ * @param[in] ump Universal MIDI Packet (containing a UMP Stream message)
256+ * @see midi_ump_stream_status
257+ */
258+ #define UMP_STREAM_STATUS (ump ) \
259+ (((ump).data[0] >> 16) & BIT_MASK(10))
260+
261+ /**
262+ * @defgroup midi_ump_stream_status UMP Stream status
263+ * @ingroup midi_ump_stream
264+ * @see ump112: 7.1 UMP Stream Messages
265+ * @remark When UMP_MT(x)=UMP_MT_UMP_STREAM,
266+ * then UMP_STREAM_STATUS(x) may be one of:
267+ * @{
268+ */
269+
270+ /** Endpoint Discovery Message */
271+ #define UMP_STREAM_STATUS_EP_DISCOVERY 0x00
272+ /** Endpoint Info Notification Message */
273+ #define UMP_STREAM_STATUS_EP_INFO 0x01
274+ /** Device Identity Notification Message */
275+ #define UMP_STREAM_STATUS_DEVICE_IDENT 0x02
276+ /** Endpoint Name Notification */
277+ #define UMP_STREAM_STATUS_EP_NAME 0x03
278+ /** Product Instance Id Notification Message */
279+ #define UMP_STREAM_STATUS_PROD_ID 0x04
280+ /** Stream Configuration Request Message */
281+ #define UMP_STREAM_STATUS_CONF_REQ 0x05
282+ /** Stream Configuration Notification Message */
283+ #define UMP_STREAM_STATUS_CONF_NOTIF 0x06
284+ /** Function Block Discovery Message */
285+ #define UMP_STREAM_STATUS_FB_DISCOVERY 0x10
286+ /** Function Block Info Notification */
287+ #define UMP_STREAM_STATUS_FB_INFO 0x11
288+ /** Function Block Name Notification */
289+ #define UMP_STREAM_STATUS_FB_NAME 0x12
290+ /** @} */
291+
292+ /**
293+ * @brief Filter bitmap of an Endpoint Discovery message
294+ * @param[in] ump Universal MIDI Packet (containing an Endpoint Discovery message)
295+ * @see ump112: 7.1.1 Endpoint Discovery Message
296+ * @see midi_ump_ep_disc
297+ */
298+ #define UMP_STREAM_EP_DISCOVERY_FILTER (ump ) \
299+ ((ump).data[1] & BIT_MASK(8))
300+
301+ /**
302+ * @defgroup midi_ump_ep_disc UMP Stream endpoint discovery message filter bits
303+ * @ingroup midi_ump_stream
304+ * @see ump112: 7.1.1 Fig. 12: Endpoint Discovery Message Filter Bitmap Field
305+ * @remark When UMP_MT(x)=UMP_MT_UMP_STREAM and
306+ * UMP_STREAM_STATUS(x)=UMP_STREAM_STATUS_EP_DISCOVERY,
307+ * then UMP_STREAM_EP_DISCOVERY_FILTER(x) may be an ORed combination of:
308+ * @{
309+ */
310+
311+ /** Requesting an Endpoint Info Notification */
312+ #define UMP_EP_DISC_FILTER_EP_INFO BIT(0)
313+ /** Requesting a Device Identity Notification */
314+ #define UMP_EP_DISC_FILTER_DEVICE_ID BIT(1)
315+ /** Requesting an Endpoint Name Notification */
316+ #define UMP_EP_DISC_FILTER_EP_NAME BIT(2)
317+ /** Requesting a Product Instance Id Notification */
318+ #define UMP_EP_DISC_FILTER_PRODUCT_ID BIT(3)
319+ /** Requesting a Stream Configuration Notification */
320+ #define UMP_EP_DISC_FILTER_STREAM_CFG BIT(4)
321+ /** @} */
322+
323+ /**
324+ * @brief Filter bitmap of a Function Block Discovery message
325+ * @param[in] ump Universal MIDI Packet (containing a Function Block Discovery message)
326+ * @see ump112: 7.1.7 Function Block Discovery Message
327+ * @see midi_ump_fb_disc
328+ */
329+ #define UMP_STREAM_FB_DISCOVERY_FILTER (ump ) \
330+ ((ump).data[0] & BIT_MASK(8))
331+
332+ /**
333+ * @brief Block number requested in a Function Block Discovery message
334+ * @param[in] ump Universal MIDI Packet (containing a Function Block Discovery message)
335+ * @see ump112: 7.1.7 Function Block Discovery Message
336+ */
337+ #define UMP_STREAM_FB_DISCOVERY_NUM (ump ) \
338+ (((ump).data[0] >> 8) & BIT_MASK(8))
339+
340+ /**
341+ * @defgroup midi_ump_fb_disc UMP Stream Function Block discovery message filter bits
342+ * @ingroup midi_ump_stream
343+ * @see ump112: 7.1.7 Fig. 21: Function Block Discovery Filter Bitmap Field Format
344+ * @remark When UMP_MT(x)=UMP_MT_UMP_STREAM and
345+ * UMP_STREAM_STATUS(x)=UMP_STREAM_STATUS_FB_DISCOVERY,
346+ * then UMP_STREAM_FB_DISCOVERY_FILTER(x) may be an ORed combination of:
347+ * @{
348+ */
349+ /** Requesting a Function Block Info Notification */
350+ #define UMP_FB_DISC_FILTER_INFO BIT(0)
351+ /** Requesting a Function Block Name Notification */
352+ #define UMP_FB_DISC_FILTER_NAME BIT(1)
353+ /** @} */
354+
355+ /** @} */
356+
211357/** @} */
212358
213359#ifdef __cplusplus
0 commit comments