aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.h
diff options
context:
space:
mode:
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"