Skip to content

Commit

Permalink
add other spis to dma
Browse files Browse the repository at this point in the history
  • Loading branch information
ForsakenHarmony committed Apr 25, 2021
1 parent 94dbf54 commit 299feb5
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions src/spi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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);

0 comments on commit 299feb5

Please sign in to comment.