diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-10-30 11:18:28 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-10-30 11:18:28 +0000 |
commit | a884e58e2cea877f804cb643d4d1e0909bd1fa49 (patch) | |
tree | 5a0e292f8b7ae213756e92d4710711fbd57db296 /os/hal/include | |
parent | 0cef5f4877397e508bdf5706ef8fada52cdb9d49 (diff) | |
download | ChibiOS-a884e58e2cea877f804cb643d4d1e0909bd1fa49.tar.gz ChibiOS-a884e58e2cea877f804cb643d4d1e0909bd1fa49.tar.bz2 ChibiOS-a884e58e2cea877f804cb643d4d1e0909bd1fa49.zip |
Added a polled exchange function to the SPI driver model, implemented on LPCxxxx SPI drivers.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2302 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include')
-rw-r--r-- | os/hal/include/spi.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/os/hal/include/spi.h b/os/hal/include/spi.h index ed8ba8de0..92fccec61 100644 --- a/os/hal/include/spi.h +++ b/os/hal/include/spi.h @@ -186,6 +186,21 @@ typedef enum { spi_lld_receive(spip, n, rxbuf); \
}
+/**
+ * @brief Exchanges one frame using a polled wait.
+ * @details This synchronous function exchanges one frame using a polled
+ * synchronization method. This function is useful when exchanging
+ * small amount of data on high speed channels, usually in this
+ * situation is much more efficient just wait for completion using
+ * polling than suspending the thread waiting for an interrupt.
+ * @note This API is implemented as a macro in order to minimize latency.
+ * + * @param[in] spip pointer to the @p SPIDriver object
+ * @param[in] frame the data frame to send over the SPI bus
+ * @return The received data frame from the SPI bus.
+ */
+#define spiPolledExchange(spip, frame) spi_lld_polled_exchange(spip, frame)
+
#if SPI_USE_WAIT || defined(__DOXYGEN__)
/**
* @brief Waits for operation completion.
|