Merge branch 'docs/update_cn_trans_usb_host.rst' into 'master'

Docs: Update Chinese translation for usb_host.rst

Closes DOC-6624

See merge request espressif/esp-idf!27028
This commit is contained in:
Mo Fei Fei 2023-11-15 11:50:12 +08:00
commit 6ba047bc19
2 changed files with 52 additions and 13 deletions

View File

@ -398,38 +398,37 @@ Host Stack Configuration
Non-Compliant Device Support Non-Compliant Device Support
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
To support USB devices that are non-compliant in various scenarios or exhibit specific behaviors it is possible to configure the USB Host stack. To support USB devices that are non-compliant in various scenarios or exhibit specific behaviors, it is possible to configure the USB Host stack.
As a USB device may be hot-plugged, it is essential to have the configurable delays between power switching and device attachment, and when the device's internal power has stabilized. As a USB device may be hot-plugged, it is essential to have configurable delays between power switching and device attachment, and when the device's internal power has stabilized.
Enumeration Configuration Enumeration Configuration
""""""""""""""""""""""""" """""""""""""""""""""""""
During the process of enumerating connected USB devices, several timeout values ensure the proper functioning of the device. During the process of enumerating connected USB devices, several delay values ensure the proper functioning of the device.
.. figure:: ../../../_static/usb_host/poweron-timings.png .. figure:: ../../../_static/usb_host/poweron-timings.png
:align: center :align: center
:alt: USB Root Hub Power-on and Connection Events Timing :alt: USB Root Hub Power-on and Connection Events Timing
:figclass: align-center
USB Root Hub Power-on and Connection Events Timing USB Root Hub Power-on and Connection Events Timing
The figure above shows all the timeouts associated with both turning on port power with a device connected and hot-plugging a device. The figure above shows all the delay values associated with both turning on port power with a device connected and hot-plugging a device.
* After a port is reset or resumed, the USB System Software is expected to provide a “recovery” interval of 10 ms before the device attached to the port is expected to respond to data transfers. * After a port is reset or resumed, the USB system software is expected to provide a "recovery" interval of 10 ms before the device attached to the port is expected to respond to data transfers.
* After the reset/resume recovery interval, if a device receives a SetAddress() request, the device must be able to complete processing of the request and be able to successfully complete the Status stage of the request within 50 ms. * After the reset/resume recovery interval, if a device receives a ``SetAddress()`` request, the device must be able to complete processing of the request and be able to successfully complete the Status stage of the request within 50 ms.
* After successful completion of the Status stage, the device is allowed a SetAddress() recovery interval of 2 ms. * After successful completion of the Status stage, the device is allowed a ``SetAddress()`` recovery interval of 2 ms.
.. note:: .. note::
For more details regarding connection event timings, please refer to the Universal Serial Bus 2.0 specification, chapter 7.1.7.3 "Connect and Disconnect Signaling". For more details regarding connection event timings, please refer to `USB 2.0 Specification <https://www.usb.org/document-library/usb-20-specification>`_ > Chapter 7.1.7.3 *Connect and Disconnect Signaling*.
Configurable parameters of the USB host stack can be configured with multiple options via Menuconfig. Configurable parameters of the USB host stack can be configured with multiple options via Menuconfig.
* For Debounce delay refer to :ref:`CONFIG_USB_HOST_DEBOUNCE_DELAY_MS` * For debounce delay, refer to :ref:`CONFIG_USB_HOST_DEBOUNCE_DELAY_MS`.
* For Reset hold interval refer to :ref:`CONFIG_USB_HOST_RESET_HOLD_MS` * For reset hold interval, refer to :ref:`CONFIG_USB_HOST_RESET_HOLD_MS`.
* For Reset recovery interval refer to :ref:`CONFIG_USB_HOST_RESET_RECOVERY_MS` * For reset recovery interval, refer to :ref:`CONFIG_USB_HOST_RESET_RECOVERY_MS`.
* Fer SetAddress() recovery interval refer to: :ref:`CONFIG_USB_HOST_SET_ADDR_RECOVERY_MS` * Fer ``SetAddress()`` recovery interval, refer to :ref:`CONFIG_USB_HOST_SET_ADDR_RECOVERY_MS`.
.. -------------------------------------------------- API Reference ---------------------------------------------------- .. -------------------------------------------------- API Reference ----------------------------------------------------

View File

@ -390,6 +390,46 @@ UVC
* USB 视频设备 Class 的主机 Class 驱动程序作为托管组件通过 `ESP-IDF 组件注册器 <https://components.espressif.com/component/espressif/usb_host_uvc>`__ 分发。 * USB 视频设备 Class 的主机 Class 驱动程序作为托管组件通过 `ESP-IDF 组件注册器 <https://components.espressif.com/component/espressif/usb_host_uvc>`__ 分发。
* 示例 :example:`peripherals/usb/host/uvc` 展示了如何使用 UVC 主机驱动程序接收来自 USB 摄像头的视频流,并可选择将该流通过 Wi-Fi 转发。 * 示例 :example:`peripherals/usb/host/uvc` 展示了如何使用 UVC 主机驱动程序接收来自 USB 摄像头的视频流,并可选择将该流通过 Wi-Fi 转发。
.. ---------------------------------------------- USB Host Menuconfig --------------------------------------------------
主机栈配置
----------
非兼容设备支持
^^^^^^^^^^^^^^
为了支持某些非兼容或具有特定行为的 USB 设备,可以对 USB 主机栈进行配置。
USB 设备可能是热插拔的,因此必须配置电源开关和设备连接之间的延迟,以及设备内部电源稳定后的延迟。
枚举配置
""""""""
在枚举已连接 USB 设备的过程中,需要给一些事件配置合适的间隔时间以确保设备正常运行。
.. figure:: ../../../_static/usb_host/poweron-timings.png
:align: center
:alt: USB 根集线器上电和连接事件时序
USB 根集线器上电和连接事件时序
上图展示了与连接设备时开启端口电源和热插拔设备相关的所有间隔时间。
* 端口复位或恢复运行后USB 系统软件应提供 10 毫秒的恢复时间,此后连接到端口的设备才会响应数据传输。
* 恢复时间结束后,如果设备收到 ``SetAddress()`` 请求,设备必须能够完成对该请求的处理,并能在 50 毫秒内成功完成请求的状态 (Status) 阶段。
* 状态阶段结束后,设备允许有 2 毫秒的 ``SetAddress()`` 恢复时间。
.. note::
有关连接事件时序的更多信息,请参阅 `通用串行总线 2.0 规范 <https://www.usb.org/document-library/usb-20-specification>`_ > 第 7.1.7.3 章 *连接和断开信令*
可通过 Menuconfig 选项设置 USB 主机栈的可配置参数。
* :ref:`CONFIG_USB_HOST_DEBOUNCE_DELAY_MS` 用于配置防抖延迟。
* :ref:`CONFIG_USB_HOST_RESET_HOLD_MS` 用于配置重置保持时间。
* :ref:`CONFIG_USB_HOST_RESET_RECOVERY_MS` 用于配置重置恢复时间。
* :ref:`CONFIG_USB_HOST_SET_ADDR_RECOVERY_MS` 用于配置 ``SetAddress()`` 恢复时间。
.. -------------------------------------------------- API Reference ---------------------------------------------------- .. -------------------------------------------------- API Reference ----------------------------------------------------
API 参考 API 参考