aboutsummaryrefslogtreecommitdiffstats
path: root/os/io/spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/io/spi.c')
-rw-r--r--os/io/spi.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/os/io/spi.c b/os/io/spi.c
index 5cf51e76e..231fc7ad2 100644
--- a/os/io/spi.c
+++ b/os/io/spi.c
@@ -125,19 +125,15 @@ void spiUnselect(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 be exchanged
- * @param rxbuf the pointer to the receive buffer, if @p NULL is specified then
- * the input data is discarded.
- * 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 txbuf the pointer to the transmit buffer, if @p NULL is specified all
- * ones are transmitted.
- * 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[in] n number of words to be exchanged
+ * @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.
*/
-msg_t spiExchange(SPIDriver *spip, size_t n, void *rxbuf, void *txbuf) {
+msg_t spiExchange(SPIDriver *spip, size_t n, void *txbuf, void *rxbuf) {
chDbgCheck((spip != NULL) && (n > 0) && (rxbuf != NULL) && (txbuf != NULL),
"spiExchange");
@@ -145,15 +141,17 @@ msg_t spiExchange(SPIDriver *spip, size_t n, void *rxbuf, void *txbuf) {
"spiExchange(), #1",
"not active");
- return spi_lld_exchange(spip, n, rxbuf, txbuf);
+ return spi_lld_exchange(spip, n, txbuf, rxbuf);
}
/**
* @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.
@@ -176,8 +174,10 @@ msg_t spiSend(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.