Skip to content

Commit 49f7505

Browse files
authored
Merge pull request #349 from stm32-rs/i2c
From for i2c::Mode
2 parents b2682bd + 6cfea8d commit 49f7505

File tree

9 files changed

+653
-560
lines changed

9 files changed

+653
-560
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1515

1616
### Added
1717

18+
- `From<Into<Hertz>>` for `i2c::Mode`
1819
- `exti_rtic` example
1920
- Support for OpenDrain pin configuration on SPI CLK and MOSI pins
2021
- LSB/MSB bit format selection for `SPI`

src/can.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,12 @@ use crate::pac::CAN2;
3333
use crate::pac::USB;
3434
use crate::pac::{CAN1, RCC};
3535

36-
mod sealed {
37-
pub trait Sealed {}
38-
}
39-
40-
pub trait Pins: sealed::Sealed {
36+
pub trait Pins: crate::Sealed {
4137
type Instance;
4238
fn remap(mapr: &mut MAPR);
4339
}
4440

45-
impl sealed::Sealed for (PA12<Alternate<PushPull>>, PA11<Input<Floating>>) {}
41+
impl crate::Sealed for (PA12<Alternate<PushPull>>, PA11<Input<Floating>>) {}
4642
impl Pins for (PA12<Alternate<PushPull>>, PA11<Input<Floating>>) {
4743
type Instance = CAN1;
4844

@@ -54,7 +50,7 @@ impl Pins for (PA12<Alternate<PushPull>>, PA11<Input<Floating>>) {
5450
}
5551
}
5652

57-
impl sealed::Sealed for (PB9<Alternate<PushPull>>, PB8<Input<Floating>>) {}
53+
impl crate::Sealed for (PB9<Alternate<PushPull>>, PB8<Input<Floating>>) {}
5854
impl Pins for (PB9<Alternate<PushPull>>, PB8<Input<Floating>>) {
5955
type Instance = CAN1;
6056

@@ -67,7 +63,7 @@ impl Pins for (PB9<Alternate<PushPull>>, PB8<Input<Floating>>) {
6763
}
6864

6965
#[cfg(feature = "connectivity")]
70-
impl sealed::Sealed for (PB13<Alternate<PushPull>>, PB12<Input<Floating>>) {}
66+
impl crate::Sealed for (PB13<Alternate<PushPull>>, PB12<Input<Floating>>) {}
7167
#[cfg(feature = "connectivity")]
7268
impl Pins for (PB13<Alternate<PushPull>>, PB12<Input<Floating>>) {
7369
type Instance = CAN2;
@@ -78,7 +74,7 @@ impl Pins for (PB13<Alternate<PushPull>>, PB12<Input<Floating>>) {
7874
}
7975

8076
#[cfg(feature = "connectivity")]
81-
impl sealed::Sealed for (PB6<Alternate<PushPull>>, PB5<Input<Floating>>) {}
77+
impl crate::Sealed for (PB6<Alternate<PushPull>>, PB5<Input<Floating>>) {}
8278
#[cfg(feature = "connectivity")]
8379
impl Pins for (PB6<Alternate<PushPull>>, PB5<Input<Floating>>) {
8480
type Instance = CAN2;

0 commit comments

Comments
 (0)