@@ -6,15 +6,36 @@ A program to extract AF modes on MCU pins from the database files provided with
6
6
7
7
## Usage
8
8
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/
12
11
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
14
13
(x86)\STMicroelectronics\STM32Cube\STM32CubeMX\db\mcu`, adjust as appropriate
15
14
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.
18
39
19
40
## The STM32CubeMX Database
20
41
@@ -141,10 +162,10 @@ pin (AF0), or some other variants.
141
162
142
163
## Feature Groups
143
164
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,
148
169
which is encoded in the IP versions described above.
149
170
150
171
The feature names are mapped as follows:
@@ -187,6 +208,10 @@ database is probably still better than creating our own grouping, which may be
187
208
broken at any time by ST releasing a new MCU in a pre-existing group, but with
188
209
a different, incompatible GPIO IP version.
189
210
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
+
190
215
<!-- Badges -->
191
216
[ github-actions ] : https://github.com/dbrgn/cube-parse/actions?query=branch%3Amaster
192
217
[ github-actions-badge ] : https://github.com/dbrgn/cube-parse/workflows/CI/badge.svg
0 commit comments