update docs, remove uses.rst, structure.rst. Refactor docs, use README.rst for docs index.rst

This commit is contained in:
hathach 2024-12-27 17:14:03 +07:00
parent 29f226c2fb
commit de38e53271
No known key found for this signature in database
GPG Key ID: 26FAB84F615C3C52
10 changed files with 25 additions and 174 deletions

View File

@ -5,14 +5,14 @@ Sponsors
TinyUSB is funded by: Adafruit. Purchasing products from them helps to support this project.
.. figure:: /docs/assets/adafruit_logo.svg
.. figure:: docs/assets/adafruit_logo.svg
:alt: Adafruit Logo
:target: https://www.adafruit.com
TinyUSB Project
===============
.. figure:: /docs/assets/logo.svg
.. figure:: docs/assets/logo.svg
:alt: TinyUSB
TinyUSB is an open-source cross-platform USB Host/Device stack for
@ -20,7 +20,7 @@ embedded system, designed to be memory-safe with no dynamic allocation
and thread-safe with all interrupt events are deferred then handled in
the non-ISR task function. Check out the online `documentation <https://docs.tinyusb.org/>`__ for more details.
.. figure:: /docs/assets/stack.svg
.. figure:: docs/assets/stack.svg
:width: 500px
:alt: stackup
@ -43,12 +43,12 @@ Getting started
See the `online documentation <https://docs.tinyusb.org>`_ for information about using TinyUSB and how it is implemented.
Check out `Getting Started`_ guide for adding TinyUSB to your project or building the examples. If you are new to TinyUSB, we recommend starting with the `cdc_msc` example. There is a handful of `Supported Boards`_ that should work out of the box.
We use `GitHub Discussions <https://github.com/hathach/tinyusb/discussions>`_ as our forum. It is a great place to ask questions and advice from the community or to discuss your TinyUSB-based projects.
For bugs and feature requests, please `raise an issue <https://github.com/hathach/tinyusb/issues>`_ and follow the templates there.
Check out `Getting Started`_ guide for adding TinyUSB to your project or building the examples. If you are new to TinyUSB, we recommend starting with the `cdc_msc` example.
See `Porting`_ guide for adding support for new MCUs and boards.
Device Stack
@ -241,15 +241,6 @@ Table Legend
\[empty\] Unknown
========= =========================
License
=======
All TinyUSB files in the ``src`` folder are licensed under the `MIT
license <LICENSE>`__. while other files can be
individually licensed especially those in ``lib`` and ``hw/mcu`` folder.
Please make sure you understand all the license term for files you use
in your project.
.. |Build Status| image:: https://github.com/hathach/tinyusb/actions/workflows/build.yml/badge.svg
:target: https://github.com/hathach/tinyusb/actions
@ -263,15 +254,12 @@ in your project.
:target: https://opensource.org/licenses/MIT
.. _Uses: docs/info/uses.rst
.. _Changelog: docs/info/changelog.rst
.. _Contributors: CONTRIBUTORS.rst
.. _Reference: docs/reference/index.rst
.. _Getting Started: docs/reference/getting_started.rst
.. _Supported Boards: docs/reference/boards.rst
.. _Dependencies: docs/reference/dependencies.rst
.. _Concurrency: docs/reference/concurrency.rst
.. _Contributing: docs/contributing/index.rst
.. _Code of Conduct: CODE_OF_CONDUCT.rst
.. _Structure: docs/contributing/structure.rst
.. _Porting: docs/contributing/porting.rst

View File

@ -5,13 +5,16 @@
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import re
from pathlib import Path
# -- Path setup --------------------------------------------------------------
# -- Project information -----------------------------------------------------
project = 'TinyUSB'
copyright = '2021, Ha Thach'
copyright = '2024, Ha Thach'
author = 'Ha Thach'
@ -40,3 +43,16 @@ html_theme_options = {
}
todo_include_todos = True
# pre-process path in README.rst
def preprocess_readme():
"""Modify figure paths in README.rst for Sphinx builds."""
src = Path(__file__).parent.parent / "README.rst"
tgt = Path(__file__).parent.parent / "README_processed.rst"
if src.exists():
content = src.read_text()
content = re.sub(r"docs/", r"", content)
content = re.sub(r".rst", r".html", content)
tgt.write_text(content)
preprocess_readme()

View File

@ -1 +1 @@
../../CODE_OF_CONDUCT.rst
.. include:: ../../CODE_OF_CONDUCT.rst

View File

@ -19,5 +19,4 @@ Index
:maxdepth: 2
code_of_conduct
structure
porting

View File

@ -1,59 +0,0 @@
*********
Structure
*********
Tree
====
::
.
├── docs
├── examples
├── hw
│   ├── bsp
│   └── mcu
├── lib
├── src
├── test
└── tools
docs
----
Documentation
examples
--------
Sample with Makefile build support
hw/bsp
------
Supported boards source files
hw/mcu
------
Low level mcu core & peripheral drivers
lib
---
Sources from 3rd party such as freeRTOS, fatfs ...
src
---
All sources files for TinyUSB stack itself.
test
----
Unit tests for the stack
tools
-----
Files used internally

