Skip to content

Commit de38e53

Browse files
committed
update docs, remove uses.rst, structure.rst. Refactor docs, use README.rst for docs index.rst
1 parent 29f226c commit de38e53

File tree

10 files changed

+25
-174
lines changed

10 files changed

+25
-174
lines changed

README.rst

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ Sponsors
55

66
TinyUSB is funded by: Adafruit. Purchasing products from them helps to support this project.
77

8-
.. figure:: /docs/assets/adafruit_logo.svg
8+
.. figure:: docs/assets/adafruit_logo.svg
99
:alt: Adafruit Logo
1010
:target: https://www.adafruit.com
1111

1212
TinyUSB Project
1313
===============
1414

15-
.. figure:: /docs/assets/logo.svg
15+
.. figure:: docs/assets/logo.svg
1616
:alt: TinyUSB
1717

1818
TinyUSB is an open-source cross-platform USB Host/Device stack for
1919
embedded system, designed to be memory-safe with no dynamic allocation
2020
and thread-safe with all interrupt events are deferred then handled in
2121
the non-ISR task function. Check out the online `documentation <https://docs.tinyusb.org/>`__ for more details.
2222

23-
.. figure:: /docs/assets/stack.svg
23+
.. figure:: docs/assets/stack.svg
2424
:width: 500px
2525
:alt: stackup
2626

@@ -43,12 +43,12 @@ Getting started
4343

4444
See the `online documentation <https://docs.tinyusb.org>`_ for information about using TinyUSB and how it is implemented.
4545

46+
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.
47+
4648
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.
4749

4850
For bugs and feature requests, please `raise an issue <https://github.com/hathach/tinyusb/issues>`_ and follow the templates there.
4951

50-
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.
51-
5252
See `Porting`_ guide for adding support for new MCUs and boards.
5353

5454
Device Stack
@@ -241,15 +241,6 @@ Table Legend
241241
\[empty\] Unknown
242242
========= =========================
243243

244-
License
245-
=======
246-
247-
All TinyUSB files in the ``src`` folder are licensed under the `MIT
248-
license <LICENSE>`__. while other files can be
249-
individually licensed especially those in ``lib`` and ``hw/mcu`` folder.
250-
Please make sure you understand all the license term for files you use
251-
in your project.
252-
253244

254245
.. |Build Status| image:: https://github.com/hathach/tinyusb/actions/workflows/build.yml/badge.svg
255246
:target: https://github.com/hathach/tinyusb/actions
@@ -263,15 +254,12 @@ in your project.
263254
:target: https://opensource.org/licenses/MIT
264255

265256

266-
.. _Uses: docs/info/uses.rst
267257
.. _Changelog: docs/info/changelog.rst
268258
.. _Contributors: CONTRIBUTORS.rst
269-
.. _Reference: docs/reference/index.rst
270259
.. _Getting Started: docs/reference/getting_started.rst
271260
.. _Supported Boards: docs/reference/boards.rst
272261
.. _Dependencies: docs/reference/dependencies.rst
273262
.. _Concurrency: docs/reference/concurrency.rst
274263
.. _Contributing: docs/contributing/index.rst
275264
.. _Code of Conduct: CODE_OF_CONDUCT.rst
276-
.. _Structure: docs/contributing/structure.rst
277265
.. _Porting: docs/contributing/porting.rst

docs/conf.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@
55
# list see the documentation:
66
# https://www.sphinx-doc.org/en/master/usage/configuration.html
77

8+
import re
9+
from pathlib import Path
10+
811
# -- Path setup --------------------------------------------------------------
912

1013

1114
# -- Project information -----------------------------------------------------
1215

1316
project = 'TinyUSB'
14-
copyright = '2021, Ha Thach'
17+
copyright = '2024, Ha Thach'
1518
author = 'Ha Thach'
1619

1720

@@ -40,3 +43,16 @@
4043
}
4144

