stm32: consolidate modules

This commit is contained in:
xoviat 2021-03-26 19:34:52 -05:00
parent 0de2748008
commit 6f597653af
5 changed files with 64 additions and 4 deletions

View File

@ -42,5 +42,7 @@ cortex-m-rt = "0.6.13"
cortex-m = "0.7.1" cortex-m = "0.7.1"
embedded-hal = { version = "0.2.4" } embedded-hal = { version = "0.2.4" }
embedded-dma = { version = "0.1.2" } embedded-dma = { version = "0.1.2" }
bxcan = "0.5.0"
nb = "*"
stm32f4xx-hal = { version = "0.8.3", features = ["rt", "can"], git = "https://github.com/stm32-rs/stm32f4xx-hal.git", optional = true } stm32f4xx-hal = { version = "0.8.3", features = ["rt", "can"], git = "https://github.com/stm32-rs/stm32f4xx-hal.git", optional = true }
stm32l0xx-hal = { version = "0.7.0", features = ["rt"], git = "https://github.com/stm32-rs/stm32l0xx-hal.git", optional = true } stm32l0xx-hal = { version = "0.7.0", features = ["rt"], optional = true }

View File

@ -95,6 +95,25 @@ macro_rules! can {
} }
} }
#[cfg(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",
))]
can! { can! {
CAN1 => (CAN1_TX, CAN1_RX0), CAN1 => (CAN1_TX, CAN1_RX0),
CAN2 => (CAN2_TX, CAN2_RX0), CAN2 => (CAN2_TX, CAN2_RX0),

View File

@ -34,3 +34,42 @@ pub mod fmt;
pub mod exti; pub mod exti;
pub mod interrupt; pub mod interrupt;
#[cfg(any(
feature = "stm32f405",
feature = "stm32f407",
feature = "stm32f412",
feature = "stm32f413",
feature = "stm32f415",
feature = "stm32f417",
feature = "stm32f423",
feature = "stm32f427",
feature = "stm32f429",
feature = "stm32f437",
feature = "stm32f439",
feature = "stm32f446",
feature = "stm32f469",
feature = "stm32f479",
))]
pub mod can;
#[cfg(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",
))]
pub mod rtc;

View File

@ -307,11 +307,11 @@ compile_error!(
"Multile chip features activated. You must activate exactly one of the following features: " "Multile chip features activated. You must activate exactly one of the following features: "
); );
pub use embassy_stm32::{exti, fmt, hal, interrupt, pac}; pub use embassy_stm32::{exti, fmt, hal, interrupt, pac, rtc};
#[cfg(not(any(feature = "stm32f401", feature = "stm32f410", feature = "stm32f411",)))] #[cfg(not(any(feature = "stm32f401", feature = "stm32f410", feature = "stm32f411",)))]
pub mod can; pub use embassy_stm32::can;
#[cfg(not(feature = "stm32f410"))] #[cfg(not(feature = "stm32f410"))]
pub mod qei; pub mod qei;
pub mod rtc;
pub mod serial; pub mod serial;