Skip to content

Commit d741438

Browse files
authored
I2C - Fix typo, and import I2C3 for stm32l4x5 (#170)
1 parent 3fb9920 commit d741438

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/i2c.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
use crate::gpio::{Alternate, OpenDrain, Output, AF4};
44
use crate::hal::blocking::i2c::{Read, Write, WriteRead};
55
use crate::rcc::{Clocks, APB1R1};
6+
#[cfg(feature = "stm32l4x5")]
7+
use crate::stm32::I2C3;
68
use crate::stm32::{i2c1, I2C1, I2C2};
79
use crate::time::Hertz;
810
use cast::u8;
@@ -75,8 +77,8 @@ impl StartCondition {
7577
use StartCondition::*;
7678
match self {
7779
FirstAndLast => w.start().start().autoend().automatic(),
78-
First => w.start().start().reload().not_competed(),
79-
Middle => w.start().no_start().reload().not_competed(),
80+
First => w.start().start().reload().not_completed(),
81+
Middle => w.start().no_start().reload().not_completed(),
8082
Last => w.start().no_start().autoend().automatic(),
8183
}
8284
}
@@ -538,10 +540,3 @@ pins!(I2C2, AF4, SCL: [PB13], SDA: [PB14]);
538540

539541
#[cfg(feature = "stm32l4x5")]
540542
pins!(I2C3, AF4, SCL: [PC0], SDA: [PC1]);
541-
542-
#[cfg(feature = "stm32l4x5")]
543-
use crate::stm32::I2C3;
544-
#[cfg(feature = "stm32l4x5")]
545-
hal! {
546-
I2C3: (i2c3, i2c3en, i2c3rst),
547-
}

0 commit comments

Comments
 (0)