4245
todo_include_todos = True
46+
47+
# pre-process path in README.rst
48+
def preprocess_readme():
49+
"""Modify figure paths in README.rst for Sphinx builds."""
50+
src = Path(__file__).parent.parent / "README.rst"
51+
tgt = Path(__file__).parent.parent / "README_processed.rst"
52+
if src.exists():
53+
content = src.read_text()
54+
content = re.sub(r"docs/", r"", content)
55+
content = re.sub(r".rst", r".html", content)
56+
tgt.write_text(content)
57+
58+
preprocess_readme()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../CODE_OF_CONDUCT.rst
1+
.. include:: ../../CODE_OF_CONDUCT.rst

docs/contributing/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@ Index
1919
:maxdepth: 2
2020

2121
code_of_conduct
22-
structure
2322
porting

docs/contributing/structure.rst

Lines changed: 0 additions & 59 deletions
This file was deleted.

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
:hide-toc:
22

3-
.. include:: ../README.rst
3+
.. include:: ../README_processed.rst
44

55
.. toctree::
66
:caption: Index

docs/info/contributors.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../CONTRIBUTORS.rst
1+
.. include:: ../../CONTRIBUTORS.rst

docs/info/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ Index
88
.. toctree::
99
:maxdepth: 2
1010

11-
uses
1211
changelog
1312
contributors

docs/info/uses.rst

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/reference/index.rst

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,3 @@
1-
*********
2-
Reference
3-
*********
4-
5-
.. figure:: ../assets/stack.svg
6-
:width: 1600px
7-
:alt: TinyUSB
8-
9-
::
10-
11-
.
12-
├── docs # Documentation
13-
├── examples # Examples with make and cmake build system
14-
├── hw
15-
│ ├── bsp # Supported boards source files
16-
│ └── mcu # Low level mcu core & peripheral drivers
17-
├── lib # Sources from 3rd party such as freeRTOS, fatfs ...
18-
├── src # All sources files for TinyUSB stack itself.
19-
├── test # Tests: unit test, fuzzing, hardware test
20-
└── tools # Files used internally
21-
22-
23-
Device Stack
24-
============
25-
26-
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:
27-
28-
- Audio Class 2.0 (UAC2)
29-
- Bluetooth Host Controller Interface (BTH HCI)
30-
- Communication Device Class (CDC)
31-
- Device Firmware Update (DFU): DFU mode (WIP) and Runtime
32-
- Human Interface Device (HID): Generic (In & Out), Keyboard, Mouse, Gamepad etc ...
33-
- Mass Storage Class (MSC): with multiple LUNs
34-
- Musical Instrument Digital Interface (MIDI)
35-
- Network with RNDIS, Ethernet Control Model (ECM), Network Control Model (NCM)
36-
- Test and Measurement Class (USBTMC)
37-
- Video class 1.5 (UVC): work in progress
38-
- 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.
39-
- `WebUSB <https://github.com/WICG/webusb>`__ with vendor-specific class
40-
41-
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>`_
42-
43-
Host Stack
44-
==========
45-
46-
- Human Interface Device (HID): Keyboard, Mouse, Generic
47-
- Mass Storage Class (MSC)
48-
- Communication Device Class: CDC-ACM
49-
- Vendor serial over USB: FTDI, CP210x
50-
- Hub with multiple-level support
51-
52-
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.
53-
54-
TypeC PD Stack
55-
==============
56-
57-
- Power Delivery 3.0 (PD3.0) with USB Type-C support (WIP)
58-
- Super early stage, only for testing purpose
59-
- Only support STM32 G4
60-
61-
OS Abstraction layer
62-
====================
63-
64-
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.
65-
66-
- **No OS**
67-
- **FreeRTOS**
68-
- `RT-Thread <https://github.com/RT-Thread/rt-thread>`_: `repo <https://github.com/RT-Thread-packages/tinyusb>`_
69-
- **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>`_
70-
71-
License
72-
=======
73-
74-
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.
75-
761
Index
772
=====
783

0 commit comments

Comments
 (0)