Skip to content

Commit 1f1a238

Browse files
committed
merge f7xx-hal
1 parent 64ff76c commit 1f1a238

File tree

11 files changed

+2182
-1
lines changed

11 files changed

+2182
-1
lines changed

Cargo.toml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ git = "https://github.com/stm32-rs/stm32-rs-nightlies"
7070
features = ["defmt", "atomics"]
7171
optional = true
7272

73+
[dependencies.stm32f2]
74+
git = "https://github.com/stm32-rs/stm32-rs-nightlies"
75+
features = ["defmt", "atomics"]
76+
optional = true
77+
7378
[dependencies.stm32f7]
7479
git = "https://github.com/stm32-rs/stm32-rs-nightlies"
7580
features = ["defmt", "atomics"]
@@ -130,6 +135,7 @@ default-features = false
130135
features = ["macros"]
131136

132137
[features]
138+
f2 = ["dep:stm32f2", "bb", "dma", "i2c_v1", "spi_v1", "uart_v2"]
133139
f4 = ["dep:stm32f4", "bb", "dma", "i2c_v1", "spi_v1", "uart_v2"]
134140
f7 = [
135141
"dep:stm32f7",
@@ -141,6 +147,61 @@ f7 = [
141147
"uart_v3",
142148
]
143149

150+
# F2
151+
152+
stm32f215 = ["svd-f215"]
153+
stm32f217 = ["svd-f217"]
154+
155+
svd-f215 = ["f2", "stm32f2?/stm32f215", "gpio-f217"]
156+
svd-f217 = ["f2", "stm32f2?/stm32f217", "gpio-f217"]
157+
158+
159+
gpio-f217 = [
160+
"can1",
161+
"can2",
162+
"dcmi",
163+
"eth",
164+
"fsmc",
165+
"gpioc",
166+
"gpiod",
167+
"gpioe",
168+
"gpiof",
169+
"gpiog",
170+
"gpioh",
171+
"gpioi",
172+
"i2c2",
173+
"i2c3",
174+
"i2s",
175+
"i2s2",
176+
"i2s3",
177+
"rtc",
178+
"sdio",
179+
"spi1",
180+
"spi2",
181+
"spi3",
182+
"sys",
183+
"tim1",
184+
"tim10",
185+
"tim11",
186+
"tim12",
187+
"tim13",
188+
"tim14",
189+
"tim2",
190+
"tim3",
191+
"tim4",
192+
"tim5",
193+
"tim8",
194+
"tim9",
195+
"uart4",
196+
"uart5",
197+
"usart1",
198+
"usart2",
199+
"usart3",
200+
"usart6",
201+
"otg-fs",
202+
"otg-hs",
203+
]
204+
144205
# F4
145206

146207
#! Use one of the supported STM32-serie related features:

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@ stm32f4xx-hal
99
[![Continuous integration](https://github.com/stm32-rs/stm32f4xx-hal/workflows/Continuous%20integration/badge.svg)](https://github.com/stm32-rs/stm32f4xx-hal)
1010

1111
_stm32f4xx-hal_ contains a multi device hardware abstraction on top of the
12-
peripheral access API for the STMicro STM32F4/F7 series microcontrollers. The
12+
peripheral access API for the STMicro STM32F2/F4/F7 series microcontrollers. The
1313
selection of the MCU is done by feature gates, typically specified by board
1414
support crates. Currently supported configurations are:
1515

1616
<table>
1717
<tr>
1818
<td>
1919

20+
* stm32f215
21+
* stm32f217
22+
*
2023
* stm32f401
2124
* stm32f405
2225
* stm32f407

src/adc.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ use core::fmt;
141141

142142
pub mod config;
143143

144+
#[cfg(feature = "f2")]
145+
mod f2;
146+
144147
#[cfg(feature = "f4")]
145148
mod f4;
146149

src/dma/traits.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,12 @@ macro_rules! dma_map {
351351
}
352352
use dma_map;
353353

354+
#[cfg(feature = "f2")]
355+
mod f2;
356+
#[allow(unused)]
357+
#[cfg(feature = "f2")]
358+
pub use f2::*;
359+
354360
#[cfg(feature = "f4")]
355361
mod f4;
356362
#[allow(unused)]

src/gpio.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,11 @@ macro_rules! gpio {
618618
}
619619
use gpio;
620620

621+
#[cfg(feature = "f2")]
622+
mod f2;
623+
#[cfg(feature = "f2")]
624+
pub use f2::*;
625+
621626
#[cfg(feature = "f4")]
622627
mod f4;
623628
#[cfg(feature = "f4")]

src/gpio/alt.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#[cfg(feature = "f2")]
2+
mod f2;
3+
#[cfg(feature = "f2")]
4+
pub use f2::*;
5+
16
#[cfg(feature = "f4")]
27
mod f4;
38
#[cfg(feature = "f4")]

0 commit comments

Comments
 (0)