/* Transfers a single SPI character. 
Note that this function does not handle the SS (Slave Select) pin(s) in master mode; this must be handled from the user application. */
enum status_code spi_write(struct spi_module *module, uint8_t tx_data)
/* Transfers a single SPI character. 
Note that this function does not handle the SS (Slave Select) pin(s) in master mode; this must be handled from the user application. */
enum status_code spi_write(struct spi_module *module, uint8_t tx_data)
{
	Assert(module);
	Assert(module->hw);
	Spi *const spi_module = (module->hw);
	if (!_spi_is_ready_to_write(spi_module)) {
		return STATUS_BUSY;
	}
	spi_module->TRANSMIT_DATA.reg = tx_data & SPI_TRANSMIT_DATA_MASK;
	return STATUS_OK;
}