Skip to content

Allow STM32 DCMIPP to work with UVC sample #94562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions doc/releases/migration-guide-4.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ Stepper

* :dtcompatible:`zephyr,gpio-stepper` has been replaced by :dtcompatible:`zephyr,h-bridge-stepper`.

USB
===

* The USB Video Class was configuring the framerate and format of the source video device.
This is now to be done by the application after the host selected the format (:github:`93192`).

.. zephyr-keep-sorted-stop

Bluetooth
Expand Down
6 changes: 6 additions & 0 deletions doc/releases/release-notes-4.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ New APIs and options

* :kconfig:option:`CONFIG_SETTINGS_TFM_ITS`

* USB

* Video

* :c:func:`uvc_add_format`

.. zephyr-keep-sorted-stop

New Boards
Expand Down
21 changes: 21 additions & 0 deletions drivers/video/video_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,3 +443,24 @@ int64_t video_get_csi_link_freq(const struct device *dev, uint8_t bpp, uint8_t l
/* CSI D-PHY is using a DDR data bus so bitrate is twice the frequency */
return ctrl.val64 * bpp / (2 * lane_nb);
}

int video_set_compose_format(const struct device *dev, struct video_format *fmt)
{
struct video_selection sel = {
.type = fmt->type,
.target = VIDEO_SEL_TGT_COMPOSE,
.rect.left = 0,
.rect.top = 0,
.rect.width = fmt->width,
.rect.height = fmt->height,
};
int ret;

ret = video_set_selection(dev, &sel);
if (ret < 0 && ret != -ENOSYS) {
LOG_ERR("Unable to set selection compose");
return ret;
}

return video_set_format(dev, fmt);
}
Loading
Loading