diff --git a/Cargo.toml b/Cargo.toml index b52ddad..7d279dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ edition = "2018" authors = [ "Daniel Egger ", "Thomas Bytheway ", + "Jesse Braham ", ] categories = [ "embedded", diff --git a/src/gpio.rs b/src/gpio.rs index 1efa46d..2ffb10f 100644 --- a/src/gpio.rs +++ b/src/gpio.rs @@ -561,7 +561,12 @@ gpio!(GPIOB, gpiob, iopben, PB, [ PB15: (pb15, 15, Input), ]); -#[cfg(any(feature = "stm32f038", feature = "stm32f042", feature = "stm32f048"))] +#[cfg(any( + feature = "stm32f031", + feature = "stm32f038", + feature = "stm32f042", + feature = "stm32f048", +))] gpio!(GPIOC, gpioc, iopcen, PC, [ PC13: (pc13, 13, Input), PC14: (pc14, 14, Input), @@ -634,7 +639,6 @@ gpio!(GPIOD, gpiod, iopden, PD, [ // TODO: The ST SVD files are missing the entire PE enable register. // Re-enable as soon as this gets fixed. - // #[cfg(any( // feature = "stm32f071", // feature = "stm32f072", @@ -661,7 +665,13 @@ gpio!(GPIOD, gpiod, iopden, PD, [ // PE15: (pe15, 15, Input), // ]); -#[cfg(any(feature = "stm32f030", feature = "stm32f051", feature = "stm32f058"))] +#[cfg(any( + feature = "stm32f030x4", + feature = "stm32f030x6", + feature = "stm32f030x8", + feature = "stm32f051", + feature = "stm32f058", +))] gpio!(GPIOF, gpiof, iopfen, PF, [ PF0: (pf0, 0, Input), PF1: (pf1, 1, Input), @@ -670,34 +680,24 @@ gpio!(GPIOF, gpiof, iopfen, PF, [ PF6: (pf6, 6, Input), PF7: (pf7, 7, Input), ]); - -#[cfg(feature = "stm32f031")] +#[cfg(any(feature = "stm32f030xc", feature = "stm32f070"))] gpio!(GPIOF, gpiof, iopfen, PF, [ - PF6: (pf6, 6, Input), - PF7: (pf7, 7, Input), + PF0: (pf0, 0, Input), + PF1: (pf1, 1, Input), ]); - -#[cfg(feature = "stm32f038")] +#[cfg(any(feature = "stm32f031", feature = "stm32f038"))] gpio!(GPIOF, gpiof, iopfen, PF, [ PF0: (pf0, 0, Input), PF1: (pf1, 1, Input), PF6: (pf6, 6, Input), PF7: (pf7, 7, Input), ]); - #[cfg(any(feature = "stm32f042", feature = "stm32f048"))] gpio!(GPIOF, gpiof, iopfen, PF, [ PF0: (pf0, 0, Input), PF1: (pf1, 1, Input), PF11: (pf11, 11, Input), ]); - -#[cfg(feature = "stm32f070")] -gpio!(GPIOF, gpiof, iopfen, PF, [ - PF0: (pf0, 0, Input), - PF1: (pf1, 1, Input), -]); - #[cfg(any( feature = "stm32f071", feature = "stm32f072", diff --git a/src/i2c.rs b/src/i2c.rs index a8708f5..60c738e 100644 --- a/src/i2c.rs +++ b/src/i2c.rs @@ -55,11 +55,14 @@ i2c_pins! { } } #[cfg(any( + feature = "stm32f030x4", feature = "stm32f030x6", feature = "stm32f030xc", feature = "stm32f031", + feature = "stm32f038", feature = "stm32f042", feature = "stm32f048", + feature = "stm32f070x6", feature = "stm32f091", feature = "stm32f098", ))] @@ -77,11 +80,12 @@ i2c_pins! { } } #[cfg(any( + feature = "stm32f030x4", + feature = "stm32f030x6", feature = "stm32f031", feature = "stm32f038", feature = "stm32f042", feature = "stm32f048", - feature = "stm32f030x6", ))] i2c_pins! { I2C1 => { @@ -96,21 +100,14 @@ i2c_pins! { sda => [gpiob::PB14>], } } -#[cfg(any(feature = "stm32f042", feature = "stm32f030xc", feature = "stm32f098"))] -i2c_pins! { - I2C1 => { - scl => [gpiof::PF1>], - sda => [gpiof::PF0>], - } -} -#[cfg(feature = "stm32f070x6")] -i2c_pins! { - I2C1 => { - scl => [gpioa::PA9>, gpiof::PF0>], - sda => [gpioa::PA10>, gpiof::PF1>], - } -} -#[cfg(feature = "stm32f091")] +#[cfg(any( + feature = "stm32f030xc", + feature = "stm32f042", + feature = "stm32f048", + feature = "stm32f070x6", + feature = "stm32f091", + feature = "stm32f098", +))] i2c_pins! { I2C1 => { scl => [gpiof::PF1>], @@ -182,6 +179,7 @@ i2c! { } #[cfg(any( + feature = "stm32f030x8", feature = "stm32f030xc", feature = "stm32f051", feature = "stm32f058", diff --git a/src/serial.rs b/src/serial.rs index 11d9253..52a3cbd 100644 --- a/src/serial.rs +++ b/src/serial.rs @@ -135,7 +135,12 @@ usart_pins! { rx => [gpioa::PA10>, gpiob::PB7>], } } -#[cfg(any(feature = "stm32f030x6", feature = "stm32f031", feature = "stm32f038"))] +#[cfg(any( + feature = "stm32f030x4", + feature = "stm32f030x6", + feature = "stm32f031", + feature = "stm32f038", +))] usart_pins! { USART1 => { tx => [gpioa::PA2>, gpioa::PA14>], @@ -164,8 +169,8 @@ usart_pins! { } } #[cfg(any( - feature = "stm32f072", feature = "stm32f071", + feature = "stm32f072", feature = "stm32f078", feature = "stm32f091", feature = "stm32f098", @@ -210,10 +215,9 @@ usart_pins! { rx => [gpiod::PD9>], } } - // TODO: The ST SVD files are missing the entire PE enable register. // Re-enable as soon as this gets fixed. -// #[cfg(feature = "stm32f091")] +// #[cfg(any(feature = "stm32f091", feature = "stm32f098"))] // usart_pins! { // USART4 => { // tx => [gpioe::PE8>], @@ -224,14 +228,21 @@ usart_pins! { #[cfg(any(feature = "stm32f030xc", feature = "stm32f091", feature = "stm32f098"))] usart_pins! { USART5 => { - tx => [gpiob::PB3>, gpioc::PC12>], - rx => [gpiob::PB4>, gpiod::PD2>], + tx => [gpioc::PC12>], + rx => [gpiod::PD2>], } USART6 => { tx => [gpioa::PA4>, gpioc::PC0>], rx => [gpioa::PA5>, gpioc::PC1>], } } +#[cfg(any(feature = "stm32f030xc", feature = "stm32f091"))] +usart_pins! { + USART5 => { + tx => [gpiob::PB3>], + rx => [gpiob::PB4>], + } +} // TODO: The ST SVD files are missing the entire PE enable register. // Re-enable as soon as this gets fixed. #[cfg(any(feature = "stm32f091", feature = "stm32f098"))] diff --git a/src/spi.rs b/src/spi.rs index 12ddeb9..1c4bdf0 100644 --- a/src/spi.rs +++ b/src/spi.rs @@ -49,11 +49,13 @@ use crate::stm32::SPI1; #[cfg(any( feature = "stm32f030x8", feature = "stm32f030xc", + feature = "stm32f042", feature = "stm32f048", feature = "stm32f051", feature = "stm32f058", feature = "stm32f070xb", feature = "stm32f071", + feature = "stm32f072", feature = "stm32f078", feature = "stm32f091", feature = "stm32f098", @@ -116,7 +118,12 @@ spi_pins! { mosi => [gpioa::PA7>, gpiob::PB5>], } } -#[cfg(any(feature = "stm32f030x6", feature = "stm32f038"))] +#[cfg(any( + feature = "stm32f030x4", + feature = "stm32f030x6", + feature = "stm32f031", + feature = "stm32f038", +))] spi_pins! { SPI1 => { sck => [gpiob::PB13>], @@ -145,6 +152,7 @@ spi_pins! { #[cfg(any( feature = "stm32f030x8", feature = "stm32f030xc", + feature = "stm32f042", feature = "stm32f048", feature = "stm32f051", feature = "stm32f058", @@ -231,11 +239,13 @@ spi! { #[cfg(any( feature = "stm32f030x8", feature = "stm32f030xc", + feature = "stm32f042", feature = "stm32f048", feature = "stm32f051", feature = "stm32f058", feature = "stm32f070xb", feature = "stm32f071", + feature = "stm32f072", feature = "stm32f078", feature = "stm32f091", feature = "stm32f098", diff --git a/src/timers.rs b/src/timers.rs index f33ad69..0454521 100644 --- a/src/timers.rs +++ b/src/timers.rs @@ -259,6 +259,7 @@ timers! { #[cfg(any( feature = "stm32f030xc", feature = "stm32f070xb", + feature = "stm32f071", feature = "stm32f072", feature = "stm32f078", feature = "stm32f091",