mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-09 22:21:10 +00:00
docs(ext_port): Maintainers Notes for the External Port Driver
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
USB Host External Port Driver (Ext Port)
|
||||
========================================
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
The External Port Driver (henceforth referred to as Ext Port Driver) isolates the handling process for downstream facing ports, which are provided by the Ext Hub Driver.
|
||||
|
||||
.. note::
|
||||
|
||||
For more detailed information, please refer to `USB 2.0 Specification <https://www.usb.org/document-library/usb-20-specification>`_ > Chapter 11.5 **Downstream Facing Ports**.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
Host Stack Requirements
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The Ext Port Driver takes into consideration the requirements set for the overall Host Stack (see :doc:`./usb_host_notes_design`):
|
||||
|
||||
- The Ext Port Driver must not instantiate any tasks/threads
|
||||
- The Ext Port Driver must be event driven, providing event callbacks and an event processing function
|
||||
- The Ext Port Driver must use only API from underlying layer (The Ext Hub Driver)
|
||||
|
||||
Implementation & Usage
|
||||
----------------------
|
||||
|
||||
Host Stack Interaction
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The Ext Port Driver is a part of The Ext Hub Driver, so the interaction and hierarchical place in USB Host Stack is the same as for the Ext Hub Driver. The Ext Hub and the Ext Port Drivers were split into two Drivers to achieve the goal of logic distinguishing between external Hubs and Downstream Facing Ports handling.
|
||||
|
||||
Ports handling
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
The Ext Port Driver can be installed via ``ext_port_install()`` call and uninstalled via ``ext_port_uninstall()`` call.
|
||||
|
||||
After installation, the Ext Port Driver API could be requested via ``ext_port_get_driver()`` call.
|
||||
|
||||
The Ext Port Driver API
|
||||
-----------------------
|
||||
|
||||
The Ext Port Driver provides an API, which could be split into three groups: object control, device control and general.
|
||||
|
||||
The Ext Port Driver: Object Control
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Create object
|
||||
- Delete object
|
||||
|
||||
The Ext Port Driver: Port Control
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Reset
|
||||
- Disable
|
||||
- Recycle
|
||||
- Activate
|
||||
- Get Speed
|
||||
- Get status
|
||||
- Set status
|
||||
- Gone
|
||||
|
||||
The Ext Port Driver: General Purpose
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Request processing
|
||||
|
||||
Events & Processing
|
||||
-------------------
|
||||
|
||||
The Ext Port Driver is completely event driven and all event handling is done via the ``ext_port_process()`` function. The ``ext_port_driver_config_t.proc_req_cb`` callback provided on the Ext Port Driver installation will be called when processing is required. Typically, ``ext_port_process()`` will be called from the Hub Driver ``hub_process()`` processing function.
|
||||
|
||||
The Ext Port Driver exposes the following events via ``ext_port_driver_config_t.event_cb``:
|
||||
|
||||
- ``EXT_PORT_CONNECTED`` Downstream facing port has a device connection event
|
||||
- ``EXT_PORT_RESET_COMPLETED`` Downstream facing port has a device and completed the port reset
|
||||
- ``EXT_PORT_DISCONNECTED`` Downstream facing port has a device disconnection event
|
||||
|
||||
The Ext Port Driver ports processing is based on the Hub class-specific request ``Get Port Status``.
|
||||
|
||||
After successful completion of the class-specific request ``Get Port Status`` and setting the new port status, the Ext Port Driver continues the port handling while it is required by ports' state and status.
|
||||
|
||||
.. note::
|
||||
|
||||
For more detailed information, please refer to `USB 2.0 Specification <https://www.usb.org/document-library/usb-20-specification>`_ > Chapter 11.24.2.7 **Get Port Status**
|
@@ -24,6 +24,7 @@ This document is split into the following sections:
|
||||
usb_host_notes_usbh
|
||||
usb_host_notes_enum
|
||||
usb_host_notes_ext_hub
|
||||
usb_host_notes_ext_port
|
||||
|
||||
Todo:
|
||||
|
||||
@@ -40,21 +41,3 @@ Introduction
|
||||
The ESP-IDF USB Host Stack allows the {IDF_TARGET_NAME} to operate as a USB Host. Operating as a USB Host allows the {IDF_TARGET_NAME} to communicate with a wide range of USB devices. However, most USB Host Stack implementations do not run on embedded hardware (i.e., runs on PCs and smartphones), thus have comparatively more resources (i.e., memory and CPU speed).
|
||||
|
||||
The implementation of the ESP-IDF USB Host Stack (henceforth referred to as the Host Stack) takes into account the embedded nature of the {IDF_TARGET_NAME} which is reflected in various aspects of the Host Stack's design.
|
||||
|
||||
Features & Limitations
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
**The Host Stack currently supports the following notable features:**
|
||||
|
||||
.. only:: esp32p4
|
||||
|
||||
- Supports HS (High Speed)
|
||||
|
||||
- Supports FS (Full Speed) and LS (Low Speed) devices
|
||||
- Supports all transfer types (Control, Bulk, Isochronous, and Interrupt)
|
||||
- Automatically enumerates connected devices
|
||||
- Allows multiple class drivers (i.e., Clients of the USB Host Library) to run simultaneously and share the same device (i.e., composite devices)
|
||||
|
||||
**The Host Stack currently has the following notable limitations:**
|
||||
|
||||
- No Hub support (currently only supports a single device)
|
||||
|
Reference in New Issue
Block a user