mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
docs: Update CN translation
This commit is contained in:
@@ -579,7 +579,7 @@ The API of the USB Host Library is separated into the following header files. Ho
|
||||
- `usb/include/usb/usb_helpers.h` contains various helper functions that are related to the USB protocol such as descriptor parsing.
|
||||
- `usb/include/usb/usb_types_stack.h` contains types that are used across multiple layers of the USB Host stack.
|
||||
- `usb/include/usb/usb_types_ch9.h` contains types and macros related to Chapter 9 of the USB2.0 specification, i.e., descriptors and standard requests.
|
||||
- `usb/include/usb/usb_types_ch11.h` contains types and macros related to Chapter 11 of the USB2.0 specification, i.e., hub specifications
|
||||
- `usb/include/usb/usb_types_ch11.h` contains types and macros related to Chapter 11 of the USB2.0 specification, i.e., hub specifications.
|
||||
|
||||
Header File
|
||||
^^^^^^^^^^^
|
||||
@@ -590,11 +590,12 @@ Header File
|
||||
|
||||
#include "usb/usb_host.h"
|
||||
|
||||
- This header file is a part of the API provided by the ``usb`` component. The ``usb`` component is distributed via the `ESP Component Registry <https://components.espressif.com/components/espressif/usb>`__. Thus, to use it, please add the Device Stack component as dependency using the following command:
|
||||
- This header file is a part of the API provided by the ``usb`` component. The ``usb`` component is distributed via the `ESP Component Registry <https://components.espressif.com/components/espressif/usb>`__. Thus, to use it, please add the Host Stack component as dependency using the following command:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
idf.py add-dependency usb
|
||||
|
||||
.. ------------------------------------------------ Maintainers Notes --------------------------------------------------
|
||||
|
||||
Maintainers Notes
|
||||
|
||||
@@ -295,6 +295,6 @@ I2S
|
||||
USB
|
||||
---
|
||||
|
||||
The ``usb`` component is moved to ESP Component Registry
|
||||
The ``usb`` component has been moved to `ESP Component Registry <https://components.espressif.com/components/espressif/usb>`__.
|
||||
|
||||
You can add this dependency to your project by running ``idf.py add-dependency "espressif/usb"``.
|
||||
|
||||
@@ -568,6 +568,34 @@ USB 设备可能是热插拔的,因此必须配置电源开关和设备连接
|
||||
|
||||
在 menuconfig 中启用 `CONFIG_USB_HOST_ENABLE_ENUM_FILTER_CALLBACK` 选项即可启用枚举过滤器。可以通过设置 :cpp:member:`usb_host_config_t::enum_filter_cb` 来指定回调函数,该函数会在调用 :cpp:func:`usb_host_install` 时传递至主机库。
|
||||
|
||||
.. -------------------------------------------------- API Reference ----------------------------------------------------
|
||||
|
||||
API 参考
|
||||
--------
|
||||
|
||||
USB 主机库的 API 包含以下头文件,但应用程序调用该 API 时只需 ``#include "usb/usb_host.h"``,就可以包含所有 USB 主机库的头文件。
|
||||
|
||||
- `usb/include/usb/usb_host.h` 包含 USB 主机库的函数和类型。
|
||||
- `usb/include/usb/usb_helpers.h` 包含与 USB 协议相关的各种辅助函数,如描述符解析等。
|
||||
- `usb/include/usb/usb_types_stack.h` 包含在 USB 主机栈的多个层次中使用的类型。
|
||||
- `usb/include/usb/usb_types_ch9.h` 包含了与 USB 2.0 规范中第 9 章相关的类型和宏,即描述符和标准请求。
|
||||
- `usb/include/usb/usb_types_ch11.h` 包含与 USB2.0 规范第 11 章相关的类型和宏,即集线器规范。
|
||||
|
||||
头文件
|
||||
^^^^^^^
|
||||
|
||||
- ``usb_host.h`` 可以通过以下方式包含:
|
||||
|
||||
.. code:: c
|
||||
|
||||
#include "usb/usb_host.h"
|
||||
|
||||
- 该头文件是 ``usb`` 组件提供的 API 的一部分。``usb`` 组件通过 `乐鑫组件注册表 <https://components.espressif.com/components/espressif/usb>`__ 分发。因此,若要使用该组件,请通过以下命令将 Host Stack 组件添加为依赖项:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
idf.py add-dependency usb
|
||||
|
||||
.. ------------------------------------------------ Maintainers Notes --------------------------------------------------
|
||||
|
||||
维护注意事项
|
||||
|
||||
@@ -291,3 +291,10 @@ I2S
|
||||
---
|
||||
|
||||
- ``i2s_port_t`` 类型已被移除。请使用 ``int`` 类型代替。该类型原有的 enum 项 ``I2S_NUM_0``,``I2S_NUM_1``,``I2S_NUM_2`` 和 ``I2S_NUM_AUTO`` 已用宏定义代替,以保证兼容性。
|
||||
|
||||
USB
|
||||
---
|
||||
|
||||
``usb`` 组件已迁移至 `乐鑫组件注册表 <https://components.espressif.com/components/espressif/usb>`__。
|
||||
|
||||
你可以通过运行 ``idf.py add-dependency "espressif/usb"``,将此依赖添加到项目中。
|
||||
|
||||
Reference in New Issue
Block a user