TinyUVC 0.1.0
Header-only USB Video Class (UVC) device: turn an MCU into a USB webcam
Loading...
Searching...
No Matches
TinyUVC.h
Go to the documentation of this file.
1#pragma once
27#include "TinyUVC/UVCConfig.h"
28
29// ------------------------------------------------------- platform selection
30#if !defined(TINYUVC_PLATFORM_ESP32) && !defined(TINYUVC_PLATFORM_TINYUSB) && \
31 !defined(TINYUVC_PLATFORM_DESKTOP) && !defined(TINYUVC_PLATFORM_CUSTOM)
32
33#if defined(ARDUINO_ARCH_ESP32)
34#include "sdkconfig.h"
35#include "soc/soc_caps.h"
36#if !SOC_USB_OTG_SUPPORTED
37#error "TinyUVC: this ESP32 has no USB OTG peripheral - use an ESP32-S2, S3 or P4"
38#elif defined(TINYUVC_USE_ADAFRUIT_TINYUSB)
39#define TINYUVC_PLATFORM_TINYUSB
40#elif CONFIG_TINYUSB_ENABLED && !ARDUINO_USB_MODE
41#define TINYUVC_PLATFORM_ESP32
42#else
43#error "TinyUVC: select Tools > USB Mode > 'USB-OTG (TinyUSB)'"
44#endif
45
46#elif defined(ARDUINO_ARCH_RP2040) && !defined(USE_TINYUSB)
47#error "TinyUVC: select Tools > USB Stack > 'Adafruit TinyUSB'"
48
49#elif defined(ARDUINO) && !defined(HOST)
50#define TINYUVC_PLATFORM_TINYUSB
51
52#elif defined(__linux__) || defined(__APPLE__) || defined(_WIN32) || defined(HOST)
53#define TINYUVC_PLATFORM_DESKTOP
54
55#else
56#error "TinyUVC: unsupported platform"
57#endif
58#endif
59
60#if defined(TINYUVC_PLATFORM_DESKTOP) && !defined(TINYUVC_DESKTOP)
61#define TINYUVC_DESKTOP
62#endif
63
64// ------------------------------------------------------------ the library
65#include "TinyUVC/UVCDevice.h"
66#include "TinyUVC/UVCMemory.h"
67
68#if defined(TINYUVC_PLATFORM_ESP32)
70#elif defined(TINYUVC_PLATFORM_TINYUSB)
72#elif defined(TINYUVC_PLATFORM_DESKTOP)
74#endif
75
76#include "TinyUVC/UVCTinyUSB.h"
77
78#if defined(TINYUVC_PLATFORM_DESKTOP)
80#endif
81
82#if !defined(TINYUVC_NO_USING_NAMESPACE)
83using namespace tinyuvc;
84#endif
Compile-time limits and defaults of TinyUVC. Every value can be overridden with a build flag (-DTINYU...
The USB Video Class device: descriptors, probe/commit negotiation and streaming of frames....
Desktop only: plays the USB host (and the TinyUSB core) for a UVCDevice, so the complete device side ...
Memory for frame sized buffers, taken from PSRAM where the board has it: ESP32 with PSRAM enabled (To...
Desktop platform: there is no USB device controller, the device is driven by UVCHostSimulator (deskto...
ESP32-S2/S3/P4 with the TinyUSB stack of the arduino-esp32 core (Tools > USB Mode > "USB-OTG (TinyUSB...
The generic TinyUSB platform layer, for every board that uses the Adafruit TinyUSB Library (Adafruit_...
Connects UVCDevice to TinyUSB as an application class driver (usbd_app_driver_get_cb())....
TinyUVC: USB Video Class (UVC) device for Arduino and the desktop.