1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
.. CherryUSB User Guide documentation master file, created by
sphinx-quickstart on Thu Nov 21 10:50:33 2019.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
CherryUSB User Guide
====================================================================
CherryUSB is a small, lightweight, portable USB host and device protocol stack for embedded systems. CherryUSB offers the following advantages:
**Easy to Learn USB**
To facilitate user learning of USB fundamentals, enumeration, driver loading, and IP drivers, the written code has the following advantages:
- Streamlined code with simple logic and no complex C language syntax
- Tree-structured programming with progressive code layers
- Templated and simplified Class drivers and porting drivers
- Clear API categorization (Device: initialization, class registration, command callbacks, data transmission; Host: initialization, class discovery, data transmission)
**Easy to Use USB**
To facilitate user interaction with USB interfaces, considering users' familiarity with UART and DMA, the designed data transmission interface has the following advantages:
- Equivalent to using UART TX DMA/UART RX DMA
- No length restrictions on transmission/reception; users don't need to worry about USB packetization (porting drivers handle packetization)
**Easy to Achieve USB Performance**
Considering USB performance requirements to reach theoretical USB hardware bandwidth, the designed data transmission interface has the following advantages:
- Porting drivers directly interface with registers without abstraction layer encapsulation
- Memory zero copy
- DMA mode used when IP supports DMA (DMA provides hardware packetization functionality)
- No length restrictions, facilitating hardware DMA interfacing and maximizing DMA advantages
- Packetization handled in interrupt context
**Device Protocol Stack Overall Execution Flow**
.. figure:: usbdev.svg
**Host Protocol Stack Overall Execution Flow**
.. figure:: usbhost.svg
**Other Related Links**
- **Video Tutorial**: https://www.bilibili.com/cheese/play/ss707687201
- **GitHub**: https://github.com/sakumisu/CherryUSB
- **CherryUSB Theoretical Analysis and Application Practice - Hans Journal**: https://www.hanspub.org/journal/paperinformation?paperid=126903
.. toctree::
:maxdepth: 1
:caption: Quick Start
quick_start/start
quick_start/demo
quick_start/transplant
quick_start/rtthread
quick_start/q&a
quick_start/migration
quick_start/opensource
.. toctree::
:maxdepth: 1
:caption: USB Basic Knowledge
usb/usb2.0_basic
usb/usb3.0_basic
usb/usb_desc
usb/usb_request
usb/usb_enum
usb/usb_ext
.. toctree::
:maxdepth: 1
:caption: API Manual
api/api_device
api/api_host
api/api_port
api/api_config
.. toctree::
:maxdepth: 1
:caption: Class Guide
class/class_cdc
class/class_hid
class/class_msc
class/class_audio
class/class_video
class/winusb
.. toctree::
:maxdepth: 1
:caption: Examples
demo/usbd_cdc_acm
demo/usbd_hid
demo/usbd_msc
demo/usbd_audiov1
demo/usbd_audiov2
demo/usbd_video
demo/usbd_winusb
demo/usbd_webusb
demo/usbd_rndis
demo/usbd_ecm
demo/usbd_adb
demo/usbd_mtp
demo/usbh_serial
demo/usbh_hid
demo/usbh_msc
demo/usbh_net
demo/usbh_bluetooth
demo/usbh_wifi
demo/usbh_audio
demo/usbh_video
demo/usb_otg
demo/usbd_vendor
demo/usbh_vendor
.. toctree::
:maxdepth: 1
:caption: USB IP Introduction
usbip/ohci
usbip/ehci
usbip/xhci
usbip/chipidea
usbip/dwc2
usbip/musb
usbip/fotg210
usbip/cdns2
usbip/cdns3
usbip/dwc3
.. toctree::
:maxdepth: 1
:caption: Tools Usage
tools/index
.. toctree::
:maxdepth: 1
:caption: Release Notes
version
.. toctree::
:maxdepth: 1
:caption: Performance Showcase
show/index
.. toctree::
:maxdepth: 1
:caption: Commercial Support
support/index
|