|
|
%!s(int64=3) %!d(string=hai) anos | |
|---|---|---|
| class | %!s(int64=3) %!d(string=hai) anos | |
| common | %!s(int64=4) %!d(string=hai) anos | |
| core | %!s(int64=4) %!d(string=hai) anos | |
| demo | %!s(int64=3) %!d(string=hai) anos | |
| docs | %!s(int64=4) %!d(string=hai) anos | |
| osal | %!s(int64=3) %!d(string=hai) anos | |
| packet capture | %!s(int64=4) %!d(string=hai) anos | |
| port | %!s(int64=3) %!d(string=hai) anos | |
| tools | %!s(int64=4) %!d(string=hai) anos | |
| .clang-format | %!s(int64=4) %!d(string=hai) anos | |
| .gitattributes | %!s(int64=3) %!d(string=hai) anos | |
| .gitignore | %!s(int64=4) %!d(string=hai) anos | |
| .gitmodules | %!s(int64=4) %!d(string=hai) anos | |
| LICENSE | %!s(int64=4) %!d(string=hai) anos | |
| README.md | %!s(int64=4) %!d(string=hai) anos | |
| README_zh.md | %!s(int64=4) %!d(string=hai) anos | |
| SConscript | %!s(int64=4) %!d(string=hai) anos | |
| usb_config.h | %!s(int64=4) %!d(string=hai) anos |
CherryUSB is a tiny, beautiful and portable USB host and device stack for embedded system.
.
├── class
│ ├── audio
│ ├── cdc
│ ├── dfu
│ ├── hid
│ ├── hub
│ ├── midi
│ ├── msc
│ ├── tmc
│ └── video
├── common
├── core
├── demo
│ ├── bouffalolab
│ └── stm32
│ └── mm32
│ └── ch32
├── docs
├── osal
├── packet capture
└── port
├── bouffalolab
│ └── bl702
├── ch32
├── ehci
├── fsdev
├── mm32
├── synopsys
├── musb
└── template
| Directory | Description |
|---|---|
| class | usb class driver |
| common | usb spec macros and utils |
| core | usb core implementation |
| demo | different chip demo |
| osal | os wrapper |
| docs | doc for guiding |
| packet capture | packet capture file |
| port | usb dcd and hcd porting |
CherryUSB Device Stack provides a unified framework of functions for standard device requests, CLASS requests, VENDOR requests and custom special requests. The object-oriented and chained approach allows the user to quickly get started with composite devices without having to worry about the underlying logic. At the same time, a standard dcd porting interface has been standardised for adapting different USB IPs to achieve ip-oriented programming.
How CherryUSB Device Stack is implemented, this video will tell you: https://www.bilibili.com/video/BV1Ef4y1t73d .
CherryUSB Device Stack has the following functions:
CherryUSB Device Stack resource usage:
| file | FLASH (Byte) | RAM (Byte) |
|---|---|---|
| usbd_core.c | 3045 | 373 |
| usbd_cdc.c | 302 | 20 |
| usbd_msc.c | 2452 | 132 |
| usbd_hid.c | 784 | 201 |
| usbd_audio.c | 438 | 14 |
| usbd_video.c | 402 | 4 |
The CherryUSB Host Stack has a standard enumeration implementation for devices mounted on roothubs and external hubs, and a standard interface for the different Class to indicate what the Class driver needs to do after enumeration and after disconnection. A standard hcd porting interface has also been standardised for adapting different USB IPs for IP-oriented programming. Finally, the protocol stack is managed using os, and provides osal to make a adaptation to different os.
How CherryUSB Host Stack is implemented, the video will be provided in future.
CherryUSB Host Stack has the following functions:
The CherryUSB Host stack also provides the lsusb function, which allows you to view information about all mounted devices, including those on external hubs, with the help of a shell plugin.
More of USB Device API reference, please visit : CherryUSB Device API
More of USB Host API reference, please visit: CherryUSB Host API
How to use in RT-Thread package, please visit:RT-Thread package Userguide with CherryUSB