aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.h
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2018-09-22 15:27:12 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2018-09-22 15:27:12 +0000
commitc708f7d750f2190ff82075378965214c06437d8c (patch)
tree430e2d36abfdb6bd4a4b22094e22d9cd7e78a26d /os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.h
parent7c9ad610a6068f7ee292f8259cdcd7488391a60a (diff)
downloadChibiOS-c708f7d750f2190ff82075378965214c06437d8c.tar.gz
ChibiOS-c708f7d750f2190ff82075378965214c06437d8c.tar.bz2
ChibiOS-c708f7d750f2190ff82075378965214c06437d8c.zip
USARTv2 made DMAMUX-aware.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12281 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.h')
-rw-r--r--os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.h b/os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.h
index 43fd676e2..c1cdf3c54 100644
--- a/os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.h
+++ b/os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.h
@@ -304,6 +304,38 @@
/* Devices with DMAMUX require a different kind of check.*/
#if STM32_DMA_SUPPORTS_DMAMUX
+/* Check on the presence of the DMA channel settings in mcuconf.h.*/
+#if STM32_SPI_USE_SPI1 && (!defined(STM32_SPI_SPI1_RX_DMA_CHANNEL) || \
+ !defined(STM32_SPI_SPI1_TX_DMA_CHANNEL))
+#error "SPI1 DMA channels not defined"
+#endif
+
+#if STM32_SPI_USE_SPI2 && (!defined(STM32_SPI_SPI2_RX_DMA_CHANNEL) || \
+ !defined(STM32_SPI_SPI2_TX_DMA_CHANNEL))
+#error "SPI2 DMA streams not defined"
+#endif
+
+#if STM32_SPI_USE_SPI3 && (!defined(STM32_SPI_SPI3_RX_DMA_CHANNEL) || \
+ !defined(STM32_SPI_SPI3_TX_DMA_CHANNEL))
+#error "SPI3 DMA streams not defined"
+#endif
+
+#if STM32_SPI_USE_SPI4 && (!defined(STM32_SPI_SPI4_RX_DMA_CHANNEL) || \
+ !defined(STM32_SPI_SPI4_TX_DMA_CHANNEL))
+#error "SPI4 DMA streams not defined"
+#endif
+
+#if STM32_SPI_USE_SPI5 && (!defined(STM32_SPI_SPI5_RX_DMA_CHANNEL) || \
+ !defined(STM32_SPI_SPI5_TX_DMA_CHANNEL))
+#error "SPI5 DMA streams not defined"
+#endif
+
+#if STM32_SPI_USE_SPI6 && (!defined(STM32_SPI_SPI6_RX_DMA_CHANNEL) || \
+ !defined(STM32_SPI_SPI6_TX_DMA_CHANNEL))
+#error "SPI6 DMA streams not defined"
+#endif
+
+/* Check on the validity of the assigned DMA channels.*/
#if STM32_SPI_USE_SPI1 && \
!STM32_DMA_IS_VALID_CHANNEL(STM32_SPI_SPI1_TX_DMA_CHANNEL)
#error "Invalid DMA channel assigned to SPI1 TX"