Skip to content

Commit bf2ded1

Browse files
authored
i2c and serial feature gates for stm32l4{5,6}2 devices (#325)
* Feature-gate PB6 and PB7 for i2c4 for stm32l452 and stm32l462 devices * Feature-gate serial peripherals for stm32l452 and stm32l462 devices Co-authored-by: Tobias Naumann <[email protected]>
1 parent 945c6a4 commit bf2ded1

File tree

2 files changed

+39
-6
lines changed

2 files changed

+39
-6
lines changed

src/i2c.rs

+2
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,8 @@ mod stm32l4x2_pins {
536536
pins!(I2C4, 3, SCL: [PB10], SDA: [PB11]);
537537
#[cfg(any(feature = "stm32l452", feature = "stm32l462"))]
538538
pins!(I2C4, 4, SCL: [PD12], SDA: [PD13]);
539+
#[cfg(any(feature = "stm32l452", feature = "stm32l462"))]
540+
pins!(I2C4, 5, SCL: [PB6], SDA: [PB7]);
539541
}
540542

541543
#[cfg(any(feature = "stm32l433", feature = "stm32l443"))]

src/serial.rs

+37-6
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ use crate::time::{Bps, U32Ext};
2424

2525
#[cfg(any(
2626
//feature = "stm32l451", // missing PAC support
27-
// feature = "stm32l452", // missing PAC support
28-
// feature = "stm32l462", // missing PAC support
27+
feature = "stm32l452",
28+
feature = "stm32l462",
2929
// feature = "stm32l471", // missing PAC support
3030
feature = "stm32l475",
3131
feature = "stm32l476",
@@ -858,8 +858,8 @@ hal! {
858858

859859
#[cfg(any(
860860
// feature = "stm32l451", // missing PAC support
861-
// feature = "stm32l452", // missing PAC support
862-
// feature = "stm32l462", // missing PAC support
861+
feature = "stm32l452", // missing PAC support
862+
feature = "stm32l462", // missing PAC support
863863
// feature = "stm32l471", // missing PAC support
864864
feature = "stm32l475",
865865
feature = "stm32l476",
@@ -1035,8 +1035,39 @@ impl_pin_traits! {
10351035

10361036
#[cfg(any(
10371037
// feature = "stm32l451",
1038-
// feature = "stm32l452",
1039-
// feature = "stm32l462",
1038+
feature = "stm32l452",
1039+
feature = "stm32l462",
1040+
// feature = "stm32l471",
1041+
// feature = "stm32l475",
1042+
// feature = "stm32l476",
1043+
// feature = "stm32l485",
1044+
// feature = "stm32l486",
1045+
// feature = "stm32l496",
1046+
// feature = "stm32l4a6",
1047+
// feature = "stm32l4p5",
1048+
// feature = "stm32l4q5",
1049+
// feature = "stm32l4r5",
1050+
// feature = "stm32l4s5",
1051+
// feature = "stm32l4r7",
1052+
// feature = "stm32l4s7",
1053+
// feature = "stm32l4r9",
1054+
// feature = "stm32l4s9",
1055+
))]
1056+
impl_pin_traits! {
1057+
USART3: {
1058+
7: {
1059+
TX: ;
1060+
RX: ;
1061+
RTS_DE: PA15;
1062+
CTS: ;
1063+
}
1064+
}
1065+
}
1066+
1067+
#[cfg(any(
1068+
// feature = "stm32l451",
1069+
feature = "stm32l452",
1070+
feature = "stm32l462",
10401071
// feature = "stm32l471",
10411072
feature = "stm32l475",
10421073
feature = "stm32l476",

0 commit comments

Comments
 (0)