RTEMS  5.1
Data Structures | Macros | Typedefs | Functions
qspi_dma.h File Reference
#include "chip.h"
#include "../../../../utils/utility.h"

Go to the source code of this file.

Data Structures

struct  _Qspid
 

Macros

#define QSPID_ERROR   1
 
#define QSPID_ERROR_LOCK   2
 
#define QSPID_CH_NOT_ENABLED   0xFF
 

Typedefs

typedef void(* QspidCallback) (uint8_t, void *)
 
typedef struct _Qspid QspiDma_t
 

Functions

uint32_t QSPID_Configure (QspiDma_t *pQspidma, QspiMode_t Mode, uint32_t dwConfiguration, sXdmad *pXdmad)
 Initializes the pQspidma structure and the corresponding QSPI & DMA . hardware select value. More...
 
uint32_t QSPID_EnableQspiRxChannel (QspiDma_t *pQspidma)
 Enables a QSPI Rx channel. This function will allocate a dma Rx channel for QSPI. More...
 
uint32_t QSPID_EnableQspiTxChannel (QspiDma_t *pQspidma)
 Enables a QSPI Tx channel. This function will allocate a dma Tx channel for QSPI. More...
 
uint32_t QSPID_DisableQspiRxChannel (QspiDma_t *pQspidma)
 Disables a QSPI Rx channel. This function will de-allocate previous allocated dma Rx channel for QSPI. More...
 
uint32_t QSPID_DisableQspiTxChannel (QspiDma_t *pQspidma)
 Disables a QSPI Tx channel. This function will de-allocate previous allocated dma Tx channel for QSPI. More...
 
uint32_t QSPID_DisableSpiChannel (QspiDma_t *pQspidma)
 Disables a QSPI SPI Rx and Tx channels. This function will de-allocate privious allocated dma Rx, Txchannel for QSPI in SPI mode. More...
 
uint32_t QSPID_EnableSpiChannel (QspiDma_t *pQspidma)
 Enables a QSPI SPI Rx channel. This function will allocate a dma Rx channel for QSPI SPI mode. More...
 
uint32_t QSPID_ReadWriteQSPI (QspiDma_t *pQspidma, Access_t const ReadWrite)
 Starts a QSPI read or write operation. More...
 
uint32_t QSPID_ReadWriteSPI (QspiDma_t *pQspidma, Access_t const ReadWrite)
 Starts a SPI master transfer. This is a non blocking function. It will return as soon as the transfer is started. More...
 
uint32_t QSPID_IsBusy (volatile uint8_t *QspiSemaphore)
 Check if the QSPI driver is busy. More...
 

Detailed Description

Implementation of SPI driver, transfer data through DMA.

Macro Definition Documentation

◆ QSPID_ERROR

#define QSPID_ERROR   1

An unspecified error has occurred.

◆ QSPID_ERROR_LOCK

#define QSPID_ERROR_LOCK   2

SPI driver is currently in use.

Typedef Documentation

◆ QspidCallback

typedef void(* QspidCallback) (uint8_t, void *)

SPI transfer complete callback.

◆ QspiDma_t

typedef struct _Qspid QspiDma_t

Constant structure associated with SPI port. This structure prevents client applications to have access in the same time.

Function Documentation

◆ QSPID_Configure()

uint32_t QSPID_Configure ( QspiDma_t pQspidma,
QspiMode_t  Mode,
uint32_t  dwConf,
sXdmad pXdmad 
)

Initializes the pQspidma structure and the corresponding QSPI & DMA . hardware select value.

Parameters
pQspidmaPointer to a QspiDma_t instance.
ModeAssociated SPI peripheral.
dwConfQSPI peripheral configuration.
pXdmadPointer to a Xdmad instance.

◆ QSPID_DisableQspiRxChannel()

uint32_t QSPID_DisableQspiRxChannel ( QspiDma_t pQspidma)

Disables a QSPI Rx channel. This function will de-allocate previous allocated dma Rx channel for QSPI.

Parameters
pQspidmaPointer to a Spid instance.
Returns
0 if the transfer has been started successfully; otherwise returns QSPID_ERROR_LOCK is the driver is in use, or QSPID_ERROR if the command is not valid.

◆ QSPID_DisableQspiTxChannel()

uint32_t QSPID_DisableQspiTxChannel ( QspiDma_t pQspidma)

Disables a QSPI Tx channel. This function will de-allocate previous allocated dma Tx channel for QSPI.

Parameters
pQspidmaPointer to a Spid instance.
Returns
0 if the transfer has been started successfully; otherwise returns QSPID_ERROR_LOCK is the driver is in use, or QSPID_ERROR if the command is not valid.

◆ QSPID_DisableSpiChannel()

uint32_t QSPID_DisableSpiChannel ( QspiDma_t pQspidma)

Disables a QSPI SPI Rx and Tx channels. This function will de-allocate privious allocated dma Rx, Txchannel for QSPI in SPI mode.

Parameters
pQspidmaPointer to a Spid instance.
Returns
0 if the transfer has been started successfully; otherwise returns QSPID_ERROR_LOCK is the driver is in use, or QSPID_ERROR if the command is not valid.

◆ QSPID_EnableQspiRxChannel()

uint32_t QSPID_EnableQspiRxChannel ( QspiDma_t pQspidma)

Enables a QSPI Rx channel. This function will allocate a dma Rx channel for QSPI.

Parameters
pQspidmaPointer to a Spid instance.
Returns
0 if the transfer has been started successfully; otherwise returns QSPID_ERROR_LOCK is the driver is in use, or QSPID_ERROR if the command is not valid.

◆ QSPID_EnableQspiTxChannel()

uint32_t QSPID_EnableQspiTxChannel ( QspiDma_t pQspidma)

Enables a QSPI Tx channel. This function will allocate a dma Tx channel for QSPI.

Parameters
pQspidmaPointer to a Spid instance.
Returns
0 if the transfer has been started successfully; otherwise returns QSPID_ERROR_LOCK is the driver is in use, or QSPID_ERROR if the command is not valid.

◆ QSPID_EnableSpiChannel()

uint32_t QSPID_EnableSpiChannel ( QspiDma_t pQspidma)

Enables a QSPI SPI Rx channel. This function will allocate a dma Rx channel for QSPI SPI mode.

Parameters
pQspidmaPointer to a Spid instance.
Returns
0 if the transfer has been started successfully; otherwise returns QSPID_ERROR_LOCK is the driver is in use, or QSPID_ERROR if the command is not valid.

◆ QSPID_IsBusy()

uint32_t QSPID_IsBusy ( volatile uint8_t *  QspiSemaphore)

Check if the QSPI driver is busy.

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

◆ QSPID_ReadWriteQSPI()

uint32_t QSPID_ReadWriteQSPI ( QspiDma_t pQspidma,
Access_t const  ReadWrite 
)

Starts a QSPI read or write operation.

Parameters
pQspidmaPointer to a Qspid instance.
ReadWriteDefines the memory access type
Returns
0 if the transfer has been started successfully; otherwise returns QSPID_ERROR_LOCK is the driver is in use, or QSPID_ERROR if the command is not valid.

◆ QSPID_ReadWriteSPI()

uint32_t QSPID_ReadWriteSPI ( QspiDma_t pQspidma,
Access_t const  ReadWrite 
)

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.