diff --git a/src/spi.rs b/src/spi.rs index 8703e76..8af9907 100644 --- a/src/spi.rs +++ b/src/spi.rs @@ -4,7 +4,7 @@ use nb; pub use embedded_hal::spi::{Mode, Phase, Polarity}; -#[cfg(feature = "stm32f042")] +#[cfg(any(feature = "stm32f042", feature = "stm32f030"))] use crate::stm32::{RCC, SPI1}; use crate::gpio::*; @@ -32,7 +32,7 @@ pub struct Spi { pub trait Pins {} -#[cfg(feature = "stm32f042")] +#[cfg(any(feature = "stm32f042", feature = "stm32f030"))] impl Pins for ( gpioa::PA5>, @@ -40,7 +40,7 @@ impl Pins gpioa::PA7>, ) {} -#[cfg(feature = "stm32f042")] +#[cfg(any(feature = "stm32f042", feature = "stm32f030"))] impl Pins for ( gpiob::PB3>, @@ -49,7 +49,17 @@ impl Pins ) {} -#[cfg(feature = "stm32f042")] +#[cfg(feature = "stm32f030x6")] +impl Pins + for ( + gpiob::PB13>, + gpiob::PB14>, + gpiob::PB15>, + ) +{ +} + +#[cfg(any(feature = "stm32f042", feature = "stm32f030"))] impl Spi { pub fn spi1(spi: SPI1, pins: PINS, mode: Mode, speed: F, clocks: Clocks) -> Self where @@ -128,7 +138,7 @@ impl Spi { } } -#[cfg(feature = "stm32f042")] +#[cfg(any(feature = "stm32f042", feature = "stm32f030"))] impl ::embedded_hal::spi::FullDuplex for Spi { type Error = Error; @@ -169,7 +179,7 @@ impl ::embedded_hal::spi::FullDuplex for Spi { } } -#[cfg(feature = "stm32f042")] +#[cfg(any(feature = "stm32f042", feature = "stm32f030"))] impl ::embedded_hal::blocking::spi::transfer::Default for Spi {} -#[cfg(feature = "stm32f042")] +#[cfg(any(feature = "stm32f042", feature = "stm32f030"))] impl ::embedded_hal::blocking::spi::write::Default for Spi {}