aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-10-10 16:28:34 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-10-10 16:28:34 +0000
commit1c9c40543009ecd95b56362e6564d26a2755b92a (patch)
tree208f9e85f725d1daec144fb8c06c3ae265255626 /os/hal/include
parent70ab312f0f88f24cf1e4f33218cff877c6c0b3c2 (diff)
downloadChibiOS-1c9c40543009ecd95b56362e6564d26a2755b92a.tar.gz
ChibiOS-1c9c40543009ecd95b56362e6564d26a2755b92a.tar.bz2
ChibiOS-1c9c40543009ecd95b56362e6564d26a2755b92a.zip
Fixed bug 3084764. More enhancements to the SPI driver.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2244 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include')
-rw-r--r--os/hal/include/spi.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/os/hal/include/spi.h b/os/hal/include/spi.h
index b09e33089..e6fbe7c90 100644
--- a/os/hal/include/spi.h
+++ b/os/hal/include/spi.h
@@ -39,7 +39,16 @@
/*===========================================================================*/
/**
- * @brief Enables the mutual exclusion APIs on the SPI bus.
+ * @brief Enables the @p spiWait() API.
+ * @note Disabling this option saves both code and data space.
+ */
+#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
+#define SPI_USE_WAIT TRUE
+#endif
+
+/**
+ * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
+ * @note Disabling this option saves both code and data space.
*/
#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
#define SPI_USE_MUTUAL_EXCLUSION TRUE
@@ -218,6 +227,10 @@ extern "C" {
void spiExchange(SPIDriver *spip, size_t n, const void *txbuf, void *rxbuf);
void spiSend(SPIDriver *spip, size_t n, const void *txbuf);
void spiReceive(SPIDriver *spip, size_t n, void *rxbuf);
+#if SPI_USE_WAIT
+ void _spi_wakeup(SPIDriver *spip, mag_t msg);
+ msg_t spiWait(SPIDriver *spip);
+#endif /* SPI_USE_WAIT */
#if SPI_USE_MUTUAL_EXCLUSION
void spiAcquireBus(SPIDriver *spip);
void spiReleaseBus(SPIDriver *spip);