Skip to content

Commit 4f788e0

Browse files
committed
README: Improve documentation
1 parent 028140e commit 4f788e0

File tree

1 file changed

+35
-10
lines changed

1 file changed

+35
-10
lines changed

README.md

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,36 @@ A program to extract AF modes on MCU pins from the database files provided with
66

77
## Usage
88

9-
```
10-
cargo run $PATH_TO_MCU_DB_DIR $NAME_OF_MCU_FAMILY
11-
```
9+
cargo run features STM32L0 -d /path/to/stm32cubemx/db/mcu/
10+
cargo run pin_mappings STM32L0 -d /path/to/stm32cubemx/db/mcu/
1211

13-
Under a default windows install `$PATH_TO_MCU_DB_DIR` is `C:\Program Files
12+
Under a default Windows install, the database path is `C:\Program Files
1413
(x86)\STMicroelectronics\STM32Cube\STM32CubeMX\db\mcu`, adjust as appropriate
1514
for your local config. The MCU family name should match one of the MCU families
16-
as defined in `families.xml`. The program will output one AF mode definition
17-
per GPIO variant, with a corresponding feature gate.
15+
as defined in `families.xml`. At the time of writing, the following families
16+
are available:
17+
18+
* STM32F0
19+
* STM32F1
20+
* STM32F2
21+
* STM32F3
22+
* STM32F4
23+
* STM32F7
24+
* STM32G0
25+
* STM32G4
26+
* STM32H7
27+
* STM32L0
28+
* STM32L1
29+
* STM32L4
30+
* STM32L4+
31+
* STM32L5
32+
* STM32MP1
33+
* STM32WB
34+
35+
The program will output one AF mode definition per GPIO variant, with a
36+
corresponding feature gate.
37+
38+
More on the generated feature groups can be found below.
1839

1940
## The STM32CubeMX Database
2041

@@ -141,10 +162,10 @@ pin (AF0), or some other variants.
141162

142163
## Feature Groups
143164

144-
When generating pin function mappings, we want to avoid generating a Cargo
145-
feature for every possible MCU, since that would result in dozens or even
146-
hundreds of features per family. If we don't generate a feature per MCU, we
147-
need to group them somehow. The best way is probably to follow ST's grouping,
165+
When generating pin function mappings, we want to avoid generating a mapping
166+
for every possible MCU, since that would result in dozens or even hundreds of
167+
pin definitions. However, if we don't want a mapping per MCU, we need to group
168+
them somehow. The best way for grouping is probably to follow ST's grouping,
148169
which is encoded in the IP versions described above.
149170

150171
The feature names are mapped as follows:
@@ -187,6 +208,10 @@ database is probably still better than creating our own grouping, which may be
187208
broken at any time by ST releasing a new MCU in a pre-existing group, but with
188209
a different, incompatible GPIO IP version.
189210

211+
In order to simplify the GPIO IP version selection for the user, alias features
212+
are generated. These are purely a convenience for the user and are never used
213+
directly as feature gates in the source code.
214+
190215
<!-- Badges -->
191216
[github-actions]: https://github.com/dbrgn/cube-parse/actions?query=branch%3Amaster
192217
[github-actions-badge]: https://github.com/dbrgn/cube-parse/workflows/CI/badge.svg

0 commit comments

Comments
 (0)