Skip to content

Commit d4b7d45

Browse files
committed
docs: update english docs
Signed-off-by: sakumisu <1203593632@qq.com>
1 parent 76b3720 commit d4b7d45

355 files changed

Lines changed: 4242 additions & 75 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permissions:
1111
jobs:
1212
deploy:
1313
runs-on: ubuntu-latest
14-
14+
1515
steps:
1616
- uses: actions/checkout@v4
1717
with:
@@ -23,6 +23,6 @@ jobs:
2323
- uses: JamesIves/github-pages-deploy-action@v4
2424
with:
2525
branch: gh-pages
26-
folder: docs/build/html
26+
folder: docs/output/zh/html
2727

2828

README.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,31 @@ CherryUSB is a tiny and beautiful, high performance and portable USB host and de
1414

1515
## Why choose CherryUSB
1616

17-
### Easy to study USB
17+
### Easy to Learn USB
1818

19-
In order to make it easier for users to learn USB basics, enumeration, driver loading and IP drivers, the code has been written with the following advantages:
19+
To facilitate user learning of USB fundamentals, enumeration, driver loading, and IP drivers, the written code has the following advantages:
2020

21-
- Lean code, simple logic, no complex C syntax
22-
- Tree-based programming with cascading code
23-
- Class-drivers and porting-drivers are templating and simplification
24-
- Clear API classification (slave: initialisation, registration api, command callback api, data sending and receiving api; host: initialisation, lookup api, data sending and receiving api)
21+
- Streamlined code with simple logic and no complex C language syntax
22+
- Tree-structured programming with progressive code layers
23+
- Templated and simplified Class drivers and porting drivers
24+
- Clear API categorization (Device: initialization, class registration, command callbacks, data transmission; Host: initialization, class discovery, data transmission)
2525

26-
### Easy to use USB
26+
### Easy to Use USB
2727

28-
In order to facilitate the use of the USB interface and to take into account the fact that users have learned about uart and dma, the following advantages have been designed for the data sending and receiving class of interface:
28+
To facilitate user interaction with USB interfaces, considering users’ familiarity with UART and DMA, the designed data transmission interface has the following advantages:
2929

30-
- Equivalent to using uart tx dma/uart rx dma
31-
- There is no limit to the length of send and receive, the user does not need to care about the USB packetization process (the porting driver does it)
30+
- Equivalent to using UART TX DMA/UART RX DMA
31+
- No length restrictions on transmission/reception; users don’t need to worry about USB packetization (porting drivers handle packetization)
3232

33-
### Easy to bring out USB performance
33+
### Easy to Achieve USB Performance
3434

35-
Taking into account USB performance issues and trying to achieve the theoretical bandwidth of the USB hardware, the design of the data transceiver class interface has the following advantages:
35+
Considering USB performance requirements to reach theoretical USB hardware bandwidth, the designed data transmission interface has the following advantages:
3636

37-
- Porting drivers directly to registers, no abstraction layer encapsulation
37+
- Porting drivers directly interface with registers without abstraction layer encapsulation
3838
- Memory zero copy
39-
- If IP has DMA then uses DMA mode (DMA with hardware packetization)
40-
- Unlimited length make it easier to interface with hardware DMA and take advantage of DMA
41-
- Packetization is handled in interrupt
39+
- DMA mode used when IP supports DMA (DMA provides hardware packetization functionality)
40+
- No length restrictions, facilitating hardware DMA interfacing and maximizing DMA advantages
41+
- Packetization handled in interrupt context
4242

4343
Performance show:https://cherryusb.cherry-embedded.org/show/
4444

@@ -176,9 +176,10 @@ Only standard and commercial USB IP are listed.
176176
| CDNS3(cadence) | CDNS3 | XHCI | × |
177177
| DWC3(synopsys) | DWC3 | XHCI | × |
178178

179-
## Documentation Tutorial
179+
## Documentation
180180

