aboutsummaryrefslogtreecommitdiffstats
path: root/os/io/platforms/STM32
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-11-02 19:09:53 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-11-02 19:09:53 +0000
commitc98a36e315b5ec6d1685baedd956926297f7ecba (patch)
tree9a7f0e29ef79acd3e8ba1b646f859b7ea3f6b297 /os/io/platforms/STM32
parent639d957e5eacffffb849b976552b39a2b66433aa (diff)
downloadChibiOS-c98a36e315b5ec6d1685baedd956926297f7ecba.tar.gz
ChibiOS-c98a36e315b5ec6d1685baedd956926297f7ecba.tar.bz2
ChibiOS-c98a36e315b5ec6d1685baedd956926297f7ecba.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1264 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/io/platforms/STM32')
-rw-r--r--os/io/platforms/STM32/spi_lld.c24
-rw-r--r--os/io/platforms/STM32/spi_lld.h2
2 files changed, 17 insertions, 9 deletions
diff --git a/os/io/platforms/STM32/spi_lld.c b/os/io/platforms/STM32/spi_lld.c
index 934501cf6..8cd7ba8e1 100644
--- a/os/io/platforms/STM32/spi_lld.c
+++ b/os/io/platforms/STM32/spi_lld.c
@@ -301,9 +301,13 @@ void spi_lld_unselect(SPIDriver *spip) {
* @details This function performs a simultaneous transmit/receive operation.
*
* @param[in] spip pointer to the @p SPIDriver object
- * @param n number of words to exchange
- * @param rxbuf the pointer to the receive buffer
- * @param txbuf the pointer to the transmit buffer
+ * @param[in] n number of words to exchange
+ * @param[in] txbuf the pointer to the transmit buffer. Note that the buffer is
+ * organized as an uint8_t array for data sizes below or equal
+ * to 8 bits else it is organized as an uint16_t array.
+ * @param[out] rxbuf the pointer to the receive buffer. Note that the buffer is
+ * organized as an uint8_t array for data sizes below or equal
+ * to 8 bits else it is organized as an uint16_t array.
* @return The operation status is returned.
* @retval RDY_OK operation complete.
* @retval RDY_RESET hardware failure.
@@ -311,7 +315,7 @@ void spi_lld_unselect(SPIDriver *spip) {
* @note The buffers are organized as uint8_t arrays for data sizes below or
* equal to 8 bits else it is organized as uint16_t arrays.
*/
-msg_t spi_lld_exchange(SPIDriver *spip, size_t n, void *rxbuf, void *txbuf) {
+msg_t spi_lld_exchange(SPIDriver *spip, size_t n, void *txbuf, void *rxbuf) {
spip->spd_dmarx->CCR = DMA_CCR1_TCIE | DMA_CCR1_MINC | DMA_CCR1_TEIE;
spip->spd_dmatx->CCR = DMA_CCR1_DIR | DMA_CCR1_MINC | DMA_CCR1_TEIE;
@@ -323,8 +327,10 @@ msg_t spi_lld_exchange(SPIDriver *spip, size_t n, void *rxbuf, void *txbuf) {
* @brief Sends data ever the SPI bus.
*
* @param[in] spip pointer to the @p SPIDriver object
- * @param n number of words to send
- * @param txbuf the pointer to the transmit buffer
+ * @param[in] n number of words to send
+ * @param[in] txbuf the pointer to the transmit buffer. Note that the buffer is
+ * organized as an uint8_t array for data sizes below or equal
+ * to 8 bits else it is organized as an uint16_t array.
* @return The operation status is returned.
* @retval RDY_OK operation complete.
* @retval RDY_RESET hardware failure.
@@ -344,8 +350,10 @@ msg_t spi_lld_send(SPIDriver *spip, size_t n, void *txbuf) {
* @brief Receives data from the SPI bus.
*
* @param[in] spip pointer to the @p SPIDriver object
- * @param n number of words to receive
- * @param rxbuf the pointer to the receive buffer
+ * @param[in] n number of words to receive
+ * @param[out] rxbuf the pointer to the receive buffer. Note that the buffer is
+ * organized as an uint8_t array for data sizes below or equal
+ * to 8 bits else it is organized as an uint16_t array.
* @return The operation status is returned.
* @retval RDY_OK operation complete.
* @retval RDY_RESET hardware failure.
diff --git a/os/io/platforms/STM32/spi_lld.h b/os/io/platforms/STM32/spi_lld.h
index 671659d72..077c7be7f 100644
--- a/os/io/platforms/STM32/spi_lld.h
+++ b/os/io/platforms/STM32/spi_lld.h
@@ -186,7 +186,7 @@ extern "C" {
void spi_lld_stop(SPIDriver *spip);
void spi_lld_select(SPIDriver *spip);
void spi_lld_unselect(SPIDriver *spip);
- msg_t spi_lld_exchange(SPIDriver *spip, size_t n, void *rxbuf, void *txbuf);
+ msg_t spi_lld_exchange(SPIDriver *spip, size_t n, void *txbuf, void *rxbuf);
msg_t spi_lld_send(SPIDriver *spip, size_t n, void *txbuf);
msg_t spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf);
#ifdef __cplusplus