Add support for stm32f038

This commit is contained in:
Jesse Braham 2019-01-13 18:37:47 -08:00
parent 7e0b205292
commit 95aadbbe18
8 changed files with 34 additions and 11 deletions

View File

@ -55,6 +55,7 @@ stm32f030x6 = ["stm32f030"]
stm32f030x8 = ["stm32f030"]
stm32f030xc = ["stm32f030"]
stm32f031 = ["stm32f0/stm32f0x1", "device-selected"]
stm32f038 = ["stm32f0/stm32f0x8", "device-selected"]
stm32f042 = ["stm32f0/stm32f0x2", "device-selected"]
stm32f051 = ["stm32f0/stm32f0x1", "device-selected"]
stm32f070 = ["stm32f0/stm32f0x0", "device-selected"]

View File

@ -354,6 +354,7 @@ impl VRef {
#[cfg(any(
feature = "stm32f031",
feature = "stm32f038",
feature = "stm32f042",
feature = "stm32f051",
feature = "stm32f071",
@ -366,6 +367,7 @@ pub struct VBat;
#[cfg(any(
feature = "stm32f031",
feature = "stm32f038",
feature = "stm32f042",
feature = "stm32f051",
feature = "stm32f071",
@ -378,6 +380,7 @@ adc_pins!(
#[cfg(any(
feature = "stm32f031",
feature = "stm32f038",
feature = "stm32f042",
feature = "stm32f051",
feature = "stm32f071",

View File

@ -561,7 +561,7 @@ gpio!(GPIOB, gpiob, iopben, PB, [
PB15: (pb15, 15, Input<Floating>),
]);
#[cfg(feature = "stm32f042")]
#[cfg(any(feature = "stm32f038", feature = "stm32f042"))]
gpio!(GPIOC, gpioc, iopcen, PC, [
PC13: (pc13, 13, Input<Floating>),
PC14: (pc14, 14, Input<Floating>),
@ -643,13 +643,6 @@ gpio!(GPIOD, gpiod, iopden, PD, [
// PE15: (pe15, 15, Input<Floating>),
// ]);
#[cfg(feature = "stm32f042")]
gpio!(GPIOF, gpiof, iopfen, PF, [
PF0: (pf0, 0, Input<Floating>),
PF1: (pf1, 1, Input<Floating>),
PF11: (pf11, 11, Input<Floating>),
]);
#[cfg(any(feature = "stm32f030", feature = "stm32f051"))]
gpio!(GPIOF, gpiof, iopfen, PF, [
PF0: (pf0, 0, Input<Floating>),
@ -666,6 +659,21 @@ gpio!(GPIOF, gpiof, iopfen, PF, [
PF7: (pf7, 7, Input<Floating>),
]);
#[cfg(feature = "stm32f038")]
gpio!(GPIOF, gpiof, iopfen, PF, [
PF0: (pf0, 0, Input<Floating>),
PF1: (pf1, 1, Input<Floating>),
PF6: (pf6, 6, Input<Floating>),
PF7: (pf7, 7, Input<Floating>),
]);
#[cfg(feature = "stm32f042")]
gpio!(GPIOF, gpiof, iopfen, PF, [
PF0: (pf0, 0, Input<Floating>),
PF1: (pf1, 1, Input<Floating>),
PF11: (pf11, 11, Input<Floating>),
]);
#[cfg(feature = "stm32f070")]
gpio!(GPIOF, gpiof, iopfen, PF, [
PF0: (pf0, 0, Input<Floating>),

View File

@ -36,6 +36,7 @@ macro_rules! i2c_pins {
#[cfg(any(
feature = "stm32f030",
feature = "stm32f031",
feature = "stm32f038",
feature = "stm32f042",
feature = "stm32f051",
feature = "stm32f070",
@ -69,7 +70,12 @@ i2c_pins! {
sda => [gpioa::PA12<Alternate<AF5>>],
}
}
#[cfg(any(feature = "stm32f031", feature = "stm32f042", feature = "stm32f030x6"))]
#[cfg(any(
feature = "stm32f031",
feature = "stm32f038",
feature = "stm32f042",
feature = "stm32f030x6",
))]
i2c_pins! {
I2C1 => {
scl => [gpiob::PB10<Alternate<AF1>>],

View File

@ -17,6 +17,9 @@ pub use stm32f0::stm32f0x1 as stm32;
#[cfg(any(feature = "stm32f042", feature = "stm32f072"))]
pub use stm32f0::stm32f0x2 as stm32;
#[cfg(feature = "stm32f038")]
pub use stm32f0::stm32f0x8 as stm32;
#[cfg(feature = "device-selected")]
pub mod adc;
#[cfg(feature = "device-selected")]

View File

@ -126,7 +126,7 @@ usart_pins! {
rx => [gpioa::PA10<Alternate<AF1>>, gpiob::PB6<Alternate<AF0>>],
}
}
#[cfg(any(feature = "stm32f031", feature = "stm32f030x6"))]
#[cfg(any(feature = "stm32f030x6", feature = "stm32f031", feature = "stm32f038"))]
usart_pins! {
USART1 => {
tx => [gpioa::PA2<Alternate<AF1>>, gpioa::PA14<Alternate<AF1>>],
@ -135,6 +135,7 @@ usart_pins! {
}
#[cfg(any(
feature = "stm32f031",
feature = "stm32f038",
feature = "stm32f070",
feature = "stm32f072",
feature = "stm32f091",

View File

@ -112,7 +112,7 @@ spi_pins! {
mosi => [gpioa::PA7<Alternate<AF0>>, gpiob::PB5<Alternate<AF0>>],
}
}
#[cfg(feature = "stm32f030x6")]
#[cfg(any(feature = "stm32f030x6", feature = "stm32f038"))]
spi_pins! {
SPI1 => {
sck => [gpiob::PB13<Alternate<AF0>>],

View File

@ -224,6 +224,7 @@ timers! {
#[cfg(any(
feature = "stm32f031",
feature = "stm32f038",
feature = "stm32f042",
feature = "stm32f051",
feature = "stm32f071",