diff options
Diffstat (limited to 'os/ex/ST/lps25h.h')
-rw-r--r-- | os/ex/ST/lps25h.h | 128 |
1 files changed, 73 insertions, 55 deletions
diff --git a/os/ex/ST/lps25h.h b/os/ex/ST/lps25h.h index 54d96635c..fc908e09d 100644 --- a/os/ex/ST/lps25h.h +++ b/os/ex/ST/lps25h.h @@ -206,71 +206,89 @@ /* Driver pre-compile time settings. */ /*===========================================================================*/ -/** - * @name Configuration options - * @{ - */ -/** - * @brief LPS25H SPI interface switch. - * @details If set to @p TRUE the support for SPI is included. - * @note The default is @p FALSE. - */ -#if !defined(LPS25H_USE_SPI) || defined(__DOXYGEN__) -#define LPS25H_USE_SPI FALSE -#endif - -/** - * @brief LPS25H I2C interface switch. - * @details If set to @p TRUE the support for I2C is included. - * @note The default is @p TRUE. - */ -#if !defined(LPS25H_USE_I2C) || defined(__DOXYGEN__) -#define LPS25H_USE_I2C TRUE -#endif - -/** - * @brief LPS25H advanced configurations switch. - * @details If set to @p TRUE more configurations are available. - * @note The default is @p FALSE. - */ -#if !defined(LPS25H_USE_ADVANCED) || defined(__DOXYGEN__) -#define LPS25H_USE_ADVANCED FALSE -#endif - -/** - * @brief LPS25H shared I2C switch. - * @details If set to @p TRUE the device acquires I2C bus ownership - * on each transaction. - * @note The default is @p FALSE. Requires I2C_USE_MUTUAL_EXCLUSION - */ -#if !defined(LPS25H_SHARED_I2C) || defined(__DOXYGEN__) -#define LPS25H_SHARED_I2C FALSE -#endif +/**
+ * @name Configuration options
+ * @{
+ */
+/**
+ * @brief LPS25H SPI interface switch.
+ * @details If set to @p TRUE the support for SPI is included.
+ * @note The default is @p FALSE.
+ */
+#if !defined(LPS25H_USE_SPI) || defined(__DOXYGEN__)
+#define LPS25H_USE_SPI FALSE
+#endif
+
+/**
+ * @brief LPS25H shared SPI switch.
+ * @details If set to @p TRUE the device acquires SPI bus ownership
+ * on each transaction.
+ * @note The default is @p FALSE. Requires SPI_USE_MUTUAL_EXCLUSION.
+ */
+#if !defined(LPS25H_SHARED_SPI) || defined(__DOXYGEN__)
+#define LPS25H_SHARED_SPI FALSE
+#endif
+
+/**
+ * @brief LPS25H I2C interface switch.
+ * @details If set to @p TRUE the support for I2C is included.
+ * @note The default is @p TRUE.
+ */
+#if !defined(LPS25H_USE_I2C) || defined(__DOXYGEN__)
+#define LPS25H_USE_I2C TRUE
+#endif
+
+/**
+ * @brief LPS25H shared I2C switch.
+ * @details If set to @p TRUE the device acquires I2C bus ownership
+ * on each transaction.
+ * @note The default is @p FALSE. Requires I2C_USE_MUTUAL_EXCLUSION.
+ */
+#if !defined(LPS25H_SHARED_I2C) || defined(__DOXYGEN__)
+#define LPS25H_SHARED_I2C FALSE
+#endif
+
+/**
+ * @brief LPS25H accelerometer subsystem advanced configurations
+ * switch.
+ * @details If set to @p TRUE more configurations are available.
+ * @note The default is @p FALSE.
+ */
+#if !defined(LPS25H_USE_ADVANCED) || defined(__DOXYGEN__)
+#define LPS25H_USE_ADVANCED FALSE
+#endif
/** @} */ /*===========================================================================*/ /* Derived constants and error checks. */ /*===========================================================================*/ -#if !(LPS25H_USE_SPI ^ LPS25H_USE_I2C) -#error "LPS25H_USE_SPI and LPS25H_USE_I2C cannot be both true or both false" -#endif - -#if LPS25H_USE_SPI && !HAL_USE_SPI -#error "LPS25H_USE_SPI requires HAL_USE_SPI" -#endif +#if !(LPS25H_USE_SPI ^ LPS25H_USE_I2C)
+#error "LPS25H_USE_SPI and LPS25H_USE_I2C cannot be both true or both false"
+#endif
+#if LPS25H_USE_SPI && !HAL_USE_SPI
+#error "LPS25H_USE_SPI requires HAL_USE_SPI"
+#endif
+
+#if LPS25H_SHARED_SPI && !SPI_USE_MUTUAL_EXCLUSION
+#error "LPS25H_SHARED_SPI requires SPI_USE_MUTUAL_EXCLUSION"
+#endif
+
+#if LPS25H_USE_I2C && !HAL_USE_I2C
+#error "LPS25H_USE_I2C requires HAL_USE_I2C"
+#endif
+
+#if LPS25H_SHARED_I2C && !I2C_USE_MUTUAL_EXCLUSION
+#error "LPS25H_SHARED_I2C requires I2C_USE_MUTUAL_EXCLUSION"
+#endif
+
+/**
+ * @todo Add support for LPS25H over SPI.
+ */
#if LPS25H_USE_SPI
#error "LPS25H over SPI still not supported"
#endif
- -#if LPS25H_USE_I2C && !HAL_USE_I2C -#error "LPS25H_USE_I2C requires HAL_USE_I2C" -#endif - -#if LPS25H_SHARED_I2C && !I2C_USE_MUTUAL_EXCLUSION -#error "LPS25H_SHARED_I2C requires I2C_USE_MUTUAL_EXCLUSION" -#endif
/*===========================================================================*/ /* Driver data structures and types. */ |