181-
Quickly start, USB basic concepts, API manual, Class basic concepts and examples, see [CherryUSB Documentation Tutorial](https://cherryusb.readthedocs.io/).
181+
[CherryUSB Chinese Documentation](https://cherryusb.readthedocs.io/zh-cn/latest/)
182+
[CherryUSB English Documentation](https://cherryusb.readthedocs.io/en/latest/)
182183

183184
## Video Tutorial
184185

README_zh.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ x 受以下宏影响:
178178

179179
## 文档教程
180180

181-
CherryUSB 快速入门、USB 基本概念、API 手册、Class 基本概念和例程,参考 [CherryUSB Documentation Tutorial](https://cherryusb.readthedocs.io/)
181+
[CherryUSB Chinese Documentation](https://cherryusb.readthedocs.io/zh-cn/latest/)
182+
[CherryUSB English Documentation](https://cherryusb.readthedocs.io/en/latest/)
182183

183184
## 视频教程
184185

docs/Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@
55
# from the environment for the first two.
66
SPHINXOPTS ?=
77
SPHINXBUILD ?= sphinx-build
8-
SOURCEDIR = source
9-
BUILDDIR = build
108

119
# Put it first so that "make" without argument is like "make help".
1210
help:
13-
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
11+
@$(SPHINXBUILD) -M help
1412

1513
.PHONY: help Makefile
1614

1715
# Catch-all target: route all unknown targets to Sphinx using the new
1816
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1917
%: Makefile
20-
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
18+
@$(SPHINXBUILD) -M html "zh" "output/zh" $(SPHINXOPTS) $(O)
19+
@$(SPHINXBUILD) -M html "en" "output/en" $(SPHINXOPTS) $(O)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ build:
1616

1717
# Build documentation in the "docs/" directory with Sphinx
1818
sphinx:
19-
configuration: docs/source/conf.py
19+
configuration: docs/en/conf.py
2020
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
2121
# builder: "dirhtml"
2222
# Fail on all warnings to avoid broken references

docs/en/api/api_config.rst

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
USB CONFIG Description
2+
=======================================
3+
4+
General CONFIG
5+
---------------------
6+
7+
CONFIG_USB_PRINTF
8+
^^^^^^^^^^^^^^^^^^^^
9+
10+
USB log functionality, defaults to redirect to printf. Note that USB log will be used in interrupts, so the redirected API must not block. For example, if using RT-Thread, please change to rt-kprintf
11+
12+
CONFIG_USB_DBG_LEVEL
13+
^^^^^^^^^^^^^^^^^^^^^^
14+
15+
Controls the log print level
16+
17+
CONFIG_USB_PRINTF_COLOR_ENABLE
18+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19+
20+
Controls log color printing, enabled by default
21+
22+
CONFIG_USB_DCACHE_ENABLE
23+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24+
25+
When not using nocache RAM, enable this macro to ensure data consistency. **When using EHCI, nocache RAM is still required internally**.
26+
27+
CONFIG_USB_ALIGN_SIZE
28+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29+
30+
USB buffer alignment size, default is 4. IP in DMA mode may have alignment requirements for input buffers, typically 4. If other alignment is needed, please modify this value.
31+
32+
USB_NOCACHE_RAM_SECTION
33+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
34+
35+
If the chip doesn't have cache functionality, this macro is ineffective. If it does, USB input/output buffers must be placed in nocache RAM to ensure data consistency.
36+
37+
Device Protocol Stack CONFIG
38+
------------------------------
39+
40+
CONFIG_USBDEV_REQUEST_BUFFER_LEN
41+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42+
43+
Controls the maximum length of control transfer receive and send buffer, default is 512.
44+
45+
CONFIG_USBDEV_SETUP_LOG_PRINT
46+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47+
48+
Enable or disable setup packet dump information, disabled by default.
49+
50+
CONFIG_USBDEV_DESC_CHECK
51+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
52+
53+
Not implemented yet
54+
55+
CONFIG_USBDEV_TEST_MODE
56+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
57+
Enable or disable USB test mode
58+
59+
CONFIG_USBDEV_MSC_MAX_BUFSIZE
60+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61+
62+
Maximum length of MSC cache. Larger cache results in higher USB speed because storage media typically has much higher multi-block read/write speeds than single block, such as SD cards.
63+
Default 512. For flash, needs to be changed to 4K. Cache size must be a multiple of the storage media's block size.
64+
65+
CONFIG_USBDEV_MSC_MANUFACTURER_STRING
66+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
67+
68+
CONFIG_USBDEV_MSC_PRODUCT_STRING
69+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
70+
71+
CONFIG_USBDEV_MSC_VERSION_STRING
72+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
73+
74+
CONFIG_USBDEV_MSC_POLLING
75+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
76+
77+
Run usbd_msc_sector_read and usbd_msc_sector_write operations in while1, used in bare-metal systems.
78+
79+
CONFIG_USBDEV_MSC_THREAD
80+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
81+
82+
Enable or disable MSC thread, disabled by default. usbd_msc_sector_read and usbd_msc_sector_write are executed in interrupts by default, so if OS is enabled, it's recommended to enable this macro, then usbd_msc_sector_read and usbd_msc_sector_write will execute in threads.
83+
84+
CONFIG_USBDEV_MSC_PRIO
85+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
86+
87+
Priority of MSC read/write thread, default is 4. Lower values mean higher priority.
88+
89+
CONFIG_USBDEV_MSC_STACKSIZE
90+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
91+
92+
Stack size of MSC read/write thread, default 2K bytes
93+
94+
CONFIG_USBDEV_RNDIS_RESP_BUFFER_SIZE
95+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
96+
97+
Maximum receive and send length for RNDIS control transfers. Minimum length determined by RNDIS options list, default should be greater than or equal to 156.
98+
99+
CONFIG_USBDEV_RNDIS_ETH_MAX_FRAME_SIZE
100+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
101+
102+
Maximum length of RNDIS Ethernet frame, default 1580
103+
104+
CONFIG_USBDEV_RNDIS_VENDOR_ID
105+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
106+
107+
CONFIG_USBDEV_RNDIS_VENDOR_DESC
108+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
109+
110+
CONFIG_USBDEV_RNDIS_USING_LWIP
111+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
112+
113+
RNDIS interface with LWIP
114+
115+
Host Protocol Stack CONFIG
116+
----------------------------
117+
118+
The following parameters determine the maximum number of supported external hubs, interfaces, endpoints per interface, and altsetting counts. Changing these values affects RAM size, it's recommended to adjust according to actual requirements.
119+
120+
.. code-block:: C
121+
122+
#define CONFIG_USBHOST_MAX_RHPORTS 1
123+
#define CONFIG_USBHOST_MAX_EXTHUBS 1
124+
#define CONFIG_USBHOST_MAX_EHPORTS 4
125+
#define CONFIG_USBHOST_MAX_INTERFACES 6
126+
#define CONFIG_USBHOST_MAX_INTF_ALTSETTINGS 1
127+
#define CONFIG_USBHOST_MAX_ENDPOINTS 4
128+
129+
The following parameters determine the maximum number of supported class drivers. Changing these values affects RAM size, it's recommended to adjust according to actual requirements.
130+
131+
.. code-block:: C
132+
133+
#define CONFIG_USBHOST_MAX_SERIAL_CLASS 4
134+
#define CONFIG_USBHOST_MAX_HID_CLASS 4
135+
#define CONFIG_USBHOST_MAX_MSC_CLASS 2
136+
#define CONFIG_USBHOST_MAX_AUDIO_CLASS 1
137+
#define CONFIG_USBHOST_MAX_VIDEO_CLASS 1
138+
139+
CONFIG_USBHOST_PSC_PRIO
140+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
141+
142+
Priority of host plug/unplug thread, default is 0. Lower values mean higher priority.
143+
144+
CONFIG_USBHOST_PSC_STACKSIZE
145+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
146+
147+
Stack size of host plug/unplug thread, default 2K bytes
148+
149+
CONFIG_USBHOST_REQUEST_BUFFER_LEN
150+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
151+
152+
Maximum length for control transfer receive or send
153+
154+
CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT
155+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
156+
157+
Timeout for control transfer send or receive, default 500 ms
158+
159+
CONFIG_USBHOST_MSC_TIMEOUT
160+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
161+
162+
Timeout for MSC read/write transfers, default 5s

0 commit comments

Comments
 (0)