Skip to content

Commit 35946d6

Browse files
authored
Merge pull request #222 from akloboucnik/spi2-enabled-for-stm32l4x2
Enable SPI2 for all stm32l4x2 chips, some variants have it
2 parents e0b7d55 + ca6a43e commit 35946d6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/spi.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
//! Serial Peripheral Interface (SPI) bus
2+
//!
3+
//! The PACs and SVDs are not set up granularity enough to handle all peripheral configurations.
4+
//! SPI2 is enabled for stm32l4x2 feature at a HAL level even though some variants do and some
5+
//! don't have it (L432xx and L442xx don't, L452xx does). Users of this MCU variant that
6+
//! don't have it shouldn't attempt to use it. Relevant info is on user-manual level.
27
38
use core::ptr;
49

@@ -261,6 +266,7 @@ macro_rules! hal {
261266

262267
#[cfg(any(
263268
feature = "stm32l4x1",
269+
feature = "stm32l4x2",
264270
feature = "stm32l4x3",
265271
feature = "stm32l4x5",
266272
feature = "stm32l4x6",
@@ -331,6 +337,7 @@ pins!(SPI3, AF6, SCK: [PG9], MISO: [PG10], MOSI: [PG11]);
331337

332338
#[cfg(any(
333339
feature = "stm32l4x1",
340+
feature = "stm32l4x2",
334341
feature = "stm32l4x3",
335342
feature = "stm32l4x5",
336343
feature = "stm32l4x6",
@@ -339,6 +346,7 @@ use crate::stm32::SPI2;
339346

340347
#[cfg(any(
341348
feature = "stm32l4x1",
349+
feature = "stm32l4x2",
342350
feature = "stm32l4x3",
343351
feature = "stm32l4x5",
344352
feature = "stm32l4x6",
@@ -349,6 +357,7 @@ hal! {
349357

350358
#[cfg(any(
351359
feature = "stm32l4x1",
360+
feature = "stm32l4x2",
352361
feature = "stm32l4x3",
353362
feature = "stm32l4x5",
354363
feature = "stm32l4x6",

0 commit comments

Comments
 (0)