From be3604f962b65ba95c44a2d0aa38241fef7b2cf7 Mon Sep 17 00:00:00 2001 From: David Sawatzke Date: Tue, 1 Jan 2019 17:39:36 +0100 Subject: [PATCH] Fix the mappings a bit --- src/pin_mappings.rs | 67 +++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/src/pin_mappings.rs b/src/pin_mappings.rs index 4d3b183..0858775 100644 --- a/src/pin_mappings.rs +++ b/src/pin_mappings.rs @@ -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")] @@ -58,31 +58,7 @@ pins! { PA12 => {AF5: SdaPin} } -#[cfg(feature = "stm32f030x6")] -pins! { - PA2 => {AF1: TxPin}, - PA3 => {AF1: RxPin}, - PA14 => {AF1: TxPin}, - PA15 => {AF1: RxPin}, - PB13 => {AF0: SckPin}, - PB14 => {AF0: MisoPin}, - PB15 => {AF0: MosiPin} -} - -#[cfg(any( - feature = "stm32f030x8", - feature = "stm32f030xc", - feature = "stm32f042", - feature = "stm32f070", -))] -pins! { - PA2 => {AF1: TxPin}, - PA3 => {AF1: RxPin}, - PA14 => {AF1: TxPin}, - PA15 => {AF1: RxPin} -} - -#[cfg(any(feature = "stm32f030xc", feature = "stm32f070xb"))] +#[cfg(any(feature = "stm32f030", feature = "stm32f070"))] pins! { PA0 => {AF4: TxPin}, PA1 => {AF4: RxPin}, @@ -105,7 +81,7 @@ pins! { } } -#[cfg(feature = "stm32f030xc")] +#[cfg(feature = "stm32f030")] pins! { PA4 => {AF5: TxPin}, PA5 => {AF5: RxPin}, @@ -117,6 +93,29 @@ pins! { PD2 => {AF2: TxPin} } +#[cfg(feature = "stm32f030x6")] +pins! { + PA2 => {AF1: TxPin}, + PA3 => {AF1: RxPin}, + PA14 => {AF1: TxPin}, + PA15 => {AF1: RxPin}, + PB13 => {AF0: SckPin}, + PB14 => {AF0: MisoPin}, + PB15 => {AF0: MosiPin} +} + +#[cfg(any( + feature = "stm32f030x8", + feature = "stm32f030xc", + feature = "stm32f042", + feature = "stm32f070", +))] +pins! { + PA2 => {AF1: TxPin}, + PA3 => {AF1: RxPin}, + PA14 => {AF1: TxPin}, + PA15 => {AF1: RxPin} +} #[cfg(any( feature = "stm32f030x8", feature = "stm32f030xc", @@ -132,7 +131,7 @@ pins! { feature = "stm32f030x6", feature = "stm32f030xc", feature = "stm32f042", - feature = "stm32f070x6", + feature = "stm32f070x6" ))] pins! { PA9 => {AF4: SclPin}, @@ -140,10 +139,8 @@ pins! { } #[cfg(any( - feature = "stm32f042", feature = "stm32f030x6", - feature = "stm32f030x8", - feature = "stm32f030xc", + feature = "stm32f042", feature = "stm32f070xb" ))] pins! { @@ -151,20 +148,24 @@ pins! { PB11 => {AF1: SdaPin} } +#[cfg(any(feature = "stm32f030x8", feature = "stm32f030xc"))] +pins! { + PB10 => {AF1: SclPin}, + PB11 => {AF1: SdaPin} +} #[cfg(any( feature = "stm32f042", feature = "stm32f030xc", feature = "stm32f070x6", ))] pins! { - PF1 => {AF1: SclPin}, PF0 => {AF1: SdaPin} + PF1 => {AF1: SclPin}, } #[cfg(any( feature = "stm32f042", feature = "stm32f030xc", - feature = "stm32f030xc", feature = "stm32f070xb" ))] pins! {