2#if defined(USE_ESP32_VARIANT_ESP32P4) || defined(USE_ESP32_VARIANT_ESP32S2) || defined(USE_ESP32_VARIANT_ESP32S3) || \
3 defined(USE_ESP32_VARIANT_ESP32S31) || defined(USE_ESP32_VARIANT_ESP32H4)
23static const char *
const DEFAULT_USB_STR =
"ESPHome";
27 void setup()
override;
74 .bLength =
sizeof(tusb_desc_device_t),
75 .bDescriptorType = TUSB_DESC_DEVICE,
77 .bDeviceClass = TUSB_CLASS_MISC,
78 .bDeviceSubClass = MISC_SUBCLASS_COMMON,
79 .bDeviceProtocol = MISC_PROTOCOL_IAD,
80 .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
83 .bcdDevice = CONFIG_TINYUSB_DESC_BCD_DEVICE,
87 .bNumConfigurations = 1,
tinyusb_config_t tusb_cfg_
void set_usb_desc_serial(const char *usb_desc_serial)
void set_usb_desc_product(const char *usb_desc_product)
void set_usb_desc_lang_id(uint16_t lang_id)
const char * string_descriptor_[SIZE]
void set_usb_desc_vendor_id(uint16_t vendor_id)
tusb_desc_device_t usb_descriptor_
void add_on_mount_state_callback(F &&callback)
Called with the new mount state whenever a host mounts or unmounts the device.
float get_setup_priority() const override
LazyCallbackManager< void(bool)> mount_state_callback_
void dump_config() override
void set_vbus_monitor_pin(int pin)
Self-powered device: watch VBUS on this GPIO so a cable pull becomes a detach.
char usb_desc_lang_id_[2]
void set_usb_desc_product_id(uint16_t product_id)
bool is_mounted() const
True while a USB host has enumerated and configured the device.
void set_usb_desc_manufacturer(const char *usb_desc_manufacturer)
bool last_reported_mounted_
void set_full_speed_config(const uint8_t *descriptor)
Configuration descriptor from a class component that esp_tinyusb has no built-in default for (HID).
constexpr float BUS
For communication buses like i2c/spi.