16#include <esp_heap_caps.h>
18#include "../UVCDevice.h"
19#include "esp32-hal-tinyusb.h"
25#if defined(TUD_OPT_HIGH_SPEED) && TUD_OPT_HIGH_SPEED
35 if (dev ==
nullptr)
return 0;
36 const uint8_t str = tinyusb_add_string_descriptor(dev->
name());
37 const uint8_t ep = tinyusb_get_free_in_endpoint();
52 USB.usbClass(TUSB_CLASS_MISC);
53 USB.usbSubClass(MISC_SUBCLASS_COMMON);
54 USB.usbProtocol(MISC_PROTOCOL_IAD);
58 "could not add the camera: USB was already started. Select Tools > "
59 "USB CDC On Boot: Disabled and call begin() before USB.begin()");
65inline void end(UVCDevice &) {}
67inline void idle() { delay(1); }
68inline uint32_t
millis() { return ::millis(); }
69inline uint32_t
micros() { return ::micros(); }
72 size = (size + 63) & ~(
size_t)63;
73 return (uint8_t *)heap_caps_aligned_alloc(64, size,
74 MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL);
76inline void freeBuffer(uint8_t *buf) { heap_caps_free(buf); }
#define TINYUVC_LOGE(...)
Definition UVCLogger.h:75
USB Video Class (UVC 1.1) device - a USB webcam.
Definition UVCDevice.h:95
static UVCDevice *& instance()
The active device.
Definition UVCDevice.h:346
const char * name() const
Definition UVCDevice.h:176
uint16_t descriptorLength() const
Length of the function descriptors.
Definition UVCDevice.h:352
uint16_t buildDescriptor(uint8_t *buf, uint16_t bufLen, uint8_t controlItf, uint8_t endpointIn, uint16_t maxPacketSize, uint8_t stringIndex)
Definition UVCDevice.h:361
TinyUVC: USB Video Class (UVC) device for Arduino and the desktop.