Skip to content

Commit

Permalink
Fix the mappings a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
david-sawatzke committed Jan 24, 2019
1 parent 221ef90 commit be3604f
Showing 1 changed file with 34 additions and 33 deletions.
67 changes: 34 additions & 33 deletions src/pin_mappings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::gpio::gpiob::*;
#[allow(unused)]
#[cfg(feature = "device-selected")]
use crate::gpio::gpioc::*;
#[cfg(feature = "stm32f030xc")]
#[cfg(feature = "stm32f030")]
use crate::gpio::gpiod::*;
#[allow(unused)]
#[cfg(feature = "device-selected")]
Expand Down Expand Up @@ -58,31 +58,7 @@ pins! {
PA12 => {AF5: SdaPin<I2C1>}
}

#[cfg(feature = "stm32f030x6")]
pins! {
PA2 => {AF1: TxPin<USART1>},
PA3 => {AF1: RxPin<USART1>},
PA14 => {AF1: TxPin<USART1>},
PA15 => {AF1: RxPin<USART1>},
PB13 => {AF0: SckPin<SPI1>},
PB14 => {AF0: MisoPin<SPI1>},
PB15 => {AF0: MosiPin<SPI1>}
}

#[cfg(any(
feature = "stm32f030x8",
feature = "stm32f030xc",
feature = "stm32f042",
feature = "stm32f070",
))]
pins! {
PA2 => {AF1: TxPin<USART2>},
PA3 => {AF1: RxPin<USART2>},
PA14 => {AF1: TxPin<USART2>},
PA15 => {AF1: RxPin<USART2>}
}

#[cfg(any(feature = "stm32f030xc", feature = "stm32f070xb"))]
#[cfg(any(feature = "stm32f030", feature = "stm32f070"))]
pins! {
PA0 => {AF4: TxPin<USART4>},
PA1 => {AF4: RxPin<USART4>},
Expand All @@ -105,7 +81,7 @@ pins! {
}
}

#[cfg(feature = "stm32f030xc")]
#[cfg(feature = "stm32f030")]
pins! {
PA4 => {AF5: TxPin<USART6>},
PA5 => {AF5: RxPin<USART6>},
Expand All @@ -117,6 +93,29 @@ pins! {
PD2 => {AF2: TxPin<USART5>}
}

#[cfg(feature = "stm32f030x6")]
pins! {
PA2 => {AF1: TxPin<USART1>},
PA3 => {AF1: RxPin<USART1>},
PA14 => {AF1: TxPin<USART1>},
PA15 => {AF1: RxPin<USART1>},
PB13 => {AF0: SckPin<SPI1>},
PB14 => {AF0: MisoPin<SPI1>},
PB15 => {AF0: MosiPin<SPI1>}
}

#[cfg(any(
feature = "stm32f030x8",
feature = "stm32f030xc",
feature = "stm32f042",
feature = "stm32f070",
))]
pins! {
PA2 => {AF1: TxPin<USART2>},
PA3 => {AF1: RxPin<USART2>},
PA14 => {AF1: TxPin<USART2>},
PA15 => {AF1: RxPin<USART2>}
}
#[cfg(any(
feature = "stm32f030x8",
feature = "stm32f030xc",
Expand All @@ -132,39 +131,41 @@ pins! {
feature = "stm32f030x6",
feature = "stm32f030xc",
feature = "stm32f042",
feature = "stm32f070x6",
feature = "stm32f070x6"
))]
pins! {
PA9 => {AF4: SclPin<I2C1>},
PA10 => {AF4: SdaPin<I2C1>}
}

#[cfg(any(
feature = "stm32f042",
feature = "stm32f030x6",
feature = "stm32f030x8",
feature = "stm32f030xc",
feature = "stm32f042",
feature = "stm32f070xb"
))]
pins! {
PB10 => {AF1: SclPin<I2C1>},
PB11 => {AF1: SdaPin<I2C1>}
}

#[cfg(any(feature = "stm32f030x8", feature = "stm32f030xc"))]
pins! {
PB10 => {AF1: SclPin<I2C2>},
PB11 => {AF1: SdaPin<I2C1>}
}
#[cfg(any(
feature = "stm32f042",
feature = "stm32f030xc",
feature = "stm32f070x6",
))]
pins! {
PF1 => {AF1: SclPin<I2C1>},
PF0 => {AF1: SdaPin<I2C1>}
PF1 => {AF1: SclPin<I2C1>},
}

#[cfg(any(
feature = "stm32f042",
feature = "stm32f030xc",
feature = "stm32f030xc",
feature = "stm32f070xb"
))]
pins! {
Expand Down

0 comments on commit be3604f

Please sign in to comment.