RTEMS  5.1
Functions

Functions

ALT_STATUS_CODE alt_qspi_dma_disable (void)
 
ALT_STATUS_CODE alt_qspi_dma_enable (void)
 
ALT_STATUS_CODE alt_qspi_dma_config_get (uint32_t *single_type_sz, uint32_t *burst_type_sz)
 
ALT_STATUS_CODE alt_qspi_dma_config_set (const uint32_t single_type_sz, const uint32_t burst_type_sz)
 

Detailed Description

The DMA peripheral request controller is only used for the indirect mode of operation where data is temporarily stored in the SRAM. The QSPI flash controller uses the DMA peripheral request interface to trigger the external DMA into performing data transfers between memory and the QSPI controller.

There are two DMA peripheral request interfaces, one for indirect reads and one for indirect writes. The DMA peripheral request controller can issue two types of DMA requests, single or burst, to the external DMA. The number of bytes for each single or burst request is specified using the alt_qspi_dma_config_set(). The DMA peripheral request controller splits the total amount of data to be transferred into a number of DMA burst and single requests by dividing the total number of bytes by the number of bytes specified in the burst request, and then dividing the remainder by the number of bytes in a single request.

When programming the DMA controller, the burst request size must match the burst request size set in the quad SPI controller to avoid quickly reaching an overflow or underflow condition.

Function Documentation

◆ alt_qspi_dma_config_get()

ALT_STATUS_CODE alt_qspi_dma_config_get ( uint32_t *  single_type_sz,
uint32_t *  burst_type_sz 
)

Get the current DMA peripheral configuration.

This function returns the QSPI DMA peripheral interface single and burst type transfer size configurations.

Parameters
single_type_sz[out] The number of bytes for each DMA single type request. Value must be a power of 2 between 1 and 32728.
burst_type_sz[out] The number of bytes for each DMA burst type request. Value must be a power of 2 between 1 and 32728.
Return values
ALT_E_SUCCESSIndicates successful completion.
ALT_E_ERRORIndicates an error occurred.

◆ alt_qspi_dma_config_set()

ALT_STATUS_CODE alt_qspi_dma_config_set ( const uint32_t  single_type_sz,
const uint32_t  burst_type_sz 
)

Set the DMA peripheral configuration.

This function configures the QSPI DMA peripheral interface single and burst type transfer sizes. The DMA configruation should be setup while the controller is idle. Because all transfers are required to be word aligned, the smallest DMA request is 4 bytes.

This API requires that the QSPI controller be idle, as determined by alt_qspi_is_idle().

Parameters
single_type_szThe number of bytes for each DMA single type request. Value must be a power of 2 between 4 and 32768.
burst_type_szThe number of bytes for each DMA burst type request. Value must be a power of 2 between 4 and 32768. Bursts must be equal or larger than single requests.
Return values
ALT_E_SUCCESSIndicates successful completion.
ALT_E_ERRORIndicates an error occurred.

◆ alt_qspi_dma_disable()

ALT_STATUS_CODE alt_qspi_dma_disable ( void  )

Disable the QSPI DMA peripheral interface.

Return values
ALT_E_SUCCESSIndicates successful completion.
ALT_E_ERRORIndicates an error occurred.

◆ alt_qspi_dma_enable()

ALT_STATUS_CODE alt_qspi_dma_enable ( void  )

Enable the QSPI DMA peripheral interface.

Enable the QSPI DMA handshaking logic. When enabled the QSPI will trigger DMA transfer requests via the DMA peripheral interface.

Return values
ALT_E_SUCCESSIndicates successful completion.
ALT_E_ERRORIndicates an error occurred.