diff --git a/CHANGELOG.md b/CHANGELOG.md index 33ceb964..55fa7a20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,11 +16,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Changed + - Move private features to `build.rs` [#710] - Use `stm32f4-staging` until `stm32f4` is released [#706] - Allow different lengths of buffers in hal_1 SpiBus impl [#566] [#566]: https://github.com/stm32-rs/stm32f4xx-hal/pull/566 [#706]: https://github.com/stm32-rs/stm32f4xx-hal/pull/706 +[#710]: https://github.com/stm32-rs/stm32f4xx-hal/pull/710 [#731]: https://github.com/stm32-rs/stm32f4xx-hal/pull/731 [#758]: https://github.com/stm32-rs/stm32f4xx-hal/pull/758 diff --git a/Cargo.toml b/Cargo.toml index 9bc9e7ca..d3d94b73 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,7 +61,7 @@ embedded-storage = "0.3" vcell = "0.1.3" document-features = "0.2" -micromath = { version = "2.1.0", optional = true } +micromath = { version = "2.1.0" } [dependencies.stm32f4] package = "stm32f4-staging" @@ -87,6 +87,10 @@ version = "1.0" version = "0.5.0" optional = true +[build-dependencies.phf] +version = "0.11.2" +features = ["macros"] + [dev-dependencies] defmt = "0.3.4" defmt-rtt = "0.4.0" @@ -127,325 +131,23 @@ 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"] -stm32f437 = ["stm32f4/stm32f427", "gpio-f427", "fsmc", "cryp"] -stm32f439 = ["stm32f4/stm32f429", "gpio-f427", "fmc", "cryp"] -stm32f446 = ["stm32f4/stm32f446", "gpio-f446"] -stm32f469 = ["stm32f4/stm32f469", "gpio-f469"] -stm32f479 = ["stm32f4/stm32f469", "gpio-f469", "cryp"] - -gpio-f401 = [ - "gpiod", - "gpioe", - "i2c3", - "otg-fs", - "sdio", - "spi3", - "spi4", - "tim1", - "tim2", - "tim3", - "tim4", - "tim5", - "tim9", - "tim10", - "tim11", -] -gpio-f410 = [ - "dac", - "fmpi2c1", - "lptim1", - "spi5", - "tim1", - "tim5", - "tim6", - "tim9", - "tim11", -] -gpio-f411 = [ - "gpiod", - "gpioe", # "gpioi", - "i2c3", - "otg-fs", - "sdio", - "tim1", - "tim2", - "tim3", - "tim4", - "tim5", - "tim9", - "tim10", - "tim11", - "spi3", - "spi4", - "spi5", -] -gpio-f412 = [ - "gpiod", - "gpioe", - "gpiof", - "gpiog", - "can1", - "can2", - "dfsdm1", - "fmpi2c1", - "fsmc", - "i2c3", - "quadspi", - "otg-fs", - "rng", - "sdio", - "spi3", - "spi4", - "spi5", - "tim1", - "tim2", - "tim3", - "tim4", - "tim5", - "tim6", - "tim7", - "tim8", - "tim9", - "tim10", - "tim11", - "tim12", - "tim13", - "tim14", - "usart3", -] -gpio-f413 = [ - "gpiod", - "gpioe", - "gpiof", - "gpiog", - "can1", - "can2", - "can3", - "dac", - "dfsdm1", - "dfsdm2", - "fsmc", - "fmpi2c1", - "i2c3", - "lptim1", - "quadspi", - "otg-fs", - "rng", - "sai1", - "sdio", - "spi3", - "spi4", - "spi5", - "tim1", - "tim2", - "tim3", - "tim4", - "tim5", - "tim6", - "tim7", - "tim8", - "tim9", - "tim10", - "tim11", - "tim12", - "tim13", - "tim14", - "usart3", - "uart4", - "uart5", - "uart7", - "uart8", - "uart9", - "uart10", -] -gpio-f417 = [ - "gpiod", - "gpioe", - "gpiof", - "gpiog", - "gpioi", - "adc2", - "adc3", - "can1", - "can2", - "dac", - "dcmi", - "eth", - "fsmc", - "i2c3", - "otg-fs", - "otg-hs", - "rng", - "sdio", - "spi3", - "tim1", - "tim2", - "tim3", - "tim4", - "tim5", - "tim6", - "tim7", - "tim8", - "tim9", - "tim10", - "tim11", - "tim12", - "tim13", - "tim14", - "usart3", - "uart4", - "uart5", -] -gpio-f427 = [ - "gpiod", - "gpioe", - "gpiof", - "gpiog", - "gpioi", - "gpioj", - "gpiok", - "adc2", - "adc3", - "can1", - "can2", - "dac", - "dcmi", - "dma2d", - "eth", - "i2c3", - "ltdc", - "otg-fs", - "otg-hs", - "rng", - "sai1", - "sdio", - "spi3", - "spi4", - "spi5", - "spi6", - "tim1", - "tim2", - "tim3", - "tim4", - "tim5", - "tim6", - "tim7", - "tim8", - "tim9", - "tim10", - "tim11", - "tim12", - "tim13", - "tim14", - "usart3", - "uart4", - "uart5", - "uart7", - "uart8", -] -gpio-f446 = [ - "gpiod", - "gpioe", - "gpiof", - "gpiog", - "adc2", - "adc3", - "can1", - "can2", - "dac", - "dcmi", - "fmpi2c1", - "fmc", - "i2c3", - "quadspi", - "otg-fs", - "otg-hs", - "sai1", - "sai2", - "sdio", - "spi3", - "spi4", - "spdifrx", - "tim1", - "tim2", - "tim3", - "tim4", - "tim5", - "tim6", - "tim7", - "tim8", - "tim9", - "tim10", - "tim11", - "tim12", - "tim13", - "tim14", - "usart3", - "uart4", - "uart5", -] -gpio-f469 = [ - "gpiod", - "gpioe", - "gpiof", - "gpiog", - "gpioi", - "gpioj", - "gpiok", - "adc2", - "adc3", - "can1", - "can2", - "dac", - "dma2d", - "dcmi", - "dsihost", - "eth", - "fmc", - "i2c3", - "ltdc", - "quadspi", - "otg-fs", - "otg-hs", - "rng", - "sai1", - "sdio", - "spi3", - "spi4", - "spi5", - "spi6", - "tim1", - "tim2", - "tim3", - "tim4", - "tim5", - "tim6", - "tim7", - "tim8", - "tim9", - "tim10", - "tim11", - "tim12", - "tim13", - "tim14", - "usart3", - "uart4", - "uart5", - "uart7", - "uart8", -] +stm32f401 = ["stm32f4/stm32f401", "_pac_gpiod", "_pac_otg_fs", "_pac_sdio", "_pac_spi4", "_pac_tim2"] +stm32f405 = ["stm32f4/stm32f405", "_pac_gpiog", "_pac_fsmc", "_pac_otg_fs", "_pac_rng", "_pac_sdio", "_pac_tim8"] +stm32f407 = ["stm32f4/stm32f407", "_pac_gpiog", "_pac_fsmc", "_pac_otg_fs", "_pac_rng", "_pac_sdio", "_pac_tim8"] +stm32f415 = ["stm32f4/stm32f405", "_pac_gpiog", "_pac_fsmc", "_pac_otg_fs", "_pac_rng", "_pac_sdio", "_pac_tim8"] +stm32f417 = ["stm32f4/stm32f407", "_pac_gpiog", "_pac_fsmc", "_pac_otg_fs", "_pac_rng", "_pac_sdio", "_pac_tim8"] +stm32f410 = ["stm32f4/stm32f410"] +stm32f411 = ["stm32f4/stm32f411", "_pac_gpiod", "_pac_otg_fs", "_pac_sdio", "_pac_tim2", "_pac_spi4"] +stm32f412 = ["stm32f4/stm32f412", "_pac_gpiog", "_pac_fsmc", "_pac_otg_fs", "_pac_rng", "_pac_sdio", "_pac_spi4", "_pac_tim8"] +stm32f413 = ["stm32f4/stm32f413", "_pac_gpiog", "_pac_fsmc", "_pac_otg_fs", "_pac_rng", "_pac_sdio", "_pac_spi4", "_pac_tim8"] +stm32f423 = ["stm32f4/stm32f413", "_pac_gpiog", "_pac_fsmc", "_pac_otg_fs", "_pac_rng", "_pac_sdio", "_pac_spi4", "_pac_tim8"] +stm32f427 = ["stm32f4/stm32f427", "_pac_fsmc", "_pac_gpiog", "_pac_otg_fs", "_pac_rng", "_pac_sdio", "_pac_spi4", "_pac_tim8"] +stm32f429 = ["stm32f4/stm32f429", "_pac_gpiog", "_pac_otg_fs", "_pac_rng", "_pac_sdio", "_pac_spi4", "_pac_tim8"] +stm32f437 = ["stm32f4/stm32f427", "_pac_fsmc", "_pac_gpiog", "_pac_otg_fs", "_pac_rng", "_pac_sdio", "_pac_spi4", "_pac_tim8"] +stm32f439 = ["stm32f4/stm32f429", "_pac_gpiog", "_pac_otg_fs", "_pac_rng", "_pac_sdio", "_pac_spi4", "_pac_tim8"] +stm32f446 = ["stm32f4/stm32f446", "_pac_gpiog", "_pac_otg_fs", "_pac_spi4", "_pac_tim8"] +stm32f469 = ["stm32f4/stm32f469", "_pac_gpiog", "_pac_otg_fs", "_pac_rng", "_pac_sdio", "_pac_spi4", "_pac_tim8"] +stm32f479 = ["stm32f4/stm32f469", "_pac_gpiog", "_pac_otg_fs", "_pac_rng", "_pac_sdio", "_pac_spi4", "_pac_tim8"] ## 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"] @@ -484,69 +186,16 @@ fsmc_lcd = ["dep:display-interface", "dep:display-interface-04"] ## SDIO peripheral support. See [sdio-host](https://crates.io/crates/sdio-host) sdio-host = ["dep:sdio-host"] -dfsdm = [] -sai = [] - -adc2 = [] -adc3 = [] -aes = [] -can1 = [] -can2 = [] -can3 = [] -cryp = [] -dac = [] -dcmi = [] -dfsdm1 = ["dfsdm"] -dfsdm2 = ["dfsdm"] -dma2d = [] -dsihost = [] -eth = [] -fmc = [] -fsmc = [] -fmpi2c1 = [] -gpiod = [] -gpioe = [] -gpiof = [] -gpiog = [] -gpioi = [] -gpioj = [] -gpiok = [] -i2c3 = [] -lptim1 = [] -ltdc = ["dep:micromath"] -quadspi = [] -otg-fs = [] -otg-hs = [] -rng = [] -sai1 = ["sai"] -sai2 = ["sai"] -sdio = [] -spi3 = [] -spi4 = [] -spi5 = [] -spi6 = [] -spdifrx = [] -tim1 = [] -tim2 = [] -tim3 = [] -tim4 = [] -tim5 = [] -tim6 = [] -tim7 = [] -tim8 = [] -tim9 = [] -tim10 = [] -tim11 = [] -tim12 = [] -tim13 = [] -tim14 = [] -usart3 = [] -uart4 = [] -uart5 = [] -uart7 = [] -uart8 = [] -uart9 = [] -uart10 = [] +# Private features for testing only +_pac_fsmc = [] +_pac_gpiod = [] +_pac_gpiog = ["_pac_gpiod"] +_pac_tim2 = [] +_pac_tim8 = ["_pac_tim2"] +_pac_rng = [] +_pac_sdio = [] +_pac_spi4 = [] +_pac_otg_fs = [] [profile.dev] debug = true @@ -561,11 +210,11 @@ opt-level = "s" [[example]] name = "analog-stopwatch-with-spi-ssd1306" -required-features = ["spi4", "tim2", "gpioe", "gpiog"] # stm32f429 +required-features = ["_pac_spi4", "_pac_tim2", "_pac_gpiog"] # stm32f429 [[example]] name = "blinky-timer-irq" -required-features = ["tim2"] # stm32f411 +required-features = ["_pac_tim2"] # stm32f411 [[example]] name = "can-send" @@ -585,7 +234,7 @@ required-features = ["fsmc_lcd", "stm32f412"] #or stm32f413 [[example]] name = "dwt-blinky" -required-features = ["gpiog"] # "stm32f429" +required-features = ["_pac_gpiog"] # "stm32f429" [[example]] name = "dynamic-gpio" @@ -594,11 +243,9 @@ required-features = [] [[example]] name = "f413disco-lcd-ferris" required-features = [ - "gpiod", - "gpioe", - "gpiof", - "gpiog", - "fsmc", + "_pac_gpiod", + "_pac_gpiog", + "_pac_fsmc", "fsmc_lcd", ] # stm32f413 @@ -620,7 +267,7 @@ required-features = [] [[example]] name = "pwm-input" -required-features = ["tim8"] # stm32f446 +required-features = ["_pac_tim8"] # stm32f446 [[example]] name = "pwm-sinus" @@ -628,7 +275,7 @@ required-features = ["stm32f411"] [[example]] name = "qei" -required-features = ["tim2"] # stm32f411 +required-features = ["_pac_tim2"] # stm32f411 [[example]] name = "qspi-w25q" @@ -636,7 +283,7 @@ required-features = ["stm32f412"] [[example]] name = "rng-display" -required-features = ["rng"] # stm32f407 +required-features = ["_pac_rng"] # stm32f407 [[example]] name = "rtc" @@ -672,7 +319,7 @@ required-features = ["stm32f411", "rtic1"] [[example]] name = "rtic-tick" -required-features = ["tim2", "rtic1"] +required-features = ["_pac_tim2", "rtic1"] [[example]] name = "rtic2-tick" @@ -688,11 +335,11 @@ required-features = ["stm32f411", "rtic1"] # stm32f411 [[example]] name = "rtic-usb-cdc-echo" -required-features = ["stm32f411", "rtic1", "otg-fs", "usb_fs"] # stm32f411 +required-features = ["stm32f411", "rtic1", "_pac_otg_fs", "usb_fs"] # stm32f411 [[example]] name = "sd" -required-features = ["gpiod", "sdio", "sdio-host"] # stm32f405 +required-features = ["_pac_gpiod", "_pac_sdio", "sdio-host"] # stm32f405 [[example]] name = "serial" @@ -700,7 +347,7 @@ required-features = [] [[example]] name = "serial-9bit" -required-features = ["gpiod"] # stm32f411 +required-features = ["_pac_gpiod"] # stm32f411 [[example]] name = "serial-dma" @@ -720,15 +367,15 @@ required-features = [] # stm32f411 [[example]] name = "st7789-lcd" -required-features = ["fsmc", "fsmc_lcd"] # stm32f412 +required-features = ["_pac_fsmc", "fsmc_lcd"] # stm32f412 [[example]] name = "stopwatch-with-ssd1306-and-interrupts" -required-features = ["tim2"] # stm32f411 +required-features = ["_pac_tim2"] # stm32f411 [[example]] name = "stopwatch-with-ssd1306-and-interrupts-and-dma-i2c" -required-features = ["tim2", "stm32f411"] # stm32f411 +required-features = ["_pac_tim2", "stm32f411"] # stm32f411 [[example]] name = "ltdc-screen" @@ -744,11 +391,11 @@ required-features = [] [[example]] name = "usb-serial-irq" -required-features = ["otg-fs", "usb_fs"] # stm32f407 +required-features = ["_pac_otg_fs", "usb_fs"] # stm32f407 [[example]] name = "usb-serial-poll" -required-features = ["otg-fs", "usb_fs"] # stm32f401 +required-features = ["_pac_otg_fs", "usb_fs"] # stm32f401 [[example]] name = "ws2812-spi" diff --git a/build.rs b/build.rs index 8e25570e..866b1988 100644 --- a/build.rs +++ b/build.rs @@ -1,4 +1,4 @@ -use std::env; +use std::{collections::HashSet, env}; #[derive(Clone, Copy, Debug)] enum GetOneError { @@ -19,9 +19,178 @@ impl IteratorExt for T { } } } +const FEATURES: phf::Map<&str, &[&str]> = phf::phf_map! { + "stm32f401" => &["gpio_f401"], + "stm32f405" => &["gpio_f417"], + "stm32f407" => &["gpio_f417"], + "stm32f415" => &["gpio_f417", "pac_cryp"], + "stm32f417" => &["gpio_f417", "pac_cryp"], + "stm32f410" => &["gpio_f410"], + "stm32f411" => &["gpio_f411"], + "stm32f412" => &["gpio_f412"], + "stm32f413" => &["gpio_f413"], + "stm32f423" => &["gpio_f413", "pac_aes"], + "stm32f427" => &["gpio_f427", "pac_fsmc"], + "stm32f429" => &["gpio_f427", "pac_fmc"], + "stm32f437" => &["gpio_f427", "pac_fsmc", "pac_cryp"], + "stm32f439" => &["gpio_f427", "pac_fmc", "pac_cryp"], + "stm32f446" => &["gpio_f446"], + "stm32f469" => &["gpio_f469"], + "stm32f479" => &["gpio_f469", "pac_cryp"], + + "gpio_f401" => &[ + "pac_gpiod", "pac_gpioe", + "pac_i2c3", + "pac_otg_fs", + "pac_sdio", + "pac_spi3", "pac_spi4", + "pac_tim1", "pac_tim2", "pac_tim3", "pac_tim4", "pac_tim5", "pac_tim9", "pac_tim10", "pac_tim11", + ], + "gpio_f410" => &[ + "pac_dac", + "pac_fmpi2c1", + "pac_lptim1", + "pac_spi5", + "pac_tim1", "pac_tim5", "pac_tim6", "pac_tim9", "pac_tim11", + ], + "gpio_f411" => &[ + "pac_gpiod", "pac_gpioe", // "pac_gpioi", + "pac_i2c3", + "pac_otg_fs", + "pac_sdio", + "pac_tim1", "pac_tim2", "pac_tim3", "pac_tim4", "pac_tim5", "pac_tim9", "pac_tim10", "pac_tim11", + "pac_spi3", "pac_spi4", "pac_spi5", + ], + "gpio_f412" => &[ + "pac_gpiod", "pac_gpioe", "pac_gpiof", "pac_gpiog", + "pac_can1", "pac_can2", + "pac_dfsdm1", + "pac_fmpi2c1", + "pac_fsmc", + "pac_i2c3", + "pac_quadspi", + "pac_otg_fs", + "pac_rng", + "pac_sdio", + "pac_spi3", "pac_spi4", "pac_spi5", + "pac_tim1", "pac_tim2", "pac_tim3", "pac_tim4", "pac_tim5", "pac_tim6", "pac_tim7", "pac_tim8", "pac_tim9", "pac_tim10", "pac_tim11", "pac_tim12", "pac_tim13", "pac_tim14", + "pac_usart3", + ], + "gpio_f413" => &[ + "pac_gpiod", "pac_gpioe", "pac_gpiof", "pac_gpiog", + "pac_can1", "pac_can2", "pac_can3", + "pac_dac", + "pac_dfsdm1", + "pac_dfsdm2", + "pac_fsmc", + "pac_fmpi2c1", + "pac_i2c3", + "pac_lptim1", + "pac_quadspi", + "pac_otg_fs", + "pac_rng", + "pac_sai1", + "pac_sdio", + "pac_spi3", "pac_spi4", "pac_spi5", + "pac_tim1", "pac_tim2", "pac_tim3", "pac_tim4", "pac_tim5", "pac_tim6", "pac_tim7", "pac_tim8", "pac_tim9", "pac_tim10", "pac_tim11", "pac_tim12", "pac_tim13", "pac_tim14", + "pac_usart3", "pac_uart4", "pac_uart5", "pac_uart7", "pac_uart8", "pac_uart9", "pac_uart10", + ], + "gpio_f417" => &[ + "pac_gpiod", "pac_gpioe", "pac_gpiof", "pac_gpiog", "pac_gpioi", + "pac_adc2", "pac_adc3", + "pac_can1", "pac_can2", + "pac_dac", + "pac_dcmi", + "pac_eth", + "pac_fsmc", + "pac_i2c3", + "pac_otg_fs", "pac_otg_hs", + "pac_rng", + "pac_sdio", + "pac_spi3", + "pac_tim1", "pac_tim2", "pac_tim3", "pac_tim4", "pac_tim5", "pac_tim6", "pac_tim7", "pac_tim8", "pac_tim9", "pac_tim10", "pac_tim11", "pac_tim12", "pac_tim13", "pac_tim14", + "pac_usart3", "pac_uart4", "pac_uart5", + ], + "gpio_f427" => &[ + "pac_gpiod", "pac_gpioe", "pac_gpiof", "pac_gpiog", "pac_gpioi", "pac_gpioj", "pac_gpiok", + "pac_adc2", "pac_adc3", + "pac_can1", "pac_can2", + "pac_dac", + "pac_dcmi", + "pac_dma2d", + "pac_eth", + "pac_i2c3", + "pac_ltdc", + "pac_otg_fs", "pac_otg_hs", + "pac_rng", + "pac_sai1", + "pac_sdio", + "pac_spi3", "pac_spi4", "pac_spi5", "pac_spi6", + "pac_tim1", "pac_tim2", "pac_tim3", "pac_tim4", "pac_tim5", "pac_tim6", "pac_tim7", "pac_tim8", "pac_tim9", "pac_tim10", "pac_tim11", "pac_tim12", "pac_tim13", "pac_tim14", + "pac_usart3", "pac_uart4", "pac_uart5", "pac_uart7", "pac_uart8", + ], + "gpio_f446" => &[ + "pac_gpiod", "pac_gpioe", "pac_gpiof", "pac_gpiog", + "pac_adc2", "pac_adc3", + "pac_can1", "pac_can2", + "pac_dac", + "pac_dcmi", + "pac_fmpi2c1", + "pac_fmc", + "pac_i2c3", + "pac_quadspi", + "pac_otg_fs", "pac_otg_hs", + "pac_sai1", + "pac_sai2", + "pac_sdio", + "pac_spi3", "pac_spi4", + "pac_spdifrx", + "pac_tim1", "pac_tim2", "pac_tim3", "pac_tim4", "pac_tim5", "pac_tim6", "pac_tim7", "pac_tim8", "pac_tim9", "pac_tim10", "pac_tim11", "pac_tim12", "pac_tim13", "pac_tim14", + "pac_usart3", "pac_uart4", "pac_uart5", + ], + "gpio_f469" => &[ + "pac_gpiod", "pac_gpioe", "pac_gpiof", "pac_gpiog", "pac_gpioi", "pac_gpioj", "pac_gpiok", + "pac_adc2", "pac_adc3", + "pac_can1", "pac_can2", + "pac_dac", + "pac_dcmi", + "pac_dma2d", + "pac_dsihost", + "pac_eth", + "pac_fmc", + "pac_i2c3", + "pac_ltdc", + "pac_quadspi", + "pac_otg_fs", "pac_otg_hs", + "pac_rng", + "pac_sai1", + "pac_sdio", + "pac_spi3", "pac_spi4", "pac_spi5", "pac_spi6", + "pac_tim1", "pac_tim2", "pac_tim3", "pac_tim4", "pac_tim5", "pac_tim6", "pac_tim7", "pac_tim8", "pac_tim9", "pac_tim10", "pac_tim11", "pac_tim12", "pac_tim13", "pac_tim14", + "pac_usart3", "pac_uart4", "pac_uart5", "pac_uart7", "pac_uart8", + ], + + "pac_sai1" => &["any_sai"], + "pac_sai2" => &["any_sai"], + "pac_dfsdm1" => &["any_dfsdm"], + "pac_dfsdm2" => &["any_dfsdm"], +}; + +fn enable_feature<'a>(fname: &'a str, enabled: &mut HashSet<&'a str>) { + if !enabled.contains(fname) { + if let Some(v) = FEATURES.get(fname) { + for &f in v.iter() { + println!("cargo:rustc-cfg={}", f); + enabled.insert(fname); + enable_feature(f, enabled); + } + } + } +} fn main() { - let _chip_name = match env::vars() + let mut enabled = HashSet::new(); + let chip_name = match env::vars() .map(|(a, _)| a) .filter(|x| x.starts_with("CARGO_FEATURE_STM32F4")) .get_one() @@ -33,4 +202,6 @@ fn main() { .strip_prefix("CARGO_FEATURE_") .unwrap() .to_ascii_lowercase(); + + enable_feature(&chip_name, &mut enabled); } diff --git a/src/adc.rs b/src/adc.rs index 37401998..96cd40ef 100644 --- a/src/adc.rs +++ b/src/adc.rs @@ -1033,8 +1033,8 @@ unsafe impl DMASet (adc1, ADC_COMMON, 8)); -#[cfg(feature = "adc2")] +#[cfg(pac_adc2)] adc!(ADC2 => (adc2, ADC_COMMON, 9)); -#[cfg(feature = "adc3")] +#[cfg(pac_adc3)] adc!(ADC3 => (adc3, ADC_COMMON, 10)); diff --git a/src/can.rs b/src/can.rs index 44034f24..07d2568d 100644 --- a/src/can.rs +++ b/src/can.rs @@ -18,11 +18,11 @@ macro_rules! can { // Implemented by all SPI instances can! { CAN1: Can1 } can! { CAN2: Can2 } -#[cfg(feature = "can3")] +#[cfg(pac_can3)] can! { crate::pac::CAN3: Can3 } /// Pins and definitions for models with a third CAN peripheral -#[cfg(feature = "can3")] +#[cfg(pac_can3)] mod can3 { use super::*; use crate::pac::CAN3; diff --git a/src/dma/mod.rs b/src/dma/mod.rs index 6121a94f..9cc74ee9 100644 --- a/src/dma/mod.rs +++ b/src/dma/mod.rs @@ -52,7 +52,7 @@ impl Debug for DMAError { } // most of STM32F4 have 8 DmaChannel -#[cfg(not(feature = "gpio-f413"))] +#[cfg(not(gpio_f413))] /// Possible Channel of a DMA Stream. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum DmaChannel { @@ -67,7 +67,7 @@ pub enum DmaChannel { } // STM32F413 and STM32F423 have 16 DmaChannel -#[cfg(feature = "gpio-f413")] +#[cfg(gpio_f413)] /// Possible Channel of a DMA Stream. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum DmaChannel { @@ -380,12 +380,12 @@ impl StreamX { } impl StreamX { - #[cfg(not(any(feature = "gpio-f411", feature = "gpio-f413", feature = "gpio-f410")))] + #[cfg(not(any(gpio_f411, gpio_f413, gpio_f410)))] #[inline(always)] unsafe fn st() -> &'static pac::dma2::ST { (*DMA::ptr()).st(S as usize) } - #[cfg(any(feature = "gpio-f411", feature = "gpio-f413", feature = "gpio-f410"))] + #[cfg(any(gpio_f411, gpio_f413, gpio_f410))] #[inline(always)] unsafe fn st() -> &'static pac::dma1::ST { (*DMA::ptr()).st(S as usize) @@ -768,7 +768,7 @@ dma_channel!( (Channel7, 7), ); -#[cfg(feature = "gpio-f413")] +#[cfg(gpio_f413)] dma_channel!((Channel8, 8), (Channel9, 9),); /// Contains types related to DMA configuration. diff --git a/src/dma/traits.rs b/src/dma/traits.rs index 96e9ef71..2427bb50 100644 --- a/src/dma/traits.rs +++ b/src/dma/traits.rs @@ -346,20 +346,20 @@ use dma_map; mod f4; -#[cfg(feature = "dfsdm")] +#[cfg(any_dfsdm)] pub struct FLT { _per: PhantomData, } -#[cfg(feature = "dfsdm")] +#[cfg(any_dfsdm)] impl crate::Sealed for FLT {} -#[cfg(feature = "sai")] +#[cfg(any_sai)] pub struct SAICH { _per: PhantomData, } -#[cfg(feature = "sai")] +#[cfg(any_sai)] impl crate::Sealed for SAICH {} dma_map!( @@ -373,24 +373,24 @@ dma_map!( (Stream7:0, MemoryToMemory, [MemoryToMemory | MemoryToMemory | MemoryToMemory]), ); -#[cfg(feature = "spdifrx")] +#[cfg(pac_spdifrx)] address!((pac::SPDIFRX, dr, u32),); -#[cfg(feature = "aes")] +#[cfg(pac_aes)] #[non_exhaustive] pub struct AES_IN; -#[cfg(feature = "aes")] +#[cfg(pac_aes)] #[non_exhaustive] pub struct AES_OUT; -#[cfg(feature = "aes")] +#[cfg(pac_aes)] unsafe impl PeriAddress for AES_IN { fn address(&self) -> u32 { unsafe { (*pac::AES::ptr()).dinr().as_ptr() as u32 } } type MemSize = u32; } -#[cfg(feature = "aes")] +#[cfg(pac_aes)] unsafe impl PeriAddress for AES_OUT { fn address(&self) -> u32 { unsafe { (*pac::AES::ptr()).doutr().as_ptr() as u32 } @@ -398,21 +398,21 @@ unsafe impl PeriAddress for AES_OUT { type MemSize = u32; } -#[cfg(feature = "cryp")] +#[cfg(pac_cryp)] #[non_exhaustive] pub struct CRYP_IN; -#[cfg(feature = "cryp")] +#[cfg(pac_cryp)] #[non_exhaustive] pub struct CRYP_OUT; -#[cfg(feature = "cryp")] +#[cfg(pac_cryp)] unsafe impl PeriAddress for CRYP_IN { fn address(&self) -> u32 { unsafe { (*pac::CRYP::ptr()).din().as_ptr() as u32 } } type MemSize = u32; } -#[cfg(feature = "cryp")] +#[cfg(pac_cryp)] unsafe impl PeriAddress for CRYP_OUT { fn address(&self) -> u32 { unsafe { (*pac::CRYP::ptr()).dout().as_ptr() as u32 } diff --git a/src/dma/traits/f4.rs b/src/dma/traits/f4.rs index 837d8443..564dd100 100644 --- a/src/dma/traits/f4.rs +++ b/src/dma/traits/f4.rs @@ -1,6 +1,6 @@ use super::*; -#[cfg(feature = "tim1")] +#[cfg(pac_tim1)] dma_map!( (Stream0:6, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM1_TRIG (Stream1:6, timer::CCR1, [MemoryToPeripheral | PeripheralToMemory]), //TIM1_CH1 @@ -15,7 +15,7 @@ dma_map!( (Stream6:6, timer::CCR3, [MemoryToPeripheral | PeripheralToMemory]), //TIM1_CH3 ); -#[cfg(feature = "tim5")] +#[cfg(pac_tim5)] dma_map!( (Stream0:6, timer::CCR3, [MemoryToPeripheral | PeripheralToMemory]), //TIM5_CH3 (Stream0:6, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM5_UP @@ -63,14 +63,7 @@ address!( ); #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f417", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469", + gpio_f401, gpio_f417, gpio_f411, gpio_f412, gpio_f413, gpio_f427, gpio_f446, gpio_f469, ))] dma_map!( (Stream0:2, timer::CCR1, [MemoryToPeripheral | PeripheralToMemory]), //TIM4_CH1 @@ -93,33 +86,27 @@ dma_map!( (Stream7:0, pac::SPI3, [MemoryToPeripheral]), //SPI3_TX ); -#[cfg(feature = "i2c3")] +#[cfg(pac_i2c3)] address!((pac::I2C3, dr, u8),); -#[cfg(feature = "spi3")] +#[cfg(pac_spi3)] address!((pac::SPI3, dr, u8),); -#[cfg(feature = "sdio")] +#[cfg(pac_sdio)] dma_map!( (Stream3:4, pac::SDIO, [MemoryToPeripheral | PeripheralToMemory]), //SDIO (Stream6:4, pac::SDIO, [MemoryToPeripheral | PeripheralToMemory]), //SDIO ); -#[cfg(feature = "sdio")] +#[cfg(pac_sdio)] address!((pac::SDIO, fifo, u32),); -#[cfg(any( - feature = "gpio-f401", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f446", -))] +#[cfg(any(gpio_f401, gpio_f411, gpio_f412, gpio_f413, gpio_f446))] dma_map!( (Stream1:1, pac::I2C3, [PeripheralToMemory]), //I2C3_RX (Stream2:3, pac::I2C3, [PeripheralToMemory]), //I2C3_RX:DMA_CHANNEL_3 ); -#[cfg(any(feature = "gpio-f401", feature = "gpio-f411"))] +#[cfg(any(gpio_f401, gpio_f411))] dma_map!( (Stream1:3, timer::CCR3, [MemoryToPeripheral | PeripheralToMemory]), //TIM2_CH3 (Stream1:3, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM2_UP @@ -127,23 +114,12 @@ dma_map!( (Stream7:3, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM2_UP ); -#[cfg(any( - feature = "gpio-f401", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", -))] +#[cfg(any(gpio_f401, gpio_f411, gpio_f412, gpio_f413))] dma_map!( (Stream5:6, pac::I2C3, [MemoryToPeripheral]), //I2C3_TX:DMA_CHANNEL_6); ); -#[cfg(any( - feature = "gpio-f401", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469", -))] +#[cfg(any(gpio_f401, gpio_f417, gpio_f427, gpio_f446, gpio_f469))] dma_map!( (Stream6:1, pac::I2C1, [MemoryToPeripheral]), //I2C1_TX (Stream7:1, pac::I2C1, [MemoryToPeripheral]), //I2C1_TX @@ -152,13 +128,7 @@ dma_map!( ); #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469", + gpio_f401, gpio_f411, gpio_f412, gpio_f413, gpio_f427, gpio_f446, gpio_f469, ))] dma_map!( (Stream0:4, pac::SPI4, [PeripheralToMemory]), //SPI4_RX @@ -168,23 +138,11 @@ dma_map!( ); #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469", + gpio_f401, gpio_f411, gpio_f412, gpio_f413, gpio_f427, gpio_f446, gpio_f469, ))] address!((pac::SPI4, dr, u8),); -#[cfg(any( - feature = "gpio-f417", - feature = "gpio-f413", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469", -))] +#[cfg(any(gpio_f417, gpio_f413, gpio_f427, gpio_f446, gpio_f469))] dma_map!( (Stream0:4, pac::UART5, [PeripheralToMemory]), //UART5_RX (Stream2:4, pac::UART4, [PeripheralToMemory]), //UART4_RX @@ -192,27 +150,14 @@ dma_map!( //(Stream6:7, pac::DAC2, [MemoryToPeripheral]), //DAC2 ); -#[cfg(any( - feature = "gpio-f417", - feature = "gpio-f413", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469", -))] +#[cfg(any(gpio_f417, gpio_f413, gpio_f427, gpio_f446, gpio_f469))] address!( (pac::UART4, dr, u8), (pac::UART5, dr, u8), //(pac::DAC, ??), ); -#[cfg(any( - feature = "gpio-f417", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469", -))] +#[cfg(any(gpio_f417, gpio_f412, gpio_f413, gpio_f427, gpio_f446, gpio_f469))] dma_map!( (Stream1:3, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM2_UP (Stream1:3, timer::CCR3, [MemoryToPeripheral | PeripheralToMemory]), //TIM2_CH3 @@ -234,26 +179,19 @@ dma_map!( (Stream4:7, pac::USART3, [MemoryToPeripheral]), //USART3_TX:DMA_CHANNEL_7 ); -#[cfg(any( - feature = "gpio-f417", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469", -))] +#[cfg(any(gpio_f417, gpio_f412, gpio_f413, gpio_f427, gpio_f446, gpio_f469))] address!((pac::USART3, dr, u8),); /* DMAR register appears to be missing from TIM6 derived timers on these devices Not sure how _UP is supposed to work without DMAR or if this is just an SVD issue -#[cfg(feature = "tim6")] +#[cfg(pac_tim6)] dma_map!( (Stream1:7, timer::DMAR, [MemoryToPeripheral | PeripheralToMemory]), //TIM6_UP ); */ -#[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] +#[cfg(any(gpio_f417, gpio_f427, gpio_f469))] dma_map!( (Stream2:3, pac::I2C3, [PeripheralToMemory]), //I2C3_RX (Stream5:2, pac::CRYP, [PeripheralToMemory]), //CRYP_OUT @@ -261,10 +199,10 @@ dma_map!( (Stream7:2, pac::HASH, [MemoryToPeripheral]), //HASH_IN ); -#[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] +#[cfg(any(gpio_f417, gpio_f427, gpio_f469))] address!((pac::HASH, din, u32), (pac::CRYP, din, u32),); -#[cfg(feature = "cryp")] +#[cfg(pac_cryp)] dma_map!( (Stream5:2, CRYP_OUT, [PeripheralToMemory]), //CRYP_OUT (Stream6:2, CRYP_IN, [MemoryToPeripheral]), //CRYP_IN @@ -272,35 +210,30 @@ dma_map!( /* Not sure how DAC works with DMA #[cfg(any( - feature = "gpio-f417", - feature = "gpio-f410", - feature = "gpio-f413", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469", + gpio_f417, + gpio_f410, + gpio_f413, + gpio_f427, + gpio_f446, + gpio_f469, ))] dma_map!( (Stream5:7, pac::DAC, [MemoryToPeripheral]), //DAC1 ); #[cfg(any( - feature = "gpio-f417", - feature = "gpio-f410", - feature = "gpio-f413", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469", + gpio_f417, + gpio_f410, + gpio_f413, + gpio_f427, + gpio_f446, + gpio_f469, ))] address!( (pac::DAC, ??), ); */ -#[cfg(any( - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469", -))] +#[cfg(any(gpio_f417, gpio_f427, gpio_f446, gpio_f469))] dma_map!( (Stream7:4, pac::UART5, [MemoryToPeripheral]), //UART5_TX (Stream0:2, pac::ADC3, [PeripheralToMemory]), //ADC3 @@ -308,28 +241,18 @@ dma_map!( (Stream2:1, pac::ADC2, [PeripheralToMemory]), //ADC2 (Stream3:1, pac::ADC2, [PeripheralToMemory]), //ADC2 ); -#[cfg(any( - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469", -))] +#[cfg(any(gpio_f417, gpio_f427, gpio_f446, gpio_f469))] address!((pac::ADC2, dr, u16), (pac::ADC3, dr, u16),); -#[cfg(feature = "dcmi")] +#[cfg(pac_dcmi)] dma_map!( (Stream1:1, pac::DCMI, [PeripheralToMemory]), //DCMI (Stream7:1, pac::DCMI, [PeripheralToMemory]), //DCMI ); -#[cfg(feature = "dcmi")] +#[cfg(pac_dcmi)] address!((pac::DCMI, dr, u32),); -#[cfg(any( - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", -))] +#[cfg(any(gpio_f410, gpio_f411, gpio_f412, gpio_f413))] dma_map!( (Stream1:0, pac::I2C1, [MemoryToPeripheral]), //I2C1_TX (Stream6:1, pac::I2C1, [MemoryToPeripheral]), //I2C1_TX:DMA_CHANNEL_1 @@ -341,14 +264,7 @@ dma_map!( (Stream5:5, pac::SPI5, [MemoryToPeripheral]), //SPI5_TX:DMA_CHANNEL_5 ); -#[cfg(any( - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f427", - feature = "gpio-f469", -))] +#[cfg(any(gpio_f410, gpio_f411, gpio_f412, gpio_f413, gpio_f427, gpio_f469))] dma_map!( (Stream3:2, pac::SPI5, [PeripheralToMemory]), //SPI5_RX (Stream4:2, pac::SPI5, [MemoryToPeripheral]), //SPI5_TX @@ -356,28 +272,21 @@ dma_map!( (Stream6:7, pac::SPI5, [MemoryToPeripheral]), //SPI5_TX:DMA_CHANNEL_7 ); -#[cfg(any( - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f427", - feature = "gpio-f469", -))] +#[cfg(any(gpio_f410, gpio_f411, gpio_f412, gpio_f413, gpio_f427, gpio_f469))] address!((pac::SPI5, dr, u8),); -#[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] +#[cfg(any(gpio_f411, gpio_f412, gpio_f413))] dma_map!( (Stream4:4, pac::SPI4, [PeripheralToMemory]), //SPI4_RX ); -#[cfg(feature = "dfsdm1")] +#[cfg(pac_dfsdm1)] mod dfsdm1 { use super::*; - #[cfg(feature = "gpio-f412")] + #[cfg(gpio_f412)] use pac::DFSDM as DFSDM1; - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] use pac::DFSDM1; dma_map!( @@ -397,7 +306,7 @@ mod dfsdm1 { } */ } /* -#[cfg(feature = "dfsdm2")] +#[cfg(pac_dfsdm2)] dma_map!( (Stream0:8, FLT, [PeripheralToMemory]), //DFSDM2_FLT0 (Stream1:8, FLT, [PeripheralToMemory]), //DFSDM2_FLT1 @@ -408,7 +317,7 @@ dma_map!( (Stream6:8, FLT, [PeripheralToMemory]), //DFSDM2_FLT2 (Stream7:8, FLT, [PeripheralToMemory]), //DFSDM2_FLT3 ); -#[cfg(feature = "dfsdm2")] +#[cfg(pac_dfsdm2)] unsafe impl PeriAddress for FLT { #[inline(always)] fn address(&self) -> u32 { @@ -418,15 +327,15 @@ unsafe impl PeriAddress for FLT { type MemSize = u32; } */ -#[cfg(feature = "quadspi")] +#[cfg(pac_quadspi)] dma_map!( (Stream7:3, pac::QUADSPI, [MemoryToPeripheral | PeripheralToMemory]), //QUADSPI ); -#[cfg(feature = "quadspi")] +#[cfg(pac_quadspi)] address!((pac::QUADSPI, dr, u32),); -#[cfg(any(feature = "gpio-f413", feature = "gpio-f427", feature = "gpio-f469"))] +#[cfg(any(gpio_f413, gpio_f427, gpio_f469))] dma_map!( (Stream0:5, pac::UART8, [MemoryToPeripheral]), //UART8_TX (Stream1:5, pac::UART7, [MemoryToPeripheral]), //UART7_TX @@ -434,10 +343,10 @@ dma_map!( (Stream6:5, pac::UART8, [PeripheralToMemory]), //UART8_RX ); -#[cfg(any(feature = "gpio-f413", feature = "gpio-f427", feature = "gpio-f469"))] +#[cfg(any(gpio_f413, gpio_f427, gpio_f469))] address!((pac::UART7, dr, u8), (pac::UART8, dr, u8),); -#[cfg(feature = "gpio-f413")] +#[cfg(gpio_f413)] dma_map!( (Stream7:8, pac::UART5, [MemoryToPeripheral]), //UART5_TX (Stream0:1, pac::UART9, [MemoryToPeripheral]), //UART9_TX @@ -447,27 +356,27 @@ dma_map!( (Stream7:0, pac::UART9, [PeripheralToMemory]), //UART9_RX (Stream7:6, pac::UART10, [MemoryToPeripheral]), //UART10_TX:DMA_CHANNEL_6 ); -#[cfg(feature = "gpio-f413")] +#[cfg(gpio_f413)] address!((pac::UART9, dr, u8), (pac::UART10, dr, u8),); -#[cfg(feature = "aes")] +#[cfg(pac_aes)] dma_map!( (Stream6:2, AES_IN, [MemoryToPeripheral]), //AES_IN (Stream5:2, AES_OUT, [PeripheralToMemory]), //AES_OUT ); -#[cfg(feature = "sai1")] +#[cfg(pac_sai1)] mod sai1 { use super::*; #[cfg(not(any( - feature = "gpio-f446", + gpio_f446, feature = "stm32f417", feature = "stm32f427", feature = "stm32f437" )))] use pac::SAI as SAI1; #[cfg(any( - feature = "gpio-f446", + gpio_f446, feature = "stm32f417", feature = "stm32f427", feature = "stm32f437" @@ -490,14 +399,14 @@ mod sai1 { type MemSize = u32; } } -#[cfg(feature = "sai2")] +#[cfg(pac_sai2)] dma_map!( (Stream4:3, SAICH, [MemoryToPeripheral | PeripheralToMemory]), //SAI2_A (Stream6:3, SAICH, [MemoryToPeripheral | PeripheralToMemory]), //SAI2_B (Stream7:0, SAICH, [MemoryToPeripheral | PeripheralToMemory]), //SAI2_B:DMA_CHANNEL_0 ); -#[cfg(feature = "sai2")] +#[cfg(pac_sai2)] unsafe impl PeriAddress for SAICH { #[inline(always)] fn address(&self) -> u32 { @@ -507,22 +416,22 @@ unsafe impl PeriAddress for SAICH { type MemSize = u32; } -#[cfg(feature = "spi6")] +#[cfg(pac_spi6)] dma_map!( (Stream5:1, pac::SPI6, [MemoryToPeripheral]), //SPI6_TX (Stream6:1, pac::SPI6, [PeripheralToMemory]), //SPI6_RX ); -#[cfg(feature = "spi6")] +#[cfg(pac_spi6)] address!((pac::SPI6, dr, u8),); -#[cfg(feature = "spdifrx")] +#[cfg(pac_spdifrx)] dma_map!( (Stream1:0, pac::SPDIFRX, [PeripheralToMemory]), //SPDIF_RX_DT //(Stream6:0, SPDIFRX_CS, [PeripheralToMemory]), //SPDIF_RX_CS ); -#[cfg(any(feature = "gpio-f410", feature = "gpio-f412", feature = "gpio-f413"))] +#[cfg(any(gpio_f410, gpio_f412, gpio_f413))] dma_map!( (Stream0:7, pac::FMPI2C1, [PeripheralToMemory]), //FMPI2C1_RX (Stream1:2, pac::FMPI2C1, [MemoryToPeripheral]), //FMPI2C1_TX @@ -530,13 +439,13 @@ dma_map!( (Stream7:4, pac::FMPI2C1, [MemoryToPeripheral]), //FMPI2C1_TX:DMA_CHANNEL_4 ); -#[cfg(feature = "gpio-f446")] +#[cfg(gpio_f446)] dma_map!( (Stream2:2, pac::FMPI2C1, [PeripheralToMemory]), //FMPI2C1_RX (Stream5:2, pac::FMPI2C1, [MemoryToPeripheral]), //FMPI2C1_TX ); /* -#[cfg(feature = "fmpi2c1")] +#[cfg(pac_fmpi2c1)] address!( (pac::FMPI2C1, rxdr, u8), (pac::FMPI2C1, txdr, u8), diff --git a/src/fsmc_lcd/mod.rs b/src/fsmc_lcd/mod.rs index 5c96d7f0..bdc3792d 100644 --- a/src/fsmc_lcd/mod.rs +++ b/src/fsmc_lcd/mod.rs @@ -71,13 +71,13 @@ pub use self::timing::{AccessMode, Timing}; use crate::rcc::{Enable, Reset}; // Use the FMC or FSMC, whichever is available, and treat it like an FSMC -#[cfg(feature = "fmc")] +#[cfg(pac_fmc)] use crate::pac::fmc as fsmc; -#[cfg(feature = "fsmc")] +#[cfg(pac_fsmc)] use crate::pac::fsmc; -#[cfg(feature = "fmc")] +#[cfg(pac_fmc)] use crate::pac::FMC as FSMC; -#[cfg(feature = "fsmc")] +#[cfg(pac_fsmc)] use crate::pac::FSMC; /// A sub-bank of bank 1, with its own chip select output diff --git a/src/gpio.rs b/src/gpio.rs index 2fa1a4a0..063c58b9 100644 --- a/src/gpio.rs +++ b/src/gpio.rs @@ -608,20 +608,20 @@ const fn gpiox() -> *const crate::pac::gpioa::RegisterBlock { 'A' => crate::pac::GPIOA::ptr(), 'B' => crate::pac::GPIOB::ptr() as _, 'C' => crate::pac::GPIOC::ptr() as _, - #[cfg(feature = "gpiod")] + #[cfg(pac_gpiod)] 'D' => crate::pac::GPIOD::ptr() as _, - #[cfg(feature = "gpioe")] + #[cfg(pac_gpioe)] 'E' => crate::pac::GPIOE::ptr() as _, - #[cfg(feature = "gpiof")] + #[cfg(pac_gpiof)] 'F' => crate::pac::GPIOF::ptr() as _, - #[cfg(feature = "gpiog")] + #[cfg(pac_gpiog)] 'G' => crate::pac::GPIOG::ptr() as _, 'H' => crate::pac::GPIOH::ptr() as _, - #[cfg(feature = "gpioi")] + #[cfg(pac_gpioi)] 'I' => crate::pac::GPIOI::ptr() as _, - #[cfg(feature = "gpioj")] + #[cfg(pac_gpioj)] 'J' => crate::pac::GPIOJ::ptr() as _, - #[cfg(feature = "gpiok")] + #[cfg(pac_gpiok)] 'K' => crate::pac::GPIOK::ptr() as _, _ => panic!("Unknown GPIO port"), } diff --git a/src/gpio/alt.rs b/src/gpio/alt.rs index 83bb0978..c3620c32 100644 --- a/src/gpio/alt.rs +++ b/src/gpio/alt.rs @@ -289,14 +289,14 @@ macro_rules! pin { use pin; // CAN pins -#[cfg(feature = "can1")] +#[cfg(pac_can1)] pub trait CanCommon { type Rx; type Tx; } // DFSDM pins -#[cfg(feature = "dfsdm")] +#[cfg(any_dfsdm)] pub trait DfsdmBasic { type Ckin0; type Ckin1; @@ -304,14 +304,14 @@ pub trait DfsdmBasic { type Datin0; type Datin1; } -#[cfg(feature = "dfsdm")] +#[cfg(any_dfsdm)] pub trait DfsdmGeneral: DfsdmBasic { type Ckin2; type Ckin3; type Datin2; type Datin3; } -#[cfg(feature = "dfsdm")] +#[cfg(any_dfsdm)] pub trait DfsdmAdvanced: DfsdmGeneral { type Ckin4; type Ckin5; @@ -364,12 +364,12 @@ pub trait I2sExtPin { // QuadSPI pins -#[cfg(feature = "quadspi")] +#[cfg(pac_quadspi)] pub trait QuadSpiBanks { type Bank1; type Bank2; } -#[cfg(feature = "quadspi")] +#[cfg(pac_quadspi)] pub trait QuadSpiBank { type Io0: crate::gpio::PinSpeed; type Io1: crate::gpio::PinSpeed; @@ -380,12 +380,12 @@ pub trait QuadSpiBank { // SAI pins -#[cfg(feature = "sai1")] +#[cfg(pac_sai1)] pub trait SaiChannels { type A; type B; } -#[cfg(feature = "sai1")] +#[cfg(pac_sai1)] pub trait SaiChannel { type Fs; type Mclk; @@ -395,7 +395,7 @@ pub trait SaiChannel { // SPDIFRX pins -#[cfg(feature = "spdifrx")] +#[cfg(pac_spdifrx)] pub trait SPdifIn { type In; } diff --git a/src/gpio/alt/f4.rs b/src/gpio/alt/f4.rs index 230e1e58..55d6afb8 100644 --- a/src/gpio/alt/f4.rs +++ b/src/gpio/alt/f4.rs @@ -1,7 +1,7 @@ use super::*; use crate::gpio::{self, NoPin, OpenDrain, PushPull}; -#[cfg(feature = "can1")] +#[cfg(pac_can1)] pub mod can1 { use super::*; @@ -9,46 +9,46 @@ pub mod can1 { for no:NoPin, [ PA11<9>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PB8<8>, #[cfg(any( - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469" + gpio_f417, + gpio_f427, + gpio_f446, + gpio_f469 ))] PB8<9>, PD0<9>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PG0<9>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI9<9>, ], for no:NoPin, [ PA12<9>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PB9<8>, #[cfg(any( - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469" + gpio_f417, + gpio_f427, + gpio_f446, + gpio_f469 ))] PB9<9>, PD1<9>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PG1<9>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH13<9>, ], } @@ -59,7 +59,7 @@ pub mod can1 { } } -#[cfg(feature = "can2")] +#[cfg(pac_can2)] pub mod can2 { use super::*; @@ -69,7 +69,7 @@ pub mod can2 { PB12<9>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PG11<9>, ], @@ -78,7 +78,7 @@ pub mod can2 { PB13<9>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PG12<9>, ], } @@ -89,7 +89,7 @@ pub mod can2 { } } -#[cfg(feature = "can3")] +#[cfg(pac_can3)] pub mod can3 { use super::*; @@ -113,12 +113,7 @@ pub mod can3 { } } -#[cfg(any( - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469" -))] +#[cfg(any(gpio_f417, gpio_f427, gpio_f446, gpio_f469))] pub mod dcmi { use super::*; @@ -128,7 +123,7 @@ pub mod dcmi { PC6<13>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH9<13>, ], @@ -137,44 +132,44 @@ pub mod dcmi { PC7<13>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH10<13>, ], for [ PB5<13>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f446, gpio_f469))] PD6<13>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI3<13>, ], for [ PD2<13>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f446, gpio_f469))] PF10<13>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH15<13>, ], for [ PF11<13>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f446, gpio_f469))] PG6<13>, ], for [ - #[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f446, gpio_f469))] PG7<13>, PG15<13>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI0<13>, ], @@ -183,10 +178,10 @@ pub mod dcmi { PE0<13>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f446, gpio_f469))] PG10<13>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH11<13>, ], @@ -195,10 +190,10 @@ pub mod dcmi { PE1<13>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f446, gpio_f469))] PG11<13>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH12<13>, ], @@ -207,17 +202,17 @@ pub mod dcmi { PE4<13>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH14<13>, ], for [ PB6<13>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f446, gpio_f469))] PD3<13>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI4<13>, ], @@ -226,7 +221,7 @@ pub mod dcmi { PE5<13>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI6<13>, ], @@ -235,34 +230,34 @@ pub mod dcmi { PE6<13>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI7<13>, ], for [ PC10<13>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f469))] PH6<13>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI1<13>, ], for [ PC12<13>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f469))] PH7<13>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI2<13>, ], for [ PA4<13>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH8<13>, ], @@ -273,16 +268,16 @@ pub mod dcmi { for [ PB7<13>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f446, gpio_f469))] PG9<13>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI5<13>, ], } } -#[cfg(feature = "dfsdm1")] +#[cfg(pac_dfsdm1)] pub mod dfsdm1 { use super::*; @@ -314,7 +309,7 @@ pub mod dfsdm1 { ], for [ - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PA8<6>, PC2<8>, @@ -349,9 +344,9 @@ pub mod dfsdm1 { ], } - #[cfg(feature = "gpio-f412")] + #[cfg(gpio_f412)] use crate::pac::DFSDM; - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] use crate::pac::DFSDM1 as DFSDM; impl DfsdmBasic for DFSDM { type Ckin0 = Ckin0; @@ -368,7 +363,7 @@ pub mod dfsdm1 { } } -#[cfg(feature = "dfsdm2")] +#[cfg(pac_dfsdm2)] pub mod dfsdm2 { use super::*; @@ -513,7 +508,7 @@ pub mod dfsdm2 { } } -#[cfg(feature = "dsihost")] +#[cfg(pac_dsihost)] pub mod dsihost { use super::*; @@ -526,7 +521,7 @@ pub mod dsihost { } } -#[cfg(feature = "eth")] +#[cfg(pac_eth)] pub mod eth { use super::*; @@ -634,7 +629,7 @@ pub mod eth { } /// Pins available on all STM32F4 models that have an FSMC/FMC -#[cfg(any(feature = "fmc", feature = "fsmc"))] +#[cfg(any(pac_fmc, pac_fsmc))] pub mod fsmc { use super::*; @@ -677,14 +672,14 @@ pub mod fsmc { PG5<12, Speed::VeryHigh>, PG13<12, Speed::VeryHigh>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PC3<12, Speed::VeryHigh>, ], } pin! { for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PC3<12, Speed::VeryHigh>, PF0<12, Speed::VeryHigh>, @@ -796,7 +791,7 @@ pub mod fsmc { /// A pin that can be used for data bus 0 for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PB14<10, Speed::VeryHigh>, PD14<12, Speed::VeryHigh>, @@ -804,7 +799,7 @@ pub mod fsmc { /// A pin that can be used for data bus 1 for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PC6<10, Speed::VeryHigh>, PD15<12, Speed::VeryHigh>, @@ -812,7 +807,7 @@ pub mod fsmc { /// A pin that can be used for data bus 2 for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PC11<10, Speed::VeryHigh>, PD0<12, Speed::VeryHigh>, @@ -820,7 +815,7 @@ pub mod fsmc { /// A pin that can be used for data bus 3 for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PC12<10, Speed::VeryHigh>, PD1<12, Speed::VeryHigh>, @@ -828,7 +823,7 @@ pub mod fsmc { /// A pin that can be used for data bus 4 for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PA2<12, Speed::VeryHigh>, PE7<12, Speed::VeryHigh>, @@ -836,7 +831,7 @@ pub mod fsmc { /// A pin that can be used for data bus 5 for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PA3<12, Speed::VeryHigh>, PE8<12, Speed::VeryHigh>, @@ -844,7 +839,7 @@ pub mod fsmc { /// A pin that can be used for data bus 6 for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PA4<12, Speed::VeryHigh>, PE9<12, Speed::VeryHigh>, @@ -852,7 +847,7 @@ pub mod fsmc { /// A pin that can be used for data bus 7 for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PA5<12, Speed::VeryHigh>, PE10<12, Speed::VeryHigh>, @@ -885,7 +880,7 @@ pub mod fsmc { /// A pin that can be used for data bus 13 for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PB12<12, Speed::VeryHigh>, PD8<12, Speed::VeryHigh>, @@ -902,56 +897,56 @@ pub mod fsmc { ], for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PB14<10, Speed::VeryHigh>, PD14<12, Speed::VeryHigh>, ], for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PC6<10, Speed::VeryHigh>, PD15<12, Speed::VeryHigh>, ], for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PC11<10, Speed::VeryHigh>, PD0<12, Speed::VeryHigh>, ], for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PC12<10, Speed::VeryHigh>, PD1<12, Speed::VeryHigh>, ], for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PA2<12, Speed::VeryHigh>, PE7<12, Speed::VeryHigh>, ], for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PA3<12, Speed::VeryHigh>, PE8<12, Speed::VeryHigh>, ], for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PA4<12, Speed::VeryHigh>, PE9<12, Speed::VeryHigh>, ], for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PA5<12, Speed::VeryHigh>, PE10<12, Speed::VeryHigh>, @@ -978,7 +973,7 @@ pub mod fsmc { ], for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PB12<12, Speed::VeryHigh>, PD8<12, Speed::VeryHigh>, @@ -1017,7 +1012,7 @@ pub mod fsmc { /// A pin that can be used to enable a memory device on sub-bank 4 for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PC4<12, Speed::VeryHigh>, PG12<12, Speed::VeryHigh>, @@ -1029,7 +1024,7 @@ pub mod fsmc { /// A pin that can be used for the output enable (read enable, NOE) signal for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PC5<12, Speed::VeryHigh>, PD4<12, Speed::VeryHigh>, @@ -1041,17 +1036,17 @@ pub mod fsmc { /// A pin that can be used for the write enable (NOE) signal for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PC2<12, Speed::VeryHigh>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PD2<10, Speed::VeryHigh>, PD5<12, Speed::VeryHigh>, ], } - #[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f446, gpio_f469))] pin! { for [ PG4<12, Speed::VeryHigh>, @@ -1064,17 +1059,17 @@ pub mod fsmc { for [ PC3<12, Speed::VeryHigh>, - #[cfg(any(feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f446, gpio_f469))] PC5<12, Speed::VeryHigh>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f469))] PH2<12, Speed::VeryHigh>, ], for [ PB5<12, Speed::VeryHigh>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f469))] PH7<12, Speed::VeryHigh>, ], @@ -1089,17 +1084,17 @@ pub mod fsmc { for [ PC2<12, Speed::VeryHigh>, - #[cfg(any(feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f446, gpio_f469))] PC4<12, Speed::VeryHigh>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f469))] PH3<12, Speed::VeryHigh>, ], for [ PB6<12, Speed::VeryHigh>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f469))] PH6<12, Speed::VeryHigh>, ], @@ -1108,17 +1103,17 @@ pub mod fsmc { ], for [ - #[cfg(any(feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f446, gpio_f469))] PA7<12, Speed::VeryHigh>, PC0<12, Speed::VeryHigh>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f469))] PH5<12, Speed::VeryHigh>, ], } - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427"))] + #[cfg(any(gpio_f417, gpio_f427))] pin! { for [ PF9<12, Speed::VeryHigh>, @@ -1157,7 +1152,7 @@ pub mod fsmc { ], } - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] pin! { for [ PD12<12, Speed::VeryHigh>, @@ -1168,33 +1163,28 @@ pub mod fsmc { ], } - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] pin! { for [ PG7<12, Speed::VeryHigh>, ], } - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f446"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f446))] pin! { for [ PG7<12, Speed::VeryHigh>, ], } - #[cfg(any( - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469" - ))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f446, gpio_f469))] pin! { for [ PG9<12, Speed::VeryHigh>, ], } - #[cfg(any(feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f469))] pin! { for [ PH8<12, Speed::VeryHigh>, @@ -1270,66 +1260,66 @@ pub mod fsmc { } } -#[cfg(feature = "fmpi2c1")] +#[cfg(pac_fmpi2c1)] pub mod fmpi2c1 { use super::*; pin! { for [ - #[cfg(feature = "gpio-f410")] + #[cfg(gpio_f410)] PA8<4>, - #[cfg(any(feature = "gpio-f410", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f410, gpio_f412, gpio_f413))] PB10<9>, - #[cfg(any(feature = "gpio-f410", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f410, gpio_f412, gpio_f413))] PB15<4>, PC6<4>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] PD12<4>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] PD14<4>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] PF14<4>, ], for [ - #[cfg(any(feature = "gpio-f410", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f410, gpio_f412, gpio_f413))] PB3<4>, - #[cfg(any(feature = "gpio-f410", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f410, gpio_f412, gpio_f413))] PB14<4>, PC7<4>, - #[cfg(feature = "gpio-f410")] + #[cfg(gpio_f410)] PC9<4>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] PD13<4>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] PD15<4>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] PF15<4>, ], for [ - #[cfg(any(feature = "gpio-f410", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f410, gpio_f412, gpio_f413))] PB13<4>, - #[cfg(any(feature = "gpio-f410", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f410, gpio_f412, gpio_f413))] PC5<4>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] PD11<4>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] PF13<4>, ], } @@ -1379,56 +1369,56 @@ pub mod i2c2 { PB10<4>, #[cfg(any( - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469" + gpio_f412, + gpio_f413, + gpio_f417, + gpio_f427, + gpio_f446, + gpio_f469 ))] PF1<4>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH4<4>, ], for [ - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PB3<4>, #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413" + gpio_f401, + gpio_f410, + gpio_f411, + gpio_f412, + gpio_f413 ))] PB3<9>, #[cfg(any( - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413" + gpio_f410, + gpio_f411, + gpio_f412, + gpio_f413 ))] PB9<9>, PB11<4>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PC12<4>, #[cfg(any( - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469" + gpio_f412, + gpio_f413, + gpio_f417, + gpio_f427, + gpio_f446, + gpio_f469 ))] PF0<4>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH5<4>, ], @@ -1436,16 +1426,16 @@ pub mod i2c2 { PB12<4>, #[cfg(any( - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469" + gpio_f412, + gpio_f413, + gpio_f417, + gpio_f427, + gpio_f446, + gpio_f469 ))] PF2<4>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH6<4>, ], } @@ -1458,7 +1448,7 @@ pub mod i2c2 { } } -#[cfg(feature = "i2c3")] +#[cfg(pac_i2c3)] pub mod i2c3 { use super::*; @@ -1466,35 +1456,35 @@ pub mod i2c3 { for [ PA8<4>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH7<4>, ], for [ - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PB4<4>, #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413" + gpio_f401, + gpio_f411, + gpio_f412, + gpio_f413 ))] PB4<9>, - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PB8<9>, PC9<4>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH8<4>, ], for [ PA9<4>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH9<4>, ], } @@ -1513,18 +1503,18 @@ pub mod i2s { pin! { for [ #[cfg(any( - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413" + gpio_f410, + gpio_f411, + gpio_f412, + gpio_f413 ))] PA2<5>, #[cfg(any( - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413" + gpio_f410, + gpio_f411, + gpio_f412, + gpio_f413 ))] PB11<5>, @@ -1533,13 +1523,7 @@ pub mod i2s { } } -#[cfg(any( - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f446" -))] +#[cfg(any(gpio_f410, gpio_f411, gpio_f412, gpio_f413, gpio_f446))] pub mod i2s1 { use super::*; @@ -1551,13 +1535,13 @@ pub mod i2s1 { ], for no:NoPin, [ - #[cfg(feature = "gpio-f410")] + #[cfg(gpio_f410)] PB10<6>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] PC4<5>, - #[cfg(feature = "gpio-f410")] + #[cfg(gpio_f410)] PC7<6>, ], @@ -1591,7 +1575,7 @@ pub mod i2s2 { pin! { for [ - #[cfg(any(feature = "gpio-f413", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f413, gpio_f446, gpio_f469))] PA9<5>, PB10<5>, @@ -1599,44 +1583,44 @@ pub mod i2s2 { PB13<5>, #[cfg(any( - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f446" + gpio_f410, + gpio_f411, + gpio_f412, + gpio_f413, + gpio_f446 ))] PC7<5>, #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469" + gpio_f401, + gpio_f411, + gpio_f412, + gpio_f413, + gpio_f427, + gpio_f446, + gpio_f469 ))] PD3<5>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI1<5>, ], for no:NoPin, [ #[cfg(any( - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413" + gpio_f410, + gpio_f411, + gpio_f412, + gpio_f413 ))] PA3<5>, #[cfg(any( - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f446" + gpio_f410, + gpio_f411, + gpio_f412, + gpio_f413, + gpio_f446 ))] PA6<6>, @@ -1644,68 +1628,68 @@ pub mod i2s2 { ], for [ - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PA10<5>, PB15<5>, - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PC1<5>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PC1<7>, PC3<5>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI3<5>, ], for [ - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PA11<5>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PB4<7>, PB9<5>, PB12<5>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PD1<7>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI0<5>, ], } - #[cfg(not(any(feature = "gpio-f410", feature = "gpio-f446")))] + #[cfg(not(any(gpio_f410, gpio_f446)))] pin! { for [ #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f469" + gpio_f401, + gpio_f411, + gpio_f412, + gpio_f413, + gpio_f417, + gpio_f427, + gpio_f469 ))] PB14<6>, #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f469" + gpio_f401, + gpio_f411, + gpio_f412, + gpio_f413, + gpio_f417, + gpio_f427, + gpio_f469 ))] PC2<6>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI2<6>, ], } @@ -1720,13 +1704,13 @@ pub mod i2s2 { impl I2sMaster for SPI { type Mck = Mck; } - #[cfg(not(any(feature = "gpio-f410", feature = "gpio-f446")))] + #[cfg(not(any(gpio_f410, gpio_f446)))] impl I2sExtPin for SPI { type ExtSd = ExtSd; } } -#[cfg(feature = "gpio-f401")] +#[cfg(gpio_f401)] pub mod i2s2ext { use super::*; @@ -1745,7 +1729,7 @@ pub mod i2s2ext { } } -#[cfg(feature = "spi3")] +#[cfg(pac_spi3)] pub mod i2s3 { use super::*; @@ -1753,47 +1737,47 @@ pub mod i2s3 { for [ PB3<6>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PB12<5>, - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412"))] + #[cfg(any(gpio_f411, gpio_f412))] PB12<7>, PC10<6>, ], for no:NoPin, [ - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PB10<6>, PC7<6>, ], for [ - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PB0<7>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PB2<7>, PB5<6>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PC1<5>, PC12<6>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PD0<6>, #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469" + gpio_f401, + gpio_f411, + gpio_f412, + gpio_f413, + gpio_f427, + gpio_f446, + gpio_f469 ))] PD6<5>, ], @@ -1805,30 +1789,30 @@ pub mod i2s3 { ], } - #[cfg(not(feature = "gpio-f446"))] + #[cfg(not(gpio_f446))] pin! { for [ - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PB4<5>, #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f469" + gpio_f401, + gpio_f411, + gpio_f412, + gpio_f417, + gpio_f427, + gpio_f469 ))] PB4<7>, #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f469" + gpio_f401, + gpio_f411, + gpio_f412, + gpio_f413, + gpio_f417, + gpio_f427, + gpio_f469 ))] PC11<5>, ], @@ -1844,13 +1828,13 @@ pub mod i2s3 { impl I2sMaster for SPI { type Mck = Mck; } - #[cfg(not(feature = "gpio-f446"))] + #[cfg(not(gpio_f446))] impl I2sExtPin for SPI { type ExtSd = ExtSd; } } -#[cfg(feature = "gpio-f401")] +#[cfg(gpio_f401)] pub mod i2s3ext { use super::*; @@ -1869,7 +1853,7 @@ pub mod i2s3ext { } } -#[cfg(feature = "spi4")] +#[cfg(pac_spi4)] pub mod i2s4 { use super::*; @@ -1913,7 +1897,7 @@ pub mod i2s4 { } } -#[cfg(feature = "spi5")] +#[cfg(pac_spi5)] pub mod i2s5 { use super::*; @@ -1921,10 +1905,10 @@ pub mod i2s5 { for [ PB0<6>, - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PE2<6>, - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PE12<6>, ], @@ -1933,10 +1917,10 @@ pub mod i2s5 { PB8<6>, - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PE6<6>, - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PE14<6>, ], @@ -1945,10 +1929,10 @@ pub mod i2s5 { for [ PB1<6>, - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PE4<6>, - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PE11<6>, ], } @@ -1965,7 +1949,7 @@ pub mod i2s5 { } } -#[cfg(feature = "lptim1")] +#[cfg(pac_lptim1)] pub mod lptim1 { use super::*; @@ -2000,7 +1984,7 @@ pub mod lptim1 { } } -#[cfg(feature = "ltdc")] +#[cfg(pac_ltdc)] pub mod ltdc { use super::*; @@ -2008,7 +1992,7 @@ pub mod ltdc { for [ PE4<14>, - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PG14<14>, PJ12<14>, @@ -2021,7 +2005,7 @@ pub mod ltdc { ], for [ - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PA3<9>, PD6<14>, @@ -2090,22 +2074,22 @@ pub mod ltdc { ], for [ - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PB1<14>, PE5<14>, - #[cfg(feature = "gpio-f427")] + #[cfg(gpio_f427)] PJ7<14>, ], for [ - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PB0<14>, PE6<14>, - #[cfg(feature = "gpio-f427")] + #[cfg(gpio_f427)] PJ8<14>, ], @@ -2114,10 +2098,10 @@ pub mod ltdc { PH13<14>, - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PI15<9>, - #[cfg(feature = "gpio-f427")] + #[cfg(gpio_f427)] PJ9<14>, ], @@ -2128,37 +2112,37 @@ pub mod ltdc { PH14<14>, - #[cfg(feature = "gpio-f427")] + #[cfg(gpio_f427)] PJ10<14>, - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PJ12<9>, ], for [ PB10<14>, - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PH4<14>, PH15<14>, - #[cfg(feature = "gpio-f427")] + #[cfg(gpio_f427)] PJ11<14>, - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PJ13<9>, ], for [ PB11<14>, - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PH4<9>, PI0<14>, - #[cfg(feature = "gpio-f427")] + #[cfg(gpio_f427)] PK0<14>, ], @@ -2167,25 +2151,25 @@ pub mod ltdc { PI1<14>, - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PI11<9>, - #[cfg(feature = "gpio-f427")] + #[cfg(gpio_f427)] PK1<14>, ], for [ - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PB5<14>, PD3<14>, - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PG8<14>, PI2<14>, - #[cfg(feature = "gpio-f427")] + #[cfg(gpio_f427)] PK2<14>, ], @@ -2198,7 +2182,7 @@ pub mod ltdc { ], for [ - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PG13<14>, PH2<14>, @@ -2207,7 +2191,7 @@ pub mod ltdc { ], for [ - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PA2<14>, PH3<14>, @@ -2216,7 +2200,7 @@ pub mod ltdc { ], for [ - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PA1<14>, PC10<14>, @@ -2235,7 +2219,7 @@ pub mod ltdc { ], for [ - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PA5<14>, PA11<14>, @@ -2248,7 +2232,7 @@ pub mod ltdc { for [ PA12<14>, - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PC0<14>, PH11<14>, @@ -2271,10 +2255,10 @@ pub mod ltdc { PG6<14>, - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PJ0<9>, - #[cfg(feature = "gpio-f427")] + #[cfg(gpio_f427)] PJ6<14>, ], @@ -2288,7 +2272,7 @@ pub mod ltdc { } } -#[cfg(feature = "quadspi")] +#[cfg(pac_quadspi)] pub mod quadspi { use super::*; @@ -2310,7 +2294,7 @@ pub mod quadspi { ], for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PC8<9>, PE2<9>, @@ -2329,35 +2313,35 @@ pub mod quadspi { for [ PB6<10>, - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PB10<9>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] PG6<10>, ], for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PA6<10>, PE7<10>, - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PH2<9>, ], for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PA7<10>, PE8<10>, - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PH3<9>, ], for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PC4<10>, PE9<10>, @@ -2366,7 +2350,7 @@ pub mod quadspi { ], for [ - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PC5<10>, PE10<10>, @@ -2379,19 +2363,19 @@ pub mod quadspi { ], for [ - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PA7<10>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PB1<9>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] PB2<9>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] PD3<9>, - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PF10<9>, ], } @@ -2432,7 +2416,7 @@ pub mod rcc { ], } - #[cfg(feature = "gpio-f417")] + #[cfg(gpio_f417)] pin! { for [ PC14<0>, @@ -2455,7 +2439,7 @@ pub mod rcc { pub mod rtc { use super::*; - #[cfg(feature = "gpio-f417")] + #[cfg(gpio_f417)] pin! { for [ PC13<0>, @@ -2469,147 +2453,142 @@ pub mod rtc { } } -#[cfg(feature = "sai1")] +#[cfg(pac_sai1)] pub mod sai1 { use super::*; pin! { for [ - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PA3<6>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PB5<10>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f446, gpio_f469))] PE4<6>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PE6<7>, ], for [ - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PB9<6>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PC3<7>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f446, gpio_f469))] PF9<6>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PF9<7>, ], for [ - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PA15<10>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f446, gpio_f469))] PE2<6>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PE2<7>, - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PG7<6>, ], for [ - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PC0<6>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PC0<7>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f446, gpio_f469))] PF7<6>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PF7<7>, ], for [ - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PB4<10>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PB10<6>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f446, gpio_f469))] PE5<6>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PE5<7>, ], for [ - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PB12<6>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PC2<7>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f446, gpio_f469))] PF8<6>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PF8<7>, ], for [ - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PB2<6>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PB3<10>, - #[cfg(any(feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f446, gpio_f469))] PC1<6>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f446, gpio_f469))] PD6<6>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PE4<7>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f446, gpio_f469))] PE6<6>, ], for [ - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PA3<10>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PA9<6>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PC1<7>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f446, gpio_f469))] PE3<6>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PE3<7>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f446, gpio_f469))] PF6<6>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PF6<7>, ], } - #[cfg(any( - feature = "gpio-f413", - feature = "gpio-f469", - feature = "stm32f429", - feature = "stm32f439" - ))] + #[cfg(any(gpio_f413, gpio_f469, feature = "stm32f429", feature = "stm32f439"))] use crate::pac::SAI; - #[cfg(any(feature = "stm32f427", feature = "stm32f437", feature = "gpio-f446"))] + #[cfg(any(feature = "stm32f427", feature = "stm32f437", gpio_f446))] use crate::pac::SAI1 as SAI; pub struct ChannelA; pub struct ChannelB; @@ -2631,7 +2610,7 @@ pub mod sai1 { } } -#[cfg(feature = "sai2")] +#[cfg(pac_sai2)] pub mod sai2 { use super::*; @@ -2706,63 +2685,63 @@ pub mod sai2 { } } -#[cfg(feature = "sdio")] +#[cfg(pac_sdio)] pub mod sdio { use super::*; pin! { for [ - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PB2<12, Speed::VeryHigh>, - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PB15<12, Speed::VeryHigh>, PC12<12, Speed::VeryHigh>, ], for [ - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PA6<12, Speed::VeryHigh>, PD2<12, Speed::VeryHigh>, ], for [ - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PB4<12, Speed::VeryHigh>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PB6<12, Speed::VeryHigh>, - #[cfg(feature = "gpio-f411")] + #[cfg(gpio_f411)] PB7<12, Speed::VeryHigh>, PC8<12, Speed::VeryHigh>, ], for [ - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PA8<12, Speed::VeryHigh>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PB0<12, Speed::VeryHigh>, PC9<12, Speed::VeryHigh>, ], for [ - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PA9<12, Speed::VeryHigh>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PB1<12, Speed::VeryHigh>, PC10<12, Speed::VeryHigh>, ], for [ - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PB5<12, Speed::VeryHigh>, PC11<12, Speed::VeryHigh>, @@ -2777,14 +2756,14 @@ pub mod sdio { ], for [ - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PB14<12, Speed::VeryHigh>, PC6<12>, ], for [ - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PB10<12, Speed::VeryHigh>, PC7<12, Speed::VeryHigh>, @@ -2792,7 +2771,7 @@ pub mod sdio { } } -#[cfg(feature = "spdifrx")] +#[cfg(pac_spdifrx)] pub mod spdifrx { use super::*; @@ -2883,55 +2862,55 @@ pub mod spi2 { pin! { for no:NoPin, [ - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PA12<5>, PB14<5>, PC2<5>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI2<5>, ], for no:NoPin, [ - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PA10<5>, PB15<5>, - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PC1<5>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PC1<7>, PC3<5>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI3<5>, ], for [ - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PA11<5>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PB4<7>, PB9<5>, PB12<5>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PD1<7>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI0<5>, ], for no:NoPin, [ - #[cfg(any(feature = "gpio-f413", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f413, gpio_f446, gpio_f469))] PA9<5>, PB10<5>, @@ -2939,26 +2918,26 @@ pub mod spi2 { PB13<5>, #[cfg(any( - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f446" + gpio_f410, + gpio_f411, + gpio_f412, + gpio_f413, + gpio_f446 ))] PC7<5>, #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469" + gpio_f401, + gpio_f411, + gpio_f412, + gpio_f413, + gpio_f427, + gpio_f446, + gpio_f469 ))] PD3<5>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI1<5>, ], } @@ -2971,7 +2950,7 @@ pub mod spi2 { } } -#[cfg(feature = "spi3")] +#[cfg(pac_spi3)] pub mod spi3 { use super::*; @@ -2983,30 +2962,30 @@ pub mod spi3 { ], for no:NoPin, [ - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PB0<7>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PB2<7>, PB5<6>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PC1<5>, PC12<6>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PD0<6>, #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469" + gpio_f401, + gpio_f411, + gpio_f412, + gpio_f413, + gpio_f427, + gpio_f446, + gpio_f469 ))] PD6<5>, ], @@ -3020,7 +2999,7 @@ pub mod spi3 { for no:NoPin, [ PB3<6>, - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PB12<7>, PC10<6>, @@ -3035,59 +3014,59 @@ pub mod spi3 { } } -#[cfg(feature = "spi4")] +#[cfg(pac_spi4)] pub mod spi4 { use super::*; pin! { for no:NoPin, [ - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PA11<6>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PD0<5>, PE5<5>, PE13<5>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PG12<6>, ], for no:NoPin, [ - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PA1<5>, PE6<5>, PE14<5>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PG13<6>, ], for [ - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PB12<6>, PE4<5>, PE11<5>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PG14<6>, ], for no:NoPin, [ - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PB13<6>, PE2<5>, PE12<5>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PG11<6>, ], } @@ -3100,104 +3079,104 @@ pub mod spi4 { } } -#[cfg(feature = "spi5")] +#[cfg(pac_spi5)] pub mod spi5 { use super::*; pin! { for no:NoPin, [ #[cfg(any( - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413" + gpio_f410, + gpio_f411, + gpio_f412, + gpio_f413 ))] PA12<6>, - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PE5<6>, - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PE13<6>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f469))] PF8<5>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f469))] PH7<5>, ], for no:NoPin, [ #[cfg(any( - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413" + gpio_f410, + gpio_f411, + gpio_f412, + gpio_f413 ))] PA10<6>, #[cfg(any( - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413" + gpio_f410, + gpio_f411, + gpio_f412, + gpio_f413 ))] PB8<6>, - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PE6<6>, - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PE14<6>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f469))] PF9<5>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f469))] PF11<5>, ], for [ #[cfg(any( - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413" + gpio_f410, + gpio_f411, + gpio_f412, + gpio_f413 ))] PB1<6>, - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PE4<6>, - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PE11<6>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f469))] PF6<5>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f469))] PH5<5>, ], for no:NoPin, [ #[cfg(any( - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413" + gpio_f410, + gpio_f411, + gpio_f412, + gpio_f413 ))] PB0<6>, - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PE2<6>, - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] PE12<6>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f469))] PF7<5>, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f469))] PH6<5>, ], } @@ -3210,7 +3189,7 @@ pub mod spi5 { } } -#[cfg(feature = "spi6")] +#[cfg(pac_spi6)] pub mod spi6 { use super::*; @@ -3265,83 +3244,83 @@ pub mod sys { ], for [ - #[cfg(feature = "gpio-f410")] + #[cfg(gpio_f410)] PC6<0>, - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] PE2<0>, ], for [ - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PC1<0>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PC8<0>, - #[cfg(feature = "gpio-f410")] + #[cfg(gpio_f410)] PC10<0>, - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] PE3<0>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PF6<0>, - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PG13<0>, ], for [ - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PC8<0>, - #[cfg(feature = "gpio-f410")] + #[cfg(gpio_f410)] PC11<0>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] PD3<0>, - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] PE4<0>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PF7<0>, - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PG14<0>, ], for [ - #[cfg(feature = "gpio-f410")] + #[cfg(gpio_f410)] PC12<0>, - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PD2<0>, - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] PE5<0>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] PG13<0>, ], for [ - #[cfg(feature = "gpio-f410")] + #[cfg(gpio_f410)] PB11<0>, - #[cfg(feature = "gpio-f469")] + #[cfg(gpio_f469)] PC12<0>, - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] PE6<0>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] PG14<0>, ], } - #[cfg(feature = "gpio-f417")] + #[cfg(gpio_f417)] pin! { for [ PA0<0>, @@ -3356,7 +3335,7 @@ pub mod tim1 { default: PushPull for [ PA8<1>, - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] PE9<1>, ], @@ -3365,14 +3344,14 @@ pub mod tim1 { PB13<1>, - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] PE8<1>, ], default: PushPull for [ PA9<1>, - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] PE11<1>, ], @@ -3381,14 +3360,14 @@ pub mod tim1 { PB14<1>, - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] PE10<1>, ], default: PushPull for [ PA10<1>, - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] PE13<1>, ], @@ -3397,14 +3376,14 @@ pub mod tim1 { PB15<1>, - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] PE12<1>, ], default: PushPull for [ PA11<1>, - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] PE14<1>, ], } @@ -3415,17 +3394,17 @@ pub mod tim1 { PB12<1>, - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] PE15<1>, ], for [ PA12<1>, - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] PE7<1>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PF10<1>, ], } @@ -3461,7 +3440,7 @@ pub mod tim1 { } } -#[cfg(feature = "tim2")] +#[cfg(pac_tim2)] pub mod tim2 { use super::*; @@ -3473,7 +3452,7 @@ pub mod tim2 { PA15<1>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PB8<1>, ], @@ -3482,7 +3461,7 @@ pub mod tim2 { PB3<1>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PB9<1>, ], @@ -3495,7 +3474,7 @@ pub mod tim2 { default: PushPull for [ PA3<1>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PB2<1>, PB11<1>, @@ -3510,7 +3489,7 @@ pub mod tim2 { PA15<1>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PB8<1>, ], } @@ -3534,7 +3513,7 @@ pub mod tim2 { } } -#[cfg(feature = "tim2")] +#[cfg(pac_tim2)] pub mod tim3 { use super::*; @@ -3593,7 +3572,7 @@ pub mod tim3 { } } -#[cfg(feature = "tim2")] +#[cfg(pac_tim2)] pub mod tim4 { use super::*; @@ -3655,52 +3634,52 @@ pub mod tim5 { default: PushPull for [ PA0<2>, - #[cfg(feature = "gpio-f410")] + #[cfg(gpio_f410)] PB12<2>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PF3<2>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH10<2>, ], default: PushPull for [ PA1<2>, - #[cfg(feature = "gpio-f410")] + #[cfg(gpio_f410)] PC10<2>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PF4<2>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH11<2>, ], default: PushPull for [ PA2<2>, - #[cfg(feature = "gpio-f410")] + #[cfg(gpio_f410)] PC11<2>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PF5<2>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH12<2>, ], default: PushPull for [ PA3<2>, - #[cfg(feature = "gpio-f410")] + #[cfg(gpio_f410)] PB11<2>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PF10<2>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI0<2>, ], } @@ -3721,7 +3700,7 @@ pub mod tim5 { } } -#[cfg(feature = "tim8")] +#[cfg(pac_tim8)] pub mod tim8 { use super::*; @@ -3729,7 +3708,7 @@ pub mod tim8 { default: PushPull for [ PC6<3>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI5<3>, ], @@ -3738,14 +3717,14 @@ pub mod tim8 { PA7<3>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH13<3>, ], default: PushPull for [ PC7<3>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI6<3>, ], @@ -3754,14 +3733,14 @@ pub mod tim8 { PB14<3>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH14<3>, ], default: PushPull for [ PC8<3>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI7<3>, ], @@ -3770,14 +3749,14 @@ pub mod tim8 { PB15<3>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH15<3>, ], default: PushPull for [ PC9<3>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI2<3>, ], } @@ -3786,20 +3765,20 @@ pub mod tim8 { for [ PA6<3>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PF12<3>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI4<3>, ], for [ PA0<3>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PF11<3>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI3<3>, ], } @@ -3842,20 +3821,20 @@ pub mod tim9 { default: PushPull for [ PA2<3>, - #[cfg(feature = "gpio-f410")] + #[cfg(gpio_f410)] PC4<3>, - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] PE5<3>, ], default: PushPull for [ PA3<3>, - #[cfg(feature = "gpio-f410")] + #[cfg(gpio_f410)] PC5<3>, - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] PE6<3>, ], } @@ -3870,7 +3849,7 @@ pub mod tim9 { } } -#[cfg(feature = "tim2")] +#[cfg(pac_tim2)] pub mod tim10 { use super::*; @@ -3879,12 +3858,12 @@ pub mod tim10 { PB8<3>, #[cfg(any( - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469" + gpio_f412, + gpio_f413, + gpio_f417, + gpio_f427, + gpio_f446, + gpio_f469 ))] PF6<3>, ], @@ -3904,16 +3883,16 @@ pub mod tim11 { default: PushPull for [ PB9<3>, - #[cfg(feature = "gpio-f410")] + #[cfg(gpio_f410)] PC12<3>, #[cfg(any( - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469" + gpio_f412, + gpio_f413, + gpio_f417, + gpio_f427, + gpio_f446, + gpio_f469 ))] PF7<3>, ], @@ -3926,7 +3905,7 @@ pub mod tim11 { } } -#[cfg(feature = "tim8")] +#[cfg(pac_tim8)] pub mod tim12 { use super::*; @@ -3934,14 +3913,14 @@ pub mod tim12 { default: PushPull for [ PB14<9>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH6<9>, ], default: PushPull for [ PB15<9>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH9<9>, ], } @@ -3956,7 +3935,7 @@ pub mod tim12 { } } -#[cfg(feature = "tim8")] +#[cfg(pac_tim8)] pub mod tim13 { use super::*; @@ -3975,7 +3954,7 @@ pub mod tim13 { } } -#[cfg(feature = "tim8")] +#[cfg(pac_tim8)] pub mod tim14 { use super::*; @@ -4016,10 +3995,10 @@ pub mod usart1 { PA10<7>, #[cfg(any( - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413" + gpio_f410, + gpio_f411, + gpio_f412, + gpio_f413 ))] PB3<7>, @@ -4030,10 +4009,10 @@ pub mod usart1 { PA9<7>, #[cfg(any( - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413" + gpio_f410, + gpio_f411, + gpio_f412, + gpio_f413 ))] PA15<7>, @@ -4062,21 +4041,21 @@ pub mod usart2 { for [ PA4<7>, - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] PD7<7>, ], for [ PA0<7>, - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] PD3<7>, ], for [ PA1<7>, - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] PD4<7>, ], } @@ -4085,14 +4064,14 @@ pub mod usart2 { default: PushPull for no:NoPin, [ PA3<7>, - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] PD6<7>, ], default: PushPull for no:NoPin, [ PA2<7>, - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] PD5<7>, ], } @@ -4111,21 +4090,21 @@ pub mod usart2 { } } -#[cfg(feature = "usart3")] +#[cfg(pac_usart3)] pub mod usart3 { use super::*; pin! { for [ #[cfg(any( - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469" + gpio_f417, + gpio_f427, + gpio_f446, + gpio_f469 ))] PB12<7>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PB12<8>, PC12<7>, @@ -4135,14 +4114,14 @@ pub mod usart3 { for [ #[cfg(any( - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469" + gpio_f417, + gpio_f427, + gpio_f446, + gpio_f469 ))] PB13<7>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f412, gpio_f413))] PB13<8>, PD11<7>, @@ -4159,7 +4138,7 @@ pub mod usart3 { default: PushPull for no:NoPin, [ PB11<7>, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] PC5<7>, PC11<7>, @@ -4198,25 +4177,18 @@ pub mod usart6 { PC8<8>, #[cfg(any( - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469" + gpio_f412, + gpio_f413, + gpio_f417, + gpio_f427, + gpio_f446, + gpio_f469 ))] PG7<8>, ], } - #[cfg(any( - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469" - ))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f417, gpio_f427, gpio_f446, gpio_f469))] pin! { for [ PG13<8>, @@ -4234,46 +4206,46 @@ pub mod usart6 { pin! { default: PushPull for no:NoPin, [ #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413" + gpio_f401, + gpio_f410, + gpio_f411, + gpio_f412, + gpio_f413 ))] PA12<8>, PC7<8>, #[cfg(any( - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469" + gpio_f412, + gpio_f413, + gpio_f417, + gpio_f427, + gpio_f446, + gpio_f469 ))] PG9<8>, ], default: PushPull for no:NoPin, [ #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413" + gpio_f401, + gpio_f410, + gpio_f411, + gpio_f412, + gpio_f413 ))] PA11<8>, PC6<8>, #[cfg(any( - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469" + gpio_f412, + gpio_f413, + gpio_f417, + gpio_f427, + gpio_f446, + gpio_f469 ))] PG14<8>, ], @@ -4287,25 +4259,18 @@ pub mod usart6 { impl SerialSync for USART { type Ck = Ck; } - #[cfg(any( - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469" - ))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f417, gpio_f427, gpio_f446, gpio_f469))] impl SerialRs232 for USART { type Cts = Cts; type Rts = Rts; } } -#[cfg(feature = "uart4")] +#[cfg(pac_uart4)] pub mod uart4 { use super::*; - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] pin! { for [ PB0<8>, @@ -4320,33 +4285,33 @@ pub mod uart4 { default: PushPull for no:NoPin, [ PA1<8>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PA11<11>, PC11<8>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PD0<11>, ], default: PushPull for no:NoPin, [ PA0<8>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PA12<11>, #[cfg(any( - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469" + gpio_f417, + gpio_f427, + gpio_f446, + gpio_f469 ))] PC10<8>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PD1<11>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PD10<8>, ], } @@ -4356,18 +4321,18 @@ pub mod uart4 { type Rx = Rx; type Tx = Tx; } - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] impl SerialRs232 for UART { type Cts = Cts; type Rts = Rts; } } -#[cfg(feature = "uart5")] +#[cfg(pac_uart5)] pub mod uart5 { use super::*; - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] pin! { for [ PC9<7>, @@ -4380,34 +4345,34 @@ pub mod uart5 { pin! { default: PushPull for no:NoPin, [ - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PB5<11>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PB8<11>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PB12<11>, PD2<8>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PE7<8>, ], default: PushPull for no:NoPin, [ - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PB6<11>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PB9<11>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PB13<11>, PC12<8>, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PE8<8>, ], } @@ -4417,23 +4382,23 @@ pub mod uart5 { type Rx = Rx; type Tx = Tx; } - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] impl SerialRs232 for UART { type Cts = Cts; type Rts = Rts; } } -#[cfg(feature = "uart7")] +#[cfg(pac_uart7)] pub mod uart7 { use super::*; pin! { default: PushPull for no:NoPin, [ - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PA8<8>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PB3<8>, PE7<8>, @@ -4442,10 +4407,10 @@ pub mod uart7 { ], default: PushPull for no:NoPin, [ - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PA15<8>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PB4<8>, PE8<8>, @@ -4461,7 +4426,7 @@ pub mod uart7 { } } -#[cfg(feature = "uart8")] +#[cfg(pac_uart8)] pub mod uart8 { use super::*; @@ -4469,14 +4434,14 @@ pub mod uart8 { default: PushPull for no:NoPin, [ PE0<8>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PF8<8>, ], default: PushPull for no:NoPin, [ PE1<8>, - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] PF9<8>, ], } @@ -4488,7 +4453,7 @@ pub mod uart8 { } } -#[cfg(feature = "uart9")] +#[cfg(pac_uart9)] pub mod uart9 { use super::*; @@ -4513,7 +4478,7 @@ pub mod uart9 { } } -#[cfg(feature = "uart10")] +#[cfg(pac_uart10)] pub mod uart10 { use super::*; @@ -4538,7 +4503,7 @@ pub mod uart10 { } } -#[cfg(feature = "otg-fs")] +#[cfg(pac_otg_fs)] pub mod otg_fs { use super::*; @@ -4560,7 +4525,7 @@ pub mod otg_fs { ], } - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f413"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413))] pin! { for [ PA9<10>, @@ -4568,7 +4533,7 @@ pub mod otg_fs { } } -#[cfg(feature = "otg-hs")] +#[cfg(pac_otg_hs)] pub mod otg_hs { use super::*; pin! { @@ -4609,7 +4574,7 @@ pub mod otg_hs { ], for [ - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] PB2<10, Speed::VeryHigh>, PB11<10, Speed::VeryHigh>, @@ -4630,14 +4595,14 @@ pub mod otg_hs { for [ PC2<10, Speed::VeryHigh>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PI11<10, Speed::VeryHigh>, ], for [ PC3<10, Speed::VeryHigh>, - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f417, gpio_f427, gpio_f469))] PH4<10, Speed::VeryHigh>, ], diff --git a/src/gpio/f4.rs b/src/gpio/f4.rs index 1cc1c52b..fe7eb3dc 100644 --- a/src/gpio/f4.rs +++ b/src/gpio/f4.rs @@ -2,7 +2,7 @@ use super::*; pub use super::Input as DefaultMode; -#[cfg(feature = "gpio-f401")] +#[cfg(gpio_f401)] gpio!(GPIOA, gpioa, PA, 'A', PAn, [ PA0: (pa0, 0, [1, 2, 7]), PA1: (pa1, 1, [1, 2, 7]), @@ -22,7 +22,7 @@ gpio!(GPIOA, gpioa, PA, 'A', PAn, [ PA15: (pa15, 15, [0, 1, 5, 6], super::Debugger), // JTDI, PullUp ]); -#[cfg(feature = "gpio-f401")] +#[cfg(gpio_f401)] gpio!(GPIOB, gpiob, PB, 'B', PBn, [ PB0: (pb0, 0, [1, 2]), PB1: (pb1, 1, [1, 2]), @@ -42,7 +42,7 @@ gpio!(GPIOB, gpiob, PB, 'B', PBn, [ PB15: (pb15, 15, [0, 1, 5, 6]), ]); -#[cfg(feature = "gpio-f401")] +#[cfg(gpio_f401)] gpio!(GPIOC, gpioc, PC, 'C', PCn, [ PC0: (pc0, 0, []), PC1: (pc1, 1, []), @@ -62,7 +62,7 @@ gpio!(GPIOC, gpioc, PC, 'C', PCn, [ PC15: (pc15, 15, []), ]); -#[cfg(feature = "gpio-f401")] +#[cfg(gpio_f401)] gpio!(GPIOD, gpiod, PD, 'D', PDn, [ PD0: (pd0, 0, []), PD1: (pd1, 1, []), @@ -82,7 +82,7 @@ gpio!(GPIOD, gpiod, PD, 'D', PDn, [ PD15: (pd15, 15, [2]), ]); -#[cfg(feature = "gpio-f401")] +#[cfg(gpio_f401)] gpio!(GPIOE, gpioe, PE, 'E', PEn, [ PE0: (pe0, 0, [2]), PE1: (pe1, 1, []), @@ -102,13 +102,13 @@ gpio!(GPIOE, gpioe, PE, 'E', PEn, [ PE15: (pe15, 15, [1]), ]); -#[cfg(feature = "gpio-f401")] +#[cfg(gpio_f401)] gpio!(GPIOH, gpioh, PH, 'H', PHn, [ PH0: (ph0, 0, []), PH1: (ph1, 1, []), ]); -#[cfg(feature = "gpio-f410")] +#[cfg(gpio_f410)] gpio!(GPIOA, gpioa, PA, 'A', PAn, [ PA0: (pa0, 0, [2, 7, 15]), PA1: (pa1, 1, [2, 7, 15]), @@ -128,7 +128,7 @@ gpio!(GPIOA, gpioa, PA, 'A', PAn, [ PA15: (pa15, 15, [0, 5, 7, 15], super::Debugger), ]); -#[cfg(feature = "gpio-f410")] +#[cfg(gpio_f410)] gpio!(GPIOB, gpiob, PB, 'B', PBn, [ PB0: (pb0, 0, [1, 6, 15]), PB1: (pb1, 1, [1, 6, 15]), @@ -148,7 +148,7 @@ gpio!(GPIOB, gpiob, PB, 'B', PBn, [ PB15: (pb15, 15, [0, 1, 4, 5, 15]), ]); -#[cfg(feature = "gpio-f410")] +#[cfg(gpio_f410)] gpio!(GPIOC, gpioc, PC, 'C', PCn, [ PC0: (pc0, 0, [1, 15]), PC1: (pc1, 1, [1, 15]), @@ -168,13 +168,13 @@ gpio!(GPIOC, gpioc, PC, 'C', PCn, [ PC15: (pc15, 15, [15]), ]); -#[cfg(feature = "gpio-f410")] +#[cfg(gpio_f410)] gpio!(GPIOH, gpioh, PH, 'H', PHn, [ PH0: (ph0, 0, [15]), PH1: (ph1, 1, [15]), ]); -#[cfg(feature = "gpio-f411")] +#[cfg(gpio_f411)] gpio!(GPIOA, gpioa, PA, 'A', PAn, [ PA0: (pa0, 0, [1, 2, 7]), PA1: (pa1, 1, [1, 2, 5, 7]), @@ -194,7 +194,7 @@ gpio!(GPIOA, gpioa, PA, 'A', PAn, [ PA15: (pa15, 15, [0, 1, 5, 6, 7], super::Debugger), ]); -#[cfg(feature = "gpio-f411")] +#[cfg(gpio_f411)] gpio!(GPIOB, gpiob, PB, 'B', PBn, [ PB0: (pb0, 0, [1, 2, 6]), PB1: (pb1, 1, [1, 2, 6]), @@ -214,7 +214,7 @@ gpio!(GPIOB, gpiob, PB, 'B', PBn, [ PB15: (pb15, 15, [0, 1, 5, 12]), ]); -#[cfg(feature = "gpio-f411")] +#[cfg(gpio_f411)] gpio!(GPIOC, gpioc, PC, 'C', PCn, [ PC0: (pc0, 0, []), PC1: (pc1, 1, []), @@ -234,7 +234,7 @@ gpio!(GPIOC, gpioc, PC, 'C', PCn, [ PC15: (pc15, 15, []), ]); -#[cfg(feature = "gpio-f411")] +#[cfg(gpio_f411)] gpio!(GPIOD, gpiod, PD, 'D', PDn, [ PD0: (pd0, 0, []), PD1: (pd1, 1, []), @@ -254,7 +254,7 @@ gpio!(GPIOD, gpiod, PD, 'D', PDn, [ PD15: (pd15, 15, [2]), ]); -#[cfg(feature = "gpio-f411")] +#[cfg(gpio_f411)] gpio!(GPIOE, gpioe, PE, 'E', PEn, [ PE0: (pe0, 0, [2]), PE1: (pe1, 1, []), @@ -274,13 +274,13 @@ gpio!(GPIOE, gpioe, PE, 'E', PEn, [ PE15: (pe15, 15, [1]), ]); -#[cfg(feature = "gpio-f411")] +#[cfg(gpio_f411)] gpio!(GPIOH, gpioh, PH, 'H', PHn, [ PH0: (ph0, 0, []), PH1: (ph1, 1, []), ]); -#[cfg(feature = "gpio-f412")] +#[cfg(gpio_f412)] gpio!(GPIOA, gpioa, PA, 'A', PAn, [ PA0: (pa0, 0, [1, 2, 3, 7, 15]), PA1: (pa1, 1, [1, 2, 5, 7, 9, 15]), @@ -300,7 +300,7 @@ gpio!(GPIOA, gpioa, PA, 'A', PAn, [ PA15: (pa15, 15, [0, 1, 5, 6, 7, 15], super::Debugger), ]); -#[cfg(feature = "gpio-f412")] +#[cfg(gpio_f412)] gpio!(GPIOB, gpiob, PB, 'B', PBn, [ PB0: (pb0, 0, [1, 2, 3, 6, 15]), PB1: (pb1, 1, [1, 2, 3, 6, 8, 9, 15]), @@ -320,7 +320,7 @@ gpio!(GPIOB, gpiob, PB, 'B', PBn, [ PB15: (pb15, 15, [0, 1, 3, 4, 5, 8, 9, 12, 15]), ]); -#[cfg(feature = "gpio-f412")] +#[cfg(gpio_f412)] gpio!(GPIOC, gpioc, PC, 'C', PCn, [ PC0: (pc0, 0, [15]), PC1: (pc1, 1, [15]), @@ -340,7 +340,7 @@ gpio!(GPIOC, gpioc, PC, 'C', PCn, [ PC15: (pc15, 15, [15]), ]); -#[cfg(feature = "gpio-f412")] +#[cfg(gpio_f412)] gpio!(GPIOD, gpiod, PD, 'D', PDn, [ PD0: (pd0, 0, [9, 12, 15]), PD1: (pd1, 1, [9, 12, 15]), @@ -360,7 +360,7 @@ gpio!(GPIOD, gpiod, PD, 'D', PDn, [ PD15: (pd15, 15, [2, 4, 12, 15]), ]); -#[cfg(feature = "gpio-f412")] +#[cfg(gpio_f412)] gpio!(GPIOE, gpioe, PE, 'E', PEn, [ PE0: (pe0, 0, [2, 12, 15]), PE1: (pe1, 1, [12, 15]), @@ -380,7 +380,7 @@ gpio!(GPIOE, gpioe, PE, 'E', PEn, [ PE15: (pe15, 15, [1, 12, 15]), ]); -#[cfg(feature = "gpio-f412")] +#[cfg(gpio_f412)] gpio!(GPIOF, gpiof, PF, 'F', PFn, [ PF0: (pf0, 0, [4, 12, 15]), PF1: (pf1, 1, [4, 12, 15]), @@ -400,7 +400,7 @@ gpio!(GPIOF, gpiof, PF, 'F', PFn, [ PF15: (pf15, 15, [4, 12, 15]), ]); -#[cfg(feature = "gpio-f412")] +#[cfg(gpio_f412)] gpio!(GPIOG, gpiog, PG, 'G', PGn, [ PG0: (pg0, 0, [9, 12, 15]), PG1: (pg1, 1, [9, 12, 15]), @@ -420,13 +420,13 @@ gpio!(GPIOG, gpiog, PG, 'G', PGn, [ PG15: (pg15, 15, [8, 15]), ]); -#[cfg(feature = "gpio-f412")] +#[cfg(gpio_f412)] gpio!(GPIOH, gpioh, PH, 'H', PHn, [ PH0: (ph0, 0, [15]), PH1: (ph1, 1, [15]), ]); -#[cfg(feature = "gpio-f413")] +#[cfg(gpio_f413)] gpio!(GPIOA, gpioa, PA, 'A', PAn, [ PA0: (pa0, 0, [1, 2, 3, 7, 8, 15]), PA1: (pa1, 1, [1, 2, 5, 7, 8, 9, 15]), @@ -446,7 +446,7 @@ gpio!(GPIOA, gpioa, PA, 'A', PAn, [ PA15: (pa15, 15, [0, 1, 5, 6, 7, 8, 10, 11, 15], super::Debugger), ]); -#[cfg(feature = "gpio-f413")] +#[cfg(gpio_f413)] gpio!(GPIOB, gpiob, PB, 'B', PBn, [ PB0: (pb0, 0, [1, 2, 3, 6, 15]), PB1: (pb1, 1, [1, 2, 3, 6, 8, 9, 15]), @@ -466,7 +466,7 @@ gpio!(GPIOB, gpiob, PB, 'B', PBn, [ PB15: (pb15, 15, [0, 1, 3, 4, 5, 8, 9, 12, 15]), ]); -#[cfg(feature = "gpio-f413")] +#[cfg(gpio_f413)] gpio!(GPIOC, gpioc, PC, 'C', PCn, [ PC0: (pc0, 0, [1, 3, 7, 15]), PC1: (pc1, 1, [1, 3, 7, 15]), @@ -486,7 +486,7 @@ gpio!(GPIOC, gpioc, PC, 'C', PCn, [ PC15: (pc15, 15, [15]), ]); -#[cfg(feature = "gpio-f413")] +#[cfg(gpio_f413)] gpio!(GPIOD, gpiod, PD, 'D', PDn, [ PD0: (pd0, 0, [3, 9, 11, 12, 15]), PD1: (pd1, 1, [3, 9, 11, 12, 15]), @@ -506,7 +506,7 @@ gpio!(GPIOD, gpiod, PD, 'D', PDn, [ PD15: (pd15, 15, [2, 4, 10, 11, 12, 15]), ]); -#[cfg(feature = "gpio-f413")] +#[cfg(gpio_f413)] gpio!(GPIOE, gpioe, PE, 'E', PEn, [ PE0: (pe0, 0, [2, 3, 8, 12, 15]), PE1: (pe1, 1, [3, 8, 12, 15]), @@ -526,7 +526,7 @@ gpio!(GPIOE, gpioe, PE, 'E', PEn, [ PE15: (pe15, 15, [1, 10, 12, 15]), ]); -#[cfg(feature = "gpio-f413")] +#[cfg(gpio_f413)] gpio!(GPIOF, gpiof, PF, 'F', PFn, [ PF0: (pf0, 0, [4, 12, 15]), PF1: (pf1, 1, [4, 12, 15]), @@ -546,7 +546,7 @@ gpio!(GPIOF, gpiof, PF, 'F', PFn, [ PF15: (pf15, 15, [4, 12, 15]), ]); -#[cfg(feature = "gpio-f413")] +#[cfg(gpio_f413)] gpio!(GPIOG, gpiog, PG, 'G', PGn, [ PG0: (pg0, 0, [9, 11, 12, 15]), PG1: (pg1, 1, [9, 11, 12, 15]), @@ -566,13 +566,13 @@ gpio!(GPIOG, gpiog, PG, 'G', PGn, [ PG15: (pg15, 15, [8, 15]), ]); -#[cfg(feature = "gpio-f413")] +#[cfg(gpio_f413)] gpio!(GPIOH, gpioh, PH, 'H', PHn, [ PH0: (ph0, 0, [15]), PH1: (ph1, 1, [15]), ]); -#[cfg(feature = "gpio-f417")] +#[cfg(gpio_f417)] gpio!(GPIOA, gpioa, PA, 'A', PAn, [ PA0: (pa0, 0, [0, 1, 2, 3, 7, 8, 11]), PA1: (pa1, 1, [1, 2, 7, 8, 11]), @@ -592,7 +592,7 @@ gpio!(GPIOA, gpioa, PA, 'A', PAn, [ PA15: (pa15, 15, [0, 1, 5, 6], super::Debugger), ]); -#[cfg(feature = "gpio-f417")] +#[cfg(gpio_f417)] gpio!(GPIOB, gpiob, PB, 'B', PBn, [ PB0: (pb0, 0, [1, 2, 3, 10, 11]), PB1: (pb1, 1, [1, 2, 3, 10, 11]), @@ -612,7 +612,7 @@ gpio!(GPIOB, gpiob, PB, 'B', PBn, [ PB15: (pb15, 15, [0, 1, 3, 5, 9, 12]), ]); -#[cfg(feature = "gpio-f417")] +#[cfg(gpio_f417)] gpio!(GPIOC, gpioc, PC, 'C', PCn, [ PC0: (pc0, 0, [10]), PC1: (pc1, 1, [11]), @@ -632,7 +632,7 @@ gpio!(GPIOC, gpioc, PC, 'C', PCn, [ PC15: (pc15, 15, [0]), ]); -#[cfg(feature = "gpio-f417")] +#[cfg(gpio_f417)] gpio!(GPIOD, gpiod, PD, 'D', PDn, [ PD0: (pd0, 0, [9, 12]), PD1: (pd1, 1, [9, 12]), @@ -652,7 +652,7 @@ gpio!(GPIOD, gpiod, PD, 'D', PDn, [ PD15: (pd15, 15, [2, 12]), ]); -#[cfg(feature = "gpio-f417")] +#[cfg(gpio_f417)] gpio!(GPIOE, gpioe, PE, 'E', PEn, [ PE0: (pe0, 0, [2, 12, 13]), PE1: (pe1, 1, [12, 13]), @@ -672,7 +672,7 @@ gpio!(GPIOE, gpioe, PE, 'E', PEn, [ PE15: (pe15, 15, [1, 12]), ]); -#[cfg(feature = "gpio-f417")] +#[cfg(gpio_f417)] gpio!(GPIOF, gpiof, PF, 'F', PFn, [ PF0: (pf0, 0, [4, 12]), PF1: (pf1, 1, [4, 12]), @@ -692,7 +692,7 @@ gpio!(GPIOF, gpiof, PF, 'F', PFn, [ PF15: (pf15, 15, [12]), ]); -#[cfg(feature = "gpio-f417")] +#[cfg(gpio_f417)] gpio!(GPIOG, gpiog, PG, 'G', PGn, [ PG0: (pg0, 0, [12]), PG1: (pg1, 1, [12]), @@ -712,7 +712,7 @@ gpio!(GPIOG, gpiog, PG, 'G', PGn, [ PG15: (pg15, 15, [8, 13]), ]); -#[cfg(feature = "gpio-f417")] +#[cfg(gpio_f417)] gpio!(GPIOH, gpioh, PH, 'H', PHn, [ PH0: (ph0, 0, [0]), PH1: (ph1, 1, [0]), @@ -732,7 +732,7 @@ gpio!(GPIOH, gpioh, PH, 'H', PHn, [ PH15: (ph15, 15, [3, 13]), ]); -#[cfg(feature = "gpio-f417")] +#[cfg(gpio_f417)] gpio!(GPIOI, gpioi, PI, 'I', PIn, [ PI0: (pi0, 0, [2, 5, 13]), PI1: (pi1, 1, [5, 13]), @@ -748,7 +748,7 @@ gpio!(GPIOI, gpioi, PI, 'I', PIn, [ PI11: (pi11, 11, [10]), ]); -#[cfg(feature = "gpio-f427")] +#[cfg(gpio_f427)] gpio!(GPIOA, gpioa, PA, 'A', PAn, [ PA0: (pa0, 0, [1, 2, 3, 7, 8, 11]), PA1: (pa1, 1, [1, 2, 7, 8, 11]), @@ -768,7 +768,7 @@ gpio!(GPIOA, gpioa, PA, 'A', PAn, [ PA15: (pa15, 15, [0, 1, 5, 6], super::Debugger), ]); -#[cfg(feature = "gpio-f427")] +#[cfg(gpio_f427)] gpio!(GPIOB, gpiob, PB, 'B', PBn, [ PB0: (pb0, 0, [1, 2, 3, 9, 10, 11]), PB1: (pb1, 1, [1, 2, 3, 9, 10, 11]), @@ -788,7 +788,7 @@ gpio!(GPIOB, gpiob, PB, 'B', PBn, [ PB15: (pb15, 15, [0, 1, 3, 5, 9, 12]), ]); -#[cfg(feature = "gpio-f427")] +#[cfg(gpio_f427)] gpio!(GPIOC, gpioc, PC, 'C', PCn, [ PC0: (pc0, 0, [10, 12]), PC1: (pc1, 1, [11]), @@ -808,7 +808,7 @@ gpio!(GPIOC, gpioc, PC, 'C', PCn, [ PC15: (pc15, 15, []), ]); -#[cfg(feature = "gpio-f427")] +#[cfg(gpio_f427)] gpio!(GPIOD, gpiod, PD, 'D', PDn, [ PD0: (pd0, 0, [9, 12]), PD1: (pd1, 1, [9, 12]), @@ -828,7 +828,7 @@ gpio!(GPIOD, gpiod, PD, 'D', PDn, [ PD15: (pd15, 15, [2, 12]), ]); -#[cfg(feature = "gpio-f427")] +#[cfg(gpio_f427)] gpio!(GPIOE, gpioe, PE, 'E', PEn, [ PE0: (pe0, 0, [2, 8, 12, 13]), PE1: (pe1, 1, [8, 12, 13]), @@ -848,7 +848,7 @@ gpio!(GPIOE, gpioe, PE, 'E', PEn, [ PE15: (pe15, 15, [1, 12, 14]), ]); -#[cfg(feature = "gpio-f427")] +#[cfg(gpio_f427)] gpio!(GPIOF, gpiof, PF, 'F', PFn, [ PF0: (pf0, 0, [4, 12]), PF1: (pf1, 1, [4, 12]), @@ -868,7 +868,7 @@ gpio!(GPIOF, gpiof, PF, 'F', PFn, [ PF15: (pf15, 15, [12]), ]); -#[cfg(feature = "gpio-f427")] +#[cfg(gpio_f427)] gpio!(GPIOG, gpiog, PG, 'G', PGn, [ PG0: (pg0, 0, [12]), PG1: (pg1, 1, [12]), @@ -888,7 +888,7 @@ gpio!(GPIOG, gpiog, PG, 'G', PGn, [ PG15: (pg15, 15, [8, 12, 13]), ]); -#[cfg(feature = "gpio-f427")] +#[cfg(gpio_f427)] gpio!(GPIOH, gpioh, PH, 'H', PHn, [ PH0: (ph0, 0, []), PH1: (ph1, 1, []), @@ -908,7 +908,7 @@ gpio!(GPIOH, gpioh, PH, 'H', PHn, [ PH15: (ph15, 15, [3, 12, 13, 14]), ]); -#[cfg(feature = "gpio-f427")] +#[cfg(gpio_f427)] gpio!(GPIOI, gpioi, PI, 'I', PIn, [ PI0: (pi0, 0, [2, 5, 12, 13, 14]), PI1: (pi1, 1, [5, 12, 13, 14]), @@ -928,7 +928,7 @@ gpio!(GPIOI, gpioi, PI, 'I', PIn, [ PI15: (pi15, 15, [14]), ]); -#[cfg(feature = "gpio-f427")] +#[cfg(gpio_f427)] gpio!(GPIOJ, gpioj, PJ, 'J', PJn, [ PJ0: (pj0, 0, [14]), PJ1: (pj1, 1, [14]), @@ -948,7 +948,7 @@ gpio!(GPIOJ, gpioj, PJ, 'J', PJn, [ PJ15: (pj15, 15, [14]), ]); -#[cfg(feature = "gpio-f427")] +#[cfg(gpio_f427)] gpio!(GPIOK, gpiok, PK, 'K', PKn, [ PK0: (pk0, 0, [14]), PK1: (pk1, 1, [14]), @@ -960,7 +960,7 @@ gpio!(GPIOK, gpiok, PK, 'K', PKn, [ PK7: (pk7, 7, [14]), ]); -#[cfg(feature = "gpio-f446")] +#[cfg(gpio_f446)] gpio!(GPIOA, gpioa, PA, 'A', PAn, [ PA0: (pa0, 0, [1, 2, 3, 7, 8]), PA1: (pa1, 1, [1, 2, 7, 8, 9, 10]), @@ -980,7 +980,7 @@ gpio!(GPIOA, gpioa, PA, 'A', PAn, [ PA15: (pa15, 15, [0, 1, 4, 5, 6, 8], super::Debugger), ]); -#[cfg(feature = "gpio-f446")] +#[cfg(gpio_f446)] gpio!(GPIOB, gpiob, PB, 'B', PBn, [ PB0: (pb0, 0, [1, 2, 3, 7, 8, 10, 12]), PB1: (pb1, 1, [1, 2, 3, 10, 12]), @@ -1000,7 +1000,7 @@ gpio!(GPIOB, gpiob, PB, 'B', PBn, [ PB15: (pb15, 15, [0, 1, 3, 5, 9, 12]), ]); -#[cfg(feature = "gpio-f446")] +#[cfg(gpio_f446)] gpio!(GPIOC, gpioc, PC, 'C', PCn, [ PC0: (pc0, 0, [6, 10, 12]), PC1: (pc1, 1, [5, 6, 7]), @@ -1020,7 +1020,7 @@ gpio!(GPIOC, gpioc, PC, 'C', PCn, [ PC15: (pc15, 15, []), ]); -#[cfg(feature = "gpio-f446")] +#[cfg(gpio_f446)] gpio!(GPIOD, gpiod, PD, 'D', PDn, [ PD0: (pd0, 0, [5, 6, 9, 12]), PD1: (pd1, 1, [7, 9, 12]), @@ -1040,7 +1040,7 @@ gpio!(GPIOD, gpiod, PD, 'D', PDn, [ PD15: (pd15, 15, [2, 4, 12]), ]); -#[cfg(feature = "gpio-f446")] +#[cfg(gpio_f446)] gpio!(GPIOE, gpioe, PE, 'E', PEn, [ PE0: (pe0, 0, [2, 10, 12, 13]), PE1: (pe1, 1, [12, 13]), @@ -1060,7 +1060,7 @@ gpio!(GPIOE, gpioe, PE, 'E', PEn, [ PE15: (pe15, 15, [1, 12]), ]); -#[cfg(feature = "gpio-f446")] +#[cfg(gpio_f446)] gpio!(GPIOF, gpiof, PF, 'F', PFn, [ PF0: (pf0, 0, [4, 12]), PF1: (pf1, 1, [4, 12]), @@ -1080,7 +1080,7 @@ gpio!(GPIOF, gpiof, PF, 'F', PFn, [ PF15: (pf15, 15, [4, 12]), ]); -#[cfg(feature = "gpio-f446")] +#[cfg(gpio_f446)] gpio!(GPIOG, gpiog, PG, 'G', PGn, [ PG0: (pg0, 0, [12]), PG1: (pg1, 1, [12]), @@ -1100,13 +1100,13 @@ gpio!(GPIOG, gpiog, PG, 'G', PGn, [ PG15: (pg15, 15, [8, 12, 13]), ]); -#[cfg(feature = "gpio-f446")] +#[cfg(gpio_f446)] gpio!(GPIOH, gpioh, PH, 'H', PHn, [ PH0: (ph0, 0, []), PH1: (ph1, 1, []), ]); -#[cfg(feature = "gpio-f469")] +#[cfg(gpio_f469)] gpio!(GPIOA, gpioa, PA, 'A', PAn, [ PA0: (pa0, 0, [1, 2, 3, 7, 8, 11]), PA1: (pa1, 1, [1, 2, 7, 8, 9, 11, 14]), @@ -1126,7 +1126,7 @@ gpio!(GPIOA, gpioa, PA, 'A', PAn, [ PA15: (pa15, 15, [0, 1, 5, 6], super::Debugger), ]); -#[cfg(feature = "gpio-f469")] +#[cfg(gpio_f469)] gpio!(GPIOB, gpiob, PB, 'B', PBn, [ PB0: (pb0, 0, [1, 2, 3, 9, 10, 11, 14]), PB1: (pb1, 1, [1, 2, 3, 9, 10, 11, 14]), @@ -1146,7 +1146,7 @@ gpio!(GPIOB, gpiob, PB, 'B', PBn, [ PB15: (pb15, 15, [0, 1, 3, 5, 9, 12]), ]); -#[cfg(feature = "gpio-f469")] +#[cfg(gpio_f469)] gpio!(GPIOC, gpioc, PC, 'C', PCn, [ PC0: (pc0, 0, [10, 12, 14]), PC1: (pc1, 1, [0, 5, 6, 11]), @@ -1166,7 +1166,7 @@ gpio!(GPIOC, gpioc, PC, 'C', PCn, [ PC15: (pc15, 15, []), ]); -#[cfg(feature = "gpio-f469")] +#[cfg(gpio_f469)] gpio!(GPIOD, gpiod, PD, 'D', PDn, [ PD0: (pd0, 0, [9, 12]), PD1: (pd1, 1, [9, 12]), @@ -1186,7 +1186,7 @@ gpio!(GPIOD, gpiod, PD, 'D', PDn, [ PD15: (pd15, 15, [2, 12]), ]); -#[cfg(feature = "gpio-f469")] +#[cfg(gpio_f469)] gpio!(GPIOE, gpioe, PE, 'E', PEn, [ PE0: (pe0, 0, [2, 8, 12, 13]), PE1: (pe1, 1, [8, 12, 13]), @@ -1206,7 +1206,7 @@ gpio!(GPIOE, gpioe, PE, 'E', PEn, [ PE15: (pe15, 15, [1, 12, 14]), ]); -#[cfg(feature = "gpio-f469")] +#[cfg(gpio_f469)] gpio!(GPIOF, gpiof, PF, 'F', PFn, [ PF0: (pf0, 0, [4, 12]), PF1: (pf1, 1, [4, 12]), @@ -1226,7 +1226,7 @@ gpio!(GPIOF, gpiof, PF, 'F', PFn, [ PF15: (pf15, 15, [12]), ]); -#[cfg(feature = "gpio-f469")] +#[cfg(gpio_f469)] gpio!(GPIOG, gpiog, PG, 'G', PGn, [ PG0: (pg0, 0, [12]), PG1: (pg1, 1, [12]), @@ -1246,7 +1246,7 @@ gpio!(GPIOG, gpiog, PG, 'G', PGn, [ PG15: (pg15, 15, [8, 12, 13]), ]); -#[cfg(feature = "gpio-f469")] +#[cfg(gpio_f469)] gpio!(GPIOH, gpioh, PH, 'H', PHn, [ PH0: (ph0, 0, []), PH1: (ph1, 1, []), @@ -1266,7 +1266,7 @@ gpio!(GPIOH, gpioh, PH, 'H', PHn, [ PH15: (ph15, 15, [3, 12, 13, 14]), ]); -#[cfg(feature = "gpio-f469")] +#[cfg(gpio_f469)] gpio!(GPIOI, gpioi, PI, 'I', PIn, [ PI0: (pi0, 0, [2, 5, 12, 13, 14]), PI1: (pi1, 1, [5, 12, 13, 14]), @@ -1286,7 +1286,7 @@ gpio!(GPIOI, gpioi, PI, 'I', PIn, [ PI15: (pi15, 15, [9, 14]), ]); -#[cfg(feature = "gpio-f469")] +#[cfg(gpio_f469)] gpio!(GPIOJ, gpioj, PJ, 'J', PJn, [ PJ0: (pj0, 0, [9, 14]), PJ1: (pj1, 1, [14]), @@ -1300,7 +1300,7 @@ gpio!(GPIOJ, gpioj, PJ, 'J', PJn, [ PJ15: (pj15, 15, [14]), ]); -#[cfg(feature = "gpio-f469")] +#[cfg(gpio_f469)] gpio!(GPIOK, gpiok, PK, 'K', PKn, [ PK3: (pk3, 3, [14]), PK4: (pk4, 4, [14]), @@ -1310,12 +1310,12 @@ gpio!(GPIOK, gpiok, PK, 'K', PKn, [ ]); /*#[cfg(any( - feature = "gpio-f401", - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f446" + gpio_f401, + gpio_f410, + gpio_f411, + gpio_f412, + gpio_f413, + gpio_f446 ))] gpio!(GPIOI, gpioi, PI, 'I', PIn, [ PI8: (pi8, 8, []), diff --git a/src/i2c.rs b/src/i2c.rs index 92c014ed..ba2100b1 100644 --- a/src/i2c.rs +++ b/src/i2c.rs @@ -126,7 +126,7 @@ macro_rules! i2c { i2c! { pac::I2C1: I2c1 } i2c! { pac::I2C2: I2c2 } -#[cfg(feature = "i2c3")] +#[cfg(pac_i2c3)] i2c! { pac::I2C3: I2c3 } pub trait I2cExt: Sized + Instance { diff --git a/src/i2s.rs b/src/i2s.rs index c08eace6..4d680e09 100644 --- a/src/i2s.rs +++ b/src/i2s.rs @@ -243,37 +243,31 @@ macro_rules! i2s { // Each one has to be split into two declarations because the F412, F413, F423, and F446 // have two different I2S clocks while other models have only one. -#[cfg(any(feature = "gpio-f410", feature = "gpio-f411"))] +#[cfg(any(gpio_f410, gpio_f411))] i2s!(pac::SPI1, I2s1, i2s1, i2s_clk); -#[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] +#[cfg(any(gpio_f412, gpio_f413, gpio_f446))] i2s!(pac::SPI1, I2s1, i2s1, i2s_apb2_clk); // All STM32F4 models support SPI2/I2S2 -#[cfg(not(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446")))] +#[cfg(not(any(gpio_f412, gpio_f413, gpio_f446)))] i2s!(pac::SPI2, I2s2, i2s2, i2s_clk); -#[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] +#[cfg(any(gpio_f412, gpio_f413, gpio_f446))] i2s!(pac::SPI2, I2s2, i2s2, i2s_apb1_clk); // All STM32F4 models except STM32F410 support SPI3/I2S3 -#[cfg(any( - feature = "gpio-f401", - feature = "gpio-f411", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f469", -))] +#[cfg(any(gpio_f401, gpio_f411, gpio_f417, gpio_f427, gpio_f469))] i2s!(pac::SPI3, I2s3, i2s3, i2s_clk); -#[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] +#[cfg(any(gpio_f412, gpio_f413, gpio_f446))] i2s!(pac::SPI3, I2s3, i2s3, i2s_apb1_clk); -#[cfg(feature = "gpio-f411")] +#[cfg(gpio_f411)] i2s!(pac::SPI4, I2s4, i2s4, i2s_clk); -#[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] +#[cfg(any(gpio_f412, gpio_f413))] i2s!(pac::SPI4, I2s4, i2s4, i2s_apb2_clk); -#[cfg(any(feature = "gpio-f410", feature = "gpio-f411"))] +#[cfg(any(gpio_f410, gpio_f411))] i2s!(pac::SPI5, I2s5, i2s5, i2s_clk); -#[cfg(any(feature = "gpio-f412", feature = "gpio-f413"))] +#[cfg(any(gpio_f412, gpio_f413))] i2s!(pac::SPI5, I2s5, i2s5, i2s_apb2_clk); /// A wrapper around a SPI and a I2SEXT object and pins for full duplex I2S operation @@ -372,14 +366,7 @@ impl DualI2s { /// $i2s: module containing the Ws pin definition. (example: i2s1). /// $clock: The name of the Clocks function that returns the frequency of the I2S clock input /// to this SPI peripheral (i2s_cl, i2s_apb1_clk, or i2s2_apb_clk) -#[cfg(any( - feature = "gpio-f401", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f469", -))] +#[cfg(any(gpio_f401, gpio_f411, gpio_f412, gpio_f417, gpio_f427, gpio_f469))] macro_rules! dual_i2s { ($SPI:ty,$I2SEXT:ty, $DualI2s:ident, $i2s:ident, $clock:ident) => { pub type $DualI2s = DualI2s<$SPI>; @@ -418,30 +405,18 @@ macro_rules! dual_i2s { // Each one has to be split into two declarations because the F412, F413, F423, and F446 // have two different I2S clocks while other models have only one. // All STM32F4 models except STM32F410 and STM32F446 have dual i2s support on SPI2 and SPI3 -#[cfg(any( - feature = "gpio-f401", - feature = "gpio-f411", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f469", -))] +#[cfg(any(gpio_f401, gpio_f411, gpio_f417, gpio_f427, gpio_f469))] dual_i2s!(pac::SPI2, pac::I2S2EXT, DualI2s2, i2s2, i2s_clk); // add "gpio-f413" feature here when missing I2SEXT in pac wil be fixed. -#[cfg(feature = "gpio-f412")] +#[cfg(gpio_f412)] dual_i2s!(pac::SPI2, pac::I2S2EXT, DualI2s2, i2s2, i2s_apb1_clk); -#[cfg(any( - feature = "gpio-f401", - feature = "gpio-f411", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f469", -))] +#[cfg(any(gpio_f401, gpio_f411, gpio_f417, gpio_f427, gpio_f469))] dual_i2s!(pac::SPI3, pac::I2S3EXT, DualI2s3, i2s3, i2s_clk); // add "gpio-f413" feature here when missing I2SEXT in pac wil be fixed. -#[cfg(feature = "gpio-f412")] +#[cfg(gpio_f412)] dual_i2s!(pac::SPI3, pac::I2S3EXT, DualI2s3, i2s3, i2s_apb1_clk); // DMA support: reuse existing mappings for SPI diff --git a/src/lib.rs b/src/lib.rs index 92ac13a9..c92cd58f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -86,38 +86,38 @@ pub use crate::pac::interrupt; pub mod adc; pub mod bb; -#[cfg(all(feature = "can", any(feature = "can1", feature = "can2")))] +#[cfg(all(feature = "can", any(pac_can1, pac_can2)))] pub mod can; pub mod crc32; -#[cfg(feature = "dac")] +#[cfg(pac_dac)] pub mod dac; -#[cfg(feature = "fmpi2c1")] +#[cfg(pac_fmpi2c1)] pub mod fmpi2c; pub mod gpio; pub mod i2c; pub mod i2s; -#[cfg(all(feature = "usb_fs", feature = "otg-fs"))] +#[cfg(all(feature = "usb_fs", pac_otg_fs))] pub mod otg_fs; -#[cfg(all(any(feature = "usb_hs", docsrs), feature = "otg-hs"))] +#[cfg(all(any(feature = "usb_hs", docsrs), pac_otg_hs))] pub mod otg_hs; -#[cfg(feature = "rng")] +#[cfg(pac_rng)] pub mod rng; pub mod dma; pub mod dwt; pub mod flash; -#[cfg(all(feature = "fsmc_lcd", any(feature = "fmc", feature = "fsmc")))] +#[cfg(all(feature = "fsmc_lcd", any(pac_fmc, pac_fsmc)))] pub mod fsmc_lcd; -#[cfg(all(feature = "dma2d", feature = "ltdc"))] +#[cfg(all(pac_dma2d, pac_ltdc))] pub mod ltdc; pub mod prelude; pub mod qei; -#[cfg(feature = "quadspi")] +#[cfg(pac_quadspi)] pub mod qspi; pub mod rcc; pub mod rtc; -#[cfg(all(feature = "sdio-host", feature = "sdio"))] +#[cfg(all(feature = "sdio-host", pac_sdio))] pub mod sdio; pub mod serial; pub mod signature; @@ -125,7 +125,7 @@ pub mod spi; pub mod syscfg; pub mod time; pub mod timer; -#[cfg(feature = "uart4")] +#[cfg(pac_uart4)] pub mod uart; pub mod watchdog; diff --git a/src/otg_fs.rs b/src/otg_fs.rs index 92937e94..bb44df60 100644 --- a/src/otg_fs.rs +++ b/src/otg_fs.rs @@ -46,19 +46,9 @@ unsafe impl UsbPeripheral for USB { const HIGH_SPEED: bool = false; const FIFO_DEPTH_WORDS: usize = 320; - #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f411", - feature = "gpio-f417", - feature = "gpio-f427", - ))] + #[cfg(any(gpio_f401, gpio_f411, gpio_f417, gpio_f427))] const ENDPOINT_COUNT: usize = 4; - #[cfg(any( - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f446", - feature = "gpio-f469", - ))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446, gpio_f469))] const ENDPOINT_COUNT: usize = 6; fn enable() { diff --git a/src/otg_hs.rs b/src/otg_hs.rs index f62a603b..ac60ea9c 100644 --- a/src/otg_hs.rs +++ b/src/otg_hs.rs @@ -49,9 +49,9 @@ unsafe impl UsbPeripheral for USB { const HIGH_SPEED: bool = true; const FIFO_DEPTH_WORDS: usize = 1024; - #[cfg(any(feature = "gpio-f417", feature = "gpio-f427"))] + #[cfg(any(gpio_f417, gpio_f427))] const ENDPOINT_COUNT: usize = 6; - #[cfg(any(feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f446, gpio_f469))] const ENDPOINT_COUNT: usize = 9; fn enable() { diff --git a/src/prelude.rs b/src/prelude.rs index bc5e65ca..614c0eb3 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -47,9 +47,9 @@ pub use embedded_hal_nb::serial::Write as _embedded_hal_serial_nb_Write; pub use fugit::ExtU32 as _fugit_ExtU32; pub use fugit::RateExtU32 as _fugit_RateExtU32; -#[cfg(all(feature = "can", any(feature = "can1", feature = "can2")))] +#[cfg(all(feature = "can", any(pac_can1, pac_can2)))] pub use crate::can::CanExt as _stm32f4xx_hal_can_CanExt; -#[cfg(feature = "dac")] +#[cfg(pac_dac)] pub use crate::dac::DacExt as _stm32f4xx_hal_dac_DacExt; pub use crate::dma::traits::DmaEventExt as _; pub use crate::dma::traits::DmaFlagExt as _; @@ -66,7 +66,7 @@ pub use crate::i2c::I2cExt as _stm32f4xx_hal_i2c_I2cExt; pub use crate::i2s::I2sExt as _stm32f4xx_hal_i2s_I2sExt; pub use crate::qei::QeiExt as _stm32f4xx_hal_QeiExt; pub use crate::rcc::RccExt as _stm32f4xx_hal_rcc_RccExt; -#[cfg(feature = "rng")] +#[cfg(pac_rng)] pub use crate::rng::RngExt as _stm32f4xx_hal_rng_RngExt; pub use crate::serial::dma::SerialHandleIT as _stm32f4xx_hal_serial_dma_SerialHandleIT; pub use crate::serial::dma::SerialReadDMA as _stm32f4xx_hal_serial_dma_SerialReadDMA; diff --git a/src/qei.rs b/src/qei.rs index 14bdb1f0..3b9c2939 100644 --- a/src/qei.rs +++ b/src/qei.rs @@ -105,9 +105,9 @@ macro_rules! hal { impl Instance for $TIM { fn setup_qei(&mut self) { // Configure TxC1 and TxC2 as captures - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] self.ccmr1_input().write(|w| w.cc1s().ti1().cc2s().ti2()); - #[cfg(feature = "gpio-f410")] + #[cfg(gpio_f410)] self.ccmr1_input() .write(|w| unsafe { w.cc1s().bits(0b01).cc2s().bits(0b01) }); // enable and configure to capture on rising edge @@ -128,15 +128,15 @@ macro_rules! hal { }; } -#[cfg(feature = "tim1")] +#[cfg(pac_tim1)] hal! { pac::TIM1 } -#[cfg(feature = "tim2")] +#[cfg(pac_tim2)] hal! { pac::TIM2 } -#[cfg(feature = "tim3")] +#[cfg(pac_tim3)] hal! { pac::TIM3 } -#[cfg(feature = "tim4")] +#[cfg(pac_tim4)] hal! { pac::TIM4 } -#[cfg(feature = "tim5")] +#[cfg(pac_tim5)] hal! { pac::TIM5 } -#[cfg(feature = "tim8")] +#[cfg(pac_tim8)] hal! { pac::TIM8 } diff --git a/src/rcc/enable.rs b/src/rcc/enable.rs index b8a6e3a7..b0bbf720 100644 --- a/src/rcc/enable.rs +++ b/src/rcc/enable.rs @@ -79,16 +79,16 @@ macro_rules! bus { } } -#[cfg(feature = "quadspi")] +#[cfg(pac_quadspi)] impl crate::Sealed for crate::pac::QUADSPI {} -#[cfg(feature = "quadspi")] +#[cfg(pac_quadspi)] impl RccBus for crate::pac::QUADSPI { type Bus = AHB3; } -#[cfg(feature = "quadspi")] +#[cfg(pac_quadspi)] bus_enable! { QUADSPI => 1 } -#[cfg(feature = "quadspi")] +#[cfg(pac_quadspi)] bus_reset! { QUADSPI => 1 } bus! { @@ -104,58 +104,58 @@ bus! { GPIOH => (AHB1, 7), } -#[cfg(any(feature = "gpiod", feature = "gpioe"))] +#[cfg(any(pac_gpiod, pac_gpioe))] bus! { GPIOD => (AHB1, 3), GPIOE => (AHB1, 4), } -#[cfg(any(feature = "gpiof", feature = "gpiog"))] +#[cfg(any(pac_gpiof, pac_gpiog))] bus! { GPIOF => (AHB1, 5), GPIOG => (AHB1, 6), } -#[cfg(feature = "gpioi")] +#[cfg(pac_gpioi)] bus! { GPIOI => (AHB1, 8), } -#[cfg(any(feature = "gpioj", feature = "gpiok"))] +#[cfg(any(pac_gpioj, pac_gpiok))] bus! { GPIOJ => (AHB1, 9), GPIOK => (AHB1, 10), } -#[cfg(feature = "rng")] +#[cfg(pac_rng)] bus! { RNG => (AHB2, 6), } -#[cfg(feature = "otg-fs")] +#[cfg(pac_otg_fs)] bus! { OTG_FS_GLOBAL => (AHB2, 7), } -#[cfg(feature = "otg-hs")] +#[cfg(pac_otg_hs)] bus! { OTG_HS_GLOBAL => (AHB1, 29), } -#[cfg(feature = "fmc")] +#[cfg(pac_fmc)] bus! { FMC => (AHB3, 0), } // TODO: fix absent ahb3lpenr -#[cfg(feature = "fsmc")] +#[cfg(pac_fsmc)] impl crate::Sealed for crate::pac::FSMC {} -#[cfg(feature = "fsmc")] +#[cfg(pac_fsmc)] impl RccBus for crate::pac::FSMC { type Bus = AHB3; } -#[cfg(feature = "fsmc")] +#[cfg(pac_fsmc)] bus_enable!(FSMC => 0); -#[cfg(feature = "fsmc")] +#[cfg(pac_fsmc)] bus_reset!(FSMC => 0); bus! { @@ -166,22 +166,22 @@ bus! { SPI1 => (APB2, 12), SPI2 => (APB1, 14), } -#[cfg(feature = "spi3")] +#[cfg(pac_spi3)] bus! { SPI3 => (APB1, 15), } -#[cfg(feature = "spi4")] +#[cfg(pac_spi4)] bus! { SPI4 => (APB2, 13), } -#[cfg(feature = "spi5")] +#[cfg(pac_spi5)] bus! { SPI5 => (APB2, 20), } -#[cfg(feature = "spi6")] +#[cfg(pac_spi6)] bus! { SPI6 => (APB2, 21), } @@ -190,11 +190,11 @@ bus! { I2C1 => (APB1, 21), I2C2 => (APB1, 22), } -#[cfg(feature = "i2c3")] +#[cfg(pac_i2c3)] bus! { I2C3 => (APB1, 23), } -#[cfg(feature = "fmpi2c1")] +#[cfg(pac_fmpi2c1)] bus! { FMPI2C1 => (APB1, 24), } @@ -204,40 +204,40 @@ bus! { USART2 => (APB1, 17), USART6 => (APB2, 5), } -#[cfg(feature = "usart3")] +#[cfg(pac_usart3)] bus! { USART3 => (APB1, 18), } -#[cfg(any(feature = "uart4", feature = "uart5"))] +#[cfg(any(pac_uart4, pac_uart5))] bus! { UART4 => (APB1, 19), UART5 => (APB1, 20), } -#[cfg(any(feature = "uart7", feature = "uart8"))] +#[cfg(any(pac_uart7, pac_uart8))] bus! { UART7 => (APB1, 30), UART8 => (APB1, 31), } -#[cfg(any(feature = "uart9", feature = "uart10"))] +#[cfg(any(pac_uart9, pac_uart10))] bus! { UART9 => (APB2, 6), UART10 => (APB2, 7), } -#[cfg(any(feature = "can1", feature = "can2"))] +#[cfg(any(pac_can1, pac_can2))] bus! { CAN1 => (APB1, 25), CAN2 => (APB1, 26), } -#[cfg(feature = "can3")] +#[cfg(pac_can3)] bus! { CAN3 => (APB1, 27), } -#[cfg(feature = "dac")] +#[cfg(pac_dac)] bus! { DAC => (APB1, 29), } @@ -250,30 +250,30 @@ bus! { ADC1 => (APB2, 8), } -#[cfg(feature = "adc2")] +#[cfg(pac_adc2)] impl crate::Sealed for crate::pac::ADC2 {} -#[cfg(feature = "adc2")] +#[cfg(pac_adc2)] impl RccBus for crate::pac::ADC2 { type Bus = APB2; } -#[cfg(feature = "adc2")] +#[cfg(pac_adc2)] bus_enable!(ADC2 => 9); -#[cfg(feature = "adc2")] +#[cfg(pac_adc2)] bus_lpenable!(ADC2 => 9); -#[cfg(feature = "adc2")] +#[cfg(pac_adc2)] bus_reset!(ADC2 => 8); -#[cfg(feature = "adc3")] +#[cfg(pac_adc3)] impl crate::Sealed for crate::pac::ADC3 {} -#[cfg(feature = "adc3")] +#[cfg(pac_adc3)] impl RccBus for crate::pac::ADC3 { type Bus = APB2; } -#[cfg(feature = "adc3")] +#[cfg(pac_adc3)] bus_enable!(ADC3 => 10); -#[cfg(feature = "adc3")] +#[cfg(pac_adc3)] bus_lpenable!(ADC3 => 10); -#[cfg(feature = "adc3")] +#[cfg(pac_adc3)] bus_reset!(ADC3 => 8); #[cfg(feature = "stm32f413")] @@ -286,12 +286,12 @@ bus! { SAI1 => (APB2, 22), } -#[cfg(feature = "sai2")] +#[cfg(pac_sai2)] bus! { SAI2 => (APB2, 23), } -#[cfg(feature = "sdio")] +#[cfg(pac_sdio)] bus! { SDIO => (APB2, 11), } @@ -304,14 +304,7 @@ bus! { } #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f417", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469", + gpio_f401, gpio_f417, gpio_f411, gpio_f412, gpio_f413, gpio_f427, gpio_f446, gpio_f469, ))] bus! { TIM2 => (APB1, 0), @@ -321,26 +314,13 @@ bus! { } #[cfg(any( - feature = "gpio-f410", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469", + gpio_f410, gpio_f412, gpio_f413, gpio_f417, gpio_f427, gpio_f446, gpio_f469, ))] bus! { TIM6 => (APB1, 4), } -#[cfg(any( - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469", -))] +#[cfg(any(gpio_f412, gpio_f413, gpio_f417, gpio_f427, gpio_f446, gpio_f469))] bus! { TIM7 => (APB1, 5), TIM8 => (APB2, 1), @@ -349,11 +329,11 @@ bus! { TIM14 => (APB1, 8), } -#[cfg(feature = "ltdc")] +#[cfg(pac_ltdc)] bus! { LTDC => (APB2, 26), } -#[cfg(feature = "dma2d")] +#[cfg(pac_dma2d)] bus! { DMA2D => (AHB1, 23), } diff --git a/src/rcc/mod.rs b/src/rcc/mod.rs index b3b597eb..ea3a0437 100644 --- a/src/rcc/mod.rs +++ b/src/rcc/mod.rs @@ -46,10 +46,10 @@ use crate::pac::{self, rcc, RCC}; use fugit::HertzU32 as Hertz; use fugit::RateExtU32; -#[cfg(not(feature = "gpio-f410"))] +#[cfg(not(gpio_f410))] use pll::I2sPll; use pll::MainPll; -#[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] +#[cfg(any(gpio_f427, gpio_f446, gpio_f469))] use pll::SaiPll; mod pll; @@ -216,24 +216,24 @@ bus_struct! { APB1 => (APB1ENR, apb1enr, APB1LPENR, apb1lpenr, APB1RSTR, apb1rstr, "Advanced Peripheral Bus 1 (APB1) registers"), APB2 => (APB2ENR, apb2enr, APB2LPENR, apb2lpenr, APB2RSTR, apb2rstr, "Advanced Peripheral Bus 2 (APB2) registers"), AHB1 => (AHB1ENR, ahb1enr, AHB1LPENR, ahb1lpenr, AHB1RSTR, ahb1rstr, "Advanced High-performance Bus 1 (AHB1) registers"), - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] AHB2 => (AHB2ENR, ahb2enr, AHB2LPENR, ahb2lpenr, AHB2RSTR, ahb2rstr, "Advanced High-performance Bus 2 (AHB2) registers"), - //#[cfg(any(feature = "fsmc", feature = "fmc"))] + //#[cfg(any(pac_fsmc, pac_fmc))] //AHB3 => (AHB3ENR, ahb3enr, AHB3LPENR, ahb3lpenr, AHB3RSTR, ahb3rstr, "Advanced High-performance Bus 3 (AHB3) registers"), } /// AMBA High-performance Bus 3 (AHB3) registers -#[cfg(any(feature = "fsmc", feature = "fmc"))] +#[cfg(any(pac_fsmc, pac_fmc))] #[non_exhaustive] pub struct AHB3; -#[cfg(any(feature = "fsmc", feature = "fmc"))] +#[cfg(any(pac_fsmc, pac_fmc))] impl AHB3 { #[inline(always)] fn enr(rcc: &RccRB) -> &rcc::AHB3ENR { rcc.ahb3enr() } - #[cfg(feature = "fmc")] + #[cfg(pac_fmc)] #[inline(always)] fn lpenr(rcc: &RccRB) -> &rcc::AHB3LPENR { rcc.ahb3lpenr() @@ -250,14 +250,14 @@ impl BusClock for AHB1 { } } -#[cfg(not(feature = "gpio-f410"))] +#[cfg(not(gpio_f410))] impl BusClock for AHB2 { fn clock(clocks: &Clocks) -> Hertz { clocks.hclk } } -#[cfg(any(feature = "fsmc", feature = "fmc"))] +#[cfg(any(pac_fsmc, pac_fmc))] impl BusClock for AHB3 { fn clock(clocks: &Clocks) -> Hertz { clocks.hclk @@ -300,22 +300,15 @@ impl RccExt for RCC { sysclk: None, pll48clk: false, i2s_ckin: None, - #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f469", - ))] + #[cfg(any(gpio_f401, gpio_f410, gpio_f411, gpio_f417, gpio_f427, gpio_f469))] i2s_clk: None, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] i2s_apb1_clk: None, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] i2s_apb2_clk: None, - #[cfg(feature = "sai1")] + #[cfg(pac_sai1)] sai1_clk: None, - #[cfg(feature = "sai1")] + #[cfg(pac_sai1)] sai2_clk: None, }, } @@ -331,60 +324,36 @@ pub struct Rcc { pub const HSI: u32 = 16_000_000; // Hz #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f469", + gpio_f401, gpio_f410, gpio_f411, gpio_f412, gpio_f413, gpio_f417, gpio_f427, gpio_f469, ))] /// Minimum system clock frequency pub const SYSCLK_MIN: u32 = 24_000_000; -#[cfg(feature = "gpio-f446")] +#[cfg(gpio_f446)] /// Minimum system clock frequency pub const SYSCLK_MIN: u32 = 12_500_000; -#[cfg(feature = "gpio-f401")] +#[cfg(gpio_f401)] /// Maximum system clock frequency pub const SYSCLK_MAX: u32 = 84_000_000; -#[cfg(feature = "gpio-f417")] +#[cfg(gpio_f417)] /// Maximum system clock frequency pub const SYSCLK_MAX: u32 = 168_000_000; -#[cfg(any( - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", -))] +#[cfg(any(gpio_f410, gpio_f411, gpio_f412, gpio_f413))] /// Maximum system clock frequency pub const SYSCLK_MAX: u32 = 100_000_000; -#[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] +#[cfg(any(gpio_f427, gpio_f446, gpio_f469))] /// Maximum system clock frequency pub const SYSCLK_MAX: u32 = 180_000_000; -#[cfg(any( - feature = "gpio-f401", - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", -))] +#[cfg(any(gpio_f401, gpio_f410, gpio_f411, gpio_f412, gpio_f413))] /// Maximum APB2 peripheral clock frequency pub const PCLK2_MAX: u32 = SYSCLK_MAX; -#[cfg(not(any( - feature = "gpio-f401", - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", -)))] +#[cfg(not(any(gpio_f401, gpio_f410, gpio_f411, gpio_f412, gpio_f413)))] /// Maximum APB2 peripheral clock frequency pub const PCLK2_MAX: u32 = SYSCLK_MAX / 2; @@ -401,22 +370,15 @@ pub struct CFGR { pll48clk: bool, i2s_ckin: Option, - #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f469", - ))] + #[cfg(any(gpio_f401, gpio_f410, gpio_f411, gpio_f417, gpio_f427, gpio_f469))] i2s_clk: Option, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] i2s_apb1_clk: Option, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] i2s_apb2_clk: Option, - #[cfg(feature = "sai1")] + #[cfg(pac_sai1)] sai1_clk: Option, - #[cfg(feature = "sai1")] + #[cfg(pac_sai1)] sai2_clk: Option, } @@ -477,61 +439,54 @@ impl CFGR { } /// Selects an I2S clock frequency and enables the I2S clock. - #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f469", - ))] + #[cfg(any(gpio_f401, gpio_f410, gpio_f411, gpio_f417, gpio_f427, gpio_f469))] pub fn i2s_clk(mut self, freq: Hertz) -> Self { self.i2s_clk = Some(freq.raw()); self } /// Selects an I2S clock frequency for the first set of I2S instancesand enables the I2S clock. - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] pub fn i2s_apb1_clk(mut self, freq: Hertz) -> Self { self.i2s_apb1_clk = Some(freq.raw()); self } /// Selects an I2S clock frequency for the second set of I2S instances and enables the I2S clock. - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] pub fn i2s_apb2_clk(mut self, freq: Hertz) -> Self { self.i2s_apb2_clk = Some(freq.raw()); self } /// Selects a SAIA clock frequency and enables the SAIA clock. - #[cfg(any(feature = "gpio-f413", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f413, gpio_f427, gpio_f469))] pub fn saia_clk(mut self, freq: Hertz) -> Self { self.sai1_clk = Some(freq.raw()); self } /// Selects a SAIB clock frequency and enables the SAIB clock. - #[cfg(any(feature = "gpio-f413", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f413, gpio_f427, gpio_f469))] pub fn saib_clk(mut self, freq: Hertz) -> Self { self.sai2_clk = Some(freq.raw()); self } /// Selects a SAI1 clock frequency and enables the SAI1 clock. - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] pub fn sai1_clk(mut self, freq: Hertz) -> Self { self.sai1_clk = Some(freq.raw()); self } /// Selects a SAI2 clock frequency and enables the SAI2 clock. - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] pub fn sai2_clk(mut self, freq: Hertz) -> Self { self.sai2_clk = Some(freq.raw()); self } - #[cfg(feature = "gpio-f410")] + #[cfg(gpio_f410)] #[inline(always)] fn pll_setup(&self, pllsrcclk: u32, pllsysclk: Option) -> PllSetup { let i2s_clocks = self.i2s_clocks(); @@ -558,7 +513,7 @@ impl CFGR { } } - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] #[inline(always)] fn pll_setup(&self, pllsrcclk: u32, pllsysclk: Option) -> PllSetup { let rcc = unsafe { &*RCC::ptr() }; @@ -613,88 +568,83 @@ impl CFGR { } } - #[cfg(any(feature = "gpio-f411", feature = "gpio-f412", feature = "gpio-f446"))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f446))] #[inline(always)] fn pll_setup(&self, pllsrcclk: u32, pllsysclk: Option) -> PllSetup { let i2s_clocks = self.i2s_clocks(); - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] let sai_clocks = self.sai_clocks(); // All PLLs are completely independent. let main_pll = MainPll::fast_setup(pllsrcclk, self.hse.is_some(), pllsysclk, self.pll48clk); let i2s_pll = I2sPll::setup(pllsrcclk, i2s_clocks.pll_i2s_clk); - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] let sai_pll = SaiPll::setup(pllsrcclk, sai_clocks.pll_sai_clk); PllSetup { use_pll: main_pll.use_pll, use_i2spll: i2s_pll.use_pll, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] use_saipll: sai_pll.use_pll, pllsysclk: main_pll.pllsysclk, pll48clk: main_pll.pll48clk, i2s: i2s_clocks.real(i2s_pll.plli2sclk, self.i2s_ckin), - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] sai: sai_clocks.real(sai_pll.sai_clk, self.i2s_ckin), } } - #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f469", - ))] + #[cfg(any(gpio_f401, gpio_f417, gpio_f427, gpio_f469))] #[inline(always)] fn pll_setup(&self, pllsrcclk: u32, pllsysclk: Option) -> PllSetup { let i2s_clocks = self.i2s_clocks(); - #[cfg(any(feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f469))] let sai_clocks = self.sai_clocks(); // We have separate PLLs, but they share the "M" divider. let main_pll = MainPll::fast_setup(pllsrcclk, self.hse.is_some(), pllsysclk, self.pll48clk); let i2s_pll = I2sPll::setup_shared_m(pllsrcclk, main_pll.m, i2s_clocks.pll_i2s_clk); - #[cfg(any(feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f469))] let sai_pll = SaiPll::setup_shared_m(pllsrcclk, main_pll.m.or(i2s_pll.m), sai_clocks.pll_sai_clk); PllSetup { use_pll: main_pll.use_pll, use_i2spll: i2s_pll.use_pll, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f469))] use_saipll: sai_pll.use_pll, pllsysclk: main_pll.pllsysclk, pll48clk: main_pll.pll48clk, i2s: i2s_clocks.real(i2s_pll.plli2sclk, self.i2s_ckin), - #[cfg(any(feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f469))] sai: sai_clocks.real(sai_pll.sai_clk, self.i2s_ckin), } } - #[cfg(feature = "sai1")] + #[cfg(pac_sai1)] fn sai_clocks(&self) -> SaiClocks { let sai1_ext = self.sai1_clk.is_some() && self.sai1_clk == self.i2s_ckin; - #[cfg(not(feature = "gpio-f446"))] + #[cfg(not(gpio_f446))] let sai2_ext = self.sai2_clk.is_some() && self.sai2_clk == self.i2s_ckin; // Not the PLL output, but the target clock after the divider. let pll_sai_clk = if sai1_ext { None } else { self.sai1_clk }; // The STM32F446 only supports I2S_CKIN for SAI1. - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] let pll_sai_clk2 = self.sai2_clk; - #[cfg(not(feature = "gpio-f446"))] + #[cfg(not(gpio_f446))] let pll_sai_clk2 = if sai2_ext { None } else { self.sai2_clk }; if pll_sai_clk.is_some() && pll_sai_clk2.is_some() && pll_sai_clk != pll_sai_clk2 { panic!("only one SAI PLL frequency implemented"); } SaiClocks { sai1_ext, - #[cfg(not(feature = "gpio-f446"))] + #[cfg(not(gpio_f446))] sai2_ext, pll_sai_clk, } } - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] fn i2s_clocks(&self) -> I2sClocks { let i2s_apb1_ext = self.i2s_apb1_clk.is_some() && self.i2s_apb1_clk == self.i2s_ckin; let i2s_apb2_ext = self.i2s_apb2_clk.is_some() && self.i2s_apb2_clk == self.i2s_ckin; @@ -718,7 +668,7 @@ impl CFGR { } } - #[cfg(not(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446")))] + #[cfg(not(any(gpio_f412, gpio_f413, gpio_f446)))] fn i2s_clocks(&self) -> I2sClocks { let i2s_ext = self.i2s_clk.is_some() && self.i2s_clk == self.i2s_ckin; let pll_i2s_clk = if i2s_ext { None } else { self.i2s_clk }; @@ -732,18 +682,11 @@ impl CFGR { use crate::pac::FLASH; #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f417", - feature = "gpio-f410", - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f427", - feature = "gpio-f446", - feature = "gpio-f469", + gpio_f401, gpio_f417, gpio_f410, gpio_f411, gpio_f412, gpio_f427, gpio_f446, gpio_f469, ))] let flash_latency_step = 30_000_000; - #[cfg(feature = "gpio-f413")] + #[cfg(gpio_f413)] let flash_latency_step = 25_000_000; unsafe { @@ -861,7 +804,7 @@ impl CFGR { rcc.cr().modify(|_, w| w.pllon().set_bit()); // Enable voltage regulator overdrive if HCLK is above the limit - #[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f446, gpio_f469))] if hclk > 168_000_000 { // Enable clock for PWR peripheral rcc.apb1enr().modify(|_, w| w.pwren().set_bit()); @@ -880,7 +823,7 @@ impl CFGR { while rcc.cr().read().pllrdy().bit_is_clear() {} } - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] if plls.use_i2spll { // Enable PLL. rcc.cr().modify(|_, w| w.plli2son().set_bit()); @@ -889,7 +832,7 @@ impl CFGR { while rcc.cr().read().plli2srdy().bit_is_clear() {} } - #[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f446, gpio_f469))] if plls.use_saipll { // Enable PLL. rcc.cr().modify(|_, w| w.pllsaion().set_bit()); @@ -900,7 +843,7 @@ impl CFGR { // Select I2S and SAI clocks plls.i2s.config_clocksel(); - #[cfg(feature = "sai1")] + #[cfg(pac_sai1)] plls.sai.config_clocksel(); // Set scaling factors @@ -940,20 +883,20 @@ impl CFGR { sysclk: sysclk.Hz(), pll48clk: plls.pll48clk.map(Hertz::from_raw), - #[cfg(not(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446")))] + #[cfg(not(any(gpio_f412, gpio_f413, gpio_f446)))] i2s_clk: plls.i2s.i2s_clk.map(Hertz::from_raw), - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] i2s_apb1_clk: plls.i2s.i2s_apb1_clk.map(Hertz::from_raw), - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] i2s_apb2_clk: plls.i2s.i2s_apb2_clk.map(Hertz::from_raw), - #[cfg(any(feature = "gpio-f413", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f413, gpio_f427, gpio_f469))] saia_clk: plls.sai.sai1_clk.map(Hertz::from_raw), - #[cfg(any(feature = "gpio-f413", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f413, gpio_f427, gpio_f469))] saib_clk: plls.sai.sai2_clk.map(Hertz::from_raw), - #[cfg(feature = "sai2")] + #[cfg(pac_sai2)] sai1_clk: plls.sai.sai1_clk.map(Hertz::from_raw), - #[cfg(feature = "sai2")] + #[cfg(pac_sai2)] sai2_clk: plls.sai.sai2_clk.map(Hertz::from_raw), }; @@ -969,9 +912,9 @@ impl CFGR { #[derive(Copy, Clone, PartialEq, Eq, Debug)] struct PllSetup { use_pll: bool, - #[cfg(not(feature = "gpio-f410"))] + #[cfg(not(gpio_f410))] use_i2spll: bool, - #[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f446, gpio_f469))] use_saipll: bool, pllsysclk: Option, @@ -979,11 +922,11 @@ struct PllSetup { i2s: RealI2sClocks, - #[cfg(feature = "sai1")] + #[cfg(pac_sai1)] sai: RealSaiClocks, } -#[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] +#[cfg(any(gpio_f412, gpio_f413, gpio_f446))] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[derive(Copy, Clone, PartialEq, Eq, Debug)] struct I2sClocks { @@ -995,7 +938,7 @@ struct I2sClocks { pll_i2s_clk: Option, } -#[cfg(not(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446")))] +#[cfg(not(any(gpio_f412, gpio_f413, gpio_f446)))] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[derive(Copy, Clone, PartialEq, Eq, Debug)] struct I2sClocks { @@ -1006,7 +949,7 @@ struct I2sClocks { } impl I2sClocks { - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] fn real(&self, pll_i2s_clk: Option, i2s_ckin: Option) -> RealI2sClocks { RealI2sClocks { i2s_apb1_ext: self.i2s_apb1_ext, @@ -1024,7 +967,7 @@ impl I2sClocks { } } - #[cfg(not(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446")))] + #[cfg(not(any(gpio_f412, gpio_f413, gpio_f446)))] fn real(&self, pll_i2s_clk: Option, i2s_ckin: Option) -> RealI2sClocks { RealI2sClocks { i2s_ext: self.i2s_ext, @@ -1033,7 +976,7 @@ impl I2sClocks { } } -#[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] +#[cfg(any(gpio_f412, gpio_f413, gpio_f446))] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[derive(Copy, Clone, PartialEq, Eq, Debug)] struct RealI2sClocks { @@ -1043,7 +986,7 @@ struct RealI2sClocks { i2s_apb2_clk: Option, } -#[cfg(not(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446")))] +#[cfg(not(any(gpio_f412, gpio_f413, gpio_f446)))] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[derive(Copy, Clone, PartialEq, Eq, Debug)] struct RealI2sClocks { @@ -1055,12 +998,7 @@ impl RealI2sClocks { fn config_clocksel(&self) { let rcc = unsafe { &*RCC::ptr() }; - #[cfg(not(any( - feature = "gpio-f410", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f446", - )))] + #[cfg(not(any(gpio_f410, gpio_f412, gpio_f413, gpio_f446)))] rcc.cfgr().modify(|_, w| { if self.i2s_ext { w.i2ssrc().ckin() @@ -1068,7 +1006,7 @@ impl RealI2sClocks { w.i2ssrc().plli2s() } }); - #[cfg(feature = "gpio-f410")] + #[cfg(gpio_f410)] rcc.dckcfgr().modify(|_, w| { if self.i2s_ext { w.i2ssrc().i2s_ckin() @@ -1076,7 +1014,7 @@ impl RealI2sClocks { w.i2ssrc().pllclkr() } }); - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] rcc.dckcfgr().modify(|_, w| { if self.i2s_apb1_ext { w.i2s1src().i2s_ckin() @@ -1092,53 +1030,53 @@ impl RealI2sClocks { } } -#[cfg(feature = "sai1")] +#[cfg(pac_sai1)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[derive(Copy, Clone, PartialEq, Eq, Debug)] struct SaiClocks { /// True if the clock for SAI1 (STM32F446) or SAIA (all other models) is identical to I2S_CKIN. sai1_ext: bool, /// True if the clock for SAIB is identical to I2S_CKIN. - #[cfg(not(feature = "gpio-f446"))] + #[cfg(not(gpio_f446))] sai2_ext: bool, /// Target for the SAI clock as generated by PLL and SAI clock divider. pll_sai_clk: Option, } -#[cfg(feature = "sai1")] +#[cfg(pac_sai1)] impl SaiClocks { fn real(&self, pll_sai_clk: Option, i2s_ckin: Option) -> RealSaiClocks { RealSaiClocks { sai1_ext: self.sai1_ext, - #[cfg(not(feature = "gpio-f446"))] + #[cfg(not(gpio_f446))] sai2_ext: self.sai2_ext, sai1_clk: if self.sai1_ext { i2s_ckin } else { pll_sai_clk }, - #[cfg(not(feature = "gpio-f446"))] + #[cfg(not(gpio_f446))] sai2_clk: if self.sai2_ext { i2s_ckin } else { pll_sai_clk }, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] sai2_clk: pll_sai_clk, } } } -#[cfg(feature = "sai1")] +#[cfg(pac_sai1)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[derive(Copy, Clone, PartialEq, Eq, Debug)] struct RealSaiClocks { sai1_ext: bool, - #[cfg(not(feature = "gpio-f446"))] + #[cfg(not(gpio_f446))] sai2_ext: bool, sai1_clk: Option, sai2_clk: Option, } -#[cfg(feature = "sai1")] +#[cfg(pac_sai1)] impl RealSaiClocks { fn config_clocksel(&self) { let rcc = unsafe { &*RCC::ptr() }; // Configure SAI clocks. - #[cfg(not(feature = "gpio-f446"))] + #[cfg(not(gpio_f446))] rcc.dckcfgr().modify(|_, w| { if self.sai1_ext { w.sai1asrc().i2s_ckin() @@ -1152,7 +1090,7 @@ impl RealSaiClocks { } }); - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] rcc.dckcfgr().modify(|_, w| { if self.sai1_ext { w.sai1src().i2s_ckin() @@ -1177,20 +1115,20 @@ pub struct Clocks { sysclk: Hertz, pll48clk: Option, - #[cfg(not(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446")))] + #[cfg(not(any(gpio_f412, gpio_f413, gpio_f446)))] i2s_clk: Option, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] i2s_apb1_clk: Option, - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] i2s_apb2_clk: Option, - #[cfg(any(feature = "gpio-f413", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f413, gpio_f427, gpio_f469))] saia_clk: Option, - #[cfg(any(feature = "gpio-f413", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f413, gpio_f427, gpio_f469))] saib_clk: Option, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] sai1_clk: Option, - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] sai2_clk: Option, } @@ -1240,38 +1178,38 @@ impl Clocks { } /// Returns the frequency of the I2S clock. - #[cfg(not(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446")))] + #[cfg(not(any(gpio_f412, gpio_f413, gpio_f446)))] pub fn i2s_clk(&self) -> Option { self.i2s_clk } /// Returns the frequency of the first I2S clock (for the I2S peripherals on APB1). - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] pub fn i2s_apb1_clk(&self) -> Option { self.i2s_apb1_clk } /// Returns the frequency of the second I2S clock (for the I2S peripherals on APB2). - #[cfg(any(feature = "gpio-f412", feature = "gpio-f413", feature = "gpio-f446"))] + #[cfg(any(gpio_f412, gpio_f413, gpio_f446))] pub fn i2s_apb2_clk(&self) -> Option { self.i2s_apb2_clk } /// Returns the frequency of the SAI A clock. - #[cfg(any(feature = "gpio-f413", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f413, gpio_f427, gpio_f469))] pub fn saia_clk(&self) -> Option { self.saia_clk } /// Returns the frequency of the SAI B clock. - #[cfg(any(feature = "gpio-f413", feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f413, gpio_f427, gpio_f469))] pub fn saib_clk(&self) -> Option { self.saib_clk } /// Returns the frequency of the SAI1 clock. - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] pub fn sai1_clk(&self) -> Option { self.sai1_clk } /// Returns the frequency of the SAI2 clock. - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] pub fn sai2_clk(&self) -> Option { self.sai2_clk } diff --git a/src/rcc/pll.rs b/src/rcc/pll.rs index 139c3b7f..fa10d493 100644 --- a/src/rcc/pll.rs +++ b/src/rcc/pll.rs @@ -101,7 +101,7 @@ impl MainPll { } } - #[cfg(feature = "gpio-f410")] + #[cfg(gpio_f410)] pub fn setup_with_i2s( pllsrcclk: u32, use_hse: bool, @@ -189,7 +189,7 @@ impl MainPll { } } - #[cfg(feature = "gpio-f410")] + #[cfg(gpio_f410)] fn best_divider( vco_out: u32, min: u32, @@ -218,7 +218,7 @@ impl MainPll { } } -#[cfg(not(feature = "gpio-f410"))] +#[cfg(not(gpio_f410))] pub struct I2sPll { pub use_pll: bool, /// "M" divisor, required for the other PLLs on some MCUs. @@ -227,7 +227,7 @@ pub struct I2sPll { pub plli2sclk: Option, } -#[cfg(not(feature = "gpio-f410"))] +#[cfg(not(gpio_f410))] impl I2sPll { pub fn unused() -> I2sPll { I2sPll { @@ -253,12 +253,7 @@ impl I2sPll { pll } - #[cfg(any( - feature = "gpio-f401", - feature = "gpio-f417", - feature = "gpio-f427", - feature = "gpio-f469", - ))] + #[cfg(any(gpio_f401, gpio_f417, gpio_f427, gpio_f469))] pub fn setup_shared_m(pllsrcclk: u32, m: Option, plli2sclk: Option) -> I2sPll { // "m" is None if the main PLL is not in use. let Some(m) = m else { @@ -287,12 +282,7 @@ impl I2sPll { ) } - #[cfg(not(any( - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f446", - )))] + #[cfg(not(any(gpio_f411, gpio_f412, gpio_f413, gpio_f446)))] fn apply_config(config: SingleOutputPll) { let rcc = unsafe { &*RCC::ptr() }; // "M" may have been written before, but the value is identical. @@ -301,12 +291,7 @@ impl I2sPll { rcc.plli2scfgr() .modify(|_, w| unsafe { w.plli2sn().bits(config.n).plli2sr().bits(config.outdiv) }); } - #[cfg(any( - feature = "gpio-f411", - feature = "gpio-f412", - feature = "gpio-f413", - feature = "gpio-f446", - ))] + #[cfg(any(gpio_f411, gpio_f412, gpio_f413, gpio_f446))] fn apply_config(config: SingleOutputPll) { let rcc = unsafe { &*RCC::ptr() }; rcc.plli2scfgr().modify(|_, w| unsafe { @@ -317,14 +302,14 @@ impl I2sPll { } } -#[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] +#[cfg(any(gpio_f427, gpio_f446, gpio_f469))] pub struct SaiPll { pub use_pll: bool, /// SAI clock (PLL output divided by the SAI clock divider). pub sai_clk: Option, } -#[cfg(any(feature = "gpio-f427", feature = "gpio-f446", feature = "gpio-f469"))] +#[cfg(any(gpio_f427, gpio_f446, gpio_f469))] impl SaiPll { pub fn unused() -> SaiPll { SaiPll { @@ -349,7 +334,7 @@ impl SaiPll { pll } - #[cfg(any(feature = "gpio-f427", feature = "gpio-f469"))] + #[cfg(any(gpio_f427, gpio_f469))] pub fn setup_shared_m(pllsrcclk: u32, m: Option, sai_clk: Option) -> SaiPll { // "m" is None if both other PLLs are not in use. let Some(m) = m else { @@ -390,7 +375,7 @@ impl SaiPll { ) } - #[cfg(not(feature = "gpio-f446"))] + #[cfg(not(gpio_f446))] fn apply_config(config: SingleOutputPll, saidiv: u32) { let rcc = unsafe { &*RCC::ptr() }; rcc.dckcfgr() @@ -401,7 +386,7 @@ impl SaiPll { rcc.pllsaicfgr() .modify(|_, w| unsafe { w.pllsain().bits(config.n).pllsaiq().bits(config.outdiv) }); } - #[cfg(feature = "gpio-f446")] + #[cfg(gpio_f446)] fn apply_config(config: SingleOutputPll, saidiv: u32) { let rcc = unsafe { &*RCC::ptr() }; rcc.dckcfgr() @@ -414,14 +399,14 @@ impl SaiPll { } } -#[cfg(not(feature = "gpio-f410"))] +#[cfg(not(gpio_f410))] struct SingleOutputPll { m: u8, n: u16, outdiv: u8, } -#[cfg(not(feature = "gpio-f410"))] +#[cfg(not(gpio_f410))] impl SingleOutputPll { fn optimize( pllsrcclk: u32, diff --git a/src/serial.rs b/src/serial.rs index 77e4f609..f55ffc6e 100644 --- a/src/serial.rs +++ b/src/serial.rs @@ -288,7 +288,7 @@ halUsart! { pac::USART1, Serial1, Rx1, Tx1 } halUsart! { pac::USART2, Serial2, Rx2, Tx2 } halUsart! { pac::USART6, Serial6, Rx6, Tx6 } -#[cfg(feature = "usart3")] +#[cfg(pac_usart3)] halUsart! { pac::USART3, Serial3, Rx3, Tx3 } impl Rx { diff --git a/src/serial/uart_impls.rs b/src/serial/uart_impls.rs index 16979c69..ad72ddf4 100644 --- a/src/serial/uart_impls.rs +++ b/src/serial/uart_impls.rs @@ -13,11 +13,11 @@ use crate::dma::{ use crate::gpio::{alt::SerialAsync as CommonPins, NoPin, PushPull}; use crate::rcc::{self, Clocks}; -#[cfg(feature = "uart4")] +#[cfg(pac_uart4)] pub(crate) use crate::pac::uart4::RegisterBlock as RegisterBlockUart; pub(crate) use crate::pac::usart1::RegisterBlock as RegisterBlockUsart; -#[cfg(feature = "uart4")] +#[cfg(pac_uart4)] impl crate::Sealed for RegisterBlockUart {} impl crate::Sealed for RegisterBlockUsart {} @@ -400,7 +400,7 @@ where { uartCommon! {} } -#[cfg(feature = "uart4")] +#[cfg(pac_uart4)] impl RegisterBlockImpl for RegisterBlockUart { fn new, WORD>( uart: UART, diff --git a/src/spi.rs b/src/spi.rs index 5d0a90dd..c40bb594 100644 --- a/src/spi.rs +++ b/src/spi.rs @@ -223,16 +223,16 @@ macro_rules! spi { spi! { pac::SPI1: Spi1, SpiSlave1 } spi! { pac::SPI2: Spi2, SpiSlave2 } -#[cfg(feature = "spi3")] +#[cfg(pac_spi3)] spi! { pac::SPI3: Spi3, SpiSlave3 } -#[cfg(feature = "spi4")] +#[cfg(pac_spi4)] spi! { pac::SPI4: Spi4, SpiSlave4 } -#[cfg(feature = "spi5")] +#[cfg(pac_spi5)] spi! { pac::SPI5: Spi5, SpiSlave5 } -#[cfg(feature = "spi6")] +#[cfg(pac_spi6)] spi! { pac::SPI6: Spi6, SpiSlave6 } pub trait SpiExt: Sized + Instance { diff --git a/src/timer.rs b/src/timer.rs index bdbf581a..117216b1 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -22,9 +22,9 @@ pub mod delay; pub use delay::*; pub mod pwm; pub use pwm::*; -#[cfg(not(feature = "gpio-f410"))] +#[cfg(not(gpio_f410))] pub mod pwm_input; -#[cfg(not(feature = "gpio-f410"))] +#[cfg(not(gpio_f410))] pub use pwm_input::PwmInput; #[cfg(feature = "rtic1")] pub mod monotonic; @@ -815,42 +815,42 @@ impl crate::ReadFlags for FTimer { } } -#[cfg(not(feature = "gpio-f410"))] -#[cfg(feature = "tim1")] +#[cfg(not(gpio_f410))] +#[cfg(pac_tim1)] hal!(pac::TIM1: [Timer1, u16, dmar: u32, c: (4, _aoe), m: tim1,]); -#[cfg(feature = "tim2")] +#[cfg(pac_tim2)] hal!(pac::TIM2: [Timer2, u32, dmar: u16, c: (4), m: tim2,]); -#[cfg(feature = "tim3")] +#[cfg(pac_tim3)] hal!(pac::TIM3: [Timer3, u16, dmar: u16, c: (4), m: tim3,]); -#[cfg(feature = "tim4")] +#[cfg(pac_tim4)] hal!(pac::TIM4: [Timer4, u16, dmar: u16, c: (4), m: tim3,]); -#[cfg(not(feature = "gpio-f410"))] -#[cfg(feature = "tim5")] +#[cfg(not(gpio_f410))] +#[cfg(pac_tim5)] hal!(pac::TIM5: [Timer5, u32, dmar: u16, c: (4), m: tim5,]); // TIM5 on F410 is 16-bit -#[cfg(feature = "gpio-f410")] -#[cfg(feature = "tim1")] +#[cfg(gpio_f410)] +#[cfg(pac_tim1)] hal!(pac::TIM1: [Timer1, u16, dmar: u16, c: (4, _aoe), m: tim1,]); -#[cfg(feature = "gpio-f410")] -#[cfg(feature = "tim5")] +#[cfg(gpio_f410)] +#[cfg(pac_tim5)] hal!(pac::TIM5: [Timer5, u16, dmar: u16, c: (4), m: tim5,]); -#[cfg(feature = "tim6")] +#[cfg(pac_tim6)] hal!(pac::TIM6: [Timer6, u16, m: tim6,]); -#[cfg(feature = "tim7")] +#[cfg(pac_tim7)] hal!(pac::TIM7: [Timer7, u16, m: tim7,]); -#[cfg(feature = "tim8")] +#[cfg(pac_tim8)] hal!(pac::TIM8: [Timer8, u16, dmar: u32, c: (4, _aoe), m: tim8,]); -#[cfg(feature = "tim9")] +#[cfg(pac_tim9)] hal!(pac::TIM9: [Timer9, u16, c: (2),]); -#[cfg(feature = "tim10")] +#[cfg(pac_tim10)] hal!(pac::TIM10: [Timer10, u16, c: (1),]); -#[cfg(feature = "tim11")] +#[cfg(pac_tim11)] hal!(pac::TIM11: [Timer11, u16, c: (1),]); -#[cfg(feature = "tim12")] +#[cfg(pac_tim12)] hal!(pac::TIM12: [Timer12, u16, c: (2),]); -#[cfg(feature = "tim13")] +#[cfg(pac_tim13)] hal!(pac::TIM13: [Timer13, u16, c: (1),]); -#[cfg(feature = "tim14")] +#[cfg(pac_tim14)] hal!(pac::TIM14: [Timer14, u16, c: (1),]); diff --git a/src/timer/monotonics.rs b/src/timer/monotonics.rs index add51d65..33a35d96 100644 --- a/src/timer/monotonics.rs +++ b/src/timer/monotonics.rs @@ -263,34 +263,34 @@ macro_rules! make_timer { }; } -#[cfg(all(feature = "tim2", feature = "rtic-tim2"))] +#[cfg(all(pac_tim2, feature = "rtic-tim2"))] make_timer!(tim2, TIM2, u32, TIMER2_OVERFLOWS, TIMER2_TQ); -#[cfg(all(feature = "tim3", feature = "rtic-tim3"))] +#[cfg(all(pac_tim3, feature = "rtic-tim3"))] make_timer!(tim3, TIM3, u16, TIMER3_OVERFLOWS, TIMER3_TQ); -#[cfg(all(feature = "tim4", feature = "rtic-tim4"))] +#[cfg(all(pac_tim4, feature = "rtic-tim4"))] make_timer!(tim4, TIM4, u16, TIMER4_OVERFLOWS, TIMER4_TQ); -#[cfg(all(feature = "tim5", feature = "rtic-tim5"))] +#[cfg(all(pac_tim5, feature = "rtic-tim5"))] make_timer!(tim5, TIM5, u16, TIMER5_OVERFLOWS, TIMER5_TQ); pub trait Irq { const IRQ: pac::Interrupt; } -#[cfg(feature = "tim2")] +#[cfg(pac_tim2)] impl Irq for pac::TIM2 { const IRQ: pac::Interrupt = pac::Interrupt::TIM2; } -#[cfg(feature = "tim3")] +#[cfg(pac_tim3)] impl Irq for pac::TIM3 { const IRQ: pac::Interrupt = pac::Interrupt::TIM3; } -#[cfg(feature = "tim4")] +#[cfg(pac_tim4)] impl Irq for pac::TIM4 { const IRQ: pac::Interrupt = pac::Interrupt::TIM4; } -#[cfg(feature = "tim5")] +#[cfg(pac_tim5)] impl Irq for pac::TIM5 { const IRQ: pac::Interrupt = pac::Interrupt::TIM5; } diff --git a/src/timer/pwm_input.rs b/src/timer/pwm_input.rs index aec7a14d..5c8a8397 100644 --- a/src/timer/pwm_input.rs +++ b/src/timer/pwm_input.rs @@ -63,7 +63,7 @@ where } } -#[cfg(not(feature = "gpio-f410"))] +#[cfg(not(gpio_f410))] macro_rules! hal { ($TIM:ty) => { impl Timer<$TIM> { @@ -188,19 +188,19 @@ macro_rules! hal { }; } -#[cfg(feature = "tim1")] +#[cfg(pac_tim1)] hal! { pac::TIM1 } -#[cfg(feature = "tim2")] +#[cfg(pac_tim2)] hal! { pac::TIM2 } -#[cfg(feature = "tim3")] +#[cfg(pac_tim3)] hal! { pac::TIM3 } -#[cfg(feature = "tim4")] +#[cfg(pac_tim4)] hal! { pac::TIM4 } -#[cfg(feature = "tim5")] +#[cfg(pac_tim5)] hal! { pac::TIM5 } -#[cfg(feature = "tim8")] +#[cfg(pac_tim8)] hal! { pac::TIM8 } -#[cfg(feature = "tim9")] +#[cfg(pac_tim9)] hal! { pac::TIM9 } -#[cfg(feature = "tim12")] +#[cfg(pac_tim12)] hal! { pac::TIM12 } diff --git a/src/uart.rs b/src/uart.rs index 392877ed..83767511 100644 --- a/src/uart.rs +++ b/src/uart.rs @@ -59,15 +59,15 @@ macro_rules! halUart { }; } -#[cfg(feature = "uart4")] +#[cfg(pac_uart4)] halUart! { pac::UART4, Serial4, Rx4, Tx4 } -#[cfg(feature = "uart5")] +#[cfg(pac_uart5)] halUart! { pac::UART5, Serial5, Rx5, Tx5 } -#[cfg(feature = "uart7")] +#[cfg(pac_uart7)] halUart! { pac::UART7, Serial7, Rx7, Tx7 } -#[cfg(feature = "uart8")] +#[cfg(pac_uart8)] halUart! { pac::UART8, Serial8, Rx8, Tx8 } -#[cfg(feature = "uart9")] +#[cfg(pac_uart9)] halUart! { pac::UART9, Serial9, Rx9, Tx9 } -#[cfg(feature = "uart10")] +#[cfg(pac_uart10)] halUart! { pac::UART10, Serial10, Rx10, Tx10 }