Zephyr API Documentation 4.4.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_device_init (const struct device *uvc_dev, const struct device *video_dev)
 Initialize a video device class.
int uvc_device_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.
int uvc_device_enable (const struct device *const uvc_dev)
 Completes the configuration of an UVC device instance.
int uvc_device_shutdown (const struct device *const uvc_dev)
 Withdraw the configuration of an UVC device instance.

Detailed Description

USB Video Class (UVC) device API.

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

Function Documentation

◆ uvc_device_add_format()

int uvc_device_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 uvc_device_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_device_enable()

int uvc_device_enable ( const struct device *const uvc_dev)

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

Completes the configuration of an UVC device instance.

Prepare an UVC interface for being used.

Note
This function must be called before usbd_init.
Parameters
uvc_devPointer to the UVC device to configure
Returns
0 on success, negative value on error

◆ uvc_device_init()

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

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

Initialize a video device class.

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 uvc_device_enable.
Parameters
uvc_devPointer to the UVC device to configure
video_devPointer to the video device to which controls requests are sent

◆ uvc_device_shutdown()

int uvc_device_shutdown ( const struct device *const uvc_dev)

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

Withdraw the configuration of an UVC device instance.

Reset the configuration of an USB device class, make it ready to be enabled again.

Parameters
uvc_devPointer to the UVC device to deconfigure
Returns
0 on success, negative value on error