The receive FIFO has a configurable threshold value that controls the level of entries (or above) that sets the RX_FULL status condition and triggers an interrupt. The valid range is 0..(ALT_SPI_RX_FIFO_NUM_ENTRIES - 1), with the additional restriction that SPI controller does not allow this value to be set to a value larger than the depth of the buffer. If an attempt is made to do that, the actual value set will be the maximum depth of the buffer. A value of 0 sets the threshold for 1 entry, and a value of (ALT_SPI_RX_FIFO_NUM_ENTRIES - 1) sets the threshold for ALT_SPI_RX_FIFO_NUM_ENTRIES entries.
#define ALT_SPI_RX_FIFO_NUM_ENTRIES 256 |
The number of entries (depth) of the SPI controller receive FIFO.
ALT_STATUS_CODE alt_spi_rx_fifo_deq |
( |
ALT_SPI_DEV_t * |
spi_dev, |
|
|
uint16_t * |
data |
|
) |
| |
Reads a data frame from the receive (Rx) FIFO.
- Parameters
-
spi_dev | A pointer to the SPI controller device block instance. |
data | [out] The data frame read from into the Rx FIFO. The data parameter type is sized large enough to contain the widest possible data frame size. |
- Return values
-
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Details about error status code |
ALT_STATUS_CODE alt_spi_rx_fifo_is_empty |
( |
ALT_SPI_DEV_t * |
spi_dev | ) |
|
Returns ALT_E_TRUE when the receive FIFO is empty.
- Parameters
-
spi_dev | A pointer to the SPI controller device block instance. |
- Return values
-
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Details about error status code |
ALT_STATUS_CODE alt_spi_rx_fifo_is_full |
( |
ALT_SPI_DEV_t * |
spi_dev | ) |
|
Returns ALT_E_TRUE when the receive FIFO is completely full.
- Parameters
-
spi_dev | A pointer to the SPI controller device block instance. |
- Return values
-
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Details about error status code |
ALT_STATUS_CODE alt_spi_rx_fifo_level_get |
( |
ALT_SPI_DEV_t * |
spi_dev, |
|
|
uint32_t * |
num_entries |
|
) |
| |
Returns the number of valid entries in the receive FIFO.
- Parameters
-
spi_dev | A pointer to the SPI controller device block instance. |
num_entries | [out] The number of entries in the receive FIFO. |
- Return values
-
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Details about error status code |
ALT_STATUS_CODE alt_spi_rx_fifo_threshold_get |
( |
ALT_SPI_DEV_t * |
spi_dev, |
|
|
uint8_t * |
threshold |
|
) |
| |
Gets the current receive FIFO threshold level value.
- Parameters
-
spi_dev | A pointer to the SPI controller device block instance. |
threshold | [out] The current threshold value. |
- Return values
-
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Details about error status code |
ALT_STATUS_CODE alt_spi_rx_fifo_threshold_set |
( |
ALT_SPI_DEV_t * |
spi_dev, |
|
|
const uint8_t |
threshold |
|
) |
| |
Sets the current receive FIFO threshold level value.
- Parameters
-
spi_dev | A pointer to the SPI controller device block instance. |
threshold | The threshold value. |
- Return values
-
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Details about error status code |