Skip to content

Commit 8a094e8

Browse files
authored
Merge pull request #3278 from c1570/improved_docs
Documentation improvements
2 parents 96f35fc + a1ae5b2 commit 8a094e8

25 files changed

+1767
-362
lines changed

.github/workflows/static_analysis.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ jobs:
9090
path: ${{ steps.analyze.outputs.sarif-output }}
9191

9292
PVS-Studio:
93-
if: github.repository_owner == 'hathach'
93+
# Only run on non-forked PR since secrets token is required
94+
if: github.repository_owner == 'hathach' && github.event.pull_request.head.repo.fork == false
9495
runs-on: ubuntu-latest
9596
strategy:
9697
fail-fast: false
@@ -141,7 +142,8 @@ jobs:
141142
path: pvs-studio-${{ matrix.board }}.sarif
142143

143144
SonarQube:
144-
if: github.repository_owner == 'hathach'
145+
# Only run on non-forked PR since secrets token is required
146+
if: github.repository_owner == 'hathach' && github.event.pull_request.head.repo.fork == false
145147
runs-on: ubuntu-latest
146148
env:
147149
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory
@@ -184,7 +186,8 @@ jobs:
184186
--define sonar.cfamily.compile-commands=${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json
185187
186188
IAR-CStat:
187-
#if: github.repository_owner == 'hathach'
189+
# Only run on non-forked PR since secrets token is required
190+
#if: github.repository_owner == 'hathach' && github.event.pull_request.head.repo.fork == false
188191
if: false
189192
runs-on: ubuntu-latest
190193
strategy:

README.rst

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,55 @@
1+
TinyUSB
2+
=======
3+
14
|Build Status| |CircleCI Status| |Documentation Status| |Static Analysis| |Fuzzing Status| |License|
25

36
Sponsors
4-
========
7+
--------
58

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

811
.. figure:: docs/assets/adafruit_logo.svg
912
:alt: Adafruit Logo
13+
:align: left
1014
:target: https://www.adafruit.com
1115

12-
TinyUSB Project
13-
===============
16+
.. raw:: html
17+
18+
<div class="clear-both"></div>
19+
20+
Overview
21+
--------
1422

1523
.. figure:: docs/assets/logo.svg
1624
:alt: TinyUSB
25+
:align: left
26+
27+
.. raw:: html
28+
29+
<div class="clear-both"></div>
30+
31+
TinyUSB is an open-source cross-platform USB Host/Device stack for embedded systems. It’s designed for memory safety
32+
(no dynamic allocation) and thread safety (all interrupts deferred to non-ISR task functions). The stack emphasizes portability,
33+
small footprint, and real-time performance across 50+ MCU families.
1734

18-
TinyUSB is an open-source cross-platform USB Host/Device stack for 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.
35+
Key Features
36+
------------
37+
38+
* **Thread-safe:** USB interrupts deferred to task context
39+
* **Memory-safe:** No dynamic allocation, all buffers static
40+
* **Portable:** Supports 50+ MCU families
41+
* **Comprehensive:** Includes CDC, HID, MSC, Audio, and Host support
42+
* **RTOS-friendly:** Works with bare metal, FreeRTOS, RT-Thread, and Mynewt
1943

2044
.. figure:: docs/assets/stack.svg
2145
:width: 500px
46+
:align: left
2247
:alt: stackup
2348

49+
.. raw:: html
50+
51+
<div class="clear-both"></div>
52+
2453
::
2554

2655
.
@@ -36,7 +65,7 @@ TinyUSB is an open-source cross-platform USB Host/Device stack for embedded syst
3665

3766

3867
Getting started
39-
===============
68+
---------------
4069

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

@@ -49,7 +78,7 @@ For bugs and feature requests, please `raise an issue <https://github.com/hathac
4978
See `Porting`_ guide for adding support for new MCUs and boards.
5079

5180
Device Stack
52-
============
81+
------------
5382

5483
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:
5584

@@ -70,7 +99,7 @@ Supports multiple device configurations by dynamically changing USB descriptors,
7099
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>`_
71100

72101
Host Stack
73-
==========
102+
----------
74103

75104
- Human Interface Device (HID): Keyboard, Mouse, Generic
76105
- Mass Storage Class (MSC)
@@ -81,14 +110,14 @@ Host Stack
81110
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.
82111

83112
Power Delivery Stack
84-
====================
113+
--------------------
85114

86115
- Power Delivery 3.0 (PD3.0) with USB Type-C support (WIP)
87116
- Super early stage, only for testing purpose
88117
- Only support STM32 G4
89118

90119
OS Abstraction layer
91-
====================
120+
--------------------
92121

93122
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.
94123

@@ -98,7 +127,7 @@ TinyUSB is completely thread-safe by pushing all Interrupt Service Request (ISR)
98127
- **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>`_
99128

100129
Supported CPUs
101-
==============
130+
--------------
102131

103132
+--------------+-----------------------------+--------+------+-----------+------------------------+-------------------+
104133
| Manufacturer | Family | Device | Host | Highspeed | Driver | Note |
@@ -234,7 +263,7 @@ Supported CPUs
234263
+--------------+-----------------------------+--------+------+-----------+------------------------+-------------------+
235264

236265
Table Legend
237-
------------
266+
^^^^^^^^^^^^
238267

239268
========= =========================
240269
✔ Supported
@@ -244,7 +273,7 @@ Table Legend
244273
========= =========================
245274

246275
Development Tools
247-
=================
276+
-----------------
248277

249278
The following tools are provided freely to support the development of the TinyUSB project:
250279

@@ -273,6 +302,5 @@ The following tools are provided freely to support the development of the TinyUS
273302
.. _Supported Boards: docs/reference/boards.rst
274303
.. _Dependencies: docs/reference/dependencies.rst
275304
.. _Concurrency: docs/reference/concurrency.rst
276-
.. _Contributing: docs/contributing/index.rst
277305
.. _Code of Conduct: CODE_OF_CONDUCT.rst
278-
.. _Porting: docs/contributing/porting.rst
306+
.. _Porting: docs/porting.rst

docs/_static/custom.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.clear-both {
2+
clear: both;
3+
}

docs/conf.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# -- Project information -----------------------------------------------------
1515

1616
project = 'TinyUSB'
17-
copyright = '2024, Ha Thach'
17+
copyright = '2025, Ha Thach'
1818
author = 'Ha Thach'
1919

2020

@@ -41,6 +41,8 @@
4141
html_theme_options = {
4242
'sidebar_hide_name': True,
4343
}
44+
html_static_path = ['_static']
45+
html_css_files = ['custom.css']
4446

4547
todo_include_todos = True
4648

@@ -52,7 +54,9 @@ def preprocess_readme():
5254
if src.exists():
5355
content = src.read_text()
5456
content = re.sub(r"docs/", r"", content)
55-
content = re.sub(r".rst", r".html", content)
57+
content = re.sub(r"\.rst\b", r".html", content)
58+
if not content.endswith("\n"):
59+
content += "\n"
5660
tgt.write_text(content)
5761

5862
preprocess_readme()

docs/contributing/code_of_conduct.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/contributing/index.rst

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

0 commit comments

Comments
 (0)