浏览代码

Add TX DMA implementation for SPI3 (#264)

* Add TX DMA implementation for SPI3

DMA2 channel 2 was selected after referring to the "DMA request mapping"
section of the reference manual (section 13.3.7).

Tested locally with a large number of LEDs and works well.

* Feature gate connectivity-line-only DMA channel import in spi mod
mitchmindtree 3 年之前
父节点
当前提交
b19fbb0316
共有 2 个文件被更改,包括 7 次插入2 次删除
  1. 3 2
      CHANGELOG.md
  2. 4 0
      src/spi.rs

+ 3 - 2
CHANGELOG.md

@@ -24,7 +24,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
 
 ### Fixed
 
-- Fix MonoTimer not working in debug mode. 
+- Fix MonoTimer not working in debug mode.
+- Add missing TX DMA implementation for SPI3.
 
 ## [v0.6.1] - 2020-06-25
 
@@ -36,7 +37,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
 ### Fixed
 
 - Fix wrong frequency reported by `MonoTimer`
-- Fix wrong timings generated by `Timer::syst` 
+- Fix wrong timings generated by `Timer::syst`
 - Fix period retrieval for timers
 
 ### Changed

+ 4 - 0
src/spi.rs

@@ -41,6 +41,8 @@ use crate::pac::{SPI1, SPI2};
 
 use crate::afio::MAPR;
 use crate::dma::dma1::{C3, C5};
+#[cfg(feature = "connectivity")]
+use crate::dma::dma2::C2;
 use crate::dma::{Static, Transfer, TransferPayload, Transmit, TxDma, R};
 use crate::gpio::gpioa::{PA5, PA6, PA7};
 use crate::gpio::gpiob::{PB13, PB14, PB15, PB3, PB4, PB5};
@@ -585,3 +587,5 @@ macro_rules! spi_dma {
 
 spi_dma!(SPI1, C3);
 spi_dma!(SPI2, C5);
+#[cfg(feature = "connectivity")]
+spi_dma!(SPI3, C2);