|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
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. | |
APIs for manipulating video controls.
#include <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.
| dev | Video device to query. |
| bpp | Amount of bits per pixel of the pixel format produced by the device |
| lane_nb | Number of CSI-2 lanes used |
| int video_get_ctrl | ( | const struct device * | dev, |
| struct video_control * | control ) |
#include <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.
| dev | Pointer to the device structure. |
| control | Pointer to the video control struct. |
| 0 | on success. |
| -EINVAL | Parameters are invalid. |
| -ENOTSUP | Format is not supported. |
| -EIO | General input / output error. |
| void video_print_ctrl | ( | const struct video_ctrl_query *const | cq | ) |
#include <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.
| cq | Pointer to the control query struct. |
| int video_query_ctrl | ( | struct video_ctrl_query * | cq | ) |
#include <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.
| cq | Pointer to the control query struct. |
| 0 | on success. |
| -EINVAL | Control id is invalid. |
| -ENOTSUP | Control id is not supported. |
| int video_set_ctrl | ( | const struct device * | dev, |
| struct video_control * | control ) |
#include <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.
| dev | Pointer to the device structure for the driver instance. |
| control | Pointer to the video control struct. |
| 0 | on success. |
| -EINVAL | Parameters are invalid. |
| -ENOTSUP | Format is not supported. |
| -EIO | General input / output error. |