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
feat(usb/host): Add support for USB dual host on ESP32-P4
In this first version, skip_phy_setup and intr_flags configuration options are common for both ports.
fifo_settings_custom is ignored in dual host mode.
:esp32p4: - {IDF_TARGET_NAME} includes two USB 2.0 OTG peripherals: one High-Speed and one Full-Speed. Both support USB Host functionality. However, due to a current software limitation, only one can operate as a USB Host at a time. Support for dual USB Host operation is planned for a future update.
36
+
:esp32p4: - {IDF_TARGET_NAME} has two USB 2.0 OTG controllers: one High-Speed and one Full-Speed. Each controller can operate as a USB host independently, so either one alone or both together can function as USB hosts simultaneously.
37
37
- Allows multiple class drivers to run simultaneously, i.e., multiple clients of the Host Library.
38
38
- A single device can be used by multiple clients simultaneously, e.g., composite devices.
39
39
- The Host Library itself and the underlying Host Stack does not internally instantiate any OS tasks. The number of tasks is entirely controlled by how the Host Library interface is used. However, a general rule of thumb regarding the number of tasks is ``(the number of host class drivers running + 1)``.
@@ -54,7 +54,6 @@ Currently, the Host Library and the underlying Host Stack has the following limi
54
54
- The External Hub Driver: Remote Wakeup feature is not supported (External Hubs are active, even if there are no devices inserted).
55
55
- The External Hub Driver: Doesn't handle error cases (overcurrent handling, errors during initialization etc. are not implemented yet).
56
56
- The External Hub Driver: No Interface selection. The Driver uses the first available Interface with Hub Class code (09h).
57
-
- The External Port Driver: No downstream port debounce mechanism (not implemented yet).
58
57
:esp32p4: - The External Hub Driver: No Transaction Translator layer (No FS/LS Devices support when a Hub is attached to HS Host).
59
58
60
59
@@ -536,8 +535,7 @@ CDC-ACM
536
535
"""""""
537
536
538
537
* A host class driver for the Communication Device Class (Abstract Control Model) is distributed as a managed component via the `ESP Component Registry <https://components.espressif.com/component/espressif/usb_host_cdc_acm>`__.
539
-
* `cdc_acm_host <https://github.com/espressif/esp-idf/tree/master/examples/peripherals/usb/host/cdc/cdc_acm_host>`__ demonstrates how to use the CDC-ACM Host Driver to enable communication between {IDF_TARGET_NAME} and a USB CDC-ACM device.
540
-
* `cdc_acm_vcp <https://github.com/espressif/esp-idf/tree/master/examples/peripherals/usb/host/cdc/cdc_acm_vcp>`__ demonstrates how to extend the CDC-ACM driver for Virtual Communication Port (VCP) devices like CP210x, FTDI FT23x or CH34x devices, and how to control the device and send data using the CDC-ACM API.
538
+
* `cdc_acm_host <https://github.com/espressif/esp-idf/tree/master/examples/peripherals/usb/host/cdc>`__ demonstrates how to use the CDC-ACM Host Driver to enable communication between {IDF_TARGET_NAME} and a USB CDC-ACM device, including vendor-specific devices such as CP210x, FTDI FT23x or CH34x.
541
539
* The CDC-ACM driver is also used in `esp_modem examples <https://github.com/espressif/esp-protocols/tree/master/components/esp_modem/examples>`__, where it is used for communication with cellular modems.
Copy file name to clipboardExpand all lines: docs/en/usb_host/usb_host_notes_arch.rst
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,13 +26,13 @@ The layers of the Host Stack are described in the following table. The layers ar
26
26
- The HAL (Hardware Abstraction Layer) abstracts the operating steps of the USB controller into functions according to ESP-IDF's `Hardware Abstraction API Guidelines <https://docs.espressif.com/projects/esp-idf/en/stable/{IDF_TARGET_PATH_NAME}/api-guides/hardware-abstraction.html>`__. This layer also abstracts the controller's host port and host channels, and provides APIs to operate the them.
27
27
* - HCD
28
28
- ``hcd.h``, ``hcd.c``
29
-
- The HCD (Host Controller Driver) acts as hardware agnostic API for all USB controllers (i.e., an API that can theoretically be used with any USB controller implementation). This layer also abstracts the root port (i.e., root hub) and USB pipes.
29
+
- The HCD (Host Controller Driver) acts as hardware agnostic API for all USB controllers (i.e., an API that can theoretically be used with any USB controller implementation). This layer also abstracts the root port and USB pipes.
30
30
* - USBH and Hub Driver
31
31
- ``usbh.h``, ``usbh.c``
32
32
- The USBH (USB Host Driver) layer is equivalent to the USBD layer described in chapter 10 of the USB2.0 specification. The USBH presents an abstraction of USB devices, internally manages a list of connected devices (i.e., device pool), and also arbitrates device sharing between clients (i.e., tracks which endpoints are in use and also presents a shared endpoint 0).
33
33
* - Hub Driver
34
-
- ``hub.h``, ``hub.c``
35
-
- The Hub Driver layer acts as a special client of the USBH that is responsible for handling device attachment/detachment, and notifying the USBH of such events. For device attachment, the Hub Driver also handles the enumeration process as well.
34
+
- ``hub.h``, ``hub.c``, ``enum.h``, ``enum.c``
35
+
- The Hub Driver layer implements the Root HUB and acts as a special client of the USBH that is responsible for handling device attachment/detachment, and notifying the USBH of such events. For device attachment, the Hub Driver also handles the enumeration process as well.
36
36
* - USB Host Library
37
37
- ``usb_host.h``, ``usb_host.c``
38
38
- The USB Host Library layer is the lowest public API layer of the Host Stack and presents the concept of USB Host Clients. The abstraction of clients allows for multiple class drivers to coexist simultaneously (where each class roughly maps to a single client) and also acts as a mechanism for division of labor (where each client is responsible for its own processing and event handling).
Copy file name to clipboardExpand all lines: host/usb/CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,12 @@ All notable changes to this component will be documented in this file.
4
4
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
Copy file name to clipboardExpand all lines: host/usb/src/usb_host.c
+59-38Lines changed: 59 additions & 38 deletions
Original file line number
Diff line number
Diff line change
@@ -161,10 +161,10 @@ typedef struct {
161
161
struct {
162
162
SemaphoreHandle_tevent_sem;
163
163
SemaphoreHandle_tmux_lock;
164
-
TimerHandle_tauto_suspend_timer; // Freertos timer used for automatic suspend of the root port
165
-
usb_phy_handle_tphy_handle; // Will be NULL if host library is installed with skip_phy_setup
166
-
void*enum_client; // Pointer to Enum driver (acting as a client). Used to reroute completed USBH control transfers
167
-
void*hub_client; // Pointer to External Hub driver (acting as a client). Used to reroute completed USBH control transfers. NULL, when External Hub Driver not available.
164
+
TimerHandle_tauto_suspend_timer; // Freertos timer used for automatic suspend of the root port
165
+
usb_phy_handle_tphy_handles[HCD_NUM_PORTS]; // One per port; NULL if skip_phy_setup or port not enabled
166
+
void*enum_client; // Pointer to Enum driver (acting as a client). Used to reroute completed USBH control transfers
167
+
void*hub_client; // Pointer to External Hub driver (acting as a client). Used to reroute completed USBH control transfers. NULL, when External Hub Driver not available.
0 commit comments