aboutsummaryrefslogtreecommitdiffstats
path: root/os/io/templates/spi_lld.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/io/templates/spi_lld.c')
-rw-r--r--os/io/templates/spi_lld.c68
1 files changed, 40 insertions, 28 deletions
diff --git a/os/io/templates/spi_lld.c b/os/io/templates/spi_lld.c
index dc2efca24..472e18ee3 100644
--- a/os/io/templates/spi_lld.c
+++ b/os/io/templates/spi_lld.c
@@ -49,7 +49,7 @@ void spi_lld_init(void) {
/**
* @brief Configures and activates the SPI peripheral.
*
- * @param[in] spip pointer to the @p SPIDriver object
+ * @param[in] spip pointer to the @p SPIDriver object
*/
void spi_lld_start(SPIDriver *spip) {
@@ -62,7 +62,7 @@ void spi_lld_start(SPIDriver *spip) {
/**
* @brief Deactivates the SPI peripheral.
*
- * @param[in] spip pointer to the @p SPIDriver object
+ * @param[in] spip pointer to the @p SPIDriver object
*/
void spi_lld_stop(SPIDriver *spip) {
@@ -71,7 +71,7 @@ void spi_lld_stop(SPIDriver *spip) {
/**
* @brief Asserts the slave select signal and prepares for transfers.
*
- * @param[in] spip pointer to the @p SPIDriver object
+ * @param[in] spip pointer to the @p SPIDriver object
*/
void spi_lld_select(SPIDriver *spip) {
@@ -81,27 +81,41 @@ void spi_lld_select(SPIDriver *spip) {
* @brief Deasserts the slave select signal.
* @details The previously selected peripheral is unselected.
*
- * @param[in] spip pointer to the @p SPIDriver object
+ * @param[in] spip pointer to the @p SPIDriver object
*/
void spi_lld_unselect(SPIDriver *spip) {
}
/**
+ * @brief Ignores data on the SPI bus.
+ * @details This function transmits a series of idle words on the SPI bus and
+ * ignores the received data. This function can be invoked even
+ * when a slave select signal has not been yet asserted.
+ *
+ * @param[in] spip pointer to the @p SPIDriver object
+ * @param[in] n number of words to be ignored
+ *
+ * @return The operation status is returned.
+ * @retval RDY_OK operation complete.
+ * @retval RDY_RESET hardware failure.
+ */
+msg_t spi_lld_ignore(SPIDriver *spip, size_t n) {
+
+}
+
+/**
* @brief Exchanges data on the SPI bus.
* @details This function performs a simultaneous transmit/receive operation.
*
- * @param[in] spip pointer to the @p SPIDriver object
- * @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.
+ * @param[in] spip pointer to the @p SPIDriver object
+ * @param[in] n number of words to be exchanged
+ * @param[in] txbuf the pointer to the transmit buffer
+ * @param[out] rxbuf the pointer to the receive buffer
+ *
* @return The operation status is returned.
- * @retval RDY_OK operation complete.
- * @retval RDY_RESET hardware failure.
+ * @retval RDY_OK operation complete.
+ * @retval RDY_RESET hardware failure.
*
* @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.
@@ -113,14 +127,13 @@ 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[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.
+ * @param[in] spip pointer to the @p SPIDriver object
+ * @param[in] n number of words to send
+ * @param[in] txbuf the pointer to the transmit buffer
+ *
* @return The operation status is returned.
- * @retval RDY_OK operation complete.
- * @retval RDY_RESET hardware failure.
+ * @retval RDY_OK operation complete.
+ * @retval RDY_RESET hardware failure.
*
* @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.
@@ -132,14 +145,13 @@ 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[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.
+ * @param[in] spip pointer to the @p SPIDriver object
+ * @param[in] n number of words to receive
+ * @param[out] rxbuf the pointer to the receive buffer
+ *
* @return The operation status is returned.
- * @retval RDY_OK operation complete.
- * @retval RDY_RESET hardware failure.
+ * @retval RDY_OK operation complete.
+ * @retval RDY_RESET hardware failure.
*
* @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.