Skip to content

Commit d298a66

Browse files
committed
docs(esp_tinyusb): Updated CHANGELOG.md and README.md
1 parent 849e0ae commit d298a66

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
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: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ The default installation automatically configures the port (High-speed if suppor
8181

8282
Default descriptors are provided for the following USB classes: CDC, MSC, and NCM.
8383

84-
> **⚠️ Important:** For demonstration purposes, all error handling logic has been removed from the code examples. Do not ignore proper error handling in actual development.
84+
> ⚠️ For demonstration purposes, all error handling logic has been removed from the code examples. Do not ignore proper error handling in actual development.
8585
8686
```c
8787
#include "tinyusb_default_config.h"
@@ -226,6 +226,46 @@ For self-powered devices, monitoring the VBUS voltage is required. To do this:
226226
tinyusb_driver_install(&tusb_cfg);
227227
}
228228
```
229+
230+
> ⚠️ **ESP32-P4**, USB OTG 2.0, High-speed doesn't have hardware detection of VBUS BVALID signal
231+
232+
To solve this, an additional software timer is implemented in the driver.
233+
234+
To filter glitches on the VBUS-monitor GPIO, a configurable `vbus_debounce_ms` parameter is available.
235+
236+
> **Note:** Default value of debounce timer is 250 ms
237+
238+
> ⚠️ **GPIO ISR** the GPIO driver's ETS_GPIO_INTR_SOURCE ISR handler service must be installed in advance.
239+
240+
The default debounce interval might be changed during the driver configuration:
241+
242+
```c
243+
#include "tinyusb_default_config.h"
244+
#include "sdkconfig.h"
245+
246+
void app_main(void)
247+
{
248+
tinyusb_config_t tusb_cfg = TINYUSB_DEFAULT_CONFIG();
249+
250+
tusb_cfg.phy.self_powered = true;
251+
tusb_cfg.phy.vbus_monitor_io = GPIO_NUM_0;
252+
#if (CONFIG_IDF_TARGET_ESP32P4)
253+
tusb_cfg.phy.vbus_monitor_debounce_ms = 350; // new debounce value
254+
gpio_install_isr_service(ESP_INTR_FLAG_LOWMED);
255+
#endif // CONFIG_IDF_TARGET_ESP32P4
256+
257+
tinyusb_driver_install(&tusb_cfg);
258+
259+
//
260+
261+
tinyusb_driver_uninstall();
262+
263+
#if (CONFIG_IDF_TARGET_ESP32P4)
264+
gpio_uninstall_isr_service();
265+
#endif // CONFIG_IDF_TARGET_ESP32P4
266+
}
267+
```
268+
229269
If external PHY is used:
230270

231271
```c

0 commit comments

Comments
 (0)