diff --git a/docs/en/api-reference/peripherals/usb_host.rst b/docs/en/api-reference/peripherals/usb_host.rst index 1507c991fd..c318c06eb6 100644 --- a/docs/en/api-reference/peripherals/usb_host.rst +++ b/docs/en/api-reference/peripherals/usb_host.rst @@ -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 `__. 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 `__. 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 diff --git a/docs/en/migration-guides/release-6.x/6.0/peripherals.rst b/docs/en/migration-guides/release-6.x/6.0/peripherals.rst index 5270ed6a4f..411abcd092 100644 --- a/docs/en/migration-guides/release-6.x/6.0/peripherals.rst +++ b/docs/en/migration-guides/release-6.x/6.0/peripherals.rst @@ -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 `__. You can add this dependency to your project by running ``idf.py add-dependency "espressif/usb"``. diff --git a/docs/zh_CN/api-reference/peripherals/usb_host.rst b/docs/zh_CN/api-reference/peripherals/usb_host.rst index b203b819c6..f83000d2c0 100644 --- a/docs/zh_CN/api-reference/peripherals/usb_host.rst +++ b/docs/zh_CN/api-reference/peripherals/usb_host.rst @@ -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`` 组件通过 `乐鑫组件注册表 `__ 分发。因此,若要使用该组件,请通过以下命令将 Host Stack 组件添加为依赖项: + +.. code:: bash + + idf.py add-dependency usb + .. ------------------------------------------------ Maintainers Notes -------------------------------------------------- 维护注意事项 diff --git a/docs/zh_CN/migration-guides/release-6.x/6.0/peripherals.rst b/docs/zh_CN/migration-guides/release-6.x/6.0/peripherals.rst index cc5bc30577..9bf728555a 100644 --- a/docs/zh_CN/migration-guides/release-6.x/6.0/peripherals.rst +++ b/docs/zh_CN/migration-guides/release-6.x/6.0/peripherals.rst @@ -291,3 +291,10 @@ I2S --- - ``i2s_port_t`` 类型已被移除。请使用 ``int`` 类型代替。该类型原有的 enum 项 ``I2S_NUM_0``,``I2S_NUM_1``,``I2S_NUM_2`` 和 ``I2S_NUM_AUTO`` 已用宏定义代替,以保证兼容性。 + +USB +--- + +``usb`` 组件已迁移至 `乐鑫组件注册表 `__。 + +你可以通过运行 ``idf.py add-dependency "espressif/usb"``,将此依赖添加到项目中。