aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxoviat <[email protected]>2021-03-26 19:34:52 -0500
committerxoviat <[email protected]>2021-03-26 19:34:52 -0500
commit6f597653afff99e3da1b442354258565f06005f6 (patch)
tree3e085a5ba402708df8e74f8d6d833702117a9c67
parent0de274800844ba9aa30bd21aa217642f109e8e7e (diff)
stm32: consolidate modules
-rw-r--r--embassy-stm32/Cargo.toml4
-rw-r--r--embassy-stm32/src/can.rs (renamed from embassy-stm32f4/src/can.rs)19
-rw-r--r--embassy-stm32/src/lib.rs39
-rw-r--r--embassy-stm32/src/rtc.rs (renamed from embassy-stm32f4/src/rtc.rs)0
-rw-r--r--embassy-stm32f4/src/lib.rs6
5 files changed, 64 insertions, 4 deletions
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml
index 6701ff8f3..3fae66e9e 100644
--- a/embassy-stm32/Cargo.toml
+++ b/embassy-stm32/Cargo.toml
@@ -42,5 +42,7 @@ cortex-m-rt = "0.6.13"
42cortex-m = "0.7.1" 42cortex-m = "0.7.1"
43embedded-hal = { version = "0.2.4" } 43embedded-hal = { version = "0.2.4" }
44embedded-dma = { version = "0.1.2" } 44embedded-dma = { version = "0.1.2" }
45bxcan = "0.5.0"
46nb = "*"
45stm32f4xx-hal = { version = "0.8.3", features = ["rt", "can"], git = "https://github.com/stm32-rs/stm32f4xx-hal.git", optional = true } 47stm32f4xx-hal = { version = "0.8.3", features = ["rt", "can"], git = "https://github.com/stm32-rs/stm32f4xx-hal.git", optional = true }
46stm32l0xx-hal = { version = "0.7.0", features = ["rt"], git = "https://github.com/stm32-rs/stm32l0xx-hal.git", optional = true } \ No newline at end of file 48stm32l0xx-hal = { version = "0.7.0", features = ["rt"], optional = true } \ No newline at end of file
diff --git a/embassy-stm32f4/src/can.rs b/embassy-stm32/src/can.rs
index 526d002c0..f97e900ea 100644
--- a/embassy-stm32f4/src/can.rs
+++ b/embassy-stm32/src/can.rs
@@ -95,6 +95,25 @@ macro_rules! can {
95 } 95 }
96} 96}
97 97
98#[cfg(any(
99 feature = "stm32f401",
100 feature = "stm32f405",
101 feature = "stm32f407",
102 feature = "stm32f410",
103 feature = "stm32f411",
104 feature = "stm32f412",
105 feature = "stm32f413",
106 feature = "stm32f415",
107 feature = "stm32f417",
108 feature = "stm32f423",
109 feature = "stm32f427",
110 feature = "stm32f429",
111 feature = "stm32f437",
112 feature = "stm32f439",
113 feature = "stm32f446",
114 feature = "stm32f469",
115 feature = "stm32f479",
116))]
98can! { 117can! {
99 CAN1 => (CAN1_TX, CAN1_RX0), 118 CAN1 => (CAN1_TX, CAN1_RX0),
100 CAN2 => (CAN2_TX, CAN2_RX0), 119 CAN2 => (CAN2_TX, CAN2_RX0),
diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs
index 954067f32..8a1fe5a36 100644
--- a/embassy-stm32/src/lib.rs
+++ b/embassy-stm32/src/lib.rs
@@ -34,3 +34,42 @@ pub mod fmt;
34 34
35pub mod exti; 35pub mod exti;
36pub mod interrupt; 36pub mod interrupt;
37
38#[cfg(any(
39 feature = "stm32f405",
40 feature = "stm32f407",
41 feature = "stm32f412",
42 feature = "stm32f413",
43 feature = "stm32f415",
44 feature = "stm32f417",
45 feature = "stm32f423",
46 feature = "stm32f427",
47 feature = "stm32f429",
48 feature = "stm32f437",
49 feature = "stm32f439",
50 feature = "stm32f446",
51 feature = "stm32f469",
52 feature = "stm32f479",
53))]
54pub mod can;
55
56#[cfg(any(
57 feature = "stm32f401",
58 feature = "stm32f405",
59 feature = "stm32f407",
60 feature = "stm32f410",
61 feature = "stm32f411",
62 feature = "stm32f412",
63 feature = "stm32f413",
64 feature = "stm32f415",
65 feature = "stm32f417",
66 feature = "stm32f423",
67 feature = "stm32f427",
68 feature = "stm32f429",
69 feature = "stm32f437",
70 feature = "stm32f439",
71 feature = "stm32f446",
72 feature = "stm32f469",
73 feature = "stm32f479",
74))]
75pub mod rtc;
diff --git a/embassy-stm32f4/src/rtc.rs b/embassy-stm32/src/rtc.rs
index 824a47072..824a47072 100644
--- a/embassy-stm32f4/src/rtc.rs
+++ b/embassy-stm32/src/rtc.rs
diff --git a/embassy-stm32f4/src/lib.rs b/embassy-stm32f4/src/lib.rs
index bdd4d0fda..eb6f04f88 100644
--- a/embassy-stm32f4/src/lib.rs
+++ b/embassy-stm32f4/src/lib.rs
@@ -307,11 +307,11 @@ compile_error!(
307 "Multile chip features activated. You must activate exactly one of the following features: " 307 "Multile chip features activated. You must activate exactly one of the following features: "
308); 308);
309 309
310pub use embassy_stm32::{exti, fmt, hal, interrupt, pac}; 310pub use embassy_stm32::{exti, fmt, hal, interrupt, pac, rtc};
311 311
312#[cfg(not(any(feature = "stm32f401", feature = "stm32f410", feature = "stm32f411",)))] 312#[cfg(not(any(feature = "stm32f401", feature = "stm32f410", feature = "stm32f411",)))]
313pub mod can; 313pub use embassy_stm32::can;
314
314#[cfg(not(feature = "stm32f410"))] 315#[cfg(not(feature = "stm32f410"))]
315pub mod qei; 316pub mod qei;
316pub mod rtc;
317pub mod serial; 317pub mod serial;