19.6.4.5.2 Function spi_write_buffer_wait()
Sends a buffer of length SPI characters.
enum status_code spi_write_buffer_wait( struct spi_module *const module, const uint8_t * tx_data, uint16_t length)
This function will send a buffer of SPI characters via the SPI and discard any data that is received. To both send and receive a buffer of data, use the spi_transceive_buffer_wait function.
Note that this function does not handle the _SS (slave select) pin(s) in master mode; this must be handled by the user application.
Data direction | Parameter name | Description |
---|---|---|
[in] |
module |
Pointer to the software instance struct |
[in] |
tx_data |
Pointer to the buffer to transmit |
[in] |
length |
Number of SPI characters to transfer |
Returns
Status of the write operation.
Return value | Description |
---|---|
STATUS_OK |
If the write was completed |
STATUS_ABORTED |
If transaction was ended by master before entire buffer was transferred |
STATUS_ERR_INVALID_ARG |
If invalid argument(s) were provided |
STATUS_ERR_TIMEOUT |
If the operation was not completed within the timeout in slave mode |