You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: device/esp_tinyusb/include/tinyusb.h
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,7 @@ typedef struct {
51
51
The voltage divider output should be (0.75 * Vdd) if VBUS is 4.4V (lowest valid voltage at device port).
52
52
The comparator thresholds should be set with hysteresis: 4.35V (falling edge) and 4.75V (raising edge). */
53
53
intvbus_monitor_io; /*!< GPIO for VBUS monitoring, 3.3 V tolerant (use a comparator or a resistior divider to detect the VBUS valid condition). Ignored if not self_powered. */
54
+
uint32_tvbus_monitor_debounce_ms; /*!< Debounce delay for VBUS monitoring in milliseconds. Default is 250 ms. Relevant only for ESP32P4 and ignored if not self_powered. */
ESP_RETURN_ON_FALSE(config->port!=TINYUSB_PORT_0, ESP_ERR_INVALID_ARG, TAG, "USB PHY support for OTG1.1 has not been implemented, please update your esp-idf");
101
101
#endif// ESP-IDF supports OTG1.1 peripheral
102
102
#endif// CONFIG_IDF_TARGET_ESP32P4
103
+
104
+
// Device is self powered
105
+
if (config->phy.self_powered) {
106
+
// VBUS monitoring GPIO must be valid
107
+
ESP_RETURN_ON_FALSE(config->phy.vbus_monitor_io >= GPIO_NUM_0&&config->phy.vbus_monitor_io<GPIO_NUM_MAX, ESP_ERR_INVALID_ARG, TAG, "VBUS monitor GPIO must be a valid GPIO number when self_powered is true");
108
+
#if (CONFIG_IDF_TARGET_ESP32P4)
109
+
ESP_RETURN_ON_FALSE(config->phy.vbus_monitor_debounce_ms>0, ESP_ERR_INVALID_ARG, TAG, "VBUS monitor debounce time must be greater than 0 when self_powered is true");
0 commit comments