Zephyr API 3.6.99
Loading...
Searching...
No Matches
USB Audio Class 2 device API

USB Audio Class 2 device API . More...

Data Structures

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

Macros

#define UAC2_ENTITY_ID(node)
 Get entity ID.
 

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 API .

Macro Definition Documentation

◆ UAC2_ENTITY_ID

#define UAC2_ENTITY_ID ( node)

#include <zephyr/usb/class/usbd_uac2.h>

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:3465
#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

Get entity ID.

Parameters
nodenode identifier

Function Documentation

◆ usbd_uac2_send()

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

#include <zephyr/usb/class/usbd_uac2.h>

Send audio data to output terminal.

Data buffer must be sufficiently aligned and otherwise suitable for use by UDC driver.

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 )

#include <zephyr/usb/class/usbd_uac2.h>

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