aboutsummaryrefslogtreecommitdiffstats
path: root/os/io/spi.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/io/spi.h')
-rw-r--r--os/io/spi.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/os/io/spi.h b/os/io/spi.h
index bb4244944..54409fe76 100644
--- a/os/io/spi.h
+++ b/os/io/spi.h
@@ -27,6 +27,17 @@
#ifndef _SPI_H_
#define _SPI_H_
+/**
+ * @brief Enables the mutual exclusion APIs on the SPI bus.
+ */
+#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
+#define SPI_USE_MUTUAL_EXCLUSION TRUE
+#endif
+
+#if SPI_USE_MUTUAL_EXCLUSION && !CH_USE_MUTEXES && !CH_USE_SEMAPHORES
+#error "SPI_USE_MUTUAL_EXCLUSION requires CH_USE_MUTEXES and/or CH_USE_SEMAPHORES"
+#endif
+
#include "spi_lld.h"
#ifdef __cplusplus