Software Drivers
Main Page | Data Structures | File List | Data Fields | Globals

xaxidma.h File Reference


Detailed Description


Data Structures

struct  XAxiDma
struct  XAxiDma_Config

Defines

#define XAxiDma_GetTxRing(InstancePtr)
#define XAxiDma_GetRxRing(InstancePtr)

Typedefs

typedef XAxiDma XAxiDma

Functions

XAxiDma_ConfigXAxiDma_LookupConfig (u32 DeviceId)
int XAxiDma_CfgInitialize (XAxiDma *InstancePtr, XAxiDma_Config *Config)
void XAxiDma_Reset (XAxiDma *InstancePtr)
int XAxiDma_ResetIsDone (XAxiDma *InstancePtr)
int XAxiDma_Pause (XAxiDma *InstancePtr)
int XAxiDma_Resume (XAxiDma *InstancePtr)


Define Documentation

#define XAxiDma_GetRxRing InstancePtr   ) 
 

Get Receive (Rx) Ring ptr

Warning: This has a different API than the LLDMA driver. It now returns the pointer to the BD ring.

Parameters:
InstancePtr is a pointer to the DMA engine instance to be worked on.
Returns:
Pointer to the Rx Ring
Note:
C-style signature: XAxiDma_BdRing * XAxiDma_GetRxRing(XAxiDma * InstancePtr)

#define XAxiDma_GetTxRing InstancePtr   ) 
 

Get Transmit (Tx) Ring ptr

Warning: This has a different API than the LLDMA driver. It now returns the pointer to the BD ring.

Parameters:
InstancePtr is a pointer to the DMA engine instance to be worked on.
Returns:
Pointer to the Tx Ring
Note:
C-style signature: XAxiDma_BdRing * XAxiDma_GetTxRing(XAxiDma * InstancePtr)


Typedef Documentation

typedef struct XAxiDma XAxiDma
 

The XAxiDma driver instance data. An instance must be allocated for each DMA engine in use.


Function Documentation

int XAxiDma_CfgInitialize XAxiDma InstancePtr,
XAxiDma_Config Config
 

This function initializes a DMA engine. This function must be called prior to using a DMA engine. Initializing a engine includes setting up the register base address, setting up the instance data, and ensuring the hardware is in a quiescent state.

Parameters:
InstancePtr is a pointer to the DMA engine instance to be worked on.
Config is a pointer to an XAxiDma_Config structure. It contains the information about the hardware build, including base address, and whether status control stream (StsCntrlStrm), MM2S and S2MM are included in the build.
Returns:
  • XST_SUCCESS for successful initialization
  • XST_INVALID_PARAM if pointer to the configuration structure is NULL
  • XST_DMA_ERROR if reset operation failed at the end of initialization
Note:
We assume the hardware building tool will check and error out for a hardware build that has no transfer channels.

XAxiDma_Config* XAxiDma_LookupConfig u32  DeviceId  ) 
 

Look up the hardware configuration for a device instance

Parameters:
DeviceId is the unique device ID of the device to lookup for
Returns:
The configuration structure for the device. If the device ID is not found, a NULL pointer is returned.

int XAxiDma_Pause XAxiDma InstancePtr  ) 
 

Pause DMA transactions on both channels.

If the engine is running and doing transfers, this function does not stop the DMA transactions immediately, because then hardware will throw away our previously queued transfers. All submitted transfers will finish. Transfers submitted after this function will not start until XAxiDma_BdRingStart() or XAxiDma_Resume() is called.

Parameters:
InstancePtr is a pointer to the DMA engine instance to be worked on.
Returns:
  • XST_SUCCESS if successful
  • XST_NOT_SGDMA, if the driver instance is not initialized

void XAxiDma_Reset XAxiDma InstancePtr  ) 
 

Reset both TX and RX channels of a DMA engine.

Reset one channel resets the whole AXI DMA engine.

Any DMA transaction in progress will finish gracefully before engine starts reset. Any other transactions that have been submitted to hardware will be discarded by the hardware.

Parameters:
InstancePtr is a pointer to the DMA engine instance to be worked on.
Returns:
None
Note:
After the reset:
  • All interrupts are disabled.
  • Engine is halted

int XAxiDma_ResetIsDone XAxiDma InstancePtr  ) 
 

Check whether reset is done

Parameters:
InstancePtr is a pointer to the DMA engine instance to be worked on.
Returns:
1 if reset is done, 0 otherwise

int XAxiDma_Resume XAxiDma InstancePtr  ) 
 

Resume DMA transactions on both channels.

Parameters:
InstancePtr is a pointer to the DMA engine instance to be worked on.
Returns:
  • XST_SUCCESS for success
  • XST_NOT_SGDMA if the driver instance has not been initialized
  • XST_DMA_ERROR if one of the channels fails to start