Zephyr API Documentation 4.0.0-rc3
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
usbd_uac2.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023-2024 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
17#ifndef ZEPHYR_INCLUDE_USB_CLASS_USBD_UAC2_H_
18#define ZEPHYR_INCLUDE_USB_CLASS_USBD_UAC2_H_
19
20#include <zephyr/device.h>
21
36#define UAC2_ENTITY_ID(node) \
37 ({ \
38 BUILD_ASSERT(DT_NODE_HAS_COMPAT(DT_PARENT(node), zephyr_uac2)); \
39 UTIL_INC(DT_NODE_CHILD_IDX(node)); \
40 })
41
45struct uac2_ops {
54 void (*sof_cb)(const struct device *dev, void *user_data);
66 void (*terminal_update_cb)(const struct device *dev, uint8_t terminal,
67 bool enabled, bool microframes,
68 void *user_data);
82 void *(*get_recv_buf)(const struct device *dev, uint8_t terminal,
83 uint16_t size, void *user_data);
96 void (*data_recv_cb)(const struct device *dev, uint8_t terminal,
97 void *buf, uint16_t size, void *user_data);
109 void (*buf_release_cb)(const struct device *dev, uint8_t terminal,
110 void *buf, void *user_data);
126 uint32_t (*feedback_cb)(const struct device *dev, uint8_t terminal,
127 void *user_data);
142 uint32_t (*get_sample_rate)(const struct device *dev, uint8_t clock_id,
143 void *user_data);
159 int (*set_sample_rate)(const struct device *dev, uint8_t clock_id,
160 uint32_t rate, void *user_data);
161};
162
170void usbd_uac2_set_ops(const struct device *dev,
171 const struct uac2_ops *ops, void *user_data);
172
186int usbd_uac2_send(const struct device *dev, uint8_t terminal,
187 void *data, uint16_t size);
188
193#endif /* ZEPHYR_INCLUDE_USB_CLASS_USBD_UAC2_H_ */
void usbd_uac2_set_ops(const struct device *dev, const struct uac2_ops *ops, void *user_data)
Register USB Audio 2 application callbacks.
int usbd_uac2_send(const struct device *dev, uint8_t terminal, void *data, uint16_t size)
Send audio data to output terminal.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Runtime device structure (in ROM) per driver instance.
Definition device.h:412
void * data
Address of the device instance private data.
Definition device.h:422
USB Audio 2 application event handlers.
Definition usbd_uac2.h:45
void(* sof_cb)(const struct device *dev, void *user_data)
Start of Frame callback.
Definition usbd_uac2.h:54
void(* buf_release_cb)(const struct device *dev, uint8_t terminal, void *buf, void *user_data)
Transmit buffer release callback.
Definition usbd_uac2.h:109
int(* set_sample_rate)(const struct device *dev, uint8_t clock_id, uint32_t rate, void *user_data)
Set active sample rate.
Definition usbd_uac2.h:159
void(* data_recv_cb)(const struct device *dev, uint8_t terminal, void *buf, uint16_t size, void *user_data)
Data received.
Definition usbd_uac2.h:96
uint32_t(* feedback_cb)(const struct device *dev, uint8_t terminal, void *user_data)
Get Explicit Feedback value.
Definition usbd_uac2.h:126
uint32_t(* get_sample_rate)(const struct device *dev, uint8_t clock_id, void *user_data)
Get active sample rate.
Definition usbd_uac2.h:142
void(* terminal_update_cb)(const struct device *dev, uint8_t terminal, bool enabled, bool microframes, void *user_data)
Terminal update callback.
Definition usbd_uac2.h:66