Browse Source

Add support for stm32f058

trying.tmp
Jesse Braham 4 years ago
parent
commit
c79c69c0f3
  1. 1
      Cargo.toml
  2. 4
      src/adc.rs
  3. 12
      src/gpio.rs
  4. 4
      src/i2c.rs
  5. 2
      src/lib.rs
  6. 3
      src/serial.rs
  7. 3
      src/spi.rs
  8. 2
      src/timers.rs

1
Cargo.toml

@ -59,6 +59,7 @@ stm32f038 = ["stm32f0/stm32f0x8", "device-selected"]
stm32f042 = ["stm32f0/stm32f0x2", "device-selected"]
stm32f048 = ["stm32f0/stm32f0x8", "device-selected"]
stm32f051 = ["stm32f0/stm32f0x1", "device-selected"]
stm32f058 = ["stm32f0/stm32f0x8", "device-selected"]
stm32f070 = ["stm32f0/stm32f0x0", "device-selected"]
stm32f070x6 = ["stm32f070"]
stm32f070xb = ["stm32f070"]

4
src/adc.rs

@ -207,6 +207,7 @@ adc_pins!(
#[cfg(any(
feature = "stm32f030",
feature = "stm32f051",
feature = "stm32f058",
feature = "stm32f070",
feature = "stm32f071",
feature = "stm32f072",
@ -358,6 +359,7 @@ impl VRef {
feature = "stm32f042",
feature = "stm32f048",
feature = "stm32f051",
feature = "stm32f058",
feature = "stm32f071",
feature = "stm32f072",
feature = "stm32f091",
@ -372,6 +374,7 @@ pub struct VBat;
feature = "stm32f042",
feature = "stm32f048",
feature = "stm32f051",
feature = "stm32f058",
feature = "stm32f071",
feature = "stm32f072",
feature = "stm32f091",
@ -386,6 +389,7 @@ adc_pins!(
feature = "stm32f042",
feature = "stm32f048",
feature = "stm32f051",
feature = "stm32f058",
feature = "stm32f071",
feature = "stm32f072",
feature = "stm32f091",

12
src/gpio.rs

@ -567,10 +567,10 @@ gpio!(GPIOC, gpioc, iopcen, PC, [
PC14: (pc14, 14, Input<Floating>),
PC15: (pc15, 15, Input<Floating>),
]);
#[cfg(any(
feature = "stm32f030",
feature = "stm32f051",
feature = "stm32f058",
feature = "stm32f070",
feature = "stm32f071",
feature = "stm32f072",
@ -595,11 +595,15 @@ gpio!(GPIOC, gpioc, iopcen, PC, [
PC15: (pc15, 15, Input<Floating>),
]);
#[cfg(any(feature = "stm32f030", feature = "stm32f051", feature = "stm32f070"))]
#[cfg(any(
feature = "stm32f030",
feature = "stm32f051",
feature = "stm32f058",
feature = "stm32f070",
))]
gpio!(GPIOD, gpiod, iopden, PD, [
PD2: (pd2, 2, Input<Floating>),
]);
#[cfg(any(feature = "stm32f071", feature = "stm32f072", feature = "stm32f091"))]
gpio!(GPIOD, gpiod, iopden, PD, [
PD0: (pd0, 0, Input<Floating>),
@ -643,7 +647,7 @@ gpio!(GPIOD, gpiod, iopden, PD, [
// PE15: (pe15, 15, Input<Floating>),
// ]);
#[cfg(any(feature = "stm32f030", feature = "stm32f051"))]
#[cfg(any(feature = "stm32f030", feature = "stm32f051", feature = "stm32f058"))]
gpio!(GPIOF, gpiof, iopfen, PF, [
PF0: (pf0, 0, Input<Floating>),
PF1: (pf1, 1, Input<Floating>),

4
src/i2c.rs

@ -40,6 +40,7 @@ macro_rules! i2c_pins {
feature = "stm32f042",
feature = "stm32f048",
feature = "stm32f051",
feature = "stm32f058",
feature = "stm32f070",
feature = "stm32f071",
feature = "stm32f072",
@ -114,7 +115,7 @@ i2c_pins! {
}
}
#[cfg(any(feature = "stm32f030x8", feature = "stm32f051"))]
#[cfg(any(feature = "stm32f030x8", feature = "stm32f051", feature = "stm32f058"))]
i2c_pins! {
I2C2 => {
scl => [gpiob::PB10<Alternate<AF1>>],
@ -178,6 +179,7 @@ i2c! {
#[cfg(any(
feature = "stm32f030xc",
feature = "stm32f051",
feature = "stm32f058",
feature = "stm32f070xb",
feature = "stm32f071",
feature = "stm32f072",

2
src/lib.rs

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

3
src/serial.rs

@ -119,6 +119,7 @@ macro_rules! usart_pins {
feature = "stm32f042",
feature = "stm32f048",
feature = "stm32f051",
feature = "stm32f058",
feature = "stm32f071",
))]
usart_pins! {
@ -154,6 +155,7 @@ usart_pins! {
feature = "stm32f042",
feature = "stm32f048",
feature = "stm32f051",
feature = "stm32f058",
feature = "stm32f070",
feature = "stm32f071",
feature = "stm32f072",
@ -370,6 +372,7 @@ usart! {
feature = "stm32f042",
feature = "stm32f048",
feature = "stm32f051",
feature = "stm32f058",
feature = "stm32f070",
feature = "stm32f071",
feature = "stm32f072",

3
src/spi.rs

@ -51,6 +51,7 @@ use crate::stm32::SPI1;
feature = "stm32f030xc",
feature = "stm32f048",
feature = "stm32f051",
feature = "stm32f058",
feature = "stm32f070xb",
feature = "stm32f071",
feature = "stm32f091",
@ -138,6 +139,7 @@ spi_pins! {
feature = "stm32f030xc",
feature = "stm32f048",
feature = "stm32f051",
feature = "stm32f058",
feature = "stm32f070xb",
feature = "stm32f071",
feature = "stm32f072",
@ -213,6 +215,7 @@ spi! {
feature = "stm32f030xc",
feature = "stm32f048",
feature = "stm32f051",
feature = "stm32f058",
feature = "stm32f070xb",
feature = "stm32f071",
feature = "stm32f091",

2
src/timers.rs

@ -228,6 +228,7 @@ timers! {
feature = "stm32f042",
feature = "stm32f048",
feature = "stm32f051",
feature = "stm32f058",
feature = "stm32f071",
feature = "stm32f072",
feature = "stm32f091",
@ -240,6 +241,7 @@ timers! {
feature = "stm32f030x8",
feature = "stm32f030xc",
feature = "stm32f051",
feature = "stm32f058",
feature = "stm32f070xb",
feature = "stm32f071",
feature = "stm32f072",

Loading…
Cancel
Save