Skip to content

Commit cc0a32c

Browse files
danielgallagher0Sh3Rm4n
authored andcommitted
Update SPI impls for STM32F328
Based on the datasheet, the following pins and peripherals are supported: - SPI1: - SCK: PA5<AF5>, PB3<AF5> - MISO: PA6<AF5>, PB4<AF5> - MOSI: PA7<AF5>, PB5<AF5>
1 parent 25d7773 commit cc0a32c

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/spi.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,18 @@ use crate::gpio::gpioa::{PA5, PA6, PA7};
3434
feature = "stm32f302",
3535
feature = "stm32f303",
3636
feature = "stm32f318",
37-
feature = "stm32f328",
3837
feature = "stm32f334",
3938
feature = "stm32f358",
4039
feature = "stm32f398"
4140
))]
4241
use crate::gpio::gpiob::PB13;
4342
use crate::gpio::gpiob::{PB14, PB15, PB5};
44-
#[cfg(any(feature = "stm32f302", feature = "stm32f303", feature = "stm32f318",))]
43+
#[cfg(any(
44+
feature = "stm32f302",
45+
feature = "stm32f303",
46+
feature = "stm32f318",
47+
feature = "stm32f328",
48+
))]
4549
use crate::gpio::gpiob::{PB3, PB4};
4650
use crate::gpio::gpioc::{PC10, PC11, PC12};
4751
#[cfg(any(
@@ -82,7 +86,6 @@ use crate::rcc::Clocks;
8286
feature = "stm32f303xd",
8387
feature = "stm32f303xe",
8488
feature = "stm32f318",
85-
feature = "stm32f328",
8689
feature = "stm32f358",
8790
feature = "stm32f373",
8891
feature = "stm32f378",
@@ -134,7 +137,8 @@ unsafe impl SckPin<SPI1> for PA5<AF5> {}
134137
feature = "stm32f302xc",
135138
feature = "stm32f302xd",
136139
feature = "stm32f302xe",
137-
feature = "stm32f303"
140+
feature = "stm32f303",
141+
feature = "stm32f328",
138142
))]
139143
unsafe impl SckPin<SPI1> for PB3<AF5> {}
140144

@@ -143,7 +147,6 @@ unsafe impl SckPin<SPI1> for PB3<AF5> {}
143147
feature = "stm32f302",
144148
feature = "stm32f303",
145149
feature = "stm32f318",
146-
feature = "stm32f328",
147150
feature = "stm32f334",
148151
feature = "stm32f358",
149152
feature = "stm32f398"
@@ -212,7 +215,8 @@ unsafe impl MisoPin<SPI1> for PA6<AF5> {}
212215
feature = "stm32f302xc",
213216
feature = "stm32f302xd",
214217
feature = "stm32f302xe",
215-
feature = "stm32f303"
218+
feature = "stm32f303",
219+
feature = "stm32f328",
216220
))]
217221
unsafe impl MisoPin<SPI1> for PB4<AF5> {}
218222

@@ -468,6 +472,7 @@ macro_rules! hal {
468472
#[cfg(any(
469473
feature = "stm32f303x6",
470474
feature = "stm32f303x8",
475+
feature = "stm32f328",
471476
feature = "stm32f334",
472477
))]
473478
hal! {
@@ -490,7 +495,6 @@ hal! {
490495
feature = "stm32f302xc",
491496
feature = "stm32f303xb",
492497
feature = "stm32f303xc",
493-
feature = "stm32f328",
494498
feature = "stm32f358",
495499
feature = "stm32f373",
496500
feature = "stm32f378",

0 commit comments

Comments
 (0)