SAMV71 Xplained Ultra Software Package 1.5

spi_dma.c File Reference

#include "chip.h"

Go to the source code of this file.

Defines

#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.
void SPID_ConfigureCS (Spid *pSpid, uint32_t dwCS, uint32_t dwCsr)
 Configures the parameters for the device corresponding to the cs value.
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.
uint32_t SPID_IsBusy (const Spid *pSpid)
 Check if the SPI driver is busy.

Detailed Description

Implementation for the SPI Flash with xDMA driver.

Definition in file spi_dma.c.


Define Documentation

#define DMA_SPI_LLI   2

xDMA Link List size for SPI transmission

Definition at line 69 of file spi_dma.c.

#define USE_SPI_DMA

xDMA support

Definition at line 66 of file spi_dma.c.


Function Documentation

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:
pSpid Pointer to a Spid instance.
pSpiHw Associated SPI peripheral.
spiId SPI peripheral identifier.
pDmad Pointer to a Dmad instance.

Definition at line 282 of file spi_dma.c.

Here is the call graph for this function:

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

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

Parameters:
pSpid Pointer to a Spid instance.
cs number corresponding to the SPI chip select.
csr SPI_CSR value to setup.

Definition at line 309 of file spi_dma.c.

Here is the call graph for this function:

uint32_t SPID_IsBusy ( const Spid pSpid  ) 

Check if the SPI driver is busy.

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

Definition at line 387 of file spi_dma.c.

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:
pSpid Pointer to a Spid instance.
pCommand Pointer 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.

Definition at line 335 of file spi_dma.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines