embassy/embassy-stm32f4/src/lib.rs

318 lines
16 KiB
Rust
Raw Normal View History

2020-12-28 16:17:36 +01:00
#![no_std]
#![feature(generic_associated_types)]
#![feature(asm)]
#![feature(type_alias_impl_trait)]
2021-02-26 01:06:58 +01:00
#![allow(incomplete_features)]
2020-12-28 16:17:36 +01:00
#[cfg(not(any(
feature = "stm32f401",
feature = "stm32f405",
feature = "stm32f407",
feature = "stm32f410",
feature = "stm32f411",
feature = "stm32f412",
feature = "stm32f413",
feature = "stm32f415",
feature = "stm32f417",
feature = "stm32f423",
feature = "stm32f427",
feature = "stm32f429",
feature = "stm32f437",
feature = "stm32f439",
feature = "stm32f446",
feature = "stm32f469",
feature = "stm32f479",
)))]
compile_error!(
"No chip feature activated. You must activate exactly one of the following features: "
);
#[cfg(any(
all(feature = "stm32f401", feature = "stm32f405"),
all(feature = "stm32f401", feature = "stm32f407"),
all(feature = "stm32f401", feature = "stm32f410"),
all(feature = "stm32f401", feature = "stm32f411"),
all(feature = "stm32f401", feature = "stm32f412"),
all(feature = "stm32f401", feature = "stm32f413"),
all(feature = "stm32f401", feature = "stm32f415"),
all(feature = "stm32f401", feature = "stm32f417"),
all(feature = "stm32f401", feature = "stm32f423"),
all(feature = "stm32f401", feature = "stm32f427"),
all(feature = "stm32f401", feature = "stm32f429"),
all(feature = "stm32f401", feature = "stm32f437"),
all(feature = "stm32f401", feature = "stm32f439"),
all(feature = "stm32f401", feature = "stm32f446"),
all(feature = "stm32f401", feature = "stm32f469"),
all(feature = "stm32f401", feature = "stm32f479"),
all(feature = "stm32f405", feature = "stm32f401"),
all(feature = "stm32f405", feature = "stm32f407"),
all(feature = "stm32f405", feature = "stm32f410"),
all(feature = "stm32f405", feature = "stm32f411"),
all(feature = "stm32f405", feature = "stm32f412"),
all(feature = "stm32f405", feature = "stm32f413"),
all(feature = "stm32f405", feature = "stm32f415"),
all(feature = "stm32f405", feature = "stm32f417"),
all(feature = "stm32f405", feature = "stm32f423"),
all(feature = "stm32f405", feature = "stm32f427"),
all(feature = "stm32f405", feature = "stm32f429"),
all(feature = "stm32f405", feature = "stm32f437"),
all(feature = "stm32f405", feature = "stm32f439"),
all(feature = "stm32f405", feature = "stm32f446"),
all(feature = "stm32f405", feature = "stm32f469"),
all(feature = "stm32f405", feature = "stm32f479"),
all(feature = "stm32f407", feature = "stm32f401"),
all(feature = "stm32f407", feature = "stm32f405"),
all(feature = "stm32f407", feature = "stm32f410"),
all(feature = "stm32f407", feature = "stm32f411"),
all(feature = "stm32f407", feature = "stm32f412"),
all(feature = "stm32f407", feature = "stm32f413"),
all(feature = "stm32f407", feature = "stm32f415"),
all(feature = "stm32f407", feature = "stm32f417"),
all(feature = "stm32f407", feature = "stm32f423"),
all(feature = "stm32f407", feature = "stm32f427"),
all(feature = "stm32f407", feature = "stm32f429"),
all(feature = "stm32f407", feature = "stm32f437"),
all(feature = "stm32f407", feature = "stm32f439"),
all(feature = "stm32f407", feature = "stm32f446"),
all(feature = "stm32f407", feature = "stm32f469"),
all(feature = "stm32f407", feature = "stm32f479"),
all(feature = "stm32f410", feature = "stm32f401"),
all(feature = "stm32f410", feature = "stm32f405"),
all(feature = "stm32f410", feature = "stm32f407"),
all(feature = "stm32f410", feature = "stm32f411"),
all(feature = "stm32f410", feature = "stm32f412"),
all(feature = "stm32f410", feature = "stm32f413"),
all(feature = "stm32f410", feature = "stm32f415"),
all(feature = "stm32f410", feature = "stm32f417"),
all(feature = "stm32f410", feature = "stm32f423"),
all(feature = "stm32f410", feature = "stm32f427"),
all(feature = "stm32f410", feature = "stm32f429"),
all(feature = "stm32f410", feature = "stm32f437"),
all(feature = "stm32f410", feature = "stm32f439"),
all(feature = "stm32f410", feature = "stm32f446"),
all(feature = "stm32f410", feature = "stm32f469"),
all(feature = "stm32f410", feature = "stm32f479"),
all(feature = "stm32f411", feature = "stm32f401"),
all(feature = "stm32f411", feature = "stm32f405"),
all(feature = "stm32f411", feature = "stm32f407"),
all(feature = "stm32f411", feature = "stm32f410"),
all(feature = "stm32f411", feature = "stm32f412"),
all(feature = "stm32f411", feature = "stm32f413"),
all(feature = "stm32f411", feature = "stm32f415"),
all(feature = "stm32f411", feature = "stm32f417"),
all(feature = "stm32f411", feature = "stm32f423"),
all(feature = "stm32f411", feature = "stm32f427"),
all(feature = "stm32f411", feature = "stm32f429"),
all(feature = "stm32f411", feature = "stm32f437"),
all(feature = "stm32f411", feature = "stm32f439"),
all(feature = "stm32f411", feature = "stm32f446"),
all(feature = "stm32f411", feature = "stm32f469"),
all(feature = "stm32f411", feature = "stm32f479"),
all(feature = "stm32f412", feature = "stm32f401"),
all(feature = "stm32f412", feature = "stm32f405"),
all(feature = "stm32f412", feature = "stm32f407"),
all(feature = "stm32f412", feature = "stm32f410"),
all(feature = "stm32f412", feature = "stm32f411"),
all(feature = "stm32f412", feature = "stm32f413"),
all(feature = "stm32f412", feature = "stm32f415"),
all(feature = "stm32f412", feature = "stm32f417"),
all(feature = "stm32f412", feature = "stm32f423"),
all(feature = "stm32f412", feature = "stm32f427"),
all(feature = "stm32f412", feature = "stm32f429"),
all(feature = "stm32f412", feature = "stm32f437"),
all(feature = "stm32f412", feature = "stm32f439"),
all(feature = "stm32f412", feature = "stm32f446"),
all(feature = "stm32f412", feature = "stm32f469"),
all(feature = "stm32f412", feature = "stm32f479"),
all(feature = "stm32f413", feature = "stm32f401"),
all(feature = "stm32f413", feature = "stm32f405"),
all(feature = "stm32f413", feature = "stm32f407"),
all(feature = "stm32f413", feature = "stm32f410"),
all(feature = "stm32f413", feature = "stm32f411"),
all(feature = "stm32f413", feature = "stm32f412"),
all(feature = "stm32f413", feature = "stm32f415"),
all(feature = "stm32f413", feature = "stm32f417"),
all(feature = "stm32f413", feature = "stm32f423"),
all(feature = "stm32f413", feature = "stm32f427"),
all(feature = "stm32f413", feature = "stm32f429"),
all(feature = "stm32f413", feature = "stm32f437"),
all(feature = "stm32f413", feature = "stm32f439"),
all(feature = "stm32f413", feature = "stm32f446"),
all(feature = "stm32f413", feature = "stm32f469"),
all(feature = "stm32f413", feature = "stm32f479"),
all(feature = "stm32f415", feature = "stm32f401"),
all(feature = "stm32f415", feature = "stm32f405"),
all(feature = "stm32f415", feature = "stm32f407"),
all(feature = "stm32f415", feature = "stm32f410"),
all(feature = "stm32f415", feature = "stm32f411"),
all(feature = "stm32f415", feature = "stm32f412"),
all(feature = "stm32f415", feature = "stm32f413"),
all(feature = "stm32f415", feature = "stm32f417"),
all(feature = "stm32f415", feature = "stm32f423"),
all(feature = "stm32f415", feature = "stm32f427"),
all(feature = "stm32f415", feature = "stm32f429"),
all(feature = "stm32f415", feature = "stm32f437"),
all(feature = "stm32f415", feature = "stm32f439"),
all(feature = "stm32f415", feature = "stm32f446"),
all(feature = "stm32f415", feature = "stm32f469"),
all(feature = "stm32f415", feature = "stm32f479"),
all(feature = "stm32f417", feature = "stm32f401"),
all(feature = "stm32f417", feature = "stm32f405"),
all(feature = "stm32f417", feature = "stm32f407"),
all(feature = "stm32f417", feature = "stm32f410"),
all(feature = "stm32f417", feature = "stm32f411"),
all(feature = "stm32f417", feature = "stm32f412"),
all(feature = "stm32f417", feature = "stm32f413"),
all(feature = "stm32f417", feature = "stm32f415"),
all(feature = "stm32f417", feature = "stm32f423"),
all(feature = "stm32f417", feature = "stm32f427"),
all(feature = "stm32f417", feature = "stm32f429"),
all(feature = "stm32f417", feature = "stm32f437"),
all(feature = "stm32f417", feature = "stm32f439"),
all(feature = "stm32f417", feature = "stm32f446"),
all(feature = "stm32f417", feature = "stm32f469"),
all(feature = "stm32f417", feature = "stm32f479"),
all(feature = "stm32f423", feature = "stm32f401"),
all(feature = "stm32f423", feature = "stm32f405"),
all(feature = "stm32f423", feature = "stm32f407"),
all(feature = "stm32f423", feature = "stm32f410"),
all(feature = "stm32f423", feature = "stm32f411"),
all(feature = "stm32f423", feature = "stm32f412"),
all(feature = "stm32f423", feature = "stm32f413"),
all(feature = "stm32f423", feature = "stm32f415"),
all(feature = "stm32f423", feature = "stm32f417"),
all(feature = "stm32f423", feature = "stm32f427"),
all(feature = "stm32f423", feature = "stm32f429"),
all(feature = "stm32f423", feature = "stm32f437"),
all(feature = "stm32f423", feature = "stm32f439"),
all(feature = "stm32f423", feature = "stm32f446"),
all(feature = "stm32f423", feature = "stm32f469"),
all(feature = "stm32f423", feature = "stm32f479"),
all(feature = "stm32f427", feature = "stm32f401"),
all(feature = "stm32f427", feature = "stm32f405"),
all(feature = "stm32f427", feature = "stm32f407"),
all(feature = "stm32f427", feature = "stm32f410"),
all(feature = "stm32f427", feature = "stm32f411"),
all(feature = "stm32f427", feature = "stm32f412"),
all(feature = "stm32f427", feature = "stm32f413"),
all(feature = "stm32f427", feature = "stm32f415"),
all(feature = "stm32f427", feature = "stm32f417"),
all(feature = "stm32f427", feature = "stm32f423"),
all(feature = "stm32f427", feature = "stm32f429"),
all(feature = "stm32f427", feature = "stm32f437"),
all(feature = "stm32f427", feature = "stm32f439"),
all(feature = "stm32f427", feature = "stm32f446"),
all(feature = "stm32f427", feature = "stm32f469"),
all(feature = "stm32f427", feature = "stm32f479"),
all(feature = "stm32f429", feature = "stm32f401"),
all(feature = "stm32f429", feature = "stm32f405"),
all(feature = "stm32f429", feature = "stm32f407"),
all(feature = "stm32f429", feature = "stm32f410"),
all(feature = "stm32f429", feature = "stm32f411"),
all(feature = "stm32f429", feature = "stm32f412"),
all(feature = "stm32f429", feature = "stm32f413"),
all(feature = "stm32f429", feature = "stm32f415"),
all(feature = "stm32f429", feature = "stm32f417"),
all(feature = "stm32f429", feature = "stm32f423"),
all(feature = "stm32f429", feature = "stm32f427"),
all(feature = "stm32f429", feature = "stm32f437"),
all(feature = "stm32f429", feature = "stm32f439"),
all(feature = "stm32f429", feature = "stm32f446"),
all(feature = "stm32f429", feature = "stm32f469"),
all(feature = "stm32f429", feature = "stm32f479"),
all(feature = "stm32f437", feature = "stm32f401"),
all(feature = "stm32f437", feature = "stm32f405"),
all(feature = "stm32f437", feature = "stm32f407"),
all(feature = "stm32f437", feature = "stm32f410"),
all(feature = "stm32f437", feature = "stm32f411"),
all(feature = "stm32f437", feature = "stm32f412"),
all(feature = "stm32f437", feature = "stm32f413"),
all(feature = "stm32f437", feature = "stm32f415"),
all(feature = "stm32f437", feature = "stm32f417"),
all(feature = "stm32f437", feature = "stm32f423"),
all(feature = "stm32f437", feature = "stm32f427"),
all(feature = "stm32f437", feature = "stm32f429"),
all(feature = "stm32f437", feature = "stm32f439"),
all(feature = "stm32f437", feature = "stm32f446"),
all(feature = "stm32f437", feature = "stm32f469"),
all(feature = "stm32f437", feature = "stm32f479"),
all(feature = "stm32f439", feature = "stm32f401"),
all(feature = "stm32f439", feature = "stm32f405"),
all(feature = "stm32f439", feature = "stm32f407"),
all(feature = "stm32f439", feature = "stm32f410"),
all(feature = "stm32f439", feature = "stm32f411"),
all(feature = "stm32f439", feature = "stm32f412"),
all(feature = "stm32f439", feature = "stm32f413"),
all(feature = "stm32f439", feature = "stm32f415"),
all(feature = "stm32f439", feature = "stm32f417"),
all(feature = "stm32f439", feature = "stm32f423"),
all(feature = "stm32f439", feature = "stm32f427"),
all(feature = "stm32f439", feature = "stm32f429"),
all(feature = "stm32f439", feature = "stm32f437"),
all(feature = "stm32f439", feature = "stm32f446"),
all(feature = "stm32f439", feature = "stm32f469"),
all(feature = "stm32f439", feature = "stm32f479"),
all(feature = "stm32f446", feature = "stm32f401"),
all(feature = "stm32f446", feature = "stm32f405"),
all(feature = "stm32f446", feature = "stm32f407"),
all(feature = "stm32f446", feature = "stm32f410"),
all(feature = "stm32f446", feature = "stm32f411"),
all(feature = "stm32f446", feature = "stm32f412"),
all(feature = "stm32f446", feature = "stm32f413"),
all(feature = "stm32f446", feature = "stm32f415"),
all(feature = "stm32f446", feature = "stm32f417"),
all(feature = "stm32f446", feature = "stm32f423"),
all(feature = "stm32f446", feature = "stm32f427"),
all(feature = "stm32f446", feature = "stm32f429"),
all(feature = "stm32f446", feature = "stm32f437"),
all(feature = "stm32f446", feature = "stm32f439"),
all(feature = "stm32f446", feature = "stm32f469"),
all(feature = "stm32f446", feature = "stm32f479"),
all(feature = "stm32f469", feature = "stm32f401"),
all(feature = "stm32f469", feature = "stm32f405"),
all(feature = "stm32f469", feature = "stm32f407"),
all(feature = "stm32f469", feature = "stm32f410"),
all(feature = "stm32f469", feature = "stm32f411"),
all(feature = "stm32f469", feature = "stm32f412"),
all(feature = "stm32f469", feature = "stm32f413"),
all(feature = "stm32f469", feature = "stm32f415"),
all(feature = "stm32f469", feature = "stm32f417"),
all(feature = "stm32f469", feature = "stm32f423"),
all(feature = "stm32f469", feature = "stm32f427"),
all(feature = "stm32f469", feature = "stm32f429"),
all(feature = "stm32f469", feature = "stm32f437"),
all(feature = "stm32f469", feature = "stm32f439"),
all(feature = "stm32f469", feature = "stm32f446"),
all(feature = "stm32f469", feature = "stm32f479"),
all(feature = "stm32f479", feature = "stm32f401"),
all(feature = "stm32f479", feature = "stm32f405"),
all(feature = "stm32f479", feature = "stm32f407"),
all(feature = "stm32f479", feature = "stm32f410"),
all(feature = "stm32f479", feature = "stm32f411"),
all(feature = "stm32f479", feature = "stm32f412"),
all(feature = "stm32f479", feature = "stm32f413"),
all(feature = "stm32f479", feature = "stm32f415"),
all(feature = "stm32f479", feature = "stm32f417"),
all(feature = "stm32f479", feature = "stm32f423"),
all(feature = "stm32f479", feature = "stm32f427"),
all(feature = "stm32f479", feature = "stm32f429"),
all(feature = "stm32f479", feature = "stm32f437"),
all(feature = "stm32f479", feature = "stm32f439"),
all(feature = "stm32f479", feature = "stm32f446"),
all(feature = "stm32f479", feature = "stm32f469"),
))]
compile_error!(
"Multile chip features activated. You must activate exactly one of the following features: "
);
pub use stm32f4xx_hal as hal;
pub use stm32f4xx_hal::stm32 as pac;
// This mod MUST go first, so that the others see its macros.
pub(crate) mod fmt;
2021-01-21 18:08:38 +01:00
pub mod exti;
2020-12-31 04:14:56 +01:00
pub mod interrupt;
2021-02-16 01:38:36 +01:00
pub mod rtc;
2020-12-30 02:10:47 +01:00
pub mod serial;