Zephyr API Documentation 4.3.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
USB Video Class (UVC) device API

USB Video Class (UVC) device API. More...

Functions

void uvc_set_video_dev (const struct device *uvc_dev, const struct device *video_dev)
 Set the video device that a UVC instance will use for control requests.
int uvc_add_format (const struct device *const uvc_dev, const struct video_format *const fmt)
 Add a video format that a UVC instance will present to the host.

Detailed Description

USB Video Class (UVC) device API.

Since
4.2
Version
0.1.0
See also
uvc: "Universal Serial Bus Device Class Definition for Video Devices" Document Release 1.5 (August 9, 2012)

Function Documentation

◆ uvc_add_format()

int uvc_add_format ( const struct device *const uvc_dev,
const struct video_format *const fmt )

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

Add a video format that a UVC instance will present to the host.

This information will be used to generate USB descriptors. The particular format selected by the host can be queried with video_get_format.

Note
This function must be called before usbd_enable.
The fmt struct field size must be set prior to call this function, such as calling video_set_format().
Parameters
uvc_devPointer to the UVC device to configure
fmtThe video format to add to this UVC instance
Returns
0 on success, negative value on error

◆ uvc_set_video_dev()

void uvc_set_video_dev ( const struct device * uvc_dev,
const struct device * video_dev )

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

Set the video device that a UVC instance will use for control requests.

It will query its supported video controls and frame intervals and use this information to generate the USB descriptors presented to the host. In addition, for every supported UVC control request from the host to this uvc_dev instance, it will issue a matching video API control request to video_dev.

Note
This function must be called before usbd_enable.
Parameters
uvc_devPointer to the UVC device to configure
video_devPointer to the video device to which controls requests are sent