Skip to content

Commit 8a12a70

Browse files
docs: Add USB Host and Device Chinese documentation
1 parent d36f564 commit 8a12a70

File tree

11 files changed

+1267
-13
lines changed

11 files changed

+1267
-13
lines changed

docs/build_docs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22
# SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
33
#
4-
build-docs -l en --project-path .. -t esp32s2 esp32s3 esp32p4 esp32h4
4+
build-docs --project-path .. -t esp32s2 esp32s3 esp32p4 esp32h4

docs/conf_common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@
1414
'esp_docs.esp_extensions.run_doxygen',
1515
]
1616
# Languages supported
17-
languages = ['en']
17+
languages = ['en', 'zh_CN']
1818

1919
# Project targets (used as URL slugs)
2020
idf_targets = ['esp32s2', 'esp32s3', 'esp32p4', 'esp32h4']
2121

2222
# GitHub repository information
2323
github_repo = 'espressif/esp-usb'
24+
project_homepage = 'https://github.com/espressif/esp-usb'
2425

2526
# Initialize html_context if not already defined
2627
html_context = {}

docs/en/usb_host/usb_host_notes_arch.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
USB Host Maintainers Notes (Architecture)
22
=========================================
33

4-
:link_to_translation:`zh_CN:[中文]`
5-
64
The Host Stack is roughly split into multiple layers of abstraction, with each layer representing different USB concepts and a different level of USB Host operation. For example, a higher layer may present an abstraction of devices and application data transfers, whereas a lower layer may present an abstraction of endpoints and USB transfers.
75

86
Layer Descriptions
@@ -22,10 +20,10 @@ The layers of the Host Stack are described in the following table. The layers ar
2220
- This layer represents the USB Controller Hardware of the {IDF_TARGET_NAME}. The API presented by this layer is the register interface of the controller.
2321
* - LL
2422
- ``usbh_ll.h``
25-
- The LL (Low Level) layer abstracts the basic register access of the USB controller according to ESP-IDF's :doc:`Hardware Abstraction API Guidelines <../../../api-guides/hardware-abstraction>`. In other words, this layer provides APIs to access the controller's registers and format/parse the controller's DMA descriptors.
23+
- The LL (Low Level) layer abstracts the basic register access of the USB controller 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>`__. In other words, this layer provides APIs to access the controller's registers and format/parse the controller's DMA descriptors.
2624
* - HAL
2725
- ``usbh_hal.h``, ``usbh_hal.c``
28-
- The HAL (Hardware Abstraction Layer) abstracts the operating steps of the USB controller into functions according to ESP-IDF's :doc:`Hardware Abstraction API Guidelines <../../../api-guides/hardware-abstraction>`. This layer also abstracts the controller's host port and host channels, and provides APIs to operate the them.
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.
2927
* - HCD
3028
- ``hcd.h``, ``hcd.c``
3129
- 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.
@@ -39,7 +37,7 @@ The layers of the Host Stack are described in the following table. The layers ar
3937
- ``usb_host.h``, ``usb_host.c``
4038
- 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).
4139
* - Host Class Drivers
42-
- See the `ESP-USB repository <https://github.com/espressif/esp-usb>`_ or the USB Host examples in ESP-IDF (via :example:`peripherals/usb/host`).
40+
- See the `ESP-USB repository <https://github.com/espressif/esp-usb>`_ or the USB Host examples in ESP-IDF.
4341
- The Host Class Drivers implement the host side of a particular device class (e.g., CDC, MSC, HID). The exposed API is specific to each class driver.
4442

4543
Layer Dependencies

docs/en/usb_host/usb_host_notes_design.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
USB Host Maintainers Notes (Design Guidelines)
22
==============================================
33

4-
:link_to_translation:`zh_CN:[中文]`
5-
64
Design Considerations
75
---------------------
86

docs/en/usb_host/usb_host_notes_dwc_otg.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
USB Host Maintainers Notes (DWC_OTG Controller)
22
===============================================
33

4-
:link_to_translation:`zh_CN:[中文]`
5-
64
The {IDF_TARGET_NAME} uses a DesignWare USB 2.0 On-the-Go Controller (henceforth referred to as DWC_OTG in this document) as its underlying hardware controller, where the DWC_OTG operates in Host Mode with Scatter/Gather DMA enabled.
75

86
.. note::

docs/en/usb_host/usb_host_notes_index.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
USB Host Maintainers Notes (Introduction)
22
=========================================
33

4-
:link_to_translation:`zh_CN:[中文]`
5-
64
This document contains information regarding the implementation details of the USB Host stack. This document is intended for the maintainers and third-party contributors of the USB Host stack. Users of the USB Host stack should refer to :doc:`../usb_host` instead.
75

86
.. warning::

docs/zh_CN/conf.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
2+
# SPDX-License-Identifier: Apache-2.0
3+
# -*- coding: utf-8 -*-
4+
#
5+
# Chinese Language RTD & Sphinx config file
6+
#
7+
# Uses ../conf_common.py for most non-language-specific settings.
8+
9+
# Importing conf_common adds all the non-language-specific
10+
# parts to this conf module
11+
12+
try:
13+
from conf_common import * # noqa: F403,F401
14+
except ImportError:
15+
import os
16+
import sys
17+
sys.path.insert(0, os.path.abspath('../'))
18+
from conf_common import * # noqa: F403,F401
19+
20+
import datetime
21+
22+
current_year = datetime.datetime.now().year
23+
24+
# General information about the project.
25+
project = u'ESP-USB 编程指南'
26+
copyright = '2025 - {}, 乐鑫信息科技(上海)股份有限公司'.format(current_year) # noqa: A001
27+
author = u'乐鑫信息科技(上海)股份有限公司'
28+
pdf_title = u'ESP-USB 编程指南'
29+
30+
# The language for content autogenerated by Sphinx. Refer to documentation
31+
# for a list of supported languages.
32+
language = 'zh_CN'

docs/zh_CN/index.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
2+
..
3+
.. SPDX-License-Identifier: Apache-2.0
4+
5+
ESP-USB Programming Guide
6+
==========================
7+
8+
Welcome to the ESP-USB Programming Guide.
9+
10+
.. toctree::
11+
:maxdepth: 2
12+
:caption: Contents:
13+
14+
introduction
15+
16+
.. toctree::
17+
:maxdepth: 1
18+
19+
usb_host
20+
usb_device

docs/zh_CN/introduction.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.. SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
2+
..
3+
.. SPDX-License-Identifier: Apache-2.0
4+
5+
Introduction
6+
============
7+
8+
ESP-USB is a repository containing ESP-IDF USB host and device class drivers
9+
which have been separated and uploaded into IDF Component Manager.
10+
11+
This documentation will be expanded with detailed information about:
12+
13+
* USB Host Library
14+
* USB Device Drivers
15+
* USB Class Drivers (CDC, HID, MSC, UAC, UVC)
16+
* API Reference
17+
* Examples and Usage

0 commit comments

Comments
 (0)