From 1c9c40543009ecd95b56362e6564d26a2755b92a Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 10 Oct 2010 16:28:34 +0000 Subject: 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 --- os/hal/include/spi.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'os/hal/include') 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); -- cgit v1.2.3