File tree Expand file tree Collapse file tree 7 files changed +2947
-0
lines changed Expand file tree Collapse file tree 7 files changed +2947
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Copyright (c) 2025 tinyVision.ai Inc.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ description : |
5
+ USB Video Class (UVC) device instance.
6
+
7
+ Each UVC instance added to the USB Device Controller (UDC) node will be visible
8
+ as a new camera from the host point of view.
9
+
10
+ compatible : " zephyr,uvc-device"
11
+
12
+ include : base.yaml
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2025 tinyVision.ai Inc.
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ /**
8
+ * @file
9
+ * @brief USB Video Class (UVC) public header
10
+ */
11
+
12
+ #ifndef ZEPHYR_INCLUDE_USB_CLASS_USBD_UVC_H
13
+ #define ZEPHYR_INCLUDE_USB_CLASS_USBD_UVC_H
14
+
15
+ #include <zephyr/device.h>
16
+
17
+ /**
18
+ * @brief USB Video Class (UVC) device API
19
+ * @defgroup usbd_uvc USB Video Class (UVC) device API
20
+ * @ingroup usb
21
+ * @since 4.2
22
+ * @version 0.1.0
23
+ * @see uvc: "Universal Serial Bus Device Class Definition for Video Devices"
24
+ * Document Release 1.5 (August 9, 2012)
25
+ * @{
26
+ */
27
+
28
+ /**
29
+ * @brief Set the video device that a UVC instance will use.
30
+ *
31
+ * It will query its supported controls, formats and frame rates, and use this information to
32
+ * generate USB descriptors sent to the host.
33
+ *
34
+ * At runtime, it will forward all USB controls from the host to this device.
35
+ *
36
+ * @note This function must be called before @ref usbd_enable.
37
+ *
38
+ * @param uvc_dev The UVC device
39
+ * @param video_dev The video device that this UVC instance controls
40
+ */
41
+ void uvc_set_video_dev (const struct device * uvc_dev , const struct device * video_dev );
42
+
43
+ #endif /* ZEPHYR_INCLUDE_USB_CLASS_USBD_UVC_H */
Original file line number Diff line number Diff line change @@ -78,6 +78,11 @@ zephyr_library_sources_ifdef(
78
78
class/usbd_midi2.c
79
79
)
80
80
81
+ zephyr_library_sources_ifdef (
82
+ CONFIG_USBD_VIDEO_CLASS
83
+ class/usbd_uvc.c
84
+ )
85
+
81
86
zephyr_library_sources_ifdef (
82
87
CONFIG_USBD_HID_SUPPORT
83
88
class/usbd_hid.c
Original file line number Diff line number Diff line change @@ -12,3 +12,4 @@ rsource "Kconfig.uac2"
12
12
rsource "Kconfig.hid"
13
13
rsource "Kconfig.midi2"
14
14
rsource "Kconfig.dfu"
15
+ rsource "Kconfig.uvc"
Original file line number Diff line number Diff line change
1
+ # Copyright (c) 2025 tinyVision.ai Inc.
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ config USBD_VIDEO_CLASS
6
+ bool "USB Video Class implementation [EXPERIMENTAL]"
7
+ depends on DT_HAS_ZEPHYR_UVC_DEVICE_ENABLED
8
+ select EXPERIMENTAL
9
+ help
10
+ USB Device Video Class (UVC) implementation.
11
+
12
+ if USBD_VIDEO_CLASS
13
+
14
+ config USBD_VIDEO_MAX_FORMATS
15
+ int "Max number of format descriptors"
16
+ range 1 254
17
+ default 32
18
+ help
19
+ The table of format descriptors are generated at runtime. This options plans the
20
+ storage at build time to allow enough descriptors to be generated. The default value
21
+ aims a compromise between enough descriptors for most devices, but not too much memory
22
+ being used.
23
+
24
+ config USBD_VIDEO_MAX_FRMIVAL
25
+ int "Max number of video output stream per USB Video interface"
26
+ range 1 255
27
+ default 8
28
+ help
29
+ Max number of Frame Interval listed on a frame descriptor. The
30
+ default value is selected arbitrarily to fit most situations without
31
+ requiring too much RAM.
32
+
33
+ config USBD_VIDEO_NUM_BUFS
34
+ int "Max number of buffers the UVC class can allocate"
35
+ default 16
36
+ help
37
+ Control the number of buffer UVC can allocate in parallel.
38
+ The default is a compromise to allow enough concurrent buffers but not too much
39
+ memory usage.
40
+
41
+ module = USBD_VIDEO
42
+ module-str = usbd uvc
43
+ default-count = 1
44
+ source "subsys/logging/Kconfig.template.log_config"
45
+
46
+ endif # USBD_VIDEO_CLASS
You can’t perform that action at this time.
0 commit comments