Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
usbd_uac2.h File Reference

USB Audio Class 2 device public header. More...

#include <zephyr/device.h>

Go to the source code of this file.

Data Structures

struct  uac2_ops
 USB Audio 2 application event handlers. More...
 

Macros

#define UAC2_ENTITY_ID(node)
 

Functions

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.
 

Detailed Description

USB Audio Class 2 device public header.

This header describes only class API interaction with application. The audio device itself is modelled with devicetree zephyr,uac2 compatible.

This API is currently considered experimental.

Macro Definition Documentation

◆ UAC2_ENTITY_ID

#define UAC2_ENTITY_ID (   node)
Value:
({ \
BUILD_ASSERT(DT_NODE_HAS_COMPAT(DT_PARENT(node), zephyr_uac2)); \
UTIL_INC(DT_NODE_CHILD_IDX(node)); \
})
#define DT_NODE_HAS_COMPAT(node_id, compat)
Does a devicetree node match a compatible?
Definition: devicetree.h:3274
#define DT_NODE_CHILD_IDX(node_id)
Get a devicetree node's index into its parent's list of children.
Definition: devicetree.h:552
#define DT_PARENT(node_id)
Get a node identifier for a parent node.
Definition: devicetree.h:361

Function Documentation

◆ usbd_uac2_send()

int usbd_uac2_send ( const struct device dev,
uint8_t  terminal,
void *  data,
uint16_t  size 
)

Send audio data to output terminal.

Parameters
devUSB Audio 2 device
terminalOutput Terminal ID linked to AudioStreaming interface
dataBuffer containing outgoing data
sizeNumber of bytes to send
Returns
0 on success, negative value on error

◆ usbd_uac2_set_ops()

void usbd_uac2_set_ops ( const struct device dev,
const struct uac2_ops ops,
void *  user_data 
)

Register USB Audio 2 application callbacks.

Parameters
devUSB Audio 2 device instance
opsUSB Audio 2 callback structure
user_dataOpaque user data to pass to ops callbacks