View File

@ -1,6 +1,6 @@
:hide-toc:
.. include:: ../README.rst
.. include:: ../README_processed.rst
.. toctree::
:caption: Index

View File

@ -1 +1 @@
../../CONTRIBUTORS.rst
.. include:: ../../CONTRIBUTORS.rst

View File

@ -8,6 +8,5 @@ Index
.. toctree::
:maxdepth: 2
uses
changelog
contributors

View File

@ -1,17 +0,0 @@
****
Uses
****
TinyUSB is currently used by these other projects:
- `Adafruit nRF52 Arduino <https://github.com/adafruit/Adafruit_nRF52_Arduino>`__
- `Adafruit nRF52 Bootloader <https://github.com/adafruit/Adafruit_nRF52_Bootloader>`__
- `Adafruit SAMD Arduino <https://github.com/adafruit/ArduinoCore-samd>`__
- `CircuitPython <https://github.com/adafruit/circuitpython>`__
- `Espressif IDF <https://github.com/espressif/esp-idf>`__
- `MicroPython <https://github.com/micropython/micropython>`__
- `mynewt <https://mynewt.apache.org>`__
- `openinput <https://github.com/openinput-fw/openinput>`__
- `Raspberry Pi Pico SDK <https://github.com/raspberrypi/pico-sdk>`__
- `TinyUF2 Bootloader <https://github.com/adafruit/tinyuf2>`__
- `TinyUSB Arduino Library <https://github.com/adafruit/Adafruit_TinyUSB_Arduino>`__

View File

@ -1,78 +1,3 @@
*********
Reference
*********
.. figure:: ../assets/stack.svg
:width: 1600px
:alt: TinyUSB
::
.
├── docs # Documentation
├── examples # Examples with make and cmake build system
├── hw
│ ├── bsp # Supported boards source files
│ └── mcu # Low level mcu core & peripheral drivers
├── lib # Sources from 3rd party such as freeRTOS, fatfs ...
├── src # All sources files for TinyUSB stack itself.
├── test # Tests: unit test, fuzzing, hardware test
└── tools # Files used internally
Device Stack
============
Supports multiple device configurations by dynamically changing USB descriptors, low power functions such like suspend, resume, and remote wakeup. The following device classes are supported:
- Audio Class 2.0 (UAC2)
- Bluetooth Host Controller Interface (BTH HCI)
- Communication Device Class (CDC)
- Device Firmware Update (DFU): DFU mode (WIP) and Runtime
- Human Interface Device (HID): Generic (In & Out), Keyboard, Mouse, Gamepad etc ...
- Mass Storage Class (MSC): with multiple LUNs
- Musical Instrument Digital Interface (MIDI)
- Network with RNDIS, Ethernet Control Model (ECM), Network Control Model (NCM)
- Test and Measurement Class (USBTMC)
- Video class 1.5 (UVC): work in progress
- Vendor-specific class support with generic In & Out endpoints. Can be used with MS OS 2.0 compatible descriptor to load winUSB driver without INF file.
- `WebUSB <https://github.com/WICG/webusb>`__ with vendor-specific class
If you have a special requirement, `usbd_app_driver_get_cb()` can be used to write your own class driver without modifying the stack. Here is how the RPi team added their reset interface `raspberrypi/pico-sdk#197 <https://github.com/raspberrypi/pico-sdk/pull/197>`_
Host Stack
==========
- Human Interface Device (HID): Keyboard, Mouse, Generic
- Mass Storage Class (MSC)
- Communication Device Class: CDC-ACM
- Vendor serial over USB: FTDI, CP210x
- Hub with multiple-level support
Similar to the Device Stack, if you have a special requirement, `usbh_app_driver_get_cb()` can be used to write your own class driver without modifying the stack.
TypeC PD Stack
==============
- Power Delivery 3.0 (PD3.0) with USB Type-C support (WIP)
- Super early stage, only for testing purpose
- Only support STM32 G4
OS Abstraction layer
====================
TinyUSB is completely thread-safe by pushing all Interrupt Service Request (ISR) events into a central queue, then processing them later in the non-ISR context task function. It also uses semaphore/mutex to access shared resources such as Communication Device Class (CDC) FIFO. Therefore the stack needs to use some of the OS's basic APIs. Following OSes are already supported out of the box.
- **No OS**
- **FreeRTOS**
- `RT-Thread <https://github.com/RT-Thread/rt-thread>`_: `repo <https://github.com/RT-Thread-packages/tinyusb>`_
- **Mynewt** Due to the newt package build system, Mynewt examples are better to be on its `own repo <https://github.com/hathach/mynewt-tinyusb-example>`_
License
=======
All TinyUSB sources in the `src` folder are licensed under MIT license. However, each file can be individually licensed especially those in `lib` and `hw/mcu` folder. Please make sure you understand all the license term for files you use in your project.
Index
=====