Skip to content

Commit 117c812

Browse files
Implement partial uart port to stm32f030
Missing are uart3-uart6
1 parent 8e60bd3 commit 117c812

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/serial.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,41 @@ pub enum Error {
3939

4040
pub trait Pins<USART> {}
4141

42+
#[cfg(any(feature = "stm32f030", feature = "stm32f042"))]
4243
impl Pins<USART1> for (PA9<Alternate<AF1>>, PA10<Alternate<AF1>>) {}
44+
#[cfg(any(feature = "stm32f030", feature = "stm32f042"))]
4345
impl Pins<USART1> for (PB6<Alternate<AF0>>, PB7<Alternate<AF0>>) {}
46+
#[cfg(any(feature = "stm32f030", feature = "stm32f042"))]
4447
impl Pins<USART1> for (PA9<Alternate<AF1>>, PB7<Alternate<AF0>>) {}
48+
#[cfg(any(feature = "stm32f030", feature = "stm32f042"))]
4549
impl Pins<USART1> for (PB6<Alternate<AF0>>, PA10<Alternate<AF1>>) {}
4650

51+
#[cfg(feature = "stm32f030x6")]
52+
impl Pins<USART1> for (PA2<Alternate<AF1>>, PA3<Alternate<AF1>>) {}
53+
54+
#[cfg(any(
55+
feature = "stm32f042",
56+
feature = "stm32f030x8",
57+
feature = "stm32f030xc",
58+
))]
4759
impl Pins<USART2> for (PA2<Alternate<AF1>>, PA3<Alternate<AF1>>) {}
60+
#[cfg(any(
61+
feature = "stm32f042",
62+
feature = "stm32f030x8",
63+
feature = "stm32f030xc",
64+
))]
4865
impl Pins<USART2> for (PA2<Alternate<AF1>>, PA15<Alternate<AF1>>) {}
66+
#[cfg(any(
67+
feature = "stm32f042",
68+
feature = "stm32f030x8",
69+
feature = "stm32f030xc",
70+
))]
4971
impl Pins<USART2> for (PA14<Alternate<AF1>>, PA15<Alternate<AF1>>) {}
72+
#[cfg(any(
73+
feature = "stm32f042",
74+
feature = "stm32f030x8",
75+
feature = "stm32f030xc",
76+
))]
5077
impl Pins<USART2> for (PA14<Alternate<AF1>>, PA3<Alternate<AF1>>) {}
5178

5279
/// Serial abstraction

0 commit comments

Comments
 (0)