index.rst 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. .. CherryUSB 使用指南 documentation master file, created by
  2. sphinx-quickstart on Thu Nov 21 10:50:33 2019.
  3. You can adapt this file completely to your liking, but it should at least
  4. contain the root `toctree` directive.
  5. CherryUSB 使用指南
  6. ======================================================
  7. CherryUSB 是一个小而美的、可移植性高的、用于嵌入式系统的 USB 主从协议栈。同时 CherryUSB 具有以下优点:
  8. **易于学习 USB**
  9. 为了方便用户学习 USB 基本知识、枚举、驱动加载、IP 驱动,因此,编写的代码具备以下优点:
  10. - 代码精简,逻辑简单,无复杂 C 语言语法
  11. - 树状化编程,代码层层递进
  12. - Class 驱动和 porting 驱动模板化、精简化
  13. - API 分类清晰(从机:初始化、注册类、命令回调类、数据收发类;主机:初始化、查找类、数据收发类)
  14. **易于使用 USB**
  15. 为了方便用户使用 USB 接口,考虑到用户学习过 uart 和 dma,因此,设计的数据收发类接口具备以下优点:
  16. - 等价于使用 uart tx dma/uart rx dma
  17. - 收发长度没有限制,用户不需要关心 USB 分包过程(porting 驱动做分包过程)
  18. **易于发挥 USB 性能**
  19. 考虑到 USB 性能问题,尽量达到 USB 硬件理论带宽,因此,设计的数据收发类接口具备以下优点:
  20. - Porting 驱动直接对接寄存器,无抽象层封装
  21. - Memory zero copy
  22. - IP 如果带 DMA 则使用 DMA 模式(DMA 带硬件分包功能)
  23. - 长度无限制,方便对接硬件 DMA 并且发挥 DMA 的优势
  24. - 分包功能在中断中处理
  25. **从机协议栈整体执行流程**
  26. .. figure:: usbdev.svg
  27. **主机协议栈整体执行流程**
  28. .. figure:: usbhost.svg
  29. **其他相关链接**
  30. - **CherryUSB 大纲** https://www.bilibili.com/video/BV1st4y1H7K2
  31. - **从机协议栈视频教程** https://www.bilibili.com/video/BV1Ef4y1t73d
  32. - **主机协议栈视频教程** TODO
  33. - **github** https://github.com/sakumisu/CherryUSB
  34. .. toctree::
  35. :maxdepth: 1
  36. :caption: 快速上手
  37. quick_start/index
  38. quick_start/rt-thread/rtthread
  39. quick_start/other_chip
  40. .. toctree::
  41. :maxdepth: 1
  42. :caption: USB 基本知识点
  43. usb/usb2.0_basic
  44. usb/usb3.0_basic
  45. usb/usb_desc
  46. usb/usb_request
  47. usb/usb_enum
  48. .. toctree::
  49. :maxdepth: 1
  50. :caption: API 手册
  51. api/api_device
  52. api/api_host
  53. api/api_port
  54. api/api_config
  55. .. toctree::
  56. :maxdepth: 1
  57. :caption: Class 指南
  58. class/class_cdc
  59. class/class_hid
  60. class/class_msc
  61. class/class_audio
  62. class/class_video
  63. class/winusb
  64. .. toctree::
  65. :maxdepth: 1
  66. :caption: 基本例程
  67. demo/cdc_acm
  68. demo/msc_ram
  69. demo/audio_mic_speaker
  70. demo/usb_video
  71. .. toctree::
  72. :maxdepth: 1
  73. :caption: Porting 说明
  74. porting
  75. porting_usbip
  76. .. toctree::
  77. :maxdepth: 1
  78. :caption: 工具使用
  79. tools/index