19.6.4.5.1 Function spi_write()
Transfers a single SPI character.
enum status_code spi_write( struct spi_module * module, uint16_t tx_data)
This function will send a single SPI character via SPI and ignore any data shifted in by the connected device. To both send and receive data, use the spi_transceive_wait function or use the spi_read function after writing a character. The spi_is_ready_to_write function should be called before calling this function.
Note that this function does not handle the SS (Slave Select) pin(s) in master mode; this must be handled from the user application.
Data direction | Parameter name | Description |
---|---|---|
[in] |
module |
Pointer to the software instance struct |
[in] |
tx_data |
Data to transmit |
Returns
Status of the procedure.
Return value | Description |
---|---|
STATUS_OK |
If the data was written |
STATUS_BUSY |
If the last write was not completed |