diff options
Diffstat (limited to 'os/io/include')
-rw-r--r-- | os/io/include/adc.h | 7 | ||||
-rw-r--r-- | os/io/include/can.h | 4 | ||||
-rw-r--r-- | os/io/include/mac.h | 4 | ||||
-rw-r--r-- | os/io/include/mmc_spi.h | 6 | ||||
-rw-r--r-- | os/io/include/pal.h | 6 | ||||
-rw-r--r-- | os/io/include/serial.h | 4 | ||||
-rw-r--r-- | os/io/include/spi.h | 4 |
7 files changed, 31 insertions, 4 deletions
diff --git a/os/io/include/adc.h b/os/io/include/adc.h index 08e83caa2..67ebf5ca2 100644 --- a/os/io/include/adc.h +++ b/os/io/include/adc.h @@ -27,6 +27,8 @@ #ifndef _ADC_H_
#define _ADC_H_
+#if CH_HAL_USE_ADC
+
#if !CH_USE_SEMAPHORES
#error "ADC driver requires CH_USE_SEMAPHORES"
#endif
@@ -38,7 +40,8 @@ typedef enum { ADC_UNINIT = 0, /**< @brief Not initialized. */
ADC_STOP = 1, /**< @brief Stopped. */
ADC_READY = 2, /**< @brief Ready. */
- ADC_RUNNING = 3 /**< @brief Conversion running. */
+ ADC_RUNNING = 3, /**< @brief Conversion running. */
+ ADC_COMPLETE = 4 /**< @brief Conversion complete.*/
} adcstate_t;
#include "adc_lld.h"
@@ -61,6 +64,8 @@ extern "C" { }
#endif
+#endif /* CH_HAL_USE_ADC */
+
#endif /* _ADC_H_ */
/** @} */
diff --git a/os/io/include/can.h b/os/io/include/can.h index 9d9462f86..2a8ffc7e0 100644 --- a/os/io/include/can.h +++ b/os/io/include/can.h @@ -27,6 +27,8 @@ #ifndef _CAN_H_
#define _CAN_H_
+#if CH_HAL_USE_CAN
+
/**
* @brief Driver state machine possible states.
*/
@@ -56,6 +58,8 @@ extern "C" { }
#endif
+#endif /* CH_HAL_USE_CAN */
+
#endif /* _CAN_H_ */
/** @} */
diff --git a/os/io/include/mac.h b/os/io/include/mac.h index 9a83cc2b8..ae2d3a42e 100644 --- a/os/io/include/mac.h +++ b/os/io/include/mac.h @@ -27,6 +27,8 @@ #ifndef _MAC_H_
#define _MAC_H_
+#if CH_HAL_USE_MAC
+
#include "mac_lld.h"
/**
@@ -84,6 +86,8 @@ extern "C" { }
#endif
+#endif /* CH_HAL_USE_MAC */
+
#endif /* _MAC_H_ */
/** @} */
diff --git a/os/io/include/mmc_spi.h b/os/io/include/mmc_spi.h index 96e5e3ec5..e77dbe7dc 100644 --- a/os/io/include/mmc_spi.h +++ b/os/io/include/mmc_spi.h @@ -19,7 +19,7 @@ /**
* @file mmc_spi.h
- * @brief MMC over SPI driver header
+ * @brief MMC over SPI driver header.
* @addtogroup MMC_SPI
* @{
*/
@@ -27,6 +27,8 @@ #ifndef _MMC_SPI_H_
#define _MMC_SPI_H_
+#if CH_HAL_USE_MMC_SPI
+
/*===========================================================================*/
/* Driver pre-compile time settings. */
/*===========================================================================*/
@@ -199,6 +201,8 @@ extern "C" { }
#endif
+#endif /* CH_HAL_USE_MMC_SPI */
+
#endif /* _MMC_SPI_H_ */
/** @} */
diff --git a/os/io/include/pal.h b/os/io/include/pal.h index 67bc424b1..2ea625d5e 100644 --- a/os/io/include/pal.h +++ b/os/io/include/pal.h @@ -27,6 +27,8 @@ #ifndef _PAL_H_
#define _PAL_H_
+#if CH_HAL_USE_PAL
+
/**
* @brief Bits in a mode word dedicated as mode selector.
* @details The other bits are not defined and may be used as device-specific
@@ -81,9 +83,7 @@ */
#define PAL_MODE_OUTPUT_OPENDRAIN 7
-#ifndef _PAL_LLD_H_
#include "pal_lld.h"
-#endif
/**
* @brief Logical low state. @@ -464,4 +464,6 @@ extern "C" { #endif /* _PAL_H_ */
+#endif /* CH_HAL_USE_PAL */
+
/** @} */
diff --git a/os/io/include/serial.h b/os/io/include/serial.h index 6324a5f5b..54e8b33a9 100644 --- a/os/io/include/serial.h +++ b/os/io/include/serial.h @@ -27,6 +27,8 @@ #ifndef _SERIAL_H_
#define _SERIAL_H_
+#if CH_HAL_USE_SERIAL
+
/** No pending conditions.*/
#define SD_NO_ERROR 0
/** Connection happened.*/
@@ -188,6 +190,8 @@ extern "C" { */
#define sdRead(sdp, b, n) chIQRead(&(sdp)->d2.iqueue, b, n)
+#endif /* CH_HAL_USE_SERIAL */
+
#endif /* _SERIAL_H_ */
/** @} */
diff --git a/os/io/include/spi.h b/os/io/include/spi.h index cebde453f..6f17f69c2 100644 --- a/os/io/include/spi.h +++ b/os/io/include/spi.h @@ -27,6 +27,8 @@ #ifndef _SPI_H_
#define _SPI_H_
+#if CH_HAL_USE_SPI
+
/**
* @brief Enables the mutual exclusion APIs on the SPI bus.
*/
@@ -71,6 +73,8 @@ extern "C" { }
#endif
+#endif /* CH_HAL_USE_SPI */
+
#endif /* _SPI_H_ */
/** @} */
|