aboutsummaryrefslogtreecommitdiffstats
path: root/os/io/platforms/STM32/spi_lld.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/io/platforms/STM32/spi_lld.h')
-rw-r--r--os/io/platforms/STM32/spi_lld.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/os/io/platforms/STM32/spi_lld.h b/os/io/platforms/STM32/spi_lld.h
index 2918eaa6c..1cba01b42 100644
--- a/os/io/platforms/STM32/spi_lld.h
+++ b/os/io/platforms/STM32/spi_lld.h
@@ -93,6 +93,24 @@
#define STM32_SPI2_IRQ_PRIORITY 0x60
#endif
+/**
+ * @brief SPI1 DMA error hook.
+ * @note The default action for DMA errors is a system halt because DMA error
+ * can only happen because programming errors.
+ */
+#if !defined(STM32_SPI1_DMA_ERROR_HOOK) || defined(__DOXYGEN__)
+#define STM32_SPI1_DMA_ERROR_HOOK() chSysHalt()
+#endif
+
+/**
+ * @brief SPI2 DMA error hook.
+ * @note The default action for DMA errors is a system halt because DMA error
+ * can only happen because programming errors.
+ */
+#if !defined(STM32_SPI2_DMA_ERROR_HOOK) || defined(__DOXYGEN__)
+#define STM32_SPI2_DMA_ERROR_HOOK() chSysHalt()
+#endif
+
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
@@ -158,10 +176,6 @@ typedef struct {
* @brief DMA priority bit mask.
*/
uint32_t spd_dmaprio;
- /**
- * @brief DMA error event.
- */
- EventSource spd_dmaerror;
} SPIDriver;
/*===========================================================================*/