blob: 02781b461eaccf9d9b1e514b94393eb9fe3ba31a (
plain)
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
|
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>USB CONFIG 说明 — CherryUSB 1.6.1 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=80d5e7a1" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=d6a008b6"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="CDC" href="../class/class_cdc.html" />
<link rel="prev" title="主从驱动" href="api_port.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
CherryUSB
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">快速上手</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../quick_start/start.html">入门必看</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quick_start/demo.html">基于现有 demo 快速验证</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quick_start/transplant.html">芯片通用移植指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quick_start/rtthread.html">基于 RT-Thread 软件包开发指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quick_start/q%26a.html">Q & A</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quick_start/migration.html">部分改动迁移指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quick_start/opensource.html">基于 CherryUSB 的开源项目</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quick_start/usb_speed.html">USB 极限速度测试</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">USB 基本知识点</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../usb/usb2.0_basic.html">USB 基本概念(2.0 为主)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usb/usb3.0_basic.html">USB 基本概念(3.0 为主)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usb/usb_desc.html">USB 描述符</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usb/usb_request.html">USB 设备请求</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usb/usb_enum.html">USB 枚举</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usb/usb_ext.html">USB 知识点拓展</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">API 手册</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="api_device.html">设备协议栈</a></li>
<li class="toctree-l1"><a class="reference internal" href="api_host.html">主机协议栈</a></li>
<li class="toctree-l1"><a class="reference internal" href="api_port.html">主从驱动</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">USB CONFIG 说明</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#config">通用 CONFIG</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#config-usb-printf">CONFIG_USB_PRINTF</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usb-dbg-level">CONFIG_USB_DBG_LEVEL</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usb-printf-color-enable">CONFIG_USB_PRINTF_COLOR_ENABLE</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usb-dcache-enable">CONFIG_USB_DCACHE_ENABLE</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usb-align-size">CONFIG_USB_ALIGN_SIZE</a></li>
<li class="toctree-l3"><a class="reference internal" href="#usb-nocache-ram-section">USB_NOCACHE_RAM_SECTION</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#id1">设备协议栈 CONFIG</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#config-usbdev-request-buffer-len">CONFIG_USBDEV_REQUEST_BUFFER_LEN</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usbdev-setup-log-print">CONFIG_USBDEV_SETUP_LOG_PRINT</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usbdev-desc-check">CONFIG_USBDEV_DESC_CHECK</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usbdev-test-mode">CONFIG_USBDEV_TEST_MODE</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usbdev-msc-max-bufsize">CONFIG_USBDEV_MSC_MAX_BUFSIZE</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usbdev-msc-manufacturer-string">CONFIG_USBDEV_MSC_MANUFACTURER_STRING</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usbdev-msc-product-string">CONFIG_USBDEV_MSC_PRODUCT_STRING</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usbdev-msc-version-string">CONFIG_USBDEV_MSC_VERSION_STRING</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usbdev-msc-polling">CONFIG_USBDEV_MSC_POLLING</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usbdev-msc-thread">CONFIG_USBDEV_MSC_THREAD</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usbdev-msc-prio">CONFIG_USBDEV_MSC_PRIO</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usbdev-msc-stacksize">CONFIG_USBDEV_MSC_STACKSIZE</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usbdev-rndis-resp-buffer-size">CONFIG_USBDEV_RNDIS_RESP_BUFFER_SIZE</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usbdev-rndis-eth-max-frame-size">CONFIG_USBDEV_RNDIS_ETH_MAX_FRAME_SIZE</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usbdev-rndis-vendor-id">CONFIG_USBDEV_RNDIS_VENDOR_ID</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usbdev-rndis-vendor-desc">CONFIG_USBDEV_RNDIS_VENDOR_DESC</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usbdev-rndis-using-lwip">CONFIG_USBDEV_RNDIS_USING_LWIP</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#id2">主机协议栈 CONFIG</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#config-usbhost-psc-prio">CONFIG_USBHOST_PSC_PRIO</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usbhost-psc-stacksize">CONFIG_USBHOST_PSC_STACKSIZE</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usbhost-request-buffer-len">CONFIG_USBHOST_REQUEST_BUFFER_LEN</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usbhost-control-transfer-timeout">CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-usbhost-msc-timeout">CONFIG_USBHOST_MSC_TIMEOUT</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Class 指南</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../class/class_cdc.html">CDC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../class/class_hid.html">HID</a></li>
<li class="toctree-l1"><a class="reference internal" href="../class/class_msc.html">MSC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../class/class_audio.html">UAC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../class/class_video.html">UVC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../class/winusb.html">WINUSB</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_cdc_acm.html">CDC ACM Device</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_hid.html">HID Device</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_msc.html">MSC Device</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_audiov1.html">AudioV1 Device</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_audiov2.html">AudioV2 Device</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_video.html">USB Video Device</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_winusb.html">WinUSB Device</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_webusb.html">WebUSB Device</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_rndis.html">CDC RNDIS Device</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_ecm.html">CDC ECM Device</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_adb.html">ADB Device</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_mtp.html">MTP Device</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbh_serial.html">Serial Host</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbh_hid.html">HID Host</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbh_msc.html">MSC Host</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbh_net.html">Network Host</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbh_bluetooth.html">BTBLE Host</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbh_wifi.html">WIFI Host</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbh_audio.html">Audio Host</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbh_video.html">Video Host</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usb_otg.html">USB OTG</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbd_vendor.html">Vendor Device 驱动编写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo/usbh_vendor.html">Vendor Host 驱动编写</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">USBIP 介绍</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../usbip/ohci.html">OHCI</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usbip/ehci.html">EHCI</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usbip/xhci.html">XHCI</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usbip/chipidea.html">CHIPIDEA</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usbip/dwc2.html">DWC2</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usbip/musb.html">MUSB</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usbip/fotg210.html">FOTG210</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usbip/cdns2.html">CDNS2</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usbip/cdns3.html">CDNS3</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usbip/dwc3.html">DWC3</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">工具使用</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../tools/index.html">chryusb_configurator</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tools/index.html#usb-protocol-suite">力科 USB Protocol Suite</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tools/index.html#wireshark">Wireshark</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tools/index.html#audacity">Audacity</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Release Notes</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../version.html">版本说明</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">性能展示</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../show/index.html">性能展示</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">商业支持</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../support/index.html">商业支持</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">CherryUSB</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">USB CONFIG 说明</li>
<li class="wy-breadcrumbs-aside">
<a href="../_sources/api/api_config.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="usb-config">
<h1>USB CONFIG 说明<a class="headerlink" href="#usb-config" title="Link to this heading"></a></h1>
<section id="config">
<h2>通用 CONFIG<a class="headerlink" href="#config" title="Link to this heading"></a></h2>
<section id="config-usb-printf">
<h3>CONFIG_USB_PRINTF<a class="headerlink" href="#config-usb-printf" title="Link to this heading"></a></h3>
<p>USB log 功能,默认重定向到 printf,需要注意,USB log 会在中断中使用,因此重定向的 api 不允许阻塞。举例,如果使用的是 rt-thread,请更换成 rt-kprintf</p>
</section>
<section id="config-usb-dbg-level">
<h3>CONFIG_USB_DBG_LEVEL<a class="headerlink" href="#config-usb-dbg-level" title="Link to this heading"></a></h3>
<p>控制 log 的打印级别</p>
</section>
<section id="config-usb-printf-color-enable">
<h3>CONFIG_USB_PRINTF_COLOR_ENABLE<a class="headerlink" href="#config-usb-printf-color-enable" title="Link to this heading"></a></h3>
<p>控制 log 颜色打印,默认开启</p>
</section>
<section id="config-usb-dcache-enable">
<h3>CONFIG_USB_DCACHE_ENABLE<a class="headerlink" href="#config-usb-dcache-enable" title="Link to this heading"></a></h3>
<p>不使用 nocache ram 时,开启此宏以保证数据一致性。 <strong>使用 EHCI 时,内部依旧需要使用 nocache ram</strong>。</p>
</section>
<section id="config-usb-align-size">
<h3>CONFIG_USB_ALIGN_SIZE<a class="headerlink" href="#config-usb-align-size" title="Link to this heading"></a></h3>
<p>USB buffer 的对齐大小,默认是 4。IP 在 dma 模式下可能对输入的 buffer有对齐要求,一般是4,如果是其他对齐方式,请修改此值。</p>
</section>
<section id="usb-nocache-ram-section">
<h3>USB_NOCACHE_RAM_SECTION<a class="headerlink" href="#usb-nocache-ram-section" title="Link to this heading"></a></h3>
<p>如果芯片没有 cache 功能,此宏无效。如果有,则 USB 的输入输出 buffer 必须放在 nocache ram 中,保证数据一致性。</p>
</section>
</section>
<section id="id1">
<h2>设备协议栈 CONFIG<a class="headerlink" href="#id1" title="Link to this heading"></a></h2>
<section id="config-usbdev-request-buffer-len">
<h3>CONFIG_USBDEV_REQUEST_BUFFER_LEN<a class="headerlink" href="#config-usbdev-request-buffer-len" title="Link to this heading"></a></h3>
<p>控制传输接收和发送的 buffer 最大长度,默认是 512。</p>
</section>
<section id="config-usbdev-setup-log-print">
<h3>CONFIG_USBDEV_SETUP_LOG_PRINT<a class="headerlink" href="#config-usbdev-setup-log-print" title="Link to this heading"></a></h3>
<p>使能或者关闭 setup 包的 dump 信息,默认关闭。</p>
</section>
<section id="config-usbdev-desc-check">
<h3>CONFIG_USBDEV_DESC_CHECK<a class="headerlink" href="#config-usbdev-desc-check" title="Link to this heading"></a></h3>
<p>暂时没有实现</p>
</section>
<section id="config-usbdev-test-mode">
<h3>CONFIG_USBDEV_TEST_MODE<a class="headerlink" href="#config-usbdev-test-mode" title="Link to this heading"></a></h3>
<p>使能或者关闭 usb test mode</p>
</section>
<section id="config-usbdev-msc-max-bufsize">
<h3>CONFIG_USBDEV_MSC_MAX_BUFSIZE<a class="headerlink" href="#config-usbdev-msc-max-bufsize" title="Link to this heading"></a></h3>
<p>msc 缓存的最大长度,缓存越大,USB 的速度越高,因为介质一般多个 block 读写速度比单个 block 高很多,比如 sd 卡。
默认 512 ,如果是 flash 需要改成 4K, 缓存的大小需要是介质的一个 block size 的整数倍。</p>
</section>
<section id="config-usbdev-msc-manufacturer-string">
<h3>CONFIG_USBDEV_MSC_MANUFACTURER_STRING<a class="headerlink" href="#config-usbdev-msc-manufacturer-string" title="Link to this heading"></a></h3>
</section>
<section id="config-usbdev-msc-product-string">
<h3>CONFIG_USBDEV_MSC_PRODUCT_STRING<a class="headerlink" href="#config-usbdev-msc-product-string" title="Link to this heading"></a></h3>
</section>
<section id="config-usbdev-msc-version-string">
<h3>CONFIG_USBDEV_MSC_VERSION_STRING<a class="headerlink" href="#config-usbdev-msc-version-string" title="Link to this heading"></a></h3>
</section>
<section id="config-usbdev-msc-polling">
<h3>CONFIG_USBDEV_MSC_POLLING<a class="headerlink" href="#config-usbdev-msc-polling" title="Link to this heading"></a></h3>
<p>将 usbd_msc_sector_read 和 usbd_msc_sector_write 操作放在 while1 中运行,裸机下使用。</p>
</section>
<section id="config-usbdev-msc-thread">
<h3>CONFIG_USBDEV_MSC_THREAD<a class="headerlink" href="#config-usbdev-msc-thread" title="Link to this heading"></a></h3>
<p>使能或者关闭 msc 线程,默认关闭。usbd_msc_sector_read 和 usbd_msc_sector_write 默认是在中断中执行,所以如果开启了 os 建议开启此宏,那么,
usbd_msc_sector_read 和 usbd_msc_sector_write 就会在线程中执行。</p>
</section>
<section id="config-usbdev-msc-prio">
<h3>CONFIG_USBDEV_MSC_PRIO<a class="headerlink" href="#config-usbdev-msc-prio" title="Link to this heading"></a></h3>
<p>MSC 读写线程的优先级,默认是 4,数值越小,优先级越高</p>
</section>
<section id="config-usbdev-msc-stacksize">
<h3>CONFIG_USBDEV_MSC_STACKSIZE<a class="headerlink" href="#config-usbdev-msc-stacksize" title="Link to this heading"></a></h3>
<p>MSC 读写线程的堆栈大小,默认 2K 字节</p>
</section>
<section id="config-usbdev-rndis-resp-buffer-size">
<h3>CONFIG_USBDEV_RNDIS_RESP_BUFFER_SIZE<a class="headerlink" href="#config-usbdev-rndis-resp-buffer-size" title="Link to this heading"></a></h3>
<p>rndis 控制传输最大接收和发送的长度,根据 RNDIS options list 决定最小长度,默认要大于等于 156</p>
</section>
<section id="config-usbdev-rndis-eth-max-frame-size">
<h3>CONFIG_USBDEV_RNDIS_ETH_MAX_FRAME_SIZE<a class="headerlink" href="#config-usbdev-rndis-eth-max-frame-size" title="Link to this heading"></a></h3>
<p>rndis 以太网帧的最大长度,默认 1580</p>
</section>
<section id="config-usbdev-rndis-vendor-id">
<h3>CONFIG_USBDEV_RNDIS_VENDOR_ID<a class="headerlink" href="#config-usbdev-rndis-vendor-id" title="Link to this heading"></a></h3>
</section>
<section id="config-usbdev-rndis-vendor-desc">
<h3>CONFIG_USBDEV_RNDIS_VENDOR_DESC<a class="headerlink" href="#config-usbdev-rndis-vendor-desc" title="Link to this heading"></a></h3>
</section>
<section id="config-usbdev-rndis-using-lwip">
<h3>CONFIG_USBDEV_RNDIS_USING_LWIP<a class="headerlink" href="#config-usbdev-rndis-using-lwip" title="Link to this heading"></a></h3>
<p>rndis 与 lwip 接口的对接</p>
</section>
</section>
<section id="id2">
<h2>主机协议栈 CONFIG<a class="headerlink" href="#id2" title="Link to this heading"></a></h2>
<p>以下参数决定了支持的最大外部hub数量,接口数,每个接口的端点数和 altsetting 数量,更改此值会影响 ram 的大小,建议根据实际情况更改。</p>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="cp">#define CONFIG_USBHOST_MAX_RHPORTS 1</span>
<span class="cp">#define CONFIG_USBHOST_MAX_EXTHUBS 1</span>
<span class="cp">#define CONFIG_USBHOST_MAX_EHPORTS 4</span>
<span class="cp">#define CONFIG_USBHOST_MAX_INTERFACES 6</span>
<span class="cp">#define CONFIG_USBHOST_MAX_INTF_ALTSETTINGS 1</span>
<span class="cp">#define CONFIG_USBHOST_MAX_ENDPOINTS 4</span>
</pre></div>
</div>
<p>以下参数决定了支持的 class 数目,更改此值会影响 ram 的大小,建议根据实际情况更改。</p>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="cp">#define CONFIG_USBHOST_MAX_SERIAL_CLASS 4</span>
<span class="cp">#define CONFIG_USBHOST_MAX_HID_CLASS 4</span>
<span class="cp">#define CONFIG_USBHOST_MAX_MSC_CLASS 2</span>
<span class="cp">#define CONFIG_USBHOST_MAX_AUDIO_CLASS 1</span>
<span class="cp">#define CONFIG_USBHOST_MAX_VIDEO_CLASS 1</span>
</pre></div>
</div>
<section id="config-usbhost-psc-prio">
<h3>CONFIG_USBHOST_PSC_PRIO<a class="headerlink" href="#config-usbhost-psc-prio" title="Link to this heading"></a></h3>
<p>主机插拔线程的优先级,默认是 0,数值越小,优先级越高</p>
</section>
<section id="config-usbhost-psc-stacksize">
<h3>CONFIG_USBHOST_PSC_STACKSIZE<a class="headerlink" href="#config-usbhost-psc-stacksize" title="Link to this heading"></a></h3>
<p>主机插拔线程的堆栈大小,默认 2K 字节</p>
</section>
<section id="config-usbhost-request-buffer-len">
<h3>CONFIG_USBHOST_REQUEST_BUFFER_LEN<a class="headerlink" href="#config-usbhost-request-buffer-len" title="Link to this heading"></a></h3>
<p>控制传输能够接收或者发送的最大长度</p>
</section>
<section id="config-usbhost-control-transfer-timeout">
<h3>CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT<a class="headerlink" href="#config-usbhost-control-transfer-timeout" title="Link to this heading"></a></h3>
<p>控制传输发送或者接收的超时时间,默认 500 ms</p>
</section>
<section id="config-usbhost-msc-timeout">
<h3>CONFIG_USBHOST_MSC_TIMEOUT<a class="headerlink" href="#config-usbhost-msc-timeout" title="Link to this heading"></a></h3>
<p>MSC 读写传输的超时时间,默认 5s</p>
</section>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="api_port.html" class="btn btn-neutral float-left" title="主从驱动" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="../class/class_cdc.html" class="btn btn-neutral float-right" title="CDC" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>© Copyright 2022 ~ 2026, sakumisu.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
|