Add support for stm32f051
This commit is contained in:
parent
e6db427c09
commit
b016ffdfe9
|
@ -53,6 +53,7 @@ stm32f030x8 = ["stm32f030"]
|
|||
stm32f030xc = ["stm32f030"]
|
||||
stm32f031 = ["stm32f0/stm32f0x1", "device-selected"]
|
||||
stm32f042 = ["stm32f0/stm32f0x2", "device-selected"]
|
||||
stm32f051 = ["stm32f0/stm32f0x1", "device-selected"]
|
||||
stm32f070 = ["stm32f0/stm32f0x0", "device-selected"]
|
||||
stm32f070x6 = ["stm32f070"]
|
||||
stm32f070xb = ["stm32f070"]
|
||||
|
|
|
@ -206,6 +206,7 @@ adc_pins!(
|
|||
|
||||
#[cfg(any(
|
||||
feature = "stm32f030",
|
||||
feature = "stm32f051",
|
||||
feature = "stm32f070",
|
||||
feature = "stm32f072",
|
||||
feature = "stm32f091"
|
||||
|
@ -353,6 +354,7 @@ impl VRef {
|
|||
#[cfg(any(
|
||||
feature = "stm32f031",
|
||||
feature = "stm32f042",
|
||||
feature = "stm32f051",
|
||||
feature = "stm32f072",
|
||||
feature = "stm32f091",
|
||||
))]
|
||||
|
@ -363,6 +365,7 @@ pub struct VBat;
|
|||
#[cfg(any(
|
||||
feature = "stm32f031",
|
||||
feature = "stm32f042",
|
||||
feature = "stm32f051",
|
||||
feature = "stm32f072",
|
||||
feature = "stm32f091",
|
||||
))]
|
||||
|
@ -373,6 +376,7 @@ adc_pins!(
|
|||
#[cfg(any(
|
||||
feature = "stm32f031",
|
||||
feature = "stm32f042",
|
||||
feature = "stm32f051",
|
||||
feature = "stm32f072",
|
||||
feature = "stm32f091",
|
||||
))]
|
||||
|
|
|
@ -570,6 +570,7 @@ gpio!(GPIOC, gpioc, iopcen, PC, [
|
|||
|
||||
#[cfg(any(
|
||||
feature = "stm32f030",
|
||||
feature = "stm32f051",
|
||||
feature = "stm32f070",
|
||||
feature = "stm32f072",
|
||||
feature = "stm32f091",
|
||||
|
@ -593,7 +594,7 @@ gpio!(GPIOC, gpioc, iopcen, PC, [
|
|||
PC15: (pc15, 15, Input<Floating>),
|
||||
]);
|
||||
|
||||
#[cfg(any(feature = "stm32f030", feature = "stm32f070"))]
|
||||
#[cfg(any(feature = "stm32f030", feature = "stm32f051", feature = "stm32f070"))]
|
||||
gpio!(GPIOD, gpiod, iopden, PD, [
|
||||
PD2: (pd2, 2, Input<Floating>),
|
||||
]);
|
||||
|
@ -648,7 +649,7 @@ gpio!(GPIOF, gpiof, iopfen, PF, [
|
|||
PF11: (pf11, 11, Input<Floating>),
|
||||
]);
|
||||
|
||||
#[cfg(feature = "stm32f030")]
|
||||
#[cfg(any(feature = "stm32f030", feature = "stm32f051"))]
|
||||
gpio!(GPIOF, gpiof, iopfen, PF, [
|
||||
PF0: (pf0, 0, Input<Floating>),
|
||||
PF1: (pf1, 1, Input<Floating>),
|
||||
|
|
|
@ -69,6 +69,7 @@ i2c_pins! {
|
|||
}
|
||||
#[cfg(any(
|
||||
feature = "stm32f031",
|
||||
feature = "stm32f051",
|
||||
feature = "stm32f070",
|
||||
feature = "stm32f072",
|
||||
feature = "stm32f091",
|
||||
|
@ -94,7 +95,7 @@ i2c_pins! {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "stm32f030x8"))]
|
||||
#[cfg(any(feature = "stm32f030x8", feature = "stm32f051"))]
|
||||
i2c_pins! {
|
||||
I2C2 => {
|
||||
scl => [gpiob::PB10<Alternate<AF1>>],
|
||||
|
@ -156,8 +157,7 @@ i2c! {
|
|||
|
||||
#[cfg(any(
|
||||
feature = "stm32f030xc",
|
||||
// XXX: This can't be right
|
||||
feature = "stm32f030xc",
|
||||
feature = "stm32f051",
|
||||
feature = "stm32f070xb",
|
||||
feature = "stm32f072",
|
||||
feature = "stm32f091",
|
||||
|
|
|
@ -6,7 +6,7 @@ pub use stm32f0;
|
|||
#[cfg(any(feature = "stm32f030", feature = "stm32f070"))]
|
||||
pub use stm32f0::stm32f0x0 as stm32;
|
||||
|
||||
#[cfg(any(feature = "stm32f031", feature = "stm32f091"))]
|
||||
#[cfg(any(feature = "stm32f031", feature = "stm32f051", feature = "stm32f091"))]
|
||||
pub use stm32f0::stm32f0x1 as stm32;
|
||||
|
||||
#[cfg(any(feature = "stm32f042", feature = "stm32f072"))]
|
||||
|
|
|
@ -85,7 +85,7 @@ macro_rules! usart_pins {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "stm32f030", feature = "stm32f042"))]
|
||||
#[cfg(any(feature = "stm32f030", feature = "stm32f042", feature = "stm32f051"))]
|
||||
usart_pins! {
|
||||
USART1 => {
|
||||
tx => [gpioa::PA9<Alternate<AF1>>, gpiob::PB6<Alternate<AF0>>],
|
||||
|
@ -111,10 +111,12 @@ usart_pins! {
|
|||
rx => [gpioa::PA10<Alternate<AF1>>, gpiob::PB7<Alternate<AF0>>],
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(
|
||||
feature = "stm32f030x8",
|
||||
feature = "stm32f030xc",
|
||||
feature = "stm32f042",
|
||||
feature = "stm32f051",
|
||||
feature = "stm32f070",
|
||||
feature = "stm32f072",
|
||||
feature = "stm32f091",
|
||||
|
@ -283,6 +285,7 @@ usart! {
|
|||
feature = "stm32f030x8",
|
||||
feature = "stm32f030xc",
|
||||
feature = "stm32f042",
|
||||
feature = "stm32f051",
|
||||
feature = "stm32f070",
|
||||
feature = "stm32f072",
|
||||
feature = "stm32f091",
|
||||
|
|
|
@ -133,6 +133,7 @@ spi_pins! {
|
|||
#[cfg(any(
|
||||
feature = "stm32f030x8",
|
||||
feature = "stm32f030xc",
|
||||
feature = "stm32f051",
|
||||
feature = "stm32f070xb",
|
||||
feature = "stm32f072",
|
||||
feature = "stm32f091",
|
||||
|
@ -204,6 +205,7 @@ spi! {
|
|||
#[cfg(any(
|
||||
feature = "stm32f030x8",
|
||||
feature = "stm32f030xc",
|
||||
feature = "stm32f051",
|
||||
feature = "stm32f070xb",
|
||||
feature = "stm32f091",
|
||||
))]
|
||||
|
|
|
@ -225,6 +225,7 @@ timers! {
|
|||
#[cfg(any(
|
||||
feature = "stm32f030x8",
|
||||
feature = "stm32f030xc",
|
||||
feature = "stm32f051",
|
||||
feature = "stm32f070xb",
|
||||
feature = "stm32f072",
|
||||
feature = "stm32f091",
|
||||
|
@ -247,6 +248,7 @@ timers! {
|
|||
#[cfg(any(
|
||||
feature = "stm32f031",
|
||||
feature = "stm32f042",
|
||||
feature = "stm32f051",
|
||||
feature = "stm32f072",
|
||||
feature = "stm32f091",
|
||||
))]
|
||||
|
|
Loading…
Reference in New Issue