Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

APIs for manipulating video controls. More...

Functions

int video_set_ctrl (const struct device *dev, struct video_control *control)
 Set the value of a control.
int video_get_ctrl (const struct device *dev, struct video_control *control)
 Get the current value of a control.
int video_query_ctrl (struct video_ctrl_query *cq)
 Query information about a control.
void video_print_ctrl (const struct video_ctrl_query *const cq)
 Print all the information of a control.
int64_t video_get_csi_link_freq (const struct device *dev, uint8_t bpp, uint8_t lane_nb)
 Return the link-frequency advertised by a device.

Detailed Description

APIs for manipulating video controls.

Function Documentation

◆ video_get_csi_link_freq()

int64_t video_get_csi_link_freq ( const struct device * dev,
uint8_t bpp,
uint8_t lane_nb )

#include <zephyr/video/video.h>

Return the link-frequency advertised by a device.

Device exposing a CSI link should advertise at least one of the following two controls:

At first the helper will try read the VIDEO_CID_LINK_FREQ and if not available will approximate the link-frequency from the VIDEO_CID_PIXEL_RATE value, taking into consideration the bits per pixel of the format and the number of lanes.

Parameters
devVideo device to query.
bppAmount of bits per pixel of the pixel format produced by the device
lane_nbNumber of CSI-2 lanes used

◆ video_get_ctrl()

int video_get_ctrl ( const struct device * dev,
struct video_control * control )

#include <zephyr/video/video.h>

Get the current value of a control.

This retrieve the value of a video control, value type depends on control ID, and must be interpreted accordingly.

Parameters
devPointer to the device structure.
controlPointer to the video control struct.
Return values
0on success.
-EINVALParameters are invalid.
-ENOTSUPFormat is not supported.
-EIOGeneral input / output error.

◆ video_print_ctrl()

void video_print_ctrl ( const struct video_ctrl_query *const cq)

#include <zephyr/video/video.h>

Print all the information of a control.

Print all the information of a control including its name, type, flag, range, menu (if any) and current value, i.e. by invoking the video_get_ctrl(), in a human readable format.

Parameters
cqPointer to the control query struct.

◆ video_query_ctrl()

int video_query_ctrl ( struct video_ctrl_query * cq)

#include <zephyr/video/video.h>

Query information about a control.

Applications set the id field of the query structure, the function fills the rest of this structure. It is possible to enumerate base class controls (i.e., VIDEO_CID_BASE + x) by calling this function with successive id values starting from VIDEO_CID_BASE up to and exclusive VIDEO_CID_LASTP1. The function may return -ENOTSUP if a control in this range is not supported. Applications can also enumerate private controls by starting at VIDEO_CID_PRIVATE_BASE and incrementing the id until the driver returns -ENOTSUP. For other control classes, it's a bit more difficult. Hence, the best way to enumerate all kinds of device's supported controls is to iterate with VIDEO_CTRL_FLAG_NEXT_CTRL.

Parameters
cqPointer to the control query struct.
Return values
0on success.
-EINVALControl id is invalid.
-ENOTSUPControl id is not supported.

◆ video_set_ctrl()

int video_set_ctrl ( const struct device * dev,
struct video_control * control )

#include <zephyr/video/video.h>

Set the value of a control.

This set the value of a video control, value type depends on control ID, and must be interpreted accordingly.

Parameters
devPointer to the device structure for the driver instance.
controlPointer to the video control struct.
Return values
0on success.
-EINVALParameters are invalid.
-ENOTSUPFormat is not supported.
-EIOGeneral input / output error.