Skip to content

Commit 742b92b

Browse files
committed
src/i2c.rs: define stm32l4+ pins
1 parent b432c9f commit 742b92b

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

src/i2c.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,3 +609,37 @@ mod stm32l4x6_pins {
609609
// pins!(I2C2, AF4, SCL: [PH4], SDA: [PH5]);
610610
// pins!(I2C3, AF4, SCL: [PH7], SDA: [PH8]);
611611
}
612+
613+
#[cfg(any(
614+
// feature = "stm32l4p5",
615+
// feature = "stm32l4q5",
616+
// feature = "stm32l4r5",
617+
// feature = "stm32l4s5",
618+
// feature = "stm32l4r7",
619+
// feature = "stm32l4s7",
620+
feature = "stm32l4r9",
621+
feature = "stm32l4s9",
622+
))]
623+
mod stm32l4r9_pins {
624+
use super::{I2C1, I2C2, I2C3, I2C4};
625+
use crate::gpio::*;
626+
use gpioa::PA7;
627+
use gpiob::{PB10, PB11, PB13, PB14, PB4, PB6, PB7, PB8, PB9};
628+
use gpioc::{PC0, PC1, PC9};
629+
use gpiod::{PD12, PD13};
630+
use gpiof::{PF0, PF1, PF14, PF15};
631+
use gpiog::{PG13, PG14, PG7, PG8};
632+
// use gpioh::{PH4, PH5, PH7, PH8};
633+
634+
pins!(I2C1, 4, SCL: [PB6, PB8, PG14], SDA: [PB7, PB9, PG13]);
635+
636+
pins!(I2C2, 4, SCL: [PB10, PB13, PF1], SDA: [PB11, PB14, PF0]);
637+
// pins!(I2C2, 4, SCL: [PH4], SDA: [PH5]);
638+
639+
pins!(I2C3, 4, SCL: [PA7, PC0, PG7], SDA: [PB4, PC1, PC9, PG8]);
640+
// pins!(I2C3, 4, SCL: [PH7], SDA: [PH8]);
641+
642+
pins!(I2C4, 3, SCL: [PB10], SDA: [PB11]);
643+
pins!(I2C4, 3, SCL: [PD12, PF14], SDA: [PD13, PF15]);
644+
pins!(I2C4, 5, SCL: [PB6], SDA: [PB7]);
645+
}

0 commit comments

Comments
 (0)