diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c50f925b..3bdeeaf7 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -38,6 +38,15 @@ jobs:
- stm32f446
- stm32f469
- stm32f479
+ - stm32f722
+ - stm32f723
+ - stm32f730
+ - stm32f745
+ - stm32f746
+ - stm32f765
+ - stm32f767
+ - stm32f769
+
rust:
- stable
features:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a24312e2..82281cea 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,7 +9,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Implement `embedded_hal::i2c::I2c` for `I2cMasterDma` [#838]
- Back to `stm32f4`
+ - Integrate STM32F7 support
- Implement `Ptr`, `Sealed`, `Steal` for generic `Periph` [#834]
+ - Rename `ErasedPin` to `AnyPin` [#841]
- Use `&mut RCC` for `PER::enable/reset`
- Unmacro `Adc` [#832]
- Use `write` instead of `modify` to clear flags [#829]
@@ -20,6 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Fefactor FMPI2c `embedded-hal` implementations [#784]
- remove `NoPin`, use `Option` instead [#813]
+[#667]: https://github.com/stm32-rs/stm32f4xx-hal/pull/667
[#770]: https://github.com/stm32-rs/stm32f4xx-hal/pull/770
[#784]: https://github.com/stm32-rs/stm32f4xx-hal/pull/784
[#813]: https://github.com/stm32-rs/stm32f4xx-hal/pull/813
@@ -31,6 +34,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
[#834]: https://github.com/stm32-rs/stm32f4xx-hal/pull/834
[#838]: https://github.com/stm32-rs/stm32f4xx-hal/pull/838
[#839]: https://github.com/stm32-rs/stm32f4xx-hal/pull/839
+[#841]: https://github.com/stm32-rs/stm32f4xx-hal/pull/841
## [v0.22.1] - 2024-11-03
diff --git a/Cargo.toml b/Cargo.toml
index bf124a1a..9dbccedb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -68,6 +68,12 @@ micromath = { version = "2.1.0", optional = true }
[dependencies.stm32f4]
version = "0.16.0"
features = ["atomics"]
+optional = true
+
+[dependencies.stm32f7]
+version = "0.16.0"
+features = ["atomics"]
+optional = true
[dependencies.time]
version = "0.3.37"
@@ -92,7 +98,7 @@ version = "0.5.0"
optional = true
[dev-dependencies]
-defmt = "0.3.4"
+defmt = "1.0"
defmt-rtt = "0.4.0"
panic-probe = { version = "0.3.2", features = ["print-defmt"] }
panic-semihosting = "0.6.0"
@@ -126,6 +132,11 @@ default-features = false
features = ["macros"]
[features]
+f4 = ["dep:stm32f4", "bb", "dma", "i2c_v1", "spi_v1", "uart_v2"]
+f7 = ["dep:stm32f7", "dep:micromath", "dma", "i2c_v2", "spi_v2", "uart_v3"]
+
+# F4
+
#! Use one of the supported STM32-serie related features:
#! `stm32f401`, `stm32f405`, `stm32f407`, `stm32f415`, `stm32f417`, `stm32f410`,
#! `stm32f411`, `stm32f412`, `stm32f413`, `stm32f423`, `stm32f427`, `stm32f429`,
@@ -133,32 +144,56 @@ features = ["macros"]
# Note: stm32f4 has only one feature for some very similar device families,
# so it's intended for e.g. stm32f405/415 to both enable stm32f4/stm32f405.
-stm32f401 = ["stm32f4/stm32f401", "gpio-f401"]
-stm32f405 = ["stm32f4/stm32f405", "gpio-f417"]
-stm32f407 = ["stm32f4/stm32f407", "gpio-f417"]
-stm32f415 = ["stm32f4/stm32f405", "gpio-f417", "cryp"]
-stm32f417 = ["stm32f4/stm32f407", "gpio-f417", "cryp"]
-stm32f410 = ["stm32f4/stm32f410", "gpio-f410"]
-stm32f411 = ["stm32f4/stm32f411", "gpio-f411"]
-stm32f412 = ["stm32f4/stm32f412", "gpio-f412"]
-stm32f413 = ["stm32f4/stm32f413", "gpio-f413"]
-stm32f423 = ["stm32f4/stm32f413", "gpio-f413", "aes"]
-stm32f427 = ["stm32f4/stm32f427", "gpio-f427", "fsmc"]
-stm32f429 = ["stm32f4/stm32f429", "gpio-f427", "fmc", "ltdc"]
-stm32f437 = ["stm32f4/stm32f427", "gpio-f427", "fsmc", "cryp"]
-stm32f439 = ["stm32f4/stm32f429", "gpio-f427", "fmc", "cryp", "ltdc"]
-stm32f446 = ["stm32f4/stm32f446", "gpio-f446"]
-stm32f469 = ["stm32f4/stm32f469", "gpio-f469"]
-stm32f479 = ["stm32f4/stm32f469", "gpio-f469", "cryp"]
+stm32f401 = ["svd-f401"]
+stm32f405 = ["svd-f405"]
+stm32f407 = ["svd-f407"]
+stm32f415 = ["svd-f405", "cryp"]
+stm32f417 = ["svd-f407", "cryp"]
+stm32f410 = ["svd-f410"]
+stm32f411 = ["svd-f411"]
+stm32f412 = ["svd-f412"]
+stm32f413 = ["svd-f413"]
+stm32f423 = ["svd-f413", "aes"]
+stm32f427 = ["svd-f427"]
+stm32f429 = ["svd-f429"]
+stm32f437 = ["svd-f427", "cryp"]
+stm32f439 = ["svd-f429", "cryp"]
+stm32f446 = ["svd-f446"]
+stm32f469 = ["svd-f469"]
+stm32f479 = ["svd-f469", "cryp"]
+
+svd-f401 = ["f4", "stm32f4?/stm32f401", "gpio-f401"]
+svd-f405 = ["f4", "stm32f4?/stm32f405", "gpio-f417"]
+svd-f407 = ["f4", "stm32f4?/stm32f407", "gpio-f417", "eth"]
+svd-f410 = ["f4", "stm32f4?/stm32f410", "gpio-f410"]
+svd-f411 = ["f4", "stm32f4?/stm32f411", "gpio-f411"]
+svd-f412 = ["f4", "stm32f4?/stm32f412", "gpio-f412"]
+svd-f413 = ["f4", "stm32f4?/stm32f413", "gpio-f413"]
+svd-f427 = ["f4", "stm32f4?/stm32f427", "gpio-f427", "fsmc"]
+svd-f429 = ["f4", "stm32f4?/stm32f429", "gpio-f427", "fmc", "ltdc"]
+svd-f446 = ["f4", "stm32f4?/stm32f446", "gpio-f446"]
+svd-f469 = ["f4", "stm32f4?/stm32f469", "gpio-f469"]
gpio-f401 = [
+ "gpioc",
"gpiod",
"gpioe",
+ "gpioh",
+ "i2c2",
"i2c3",
+ "i2s",
+ "i2s2",
+ "i2s2ext",
+ "i2s3",
+ "i2s3ext",
+ "rtc",
"otg-fs",
"sdio",
+ "spi1",
+ "spi2",
"spi3",
"spi4",
+ "sys",
"tim1",
"tim2",
"tim3",
@@ -167,25 +202,58 @@ gpio-f401 = [
"tim9",
"tim10",
"tim11",
+ "usart1",
+ "usart2",
+ "usart6",
"rcc_shared_m",
]
gpio-f410 = [
+ "gpioc",
+ "gpioh",
"dac",
"fmpi2c1",
+ "i2c2",
+ "i2s",
+ "i2s1",
+ "i2s2",
+ "i2s5",
"lptim1",
+ "rtc",
+ "spi1",
+ "spi2",
"spi5",
+ "sys",
"tim1",
"tim5",
"tim6",
"tim9",
"tim11",
+ "usart1",
+ "usart2",
+ "usart6",
]
gpio-f411 = [
+ "gpioc",
"gpiod",
"gpioe", # "gpioi",
+ "gpioh",
+ "i2c2",
"i2c3",
"otg-fs",
+ "i2s",
+ "i2s1",
+ "i2s2",
+ "i2s3",
+ "i2s4",
+ "i2s5",
+ "rtc",
"sdio",
+ "spi1",
+ "spi2",
+ "spi3",
+ "spi4",
+ "spi5",
+ "sys",
"tim1",
"tim2",
"tim3",
@@ -194,28 +262,41 @@ gpio-f411 = [
"tim9",
"tim10",
"tim11",
- "spi3",
- "spi4",
- "spi5",
+ "usart1",
+ "usart2",
+ "usart6",
]
gpio-f412 = [
+ "gpioc",
"gpiod",
"gpioe",
"gpiof",
"gpiog",
+ "gpioh",
"can1",
"can2",
"dfsdm1",
"fmpi2c1",
"fsmc",
+ "i2c2",
"i2c3",
+ "i2s",
+ "i2s1",
+ "i2s2",
+ "i2s3",
+ "i2s4",
+ "i2s5",
"quadspi",
"otg-fs",
"rng",
+ "rtc",
"sdio",
+ "spi1",
+ "spi2",
"spi3",
"spi4",
"spi5",
+ "sys",
"tim1",
"tim2",
"tim3",
@@ -230,14 +311,19 @@ gpio-f412 = [
"tim12",
"tim13",
"tim14",
+ "usart1",
+ "usart2",
"usart3",
+ "usart6",
"rcc_i2s_apb",
]
gpio-f413 = [
+ "gpioc",
"gpiod",
"gpioe",
"gpiof",
"gpiog",
+ "gpioh",
"can1",
"can2",
"can3",
@@ -246,16 +332,27 @@ gpio-f413 = [
"dfsdm2",
"fsmc",
"fmpi2c1",
+ "i2c2",
"i2c3",
+ "i2s",
+ "i2s1",
+ "i2s2",
+ "i2s3",
+ "i2s4",
+ "i2s5",
"lptim1",
"quadspi",
"otg-fs",
"rng",
+ "rtc",
"sai1",
"sdio",
+ "spi1",
+ "spi2",
"spi3",
"spi4",
"spi5",
+ "sys",
"tim1",
"tim2",
"tim3",
@@ -270,7 +367,10 @@ gpio-f413 = [
"tim12",
"tim13",
"tim14",
+ "usart1",
+ "usart2",
"usart3",
+ "usart6",
"uart4",
"uart5",
"uart7",
@@ -280,25 +380,34 @@ gpio-f413 = [
"rcc_i2s_apb",
]
gpio-f417 = [
+ "gpioc",
"gpiod",
"gpioe",
"gpiof",
"gpiog",
"gpioi",
+ "gpioh",
"adc2",
"adc3",
"can1",
"can2",
"dac",
"dcmi",
- "eth",
"fsmc",
+ "i2c2",
"i2c3",
+ "i2s",
+ "i2s2",
+ "i2s3",
"otg-fs",
"otg-hs",
"rng",
+ "rtc",
"sdio",
+ "spi1",
+ "spi2",
"spi3",
+ "sys",
"tim1",
"tim2",
"tim3",
@@ -313,16 +422,21 @@ gpio-f417 = [
"tim12",
"tim13",
"tim14",
+ "usart1",
+ "usart2",
"usart3",
+ "usart6",
"uart4",
"uart5",
"rcc_shared_m",
]
gpio-f427 = [
+ "gpioc",
"gpiod",
"gpioe",
"gpiof",
"gpiog",
+ "gpioh",
"gpioi",
"gpioj",
"gpiok",
@@ -334,16 +448,24 @@ gpio-f427 = [
"dcmi",
"dma2d",
"eth",
+ "i2c2",
"i2c3",
+ "i2s",
+ "i2s2",
+ "i2s3",
"otg-fs",
"otg-hs",
"rng",
+ "rtc",
"sai1",
"sdio",
+ "spi1",
+ "spi2",
"spi3",
"spi4",
"spi5",
"spi6",
+ "sys",
"tim1",
"tim2",
"tim3",
@@ -358,7 +480,10 @@ gpio-f427 = [
"tim12",
"tim13",
"tim14",
+ "usart1",
+ "usart2",
"usart3",
+ "usart6",
"uart4",
"uart5",
"uart7",
@@ -366,28 +491,40 @@ gpio-f427 = [
"rcc_shared_m",
]
gpio-f446 = [
+ "gpioc",
"gpiod",
"gpioe",
"gpiof",
"gpiog",
+ "gpioh",
"adc2",
"adc3",
"can1",
"can2",
"dac",
"dcmi",
+ "fmc",
"fmpi2c1",
"fmc",
+ "i2c2",
"i2c3",
+ "i2s",
+ "i2s1",
+ "i2s2",
+ "i2s3",
"quadspi",
+ "rtc",
"otg-fs",
"otg-hs",
"sai1",
"sai2",
"sdio",
+ "spdifrx",
+ "spi1",
+ "spi2",
"spi3",
"spi4",
- "spdifrx",
+ "sys",
"tim1",
"tim2",
"tim3",
@@ -402,16 +539,21 @@ gpio-f446 = [
"tim12",
"tim13",
"tim14",
+ "usart1",
+ "usart2",
"usart3",
+ "usart6",
"uart4",
"uart5",
"rcc_i2s_apb",
]
gpio-f469 = [
+ "gpioc",
"gpiod",
"gpioe",
"gpiof",
"gpiog",
+ "gpioh",
"gpioi",
"gpioj",
"gpiok",
@@ -425,18 +567,26 @@ gpio-f469 = [
"dsihost",
"eth",
"fmc",
+ "i2c2",
"i2c3",
+ "i2s",
+ "i2s2",
+ "i2s3",
"ltdc",
"quadspi",
"otg-fs",
"otg-hs",
"rng",
+ "rtc",
"sai1",
"sdio",
+ "spi1",
+ "spi2",
"spi3",
"spi4",
"spi5",
"spi6",
+ "sys",
"tim1",
"tim2",
"tim3",
@@ -451,7 +601,10 @@ gpio-f469 = [
"tim12",
"tim13",
"tim14",
+ "usart1",
+ "usart2",
"usart3",
+ "usart6",
"uart4",
"uart5",
"uart7",
@@ -459,6 +612,287 @@ gpio-f469 = [
"rcc_shared_m",
]
+# F7
+
+stm32f722 = ["svd-f722"]
+stm32f723 = ["svd-f723"]
+stm32f730 = ["svd-f730"]
+stm32f732 = ["svd-f732"]
+stm32f733 = ["svd-f733"]
+stm32f745 = ["svd-f745"]
+stm32f746 = ["svd-f746"]
+stm32f750 = ["svd-f750"]
+stm32f756 = ["svd-f756"]
+stm32f765 = ["svd-f765"]
+stm32f767 = ["svd-f767"]
+stm32f769 = ["svd-f769"]
+stm32f777 = ["svd-f777"]
+stm32f778 = ["svd-f778"]
+stm32f779 = ["svd-f779"]
+
+svd-f722 = ["f7", "stm32f7?/stm32f722", "gpio-f72x"]
+svd-f723 = ["f7", "stm32f7?/stm32f723", "gpio-f72x", "usb_hs_phy"]
+svd-f732 = ["f7", "stm32f7?/stm32f732", "gpio-f72x"]
+svd-f733 = ["f7", "stm32f7?/stm32f733", "gpio-f72x", "usb_hs_phy"]
+svd-f730 = ["f7", "stm32f7?/stm32f730", "gpio-f72x", "aes", "usb_hs_phy"]
+svd-f745 = ["f7", "stm32f7?/stm32f745", "gpio-f746"]
+svd-f746 = ["f7", "stm32f7?/stm32f746", "gpio-f746"]
+svd-f750 = ["f7", "stm32f7?/stm32f750", "gpio-f746"]
+svd-f756 = ["f7", "stm32f7?/stm32f756", "gpio-f746"]
+svd-f765 = ["f7", "stm32f7?/stm32f765", "gpio-f76x"]
+svd-f767 = [
+ "f7",
+ "stm32f7?/stm32f767",
+ "gpio-f76x",
+ "dsihost",
+ "can3",
+ "jpeg",
+ "mdios",
+ "sdmmc2",
+]
+svd-f769 = [
+ "f7",
+ "stm32f7?/stm32f769",
+ "gpio-f76x",
+ "dfsdm1",
+ "dsihost",
+ "can3",
+ "jpeg",
+ "mdios",
+ "sdmmc2",
+]
+svd-f777 = [
+ "f7",
+ "stm32f7?/stm32f777",
+ "gpio-f76x",
+ "dsihost",
+ "can3",
+ "jpeg",
+ "mdios",
+ "sdmmc2",
+]
+svd-f778 = [
+ "f7",
+ "stm32f7?/stm32f778",
+ "gpio-f76x",
+ "dsihost",
+ "can3",
+ "jpeg",
+ "mdios",
+ "sdmmc2",
+]
+svd-f779 = [
+ "f7",
+ "stm32f7?/stm32f779",
+ "gpio-f76x",
+ "dfsdm1",
+ "dsihost",
+ "can3",
+ "jpeg",
+ "mdios",
+ "sdmmc2",
+]
+
+gpio-f72x = [
+ "adc2",
+ "adc3",
+ "can1",
+ "dac",
+ "fmc",
+ "gpioc",
+ "gpiod",
+ "gpioe",
+ "gpiof",
+ "gpiog",
+ "gpioh",
+ "gpioi",
+ "i2c2",
+ "i2c3",
+ "i2s",
+ "i2s1",
+ "i2s2",
+ "i2s3",
+ "lptim1",
+ "quadspi",
+ "rng",
+ "rtc",
+ "sai1",
+ "sai2",
+ "sdmmc1",
+ "sdmmc2",
+ "spi1",
+ "spi2",
+ "spi3",
+ "spi4",
+ "spi5",
+ "sys",
+ "tim1",
+ "tim10",
+ "tim11",
+ "tim12",
+ "tim13",
+ "tim14",
+ "tim2",
+ "tim3",
+ "tim4",
+ "tim5",
+ "tim6",
+ "tim7",
+ "tim8",
+ "tim9",
+ "uart4",
+ "uart5",
+ "uart7",
+ "uart8",
+ "usart1",
+ "usart2",
+ "usart3",
+ "usart6",
+ "otg-fs",
+ "otg-hs",
+]
+gpio-f746 = [
+ "adc2",
+ "adc3",
+ "dac",
+ "dma2d",
+ "can1",
+ "can2",
+ "cec",
+ "cryp",
+ "dcmi",
+ "eth",
+ "fmc",
+ "gpioc",
+ "gpiod",
+ "gpioe",
+ "gpiof",
+ "gpiog",
+ "gpioh",
+ "gpioi",
+ "gpioj",
+ "gpiok",
+ "hash",
+ "i2c2",
+ "i2c3",
+ "i2c4",
+ "i2s",
+ "i2s1",
+ "i2s2",
+ "i2s3",
+ "lptim1",
+ "ltdc",
+ "quadspi",
+ "rng",
+ "rtc",
+ "sai1",
+ "sai2",
+ "sdmmc1",
+ "spdifrx",
+ "spi1",
+ "spi2",
+ "spi3",
+ "spi4",
+ "spi5",
+ "spi6",
+ "sys",
+ "tim1",
+ "tim10",
+ "tim11",
+ "tim12",
+ "tim13",
+ "tim14",
+ "tim2",
+ "tim3",
+ "tim4",
+ "tim5",
+ "tim6",
+ "tim7",
+ "tim8",
+ "tim9",
+ "uart4",
+ "uart5",
+ "uart7",
+ "uart8",
+ "usart1",
+ "usart2",
+ "usart3",
+ "usart6",
+ "otg-fs",
+ "otg-hs",
+]
+gpio-f76x = [
+ "adc2",
+ "adc3",
+ "dac",
+ "dma2d",
+ "can1",
+ "can2",
+ "cec",
+ "cryp",
+ "dcmi",
+ "eth",
+ "fmc",
+ "gpioc",
+ "gpiod",
+ "gpioe",
+ "gpiof",
+ "gpiog",
+ "gpioh",
+ "gpioi",
+ "gpioj",
+ "gpiok",
+ "hash",
+ "i2c2",
+ "i2c3",
+ "i2c4",
+ "i2s",
+ "i2s1",
+ "i2s2",
+ "i2s3",
+ "lptim1",
+ "ltdc",
+ "quadspi",
+ "rng",
+ "rtc",
+ "sai1",
+ "sai2",
+ "sdmmc1",
+ "spdifrx",
+ "spi1",
+ "spi2",
+ "spi3",
+ "spi4",
+ "spi5",
+ "spi6",
+ "sys",
+ "tim1",
+ "tim10",
+ "tim11",
+ "tim12",
+ "tim13",
+ "tim14",
+ "tim2",
+ "tim3",
+ "tim4",
+ "tim5",
+ "tim6",
+ "tim7",
+ "tim8",
+ "tim9",
+ "uart4",
+ "uart5",
+ "uart7",
+ "uart8",
+ "usart1",
+ "usart2",
+ "usart3",
+ "usart6",
+ "otg-fs",
+ "otg-hs",
+]
+
+
## Support monotonic timers and other stuff that can be used by [RTICv1 framework](https://crates.io/crates/cortex-m-rtic)
rtic1 = ["dep:rtic-monotonic", "dep:systick-monotonic", "cortex-m-rtic"]
@@ -477,7 +911,13 @@ rtic-tim4 = []
rtic-tim5 = []
## Implementation of `defmt::Format` for public enums and structures. See [defmt](https://crates.io/crates/defmt)
-defmt = ["dep:defmt", "stm32f4/defmt", "fugit/defmt", "nb/defmt-0-3"]
+defmt = [
+ "dep:defmt",
+ "stm32f4?/defmt",
+ "stm32f7?/defmt",
+ "fugit/defmt",
+ "nb/defmt-0-3",
+]
## bxCAN peripheral support. See [bxcan](https://crates.io/crates/bxcan)
can = ["dep:bxcan"]
@@ -498,6 +938,15 @@ sdio-host = ["dep:sdio-host"]
# Next features are for internal use only!!!
+bb = []
+dma = []
+i2c_v1 = []
+i2c_v2 = []
+spi_v1 = []
+spi_v2 = []
+uart_v2 = []
+uart_v3 = []
+usb_hs_phy = []
dfsdm = []
sai = []
rcc_shared_m = []
@@ -505,43 +954,102 @@ rcc_i2s_apb = []
adc2 = []
adc3 = []
+adf1 = []
aes = []
can1 = []
can2 = []
can3 = []
+cec = []
cryp = []
+cm4 = []
+crs1 = []
+comp1 = []
+comp2 = []
+comp3 = []
+comp4 = []
+comp5 = []
+comp6 = []
+comp7 = []
+crs = []
dac = []
dcmi = []
+debug = []
dfsdm1 = ["dfsdm"]
dfsdm2 = ["dfsdm"]
dma2d = []
dsihost = ["embedded-display-controller"]
+hash = []
eth = []
+fdcan1 = []
+fdcan2 = []
+fdcan3 = []
fmc = []
fsmc = []
fmpi2c1 = ["dep:micromath"]
+gpioc = []
gpiod = []
gpioe = []
gpiof = []
gpiog = []
+gpioh = []
gpioi = []
gpioj = []
gpiok = []
+hdmi = []
+hrtim1 = []
+hspi1 = []
+i2c2 = []
i2c3 = []
+i2c4 = []
+i2c5 = []
+i2c6 = []
+i2s1 = []
+i2s2 = []
+i2s2ext = []
+i2s3 = []
+i2s3ext = []
+i2s4 = []
+i2s5 = []
+i2s6 = []
+ir = []
+jpeg = []
+lcd = []
lptim1 = []
+lptim2 = []
+lptim3 = []
+lptim4 = []
+lptim5 = []
+lpuart1 = []
+lpuart2 = []
ltdc = ["dep:micromath"]
+mdios = []
+mdf1 = []
quadspi = []
+octospi = []
+opamp2 = []
otg-fs = []
otg-hs = []
+pssi = []
+pwr = []
+rf = []
rng = []
+rtc = []
sai1 = ["sai"]
sai2 = ["sai"]
+sai3 = []
+sai4 = []
sdio = []
+sdmmc1 = []
+sdmmc2 = []
+spi1 = []
+spi2 = []
spi3 = []
spi4 = []
spi5 = []
spi6 = []
+sys = []
spdifrx = []
+swpmi1 = []
tim1 = []
tim2 = []
tim3 = []
@@ -556,13 +1064,39 @@ tim11 = []
tim12 = []
tim13 = []
tim14 = []
+tim15 = []
+tim16 = []
+tim17 = []
+tim19 = []
+tim20 = []
+tim21 = []
+tim22 = []
+tim23 = []
+tim24 = []
+timx = []
+ts = []
+tsc = []
+ucpd1 = []
+ucpd2 = []
+usart1 = []
+usart2 = []
usart3 = []
+usart4 = []
+usart5 = []
+usart6 = []
+usart7 = []
+usart8 = []
+usart10 = []
uart4 = []
uart5 = []
uart7 = []
uart8 = []
uart9 = []
uart10 = []
+usb = [] # "dep:stm32-usbd"
+v_ref = []
+
+disabled = []
[profile.dev]
debug = true
@@ -577,7 +1111,7 @@ opt-level = "s"
[[example]]
name = "analog-stopwatch-with-spi-ssd1306"
-required-features = ["spi4", "tim2", "gpioe", "gpiog"] # stm32f429
+required-features = ["f4", "spi4", "tim2", "gpioe", "gpiog"] # stm32f429
[[example]]
name = "blinky-timer-irq"
@@ -660,7 +1194,7 @@ required-features = ["rng"] # stm32f407
[[example]]
name = "rtc"
-required-features = []
+required-features = ["f4"]
[[example]]
name = "rtc_alarm"
@@ -668,7 +1202,7 @@ required-features = ["stm32f411"]
[[example]]
name = "rtic-adc-dma"
-required-features = ["rtic1"] # stm32f401
+required-features = ["rtic1", "f4"] # stm32f401
[[example]]
name = "rtic-button"
@@ -738,6 +1272,10 @@ required-features = ["stm32f411"]
name = "uart-dma"
required-features = ["stm32f405"]
+[[example]]
+name = "spi_16"
+required-features = ["gpiod"]
+
[[example]]
name = "ssd1306-image"
required-features = [] # stm32f411
@@ -772,7 +1310,7 @@ required-features = ["otg-fs", "usb_fs"] # stm32f407
[[example]]
name = "usb-serial-poll"
-required-features = ["otg-fs", "usb_fs"] # stm32f401
+required-features = ["otg-fs", "usb_fs", "f4"] # stm32f401
[[example]]
name = "ws2812-spi"
diff --git a/README.md b/README.md
index 9dcd2d11..551ee9a8 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ stm32f4xx-hal
[](https://github.com/stm32-rs/stm32f4xx-hal)
_stm32f4xx-hal_ contains a multi device hardware abstraction on top of the
-peripheral access API for the STMicro STM32F4 series microcontrollers. The
+peripheral access API for the STMicro STM32F4/F7 series microcontrollers. The
selection of the MCU is done by feature gates, typically specified by board
support crates. Currently supported configurations are:
@@ -20,25 +20,44 @@ support crates. Currently supported configurations are:
* stm32f401
* stm32f405
* stm32f407
+
+
* stm32f410
* stm32f411
* stm32f412
- |
-
* stm32f413
* stm32f415
* stm32f417
* stm32f423
-* stm32f427
-* stm32f429
|
+* stm32f427
+* stm32f429
* stm32f437
* stm32f439
* stm32f446
* stm32f469
* stm32f479
+ |
+
+* stm32f722
+* stm32f723
+* stm32f730
+* stm32f732
+* stm32f733
+* stm32f745
+* stm32f746
+ |
+
+* stm32f756
+* stm32f765
+* stm32f767
+* stm32f769
+* stm32f777
+* stm32f778
+* stm32f779
+
The idea behind this crate is to gloss over the slight differences in the
diff --git a/build.rs b/build.rs
index 8e25570e..d09e1631 100644
--- a/build.rs
+++ b/build.rs
@@ -23,7 +23,9 @@ impl IteratorExt for T {
fn main() {
let _chip_name = match env::vars()
.map(|(a, _)| a)
- .filter(|x| x.starts_with("CARGO_FEATURE_STM32F4"))
+ .filter(|x| {
+ x.starts_with("CARGO_FEATURE_STM32F4") || x.starts_with("CARGO_FEATURE_STM32F7")
+ })
.get_one()
{
Ok(x) => x,
diff --git a/examples/i2c_scanner.rs b/examples/i2c_scanner.rs
index 080cb645..77ae611f 100644
--- a/examples/i2c_scanner.rs
+++ b/examples/i2c_scanner.rs
@@ -10,7 +10,7 @@ use rtt_target::{rprint, rprintln, rtt_init_print};
use cortex_m_rt::entry;
-use stm32f4xx_hal::{self as hal, gpio::GpioExt, i2c::I2c, pac, prelude::*};
+use stm32f4xx_hal::{gpio::GpioExt, i2c, pac, prelude::*};
const VALID_ADDR_RANGE: Range = 0x08..0x78;
@@ -26,11 +26,13 @@ fn main() -> ! {
// Configure I2C1
let scl = gpiob.pb8;
let sda = gpiob.pb7;
- let mut i2c = I2c::new(
+ let mut i2c = i2c::I2c::new(
dp.I2C1,
(scl, sda),
- hal::i2c::Mode::standard(100.kHz()),
+ i2c::Mode::standard(100.kHz()),
&mut rcc,
+ #[cfg(feature = "f7")]
+ i2c::ClockSource::Apb,
);
rprintln!("Start i2c scanning...");
diff --git a/examples/rng-display.rs b/examples/rng-display.rs
index 078939da..acc46d07 100644
--- a/examples/rng-display.rs
+++ b/examples/rng-display.rs
@@ -33,7 +33,7 @@ use embedded_graphics::{
use ssd1306::{prelude::*, I2CDisplayInterface, Ssd1306};
-use hal::{i2c::I2c, pac, prelude::*};
+use hal::{pac, prelude::*};
use rand_core::RngCore;
use core::fmt::Write;
@@ -69,7 +69,7 @@ fn main() -> ! {
let gpiob = dp.GPIOB.split(&mut rcc);
let scl = gpiob.pb8;
let sda = gpiob.pb9;
- let i2c = I2c::new(dp.I2C1, (scl, sda), 400.kHz(), &mut rcc);
+ let i2c = dp.I2C1.i2c((scl, sda), 400.kHz(), &mut rcc);
// Set up the display
let interface = I2CDisplayInterface::new(i2c);
diff --git a/examples/spi_16.rs b/examples/spi_16.rs
new file mode 100644
index 00000000..745aad9f
--- /dev/null
+++ b/examples/spi_16.rs
@@ -0,0 +1,55 @@
+#![no_main]
+#![no_std]
+
+use panic_semihosting as _;
+
+use stm32f4xx_hal as hal;
+
+use hal::{pac, prelude::*, spi::Spi};
+
+use cortex_m_rt::entry;
+
+#[entry]
+fn main() -> ! {
+ let p = pac::Peripherals::take().unwrap();
+
+ let mut rcc = p.RCC.constrain();
+
+ let gpioa = p.GPIOA.split(&mut rcc);
+ let gpioc = p.GPIOC.split(&mut rcc);
+ let gpiod = p.GPIOD.split(&mut rcc);
+
+ // Configure pin for button. This happens to be the pin for the USER button
+ // on the NUCLEO-F746ZG board.
+ let button = gpioc.pc13.into_floating_input();
+
+ // Prepare pins for SPI
+ let mut ncs = gpiod.pd14.into_push_pull_output();
+ let sck = gpioa.pa5;
+ let mosi = gpioa.pa7;
+
+ // Set NCS pin to high (disabled) initially
+ ncs.set_high();
+
+ // Initialize SPI
+ let mut spi = Spi::new(
+ p.SPI1,
+ (Some(sck), pac::SPI1::NoMiso, Some(mosi)),
+ embedded_hal::spi::MODE_0,
+ 250.kHz(),
+ &mut rcc,
+ )
+ .frame_size_16bit();
+
+ // Use a button to control output via the Maxim Integrated MAX5214 DAC.
+ loop {
+ let data = if button.is_high() { 0xffff } else { 0x0000 };
+
+ let word: u16 = (0b01 << 14) | // write-through mode
+ (data & 0x3fff); // data bits
+
+ ncs.set_low();
+ spi.write(&[word]).unwrap();
+ ncs.set_high();
+ }
+}
diff --git a/examples/stopwatch-with-ssd1306-and-interrupts-and-dma-i2c.rs b/examples/stopwatch-with-ssd1306-and-interrupts-and-dma-i2c.rs
index ea8ccf0d..e2470087 100644
--- a/examples/stopwatch-with-ssd1306-and-interrupts-and-dma-i2c.rs
+++ b/examples/stopwatch-with-ssd1306-and-interrupts-and-dma-i2c.rs
@@ -25,7 +25,6 @@ use crate::hal::{
dma::{Stream1, StreamsTuple},
gpio::*,
i2c::dma::{I2CMasterDma, NoDMA, TxDMA},
- i2c::I2c,
interrupt, pac,
pac::{DMA1, I2C1},
prelude::*,
@@ -162,7 +161,7 @@ fn main() -> ! {
if let (Some(mut dp), Some(cp)) = (pac::Peripherals::take(), cortex_m::Peripherals::take()) {
let mut rcc = setup_clocks(dp.RCC);
let gpiob = dp.GPIOB.split(&mut rcc);
- let i2c = I2c::new(dp.I2C1, (gpiob.pb8, gpiob.pb9), 400.kHz(), &mut rcc);
+ let i2c = dp.I2C1.i2c((gpiob.pb8, gpiob.pb9), 400.kHz(), &mut rcc);
// Then convert it to DMA
let streams = StreamsTuple::new(dp.DMA1, &mut rcc);
diff --git a/examples/stopwatch-with-ssd1306-and-interrupts.rs b/examples/stopwatch-with-ssd1306-and-interrupts.rs
index 9899071a..386c7dda 100644
--- a/examples/stopwatch-with-ssd1306-and-interrupts.rs
+++ b/examples/stopwatch-with-ssd1306-and-interrupts.rs
@@ -23,7 +23,6 @@ use stm32f4xx_hal::{self as hal, rcc::Config};
use crate::hal::{
gpio::{Edge, Input, PC13},
- i2c::I2c,
interrupt, pac,
prelude::*,
rcc::Rcc,
@@ -64,7 +63,7 @@ fn main() -> ! {
if let (Some(mut dp), Some(cp)) = (pac::Peripherals::take(), cortex_m::Peripherals::take()) {
let mut rcc = setup_clocks(dp.RCC);
let gpiob = dp.GPIOB.split(&mut rcc);
- let i2c = I2c::new(dp.I2C1, (gpiob.pb8, gpiob.pb9), 400.kHz(), &mut rcc);
+ let i2c = dp.I2C1.i2c((gpiob.pb8, gpiob.pb9), 400.kHz(), &mut rcc);
let mut syscfg = dp.SYSCFG.constrain(&mut rcc);
diff --git a/src/adc.rs b/src/adc.rs
index b8eef7df..c63a1dcf 100644
--- a/src/adc.rs
+++ b/src/adc.rs
@@ -141,8 +141,13 @@ use core::fmt;
use core::ops::Deref;
pub mod config;
+
+#[cfg(feature = "f4")]
mod f4;
+#[cfg(feature = "f7")]
+mod f7;
+
/// Vref internal signal, used for calibration
pub struct Vref;
diff --git a/src/adc/f7.rs b/src/adc/f7.rs
new file mode 100644
index 00000000..53db7ca6
--- /dev/null
+++ b/src/adc/f7.rs
@@ -0,0 +1,63 @@
+use super::*;
+
+// See "Datasheet - production data"
+// Pinouts and pin description (page 66..)
+adc_pins!(
+ gpio::PA0 => (ADC1, 0),
+ gpio::PA1 => (ADC1, 1),
+ gpio::PA2 => (ADC1, 2),
+ gpio::PA3 => (ADC1, 3),
+ gpio::PA4 => (ADC1, 4),
+ gpio::PA5 => (ADC1, 5),
+ gpio::PA6 => (ADC1, 6),
+ gpio::PA7 => (ADC1, 7),
+ gpio::PB0 => (ADC1, 8),
+ gpio::PB1 => (ADC1, 9),
+ gpio::PC0 => (ADC1, 10),
+ gpio::PC1 => (ADC1, 11),
+ gpio::PC2 => (ADC1, 12),
+ gpio::PC3 => (ADC1, 13),
+ gpio::PC4 => (ADC1, 14),
+ gpio::PC5 => (ADC1, 15),
+ Temperature => (ADC1, 18),
+ Vbat => (ADC1, 18),
+ Vref => (ADC1, 17),
+);
+
+adc_pins!(
+ gpio::PA0 => (ADC2, 0),
+ gpio::PA1 => (ADC2, 1),
+ gpio::PA2 => (ADC2, 2),
+ gpio::PA3 => (ADC2, 3),
+ gpio::PA4 => (ADC2, 4),
+ gpio::PA5 => (ADC2, 5),
+ gpio::PA6 => (ADC2, 6),
+ gpio::PA7 => (ADC2, 7),
+ gpio::PB0 => (ADC2, 8),
+ gpio::PB1 => (ADC2, 9),
+ gpio::PC0 => (ADC2, 10),
+ gpio::PC1 => (ADC2, 11),
+ gpio::PC2 => (ADC2, 12),
+ gpio::PC3 => (ADC2, 13),
+ gpio::PC4 => (ADC2, 14),
+ gpio::PC5 => (ADC2, 15),
+);
+
+adc_pins!(
+ gpio::PA0 => (ADC3, 0),
+ gpio::PA1 => (ADC3, 1),
+ gpio::PA2 => (ADC3, 2),
+ gpio::PA3 => (ADC3, 3),
+ gpio::PF6 => (ADC3, 4),
+ gpio::PF7 => (ADC3, 5),
+ gpio::PF8 => (ADC3, 6),
+ gpio::PF9 => (ADC3, 7),
+ gpio::PF10 => (ADC3, 8),
+ gpio::PF3 => (ADC3, 9),
+ gpio::PC0 => (ADC3, 10),
+ gpio::PC1 => (ADC3, 11),
+ gpio::PC2 => (ADC3, 12),
+ gpio::PC3 => (ADC3, 13),
+ gpio::PF4 => (ADC3, 14),
+ gpio::PF5 => (ADC3, 15),
+);
diff --git a/src/dma/traits.rs b/src/dma/traits.rs
index a6b461a7..3b040886 100644
--- a/src/dma/traits.rs
+++ b/src/dma/traits.rs
@@ -282,6 +282,7 @@ pub unsafe trait PeriAddress {
}
// Convenience macro for implementing addresses on peripherals
+#[allow(unused)]
macro_rules! address {
($(($peripheral:ty, $register:ident, $size: ty)),+ $(,)*) => {
$(
@@ -296,6 +297,7 @@ macro_rules! address {
)+
};
}
+#[allow(unused)]
use address;
/// Type alias to a DMA RegisterBlock.
@@ -333,7 +335,17 @@ macro_rules! dma_map {
}
use dma_map;
+#[cfg(feature = "f4")]
mod f4;
+#[allow(unused)]
+#[cfg(feature = "f4")]
+pub use f4::*;
+
+#[cfg(feature = "f7")]
+mod f7;
+#[allow(unused)]
+#[cfg(feature = "f7")]
+pub use f7::*;
#[cfg(feature = "dfsdm")]
pub struct FLT {
diff --git a/src/dma/traits/f7.rs b/src/dma/traits/f7.rs
new file mode 100644
index 00000000..de98a654
--- /dev/null
+++ b/src/dma/traits/f7.rs
@@ -0,0 +1,227 @@
+use super::*;
+
+dma_map! {
+ (Stream0:0, pac::SPI3, [PeripheralToMemory]), //SPI3_RX
+ (Stream2:0, pac::SPI3, [PeripheralToMemory]), //SPI3_RX
+ (Stream3:0, pac::SPI2, [PeripheralToMemory]), //SPI2_RX
+ (Stream4:0, pac::SPI2, [MemoryToPeripheral]), //SPI2_TX
+ (Stream5:0, pac::SPI3, [MemoryToPeripheral]), //SPI3_TX
+ (Stream7:0, pac::SPI3, [MemoryToPeripheral]), //SPI3_TX
+
+ (Stream0:1, pac::I2C1, [PeripheralToMemory]), //I2C1_RX
+ (Stream1:1, pac::I2C3, [PeripheralToMemory]), //I2C3_RX
+ (Stream2:1, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM7_UP
+ (Stream4:1, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM7_UP
+ (Stream5:1, pac::I2C1, [PeripheralToMemory]), //I2C1_RX
+ (Stream6:1, pac::I2C1, [MemoryToPeripheral]), //I2C1_TX
+ (Stream7:1, pac::I2C1, [MemoryToPeripheral]), //I2C1_TX
+
+ (Stream0:2, timer::CCR1, [MemoryToPeripheral | PeripheralToMemory]), //TIM4_CH1
+ (Stream3:2, timer::CCR2, [MemoryToPeripheral | PeripheralToMemory]), //TIM4_CH2
+ (Stream6:2, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM4_UP
+ (Stream7:2, timer::CCR3, [MemoryToPeripheral | PeripheralToMemory]), //TIM4_CH3
+
+ (Stream1:3, timer::CCR3, [MemoryToPeripheral | PeripheralToMemory]), //TIM2_CH3
+ (Stream1:3, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM2_UP
+ (Stream2:3, pac::I2C3, [PeripheralToMemory]), //I2C3_RX
+ (Stream4:3, pac::I2C3, [MemoryToPeripheral]), //I2C3_TX
+ (Stream5:3, timer::CCR1, [MemoryToPeripheral | PeripheralToMemory]), //TIM2_CH1
+ (Stream6:3, timer::CCR2, [MemoryToPeripheral | PeripheralToMemory]), //TIM2_CH2
+ (Stream6:3, timer::CCR4, [MemoryToPeripheral | PeripheralToMemory]), //TIM2_CH4
+ (Stream7:3, timer::CCR4, [MemoryToPeripheral | PeripheralToMemory]), //TIM2_CH4
+ (Stream7:3, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM2_UP
+
+ (Stream0:4, pac::UART5, [PeripheralToMemory]), //UART5_RX
+ (Stream1:4, pac::USART3, [PeripheralToMemory]), //USART3_RX
+ (Stream2:4, pac::UART4, [PeripheralToMemory]), //UART4_RX
+ (Stream3:4, pac::USART3, [MemoryToPeripheral]), //USART3_TX
+ (Stream4:4, pac::UART4, [MemoryToPeripheral]), //UART4_TX
+ (Stream5:4, pac::USART2, [PeripheralToMemory]), //USART2_RX
+ (Stream6:4, pac::USART2, [MemoryToPeripheral]), //USART2_TX
+ (Stream7:4, pac::UART5, [MemoryToPeripheral]), //UART5_TX
+
+ (Stream0:5, pac::UART8, [MemoryToPeripheral]), //UART8_TX
+ (Stream1:5, pac::UART7, [MemoryToPeripheral]), //UART7_TX
+ (Stream2:5, timer::CCR4, [MemoryToPeripheral | PeripheralToMemory]), //TIM3_CH4
+ (Stream2:5, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM3_UP
+ (Stream3:5, pac::UART7, [PeripheralToMemory]), //UART7_RX
+ (Stream4:5, timer::CCR1, [MemoryToPeripheral | PeripheralToMemory]), //TIM3_CH1
+ (Stream4:5, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM3_TRIG
+ (Stream5:5, timer::CCR2, [MemoryToPeripheral | PeripheralToMemory]), //TIM3_CH2
+ (Stream6:5, pac::UART8, [PeripheralToMemory]), //UART8_RX
+ (Stream7:5, timer::CCR3, [MemoryToPeripheral | PeripheralToMemory]), //TIM3_CH3
+
+ (Stream0:6, timer::CCR3, [MemoryToPeripheral | PeripheralToMemory]), //TIM5_CH3
+ (Stream0:6, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM5_UP
+ (Stream1:6, timer::CCR4, [MemoryToPeripheral | PeripheralToMemory]), //TIM5_CH4
+ (Stream1:6, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM5_TRIG
+ (Stream2:6, timer::CCR1, [MemoryToPeripheral | PeripheralToMemory]), //TIM5_CH1
+ (Stream3:6, timer::CCR4, [MemoryToPeripheral | PeripheralToMemory]), //TIM5_CH4
+ (Stream3:6, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM5_TRIG
+ (Stream4:6, timer::CCR2, [MemoryToPeripheral | PeripheralToMemory]), //TIM5_CH2
+ (Stream6:6, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM5_UP
+
+ (Stream1:7, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM6_UP
+ (Stream2:7, pac::I2C2, [PeripheralToMemory]), //I2C2_RX
+ (Stream3:7, pac::I2C2, [PeripheralToMemory]), //I2C2_RX
+ (Stream4:7, pac::USART3, [MemoryToPeripheral]), //USART3_TX:DMA_CHANNEL_7
+ (Stream5:7, pac::DAC, [MemoryToPeripheral]), //DAC1
+ //(Stream6:7, pac::DAC2, [MemoryToPeripheral]), //DAC2
+ (Stream7:7, pac::I2C2, [MemoryToPeripheral]), //I2C2_TX
+
+
+ (Stream0:0, pac::ADC1, [PeripheralToMemory]), //ADC1
+ (Stream1:0, SAICH, [MemoryToPeripheral | PeripheralToMemory]), //SAI1_A
+ (Stream2:0, timer::CCR1, [MemoryToPeripheral | PeripheralToMemory]), //TIM8_CH1
+ (Stream2:0, timer::CCR2, [MemoryToPeripheral | PeripheralToMemory]), //TIM8_CH2
+ (Stream2:0, timer::CCR3, [MemoryToPeripheral | PeripheralToMemory]), //TIM8_CH3
+ (Stream3:0, SAICH, [MemoryToPeripheral | PeripheralToMemory]), //SAI1_A
+ (Stream4:0, pac::ADC1, [PeripheralToMemory]), //ADC1
+ (Stream5:0, SAICH, [MemoryToPeripheral | PeripheralToMemory]), //SAI1_B:DMA_CHANNEL_0
+ (Stream6:0, timer::CCR1, [MemoryToPeripheral | PeripheralToMemory]), //TIM1_CH1
+ (Stream6:0, timer::CCR2, [MemoryToPeripheral | PeripheralToMemory]), //TIM1_CH2
+ (Stream6:0, timer::CCR3, [MemoryToPeripheral | PeripheralToMemory]), //TIM1_CH3
+ (Stream7:0, SAICH, [MemoryToPeripheral | PeripheralToMemory]), //SAI2_B:DMA_CHANNEL_0
+
+ (Stream2:1, pac::ADC2, [PeripheralToMemory]), //ADC2
+ (Stream3:1, pac::ADC2, [PeripheralToMemory]), //ADC2
+ (Stream4:1, SAICH, [MemoryToPeripheral | PeripheralToMemory]), //SAI1_B
+
+ (Stream0:2, pac::ADC3, [PeripheralToMemory]), //ADC3
+ (Stream1:2, pac::ADC3, [PeripheralToMemory]), //ADC3
+ (Stream3:2, pac::SPI5, [PeripheralToMemory]), //SPI5_RX
+ (Stream4:2, pac::SPI5, [MemoryToPeripheral]), //SPI5_TX
+
+ (Stream0:3, pac::SPI1, [PeripheralToMemory]), //SPI1_RX
+ (Stream2:3, pac::SPI1, [PeripheralToMemory]), //SPI1_RX
+ (Stream3:3, pac::SPI1, [MemoryToPeripheral]), //SPI1_TX
+ (Stream4:3, SAICH, [MemoryToPeripheral | PeripheralToMemory]), //SAI2_A
+ (Stream5:3, pac::SPI1, [MemoryToPeripheral]), //SPI1_TX
+ (Stream6:3, SAICH, [MemoryToPeripheral | PeripheralToMemory]), //SAI2_B
+ (Stream7:3, pac::QUADSPI, [MemoryToPeripheral | PeripheralToMemory]), //QUADSPI
+
+ (Stream0:4, pac::SPI4, [PeripheralToMemory]), //SPI4_RX
+ (Stream1:4, pac::SPI4, [MemoryToPeripheral]), //SPI4_TX
+ (Stream2:4, pac::USART1, [PeripheralToMemory]), //USART1_RX
+ (Stream3:4, pac::SDMMC1, [MemoryToPeripheral | PeripheralToMemory]), //SDMMC1
+ (Stream5:4, pac::USART1, [PeripheralToMemory]), //USART1_RX
+ (Stream6:4, pac::SDMMC1, [MemoryToPeripheral | PeripheralToMemory]), //SDMMC1
+ (Stream7:4, pac::USART1, [MemoryToPeripheral]), //USART1_TX
+
+ (Stream1:5, pac::USART6, [PeripheralToMemory]), //USART6_RX
+ (Stream2:5, pac::USART6, [PeripheralToMemory]), //USART6_RX
+ (Stream3:5, pac::SPI4, [PeripheralToMemory]), //SPI4_RX:DMA_CHANNEL_5
+ (Stream4:5, pac::SPI4, [MemoryToPeripheral]), //SPI4_TX:DMA_CHANNEL_5
+ (Stream6:5, pac::USART6, [MemoryToPeripheral]), //USART6_TX
+ (Stream7:5, pac::USART6, [MemoryToPeripheral]), //USART6_TX
+
+ (Stream0:6, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM1_TRIG
+ (Stream1:6, timer::CCR1, [MemoryToPeripheral | PeripheralToMemory]), //TIM1_CH1
+ (Stream2:6, timer::CCR2, [MemoryToPeripheral | PeripheralToMemory]), //TIM1_CH2
+ (Stream3:6, timer::CCR1, [MemoryToPeripheral | PeripheralToMemory]), //TIM1_CH1
+ (Stream4:6, timer::CCR4, [MemoryToPeripheral | PeripheralToMemory]), //TIM1_CH4
+ (Stream4:6, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM1_TRIG/COM
+ (Stream5:6, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM1_UP
+ (Stream6:6, timer::CCR3, [MemoryToPeripheral | PeripheralToMemory]), //TIM1_CH3
+
+ (Stream1:7, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM8_UP
+ (Stream2:7, timer::CCR1, [MemoryToPeripheral | PeripheralToMemory]), //TIM8_CH1
+ (Stream3:7, timer::CCR2, [MemoryToPeripheral | PeripheralToMemory]), //TIM8_CH2
+ (Stream4:7, timer::CCR3, [MemoryToPeripheral | PeripheralToMemory]), //TIM8_CH3
+ (Stream5:7, pac::SPI5, [PeripheralToMemory]), //SPI5_RX:DMA_CHANNEL_7
+ (Stream6:7, pac::SPI5, [MemoryToPeripheral]), //SPI5_TX:DMA_CHANNEL_7
+ (Stream7:7, timer::CCR4, [MemoryToPeripheral | PeripheralToMemory]), //TIM8_CH4
+ (Stream7:7, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM8_COM/TRIG
+}
+
+#[cfg(feature = "spdifrx")]
+dma_map!(
+ (Stream1:0, pac::SPDIFRX, [PeripheralToMemory]), //SPDIF_RX_DT
+ //(Stream6:0, SPDIFRX_CS, [PeripheralToMemory]), //SPDIF_RX_CS
+);
+
+#[cfg(feature = "i2c4")]
+dma_map!(
+ (Stream2:2, pac::I2C4, [PeripheralToMemory]), //I2C4_RX
+ (Stream5:2, pac::I2C4, [PeripheralToMemory]), //I2C4_RX
+);
+
+#[cfg(feature = "sdmmc2")]
+dma_map!(
+ (Stream0:11, pac::SDMMC2, [MemoryToPeripheral | PeripheralToMemory]), //SDMMC2
+ (Stream5:11, pac::SDMMC2, [MemoryToPeripheral | PeripheralToMemory]), //SDMMC2
+);
+
+#[cfg(feature = "dcmi")]
+dma_map!(
+ (Stream1:1, pac::DCMI, [PeripheralToMemory]), //DCMI
+ (Stream7:1, pac::DCMI, [PeripheralToMemory]), //DCMI
+);
+#[cfg(feature = "dcmi")]
+address!((pac::DCMI, dr, u32),);
+
+#[cfg(feature = "spi6")]
+dma_map!(
+ (Stream5:1, pac::SPI6, [MemoryToPeripheral]), //SPI6_TX
+ (Stream6:1, pac::SPI6, [PeripheralToMemory]), //SPI6_RX
+);
+
+#[cfg(feature = "spi6")]
+address!((pac::SPI6, dr, u8),);
+
+#[cfg(feature = "aes")]
+dma_map!(
+ (Stream6:2, AES_IN, [MemoryToPeripheral]), //AES_IN
+ (Stream5:2, AES_OUT, [PeripheralToMemory]), //AES_OUT
+);
+
+#[cfg(feature = "cryp")]
+dma_map!(
+ (Stream6:2, CRYP_IN, [MemoryToPeripheral]), //CRYP_IN
+ (Stream5:2, CRYP_OUT, [PeripheralToMemory]), //CRYP_OUT
+);
+
+/*#[cfg(feature = "hash")]
+dma_map!(
+ (Stream7:2, HASH_IN, [MemoryToPeripheral]), //HASH_IN
+);*/
+
+#[cfg(feature = "dfsdm1")]
+use crate::pac::DFSDM;
+#[cfg(feature = "dfsdm1")]
+dma_map!(
+ (Stream0:8, FLT, [PeripheralToMemory]), //DFSDM1_FLT0
+ (Stream1:8, FLT, [PeripheralToMemory]), //DFSDM1_FLT1
+ (Stream2:8, FLT, [PeripheralToMemory]), //DFSDM1_FLT2
+ (Stream3:8, FLT, [PeripheralToMemory]), //DFSDM1_FLT3
+ (Stream4:8, FLT, [PeripheralToMemory]), //DFSDM1_FLT0
+ (Stream5:8, FLT, [PeripheralToMemory]), //DFSDM1_FLT1
+ (Stream6:8, FLT, [PeripheralToMemory]), //DFSDM1_FLT2
+ (Stream7:8, FLT |