Skip to content

Commit 259a610

Browse files
danielgallagher0Sh3Rm4n
authored andcommitted
Update SPI impls for STM32F358
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> - SPI2: - SCK: PB13<AF5>, PF9<AF5>, PF10<AF5> - MISO: PB14<AF5> - MOSI: PB15<AF5> - SPI3: - SCK: PC10<AF6> - MISO: PC11<AF6> - MOSI: PC12<AF6>
1 parent cc0a32c commit 259a610

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/spi.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ use crate::gpio::gpiob::{PB14, PB15, PB5};
4545
feature = "stm32f303",
4646
feature = "stm32f318",
4747
feature = "stm32f328",
48+
feature = "stm32f358",
4849
))]
4950
use crate::gpio::gpiob::{PB3, PB4};
5051
use crate::gpio::gpioc::{PC10, PC11, PC12};
@@ -73,7 +74,8 @@ use crate::gpio::gpiof::PF1;
7374
feature = "stm32f303xb",
7475
feature = "stm32f303xc",
7576
feature = "stm32f303xd",
76-
feature = "stm32f303xe"
77+
feature = "stm32f303xe",
78+
feature = "stm32f358",
7779
))]
7880
use crate::gpio::gpiof::{PF10, PF9};
7981
use crate::gpio::{AF5, AF6};
@@ -139,6 +141,7 @@ unsafe impl SckPin<SPI1> for PA5<AF5> {}
139141
feature = "stm32f302xe",
140142
feature = "stm32f303",
141143
feature = "stm32f328",
144+
feature = "stm32f358",
142145
))]
143146
unsafe impl SckPin<SPI1> for PB3<AF5> {}
144147

@@ -170,7 +173,8 @@ unsafe impl SckPin<SPI2> for PF1<AF5> {}
170173
feature = "stm32f303xb",
171174
feature = "stm32f303xc",
172175
feature = "stm32f303xd",
173-
feature = "stm32f303xe"
176+
feature = "stm32f303xe",
177+
feature = "stm32f358",
174178
))]
175179
unsafe impl SckPin<SPI2> for PF9<AF5> {}
176180
#[cfg(any(
@@ -181,7 +185,8 @@ unsafe impl SckPin<SPI2> for PF9<AF5> {}
181185
feature = "stm32f303xb",
182186
feature = "stm32f303xc",
183187
feature = "stm32f303xd",
184-
feature = "stm32f303xe"
188+
feature = "stm32f303xe",
189+
feature = "stm32f358",
185190
))]
186191
unsafe impl SckPin<SPI2> for PF10<AF5> {}
187192

@@ -217,6 +222,7 @@ unsafe impl MisoPin<SPI1> for PA6<AF5> {}
217222
feature = "stm32f302xe",
218223
feature = "stm32f303",
219224
feature = "stm32f328",
225+
feature = "stm32f358",
220226
))]
221227
unsafe impl MisoPin<SPI1> for PB4<AF5> {}
222228

0 commit comments

Comments
 (0)