docs: update rst framework
@@ -1,7 +1,7 @@
|
|||||||
USB CONFIG 宏
|
USB CONFIG 说明
|
||||||
=========================
|
=========================
|
||||||
|
|
||||||
通用 CONFIG 宏
|
通用 CONFIG
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
CONFIG_USB_PRINTF
|
CONFIG_USB_PRINTF
|
||||||
@@ -29,13 +29,13 @@ USB_NOCACHE_RAM_SECTION
|
|||||||
|
|
||||||
如果芯片没有 cache 功能,此宏无效。如果有,则 USB 的输入输出 buffer 必须放在 nocache ram 中,保证数据一致性。
|
如果芯片没有 cache 功能,此宏无效。如果有,则 USB 的输入输出 buffer 必须放在 nocache ram 中,保证数据一致性。
|
||||||
|
|
||||||
设备相关 CONFIG 宏
|
设备协议栈 CONFIG
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
CONFIG_USBDEV_REQUEST_BUFFER_LEN
|
CONFIG_USBDEV_REQUEST_BUFFER_LEN
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
控制传输接收和发送的 buffer 最大长度,默认是 256。
|
控制传输接收和发送的 buffer 最大长度,默认是 512。
|
||||||
|
|
||||||
CONFIG_USBDEV_SETUP_LOG_PRINT
|
CONFIG_USBDEV_SETUP_LOG_PRINT
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@@ -55,7 +55,7 @@ CONFIG_USBDEV_MSC_MAX_BUFSIZE
|
|||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
msc 缓存的最大长度,缓存越大,USB 的速度越高,因为介质一般多个 block 读写速度比单个 block 高很多,比如 sd 卡。
|
msc 缓存的最大长度,缓存越大,USB 的速度越高,因为介质一般多个 block 读写速度比单个 block 高很多,比如 sd 卡。
|
||||||
默认 512 ,如果是 flash 需要改成 4K, 缓存的大小需要是 介质的一个 block size 的整数倍。
|
默认 512 ,如果是 flash 需要改成 4K, 缓存的大小需要是介质的一个 block size 的整数倍。
|
||||||
|
|
||||||
CONFIG_USBDEV_MSC_MANUFACTURER_STRING
|
CONFIG_USBDEV_MSC_MANUFACTURER_STRING
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@@ -66,6 +66,11 @@ CONFIG_USBDEV_MSC_PRODUCT_STRING
|
|||||||
CONFIG_USBDEV_MSC_VERSION_STRING
|
CONFIG_USBDEV_MSC_VERSION_STRING
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
CONFIG_USBDEV_MSC_POLLING
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
将 usbd_msc_sector_read 和 usbd_msc_sector_write 操作放在 while1 中运行,裸机下使用。
|
||||||
|
|
||||||
CONFIG_USBDEV_MSC_THREAD
|
CONFIG_USBDEV_MSC_THREAD
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
@@ -90,7 +95,7 @@ rndis 控制传输最大接收和发送的长度,根据 RNDIS options list 决
|
|||||||
CONFIG_USBDEV_RNDIS_ETH_MAX_FRAME_SIZE
|
CONFIG_USBDEV_RNDIS_ETH_MAX_FRAME_SIZE
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
rndis 以太网帧的最大长度,默认 1536
|
rndis 以太网帧的最大长度,默认 1580
|
||||||
|
|
||||||
CONFIG_USBDEV_RNDIS_VENDOR_ID
|
CONFIG_USBDEV_RNDIS_VENDOR_ID
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@@ -103,7 +108,7 @@ CONFIG_USBDEV_RNDIS_USING_LWIP
|
|||||||
|
|
||||||
rndis 与 lwip 接口的对接
|
rndis 与 lwip 接口的对接
|
||||||
|
|
||||||
主机相关 CONFIG 宏
|
主机协议栈 CONFIG
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
以下参数决定了支持的最大外部hub数量,接口数,每个接口的端点数和 altsetting 数量,更改此值会影响 ram 的大小,建议根据实际情况更改。
|
以下参数决定了支持的最大外部hub数量,接口数,每个接口的端点数和 altsetting 数量,更改此值会影响 ram 的大小,建议根据实际情况更改。
|
||||||
|
|||||||
@@ -142,6 +142,17 @@ usb_hc_init
|
|||||||
|
|
||||||
- **return** 返回 0 表示正确,其他表示错误
|
- **return** 返回 0 表示正确,其他表示错误
|
||||||
|
|
||||||
|
usb_hc_deinit
|
||||||
|
""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
``usb_hc_deinit`` 用于反初始化 usb host controller 寄存器。 **此函数不对用户开放**。
|
||||||
|
|
||||||
|
.. code-block:: C
|
||||||
|
|
||||||
|
int usb_hc_deinit(void);
|
||||||
|
|
||||||
|
- **return** 返回 0 表示正确,其他表示错误
|
||||||
|
|
||||||
usbh_roothub_control
|
usbh_roothub_control
|
||||||
""""""""""""""""""""""""""""""""""""
|
""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
TODO
|
|
||||||
2
docs/source/demo/usbd_audiov1.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
usbd_audiov1
|
||||||
|
===============
|
||||||
2
docs/source/demo/usbd_audiov2.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
usbd_audiov2
|
||||||
|
===============
|
||||||
2
docs/source/demo/usbd_cdc_acm.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
usbd_cdc_acm
|
||||||
|
===============
|
||||||
2
docs/source/demo/usbd_ecm.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
usbd_cdc_ecm
|
||||||
|
===============
|
||||||
2
docs/source/demo/usbd_hid.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
usbd_hid
|
||||||
|
===============
|
||||||
2
docs/source/demo/usbd_msc.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
usbd_msc
|
||||||
|
===============
|
||||||
2
docs/source/demo/usbd_rndis.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
usbd_rndis
|
||||||
|
===============
|
||||||
2
docs/source/demo/usbd_video.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
usbd_video
|
||||||
|
===============
|
||||||
2
docs/source/demo/usbd_webusb.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
usbd_webusb
|
||||||
|
===============
|
||||||
2
docs/source/demo/usbd_winusb.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
usbd_winusb
|
||||||
|
===============
|
||||||
2
docs/source/demo/usbh_bluetooth.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
usbh_bluetooth
|
||||||
|
===============
|
||||||
2
docs/source/demo/usbh_hid.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
usbh_hid
|
||||||
|
===============
|
||||||
2
docs/source/demo/usbh_msc.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
usbh_msc
|
||||||
|
===============
|
||||||
2
docs/source/demo/usbh_net.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
usbh_net
|
||||||
|
===============
|
||||||
2
docs/source/demo/usbh_serial.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
usbh_serial
|
||||||
|
===============
|
||||||
2
docs/source/demo/usbh_wifi.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
usbh_wifi
|
||||||
|
===============
|
||||||
@@ -53,10 +53,10 @@ CherryUSB 是一个小而美的、可移植性高的、用于嵌入式系统的
|
|||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
:caption: 快速上手
|
:caption: 快速上手
|
||||||
|
|
||||||
quick_start/index
|
quick_start/demo
|
||||||
quick_start/rt-thread/rtthread
|
quick_start/transplant
|
||||||
quick_start/other_chip
|
quick_start/rtthread
|
||||||
version
|
quick_start/esp
|
||||||
q&a
|
q&a
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
@@ -92,16 +92,39 @@ CherryUSB 是一个小而美的、可移植性高的、用于嵌入式系统的
|
|||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
:caption: 基本例程
|
:caption: 例程说明
|
||||||
|
|
||||||
demo/index
|
demo/usbd_cdc_acm
|
||||||
|
demo/usbd_hid
|
||||||
|
demo/usbd_msc
|
||||||
|
demo/usbd_rndis
|
||||||
|
demo/usbd_ecm
|
||||||
|
demo/usbd_audiov1
|
||||||
|
demo/usbd_audiov2
|
||||||
|
demo/usbd_video
|
||||||
|
demo/usbd_winusb
|
||||||
|
demo/usbd_webusb
|
||||||
|
demo/usbh_serial
|
||||||
|
demo/usbh_hid
|
||||||
|
demo/usbh_msc
|
||||||
|
demo/usbh_net
|
||||||
|
demo/usbh_bluetooth
|
||||||
|
demo/usbh_wifi
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
:caption: Porting 说明
|
:caption: USBIP 介绍
|
||||||
|
|
||||||
porting
|
usbip/ohci
|
||||||
porting_usbip
|
usbip/ehci
|
||||||
|
usbip/xhci
|
||||||
|
usbip/chipidea
|
||||||
|
usbip/dwc2
|
||||||
|
usbip/musb
|
||||||
|
usbip/fotg210
|
||||||
|
usbip/cdns2
|
||||||
|
usbip/cdns3
|
||||||
|
usbip/dwc3
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
@@ -109,6 +132,12 @@ CherryUSB 是一个小而美的、可移植性高的、用于嵌入式系统的
|
|||||||
|
|
||||||
tools/index
|
tools/index
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 1
|
||||||
|
:caption: 版本说明
|
||||||
|
|
||||||
|
version
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
:caption: 商业支持
|
:caption: 商业支持
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
Porting 如何编写
|
|
||||||
==============================
|
|
||||||
|
|
||||||
本节主要介绍没有支持的芯片如何做 porting。
|
|
||||||
|
|
||||||
从机 porting
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
- 首先复制一份从 `port/template` 复制一份 `usb_dc.c` 并参与编译,保证能编译过。
|
|
||||||
- 实现 ``usb_dc_init`` 保证能进入中断
|
|
||||||
- 在中断中判断 reset 中断并能够正常触发 reset 中断,在 reset 中断中调用 ``usbd_event_reset_handler``,如果可能,还需要启动读取 setup 包。
|
|
||||||
- 在中断中判断 setup 中断并能够正常触发 setup 中断,然后将读取的数据传入 ``usbd_event_ep0_setup_complete_handler``
|
|
||||||
- 实现 ``usbd_ep_start_write`` 并能够触发发送完成中断
|
|
||||||
- 实现 ``usbd_ep_start_read`` 并能够触发接收完成中断
|
|
||||||
- 分包处理
|
|
||||||
|
|
||||||
主机 porting
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
- 首先复制一份从 `port/template` 复制一份 `usb_hc.c` 并参与编译,保证能编译过。
|
|
||||||
- 实现 ``usb_hc_init`` 保证能进入中断
|
|
||||||
- 能够进入插拔中断,比如 ``connect`` 和 ``disconnect``,并调用 ``usbh_roothub_thread_wakeup`` 能够唤醒 hub 线程
|
|
||||||
- 实现 ``usbh_roothub_control`` 并根据第三个条件,能够完成 ``usbh_hub_events`` 中 ``usbh_enumerate`` 之前的流程
|
|
||||||
- 实现 ``usbh_submit_urb``
|
|
||||||
17
docs/source/quick_start/esp.rst
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
基于 ESP-Registry 开发指南
|
||||||
|
===========================
|
||||||
|
|
||||||
|
ESP-Registry 可以参考官方文档,推荐使用 vscode + esp-idf 的开发环境。
|
||||||
|
|
||||||
|
- ctrl + shift + p 选择 ESP-IDF 欢迎界面,然后选择 Component mananger
|
||||||
|
|
||||||
|
.. figure:: img/esp1.png
|
||||||
|
|
||||||
|
- 找到 cherryusb 并安装
|
||||||
|
|
||||||
|
.. figure:: img/esp2.png
|
||||||
|
|
||||||
|
- 打开 menuconfig,并打开 cherryusb 的配置,根据实际情况选择主机或者从机模式
|
||||||
|
|
||||||
|
.. figure:: img/esp3.png
|
||||||
|
.. figure:: img/esp4.png
|
||||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 65 KiB |
BIN
docs/source/quick_start/img/esp1.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
docs/source/quick_start/img/esp2.png
Normal file
|
After Width: | Height: | Size: 71 KiB |
BIN
docs/source/quick_start/img/esp3.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
docs/source/quick_start/img/esp4.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
@@ -1,6 +1,8 @@
|
|||||||
基于 RT-Thread 软件包开发指南
|
基于 RT-Thread 软件包开发指南
|
||||||
===============================
|
===============================
|
||||||
|
|
||||||
|
.. note:: CherryUSB 已经加入 RT-Thread 主线,可以选择使用主线版本,配置方式相同。
|
||||||
|
|
||||||
本节主要介绍使用 RT-Thread 提供的软件包管理器来配置工程,以 env 作为演示。本节操作不同芯片都一样,后续不再重复讲解。打开 env 以后使用 menuconfig 进入包管理器,并在如图所示路径中选择 CherryUSB。
|
本节主要介绍使用 RT-Thread 提供的软件包管理器来配置工程,以 env 作为演示。本节操作不同芯片都一样,后续不再重复讲解。打开 env 以后使用 menuconfig 进入包管理器,并在如图所示路径中选择 CherryUSB。
|
||||||
|
|
||||||
.. figure:: img/env0.png
|
.. figure:: img/env0.png
|
||||||
BIN
docs/source/support/img/dwc2_hostuac.png
Normal file
|
After Width: | Height: | Size: 164 KiB |
@@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
.. figure:: img/dwc2_hostuvc1.png
|
.. figure:: img/dwc2_hostuvc1.png
|
||||||
.. figure:: img/dwc2_hostuvc2.png
|
.. figure:: img/dwc2_hostuvc2.png
|
||||||
|
.. figure:: img/dwc2_hostuac.png
|
||||||
|
|
||||||
- 主机 UVC & UAC 类 MUSB IP 中 ISO 驱动和 UAC/UVC 框架, MUSB 需要为 mentor 公司制定的标准 IP
|
- 主机 UVC & UAC 类 MUSB IP 中 ISO 驱动和 UAC/UVC 框架, MUSB 需要为 mentor 公司制定的标准 IP
|
||||||
|
|
||||||
|
|||||||
2
docs/source/usbip/cdns2.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
CDNS2
|
||||||
|
===============
|
||||||
2
docs/source/usbip/cdns3.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
CDNS3
|
||||||
|
===============
|
||||||
2
docs/source/usbip/chipidea.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
CHIPIDEA
|
||||||
|
=================
|
||||||
2
docs/source/usbip/dwc2.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
DWC2
|
||||||
|
=================
|
||||||
2
docs/source/usbip/dwc3.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
DWC3
|
||||||
|
===============
|
||||||
2
docs/source/usbip/ehci.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
EHCI
|
||||||
|
=================
|
||||||
2
docs/source/usbip/fotg210.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
FOTG210
|
||||||
|
===============
|
||||||
2
docs/source/usbip/musb.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
MUSB
|
||||||
|
=================
|
||||||
2
docs/source/usbip/ohci.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
OHCI
|
||||||
|
=================
|
||||||
2
docs/source/usbip/xhci.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
XHCI
|
||||||
|
=================
|
||||||