aboutsummaryrefslogtreecommitdiff
path: root/docs/pages/stm32.adoc
diff options
context:
space:
mode:
authorUlf Lilleengen <[email protected]>2024-05-18 10:17:03 +0200
committerUlf Lilleengen <[email protected]>2024-05-21 10:05:21 +0200
commit739e5861c2e47db251725163fcd91cd822cf97b7 (patch)
tree947dc7961ca7c42ec216056fc2adf616ab812b10 /docs/pages/stm32.adoc
parent51d553092550059afb22b2620cea14bbed21abff (diff)
convert from antora to asciidoctor
Diffstat (limited to 'docs/pages/stm32.adoc')
-rw-r--r--docs/pages/stm32.adoc24
1 files changed, 24 insertions, 0 deletions
diff --git a/docs/pages/stm32.adoc b/docs/pages/stm32.adoc
new file mode 100644
index 000000000..7bfc0592b
--- /dev/null
+++ b/docs/pages/stm32.adoc
@@ -0,0 +1,24 @@
1= Embassy STM32 HAL
2
3The link:https://github.com/embassy-rs/embassy/tree/master/embassy-stm32[Embassy STM32 HAL] is based on the `stm32-metapac` project.
4
5== The infinite variant problem
6
7STM32 microcontrollers come in many families, and flavors and supporting all of them is a big undertaking. Embassy has taken advantage of the fact
8that the STM32 peripheral versions are shared across chip families. Instead of re-implementing the SPI
9peripheral for every STM32 chip family, embassy has a single SPI implementation that depends on
10code-generated register types that are identical for STM32 families with the same version of a given peripheral.
11
12=== The metapac
13
14The `stm32-metapac` module uses pre-generated chip and register definitions for STM32 chip families to generate register types. This is done at compile time based on Cargo feature flags.
15
16The chip and register definitions are located in a separate module, `stm32-data`, which is modified whenever a bug is found in the definitions, or when adding support for new chip families.
17
18=== The HAL
19
20The `embassy-stm32` module contains the HAL implementation for all STM32 families. The implementation uses automatically derived feature flags to support the correct version of a given peripheral for a given chip family.
21
22== Timer driver
23
24The STM32 timer driver operates at 32768 Hz by default.