diff --git a/src/spi.rs b/src/spi.rs index 9cac6a35..634e2249 100644 --- a/src/spi.rs +++ b/src/spi.rs @@ -4,7 +4,6 @@ use core::ptr; use core::sync::atomic; use core::sync::atomic::Ordering; -use crate::dma::dma1::C2; use crate::dma::{Receive, RxDma, Transfer, TransferPayload, W}; use crate::gpio::{Alternate, Floating, Input, AF5}; use crate::hal::spi::{FullDuplex, Mode, Phase, Polarity}; @@ -339,7 +338,6 @@ pins!(SPI3, AF6, SCK: [PG9], MISO: [PG10], MOSI: [PG11]); feature = "stm32l4x6", ))] use crate::stm32::SPI2; -use embedded_dma::StaticWriteBuffer; #[cfg(any( feature = "stm32l4x1", @@ -456,4 +454,38 @@ macro_rules! spi_rx_dma { }; } +#[cfg(any( + feature = "stm32l4x1", + feature = "stm32l4x2", + feature = "stm32l4x3", + feature = "stm32l4x5", + feature = "stm32l4x6" +))] +use embedded_dma::StaticWriteBuffer; + +#[cfg(any( + feature = "stm32l4x1", + feature = "stm32l4x2", + feature = "stm32l4x3", + feature = "stm32l4x5", + feature = "stm32l4x6" +))] +use crate::dma::dma1::C2; +#[cfg(any( + feature = "stm32l4x1", + feature = "stm32l4x2", + feature = "stm32l4x3", + feature = "stm32l4x5", + feature = "stm32l4x6" +))] spi_rx_dma!(SPI1, C2, c2s, map1); + +#[cfg(any(feature = "stm32l4x3", feature = "stm32l4x5", feature = "stm32l4x6",))] +use crate::dma::dma1::C4; +#[cfg(any(feature = "stm32l4x3", feature = "stm32l4x5", feature = "stm32l4x6",))] +spi_rx_dma!(SPI2, C4, c4s, map1); + +#[cfg(any(feature = "stm32l4x5", feature = "stm32l4x6",))] +use crate::dma::dma2::C1; +#[cfg(any(feature = "stm32l4x5", feature = "stm32l4x6",))] +spi_rx_dma!(SPI3, C1, c1s, map3);