RTEMS  5.1
Macros | Functions
spi_dma.c File Reference
#include "chip.h"

Macros

#define USE_SPI_DMA
 
#define DMA_SPI_LLI   2
 

Functions

uint32_t SPID_Configure (Spid *pSpid, Spi *pSpiHw, uint8_t spiId, uint32_t spiMode, sXdmad *pXdmad)
 Initializes the Spid structure and the corresponding SPI & DMA hardware. select value. The driver will uses DMA channel 0 for RX and DMA channel 1 for TX. The DMA channels are freed automatically when no SPI command processing. More...
 
void SPID_ConfigureCS (Spid *pSpid, uint32_t dwCS, uint32_t dwCsr)
 Configures the parameters for the device corresponding to the cs value. More...
 
uint32_t SPID_SendCommand (Spid *pSpid, SpidCmd *pCommand)
 Starts a SPI master transfer. This is a non blocking function. It will return as soon as the transfer is started. More...
 
uint32_t SPID_IsBusy (const Spid *pSpid)
 Check if the SPI driver is busy. More...
 

Detailed Description

Implementation for the SPI Flash with xDMA driver.

Macro Definition Documentation

◆ DMA_SPI_LLI

#define DMA_SPI_LLI   2

xDMA Link List size for SPI transmission

◆ USE_SPI_DMA

#define USE_SPI_DMA

xDMA support

Function Documentation

◆ SPID_Configure()

uint32_t SPID_Configure ( Spid pSpid,
Spi pSpiHw,
uint8_t  spiId,
uint32_t  spiMode,
sXdmad pXdmad 
)

Initializes the Spid structure and the corresponding SPI & DMA hardware. select value. The driver will uses DMA channel 0 for RX and DMA channel 1 for TX. The DMA channels are freed automatically when no SPI command processing.

Parameters
pSpidPointer to a Spid instance.
pSpiHwAssociated SPI peripheral.
spiIdSPI peripheral identifier.
pDmadPointer to a Dmad instance.

◆ SPID_ConfigureCS()

void SPID_ConfigureCS ( Spid pSpid,
uint32_t  dwCS,
uint32_t  dwCsr 
)

Configures the parameters for the device corresponding to the cs value.

Parameters
pSpidPointer to a Spid instance.
csnumber corresponding to the SPI chip select.
csrSPI_CSR value to setup.

◆ SPID_IsBusy()

uint32_t SPID_IsBusy ( const Spid pSpid)

Check if the SPI driver is busy.

Parameters
pSpidPointer to a Spid instance.
Returns
1 if the SPI driver is currently busy executing a command; otherwise

◆ SPID_SendCommand()

uint32_t SPID_SendCommand ( Spid pSpid,
SpidCmd pCommand 
)

Starts a SPI master transfer. This is a non blocking function. It will return as soon as the transfer is started.

Parameters
pSpidPointer to a Spid instance.
pCommandPointer to the SPI command to execute.
Returns
0 if the transfer has been started successfully; otherwise returns SPID_ERROR_LOCK is the driver is in use, or SPID_ERROR if the command is not valid.