The functions in this section provide control and accsss to the DMA interface of the SPI controller.
The SPI controller supports DMA signaling to indicate when the receive FIFO buffer has data ready to be read or when the transmit FIFO buffer needs data. It requires two DMA channels, one for transmit data and one for receive data. The SPI controller can issue single or burst DMA transfers and accepts burst acknowledges from the DMA. Software can trigger the DMA burst mode by enabling and programming an appropriate threshold value for the DMA interface. The typical setting of the threshold value is half the size of the Tx/Rx FIFO.
ALT_STATUS_CODE alt_spi_dma_tx_disable |
( |
ALT_SPI_DEV_t * |
spi_dev | ) |
|
Disable the transmit (Tx) FIFO DMA channel.
- 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_dma_tx_enable |
( |
ALT_SPI_DEV_t * |
spi_dev, |
|
|
const uint32_t |
level |
|
) |
| |
Enable and set the transmit data level for the transmit (Tx) FIFO DMA channel.
- Parameters
-
spi_dev | A pointer to the SPI controller device block instance. |
level | The transmit data level value at which the DMA request is made by the SPI controller transmit logic. The DMA request signal is generated when the number of valid data entries in the Tx FIFO is equal or below the level value. Valid values: 0 <= level < ALT_SPI_TX_FIFO_NUM_ENTRIES. |
- Return values
-
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Details about error status code |
ALT_STATUS_CODE alt_spi_dma_rx_disable |
( |
ALT_SPI_DEV_t * |
spi_dev | ) |
|
Disable the receive (Rx) FIFO DMA channel.
- 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_dma_rx_enable |
( |
ALT_SPI_DEV_t * |
spi_dev, |
|
|
const uint32_t |
level |
|
) |
| |
Enable and set the receive data level for the receive (Rx) FIFO DMA channel.
- Parameters
-
spi_dev | A pointer to the SPI controller device block instance. |
level | The receive data level value at which the DMA request is made by the SPI controller receive logic. The DMA request signal is generated when the number of valid data entries in the Rx FIFO is equal or below the level value. Valid values: 0 < level <= ALT_SPI_RX_FIFO_NUM_ENTRIES. |
- Return values
-
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Details about error status code |