Line 141... |
Line 141... |
|
|
|
|
/**********************************************************************//**
|
/**********************************************************************//**
|
* Initiate SPI transfer.
|
* Initiate SPI transfer.
|
*
|
*
|
* @warning The SPI always sends MSB first.
|
|
*
|
|
* @note This function is blocking.
|
* @note This function is blocking.
|
*
|
*
|
* @param tx_data Transmit data (8/16/24/32-bit, LSB-aligned).
|
* @param tx_data Transmit data (8/16/24/32-bit, LSB-aligned).
|
* @return Receive data (8/16/24/32-bit, LSB-aligned).
|
* @return Receive data (8/16/24/32-bit, LSB-aligned).
|
**************************************************************************/
|
**************************************************************************/
|
Line 157... |
Line 155... |
|
|
return NEORV32_SPI.DATA;
|
return NEORV32_SPI.DATA;
|
}
|
}
|
|
|
|
|
|
/**********************************************************************//**
|
|
* Initiate SPI TX transfer (non-blocking).
|
|
*
|
|
* @param tx_data Transmit data (8/16/24/32-bit, LSB-aligned).
|
|
**************************************************************************/
|
|
void neorv32_spi_put_nonblocking(uint32_t tx_data) {
|
|
|
|
NEORV32_SPI.DATA = tx_data; // trigger transfer
|
|
}
|
|
|
|
|
|
/**********************************************************************//**
|
|
* Get SPI RX data (non-blocking).
|
|
*
|
|
* @return Receive data (8/16/24/32-bit, LSB-aligned).
|
|
**************************************************************************/
|
|
uint32_t neorv32_spi_get_nonblocking(void) {
|
|
|
|
return NEORV32_SPI.DATA;
|
|
}
|
|
|
|
|
/**********************************************************************//**
|
/**********************************************************************//**
|
* Check if SPI transceiver is busy.
|
* Check if SPI transceiver is busy.
|
*
|
*
|
* @return 0 if idle, 1 if busy
|
* @return 0 if idle, 1 if busy
|
**************************************************************************/
|
**************************************************************************/
|