Skip to content

Commit 888ae35

Browse files
committed
docs(esp_tinyusb): Updated CHANGELOG.md and README.md
1 parent db96c35 commit 888ae35

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

device/esp_tinyusb/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## [Unreleased]
22

33
- Fixed forward compatibility with TinyUSB 0.19
4+
- Added VBUS monitoring feature for ESP32P4 USB OTG 2.0 (HS)
45

56
## 2.0.1
67

device/esp_tinyusb/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,38 @@ For self-powered devices, monitoring the VBUS voltage is required. To do this:
226226
tinyusb_driver_install(&tusb_cfg);
227227
}
228228
```
229+
230+
> **💡 Note:** **ESP32-P4**, USB OTG 2.0, High-speed doesn't have hardware detection of VBUS BVALID signal
231+
232+
For **ESP32-S2**/**ESP32-S3**, VBUS monitoring (driving the BVALID signal) is handled in hardware.
233+
234+
For **ESP32-P4** (USB OTG 2.0), it is implemented in the driver.
235+
236+
To achieve this, an additional software timer is used in the driver.
237+
238+
To avoid and filter glitches on the VBUS-monitor GPIO, a configurable vbus_debounce_ms parameter is available in the driver configuration.
239+
240+
Default value: 250 ms
241+
242+
If the default value isn’t enough, or if the device does not detach from the USB host port, you can increase the debounce interval:
243+
244+
```c
245+
#include "tinyusb_default_config.h"
246+
#include "sdkconfig.h"
247+
248+
void app_main(void)
249+
{
250+
tinyusb_config_t tusb_cfg = TINYUSB_DEFAULT_CONFIG();
251+
252+
tusb_cfg.phy.self_powered = true;
253+
tusb_cfg.phy.vbus_monitor_io = GPIO_NUM_0;
254+
#if (CONFIG_IDF_TARGET_ESP32P4)
255+
tusb_cfg.phy.vbus_monitor_debounce_ms = 350; // new debounce value
256+
#endif
257+
tinyusb_driver_install(&tusb_cfg);
258+
}
259+
```
260+
229261
If external PHY is used:
230262

231263
```c

0 commit comments

Comments
 (0)