GxFpgaDmaTransfer

Purpose

Transfers a block of data using DMA.

Syntax

GxFpgaDmaTransfer (nHandle, bDmaRd, pvData, nElementSize, dwSize, dwMode, pvOp, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX3700 board.
bDmaRd
BOOL
Transfer operation:
0.      GXFPGA_DMA_WRITE = DMA write operation. The function will write the buffer data (pvData) content to the User’s FLEX FPGA memory location.
1.    GXFPGA_DMA_READ = DMA read operation. The function will read from the User’s FLEX FPGA memory location to the buffer (pvData).
pvData
PVOID
Pointer to an array of data. The array must be greater or equal to dwSize parameter.
nElementSize
SHORT
The pvData buffer element size.  See comment section for limitations.
dwElements
DWORD
Number of elements in the pvData buffer.  See comment section for limitations.
dwMode
DWORD
Not used.
pvOp
PVOID
Not used.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

For the GX3700, nElementSize multiplied by dwElements must be between 4 and 65536 and evenly divisible by 32.  For the GX3700e, nElementSize multiplied by dwElements must be between 4 and 65528 and evenly divisible by 8.

The function utilizes the built-in DMA capabilities in order to transfer data to or from the User’s FLEX FPGA at the fastest speed.

Note: The user needs to setup the path to the target memory as it is design dependent.

Example

The following example read a block of 1,024 bytes (256 DWords) of data from User’s FLEX FPGA memory location to the buffer:

 

DWORD adwData[256]

GxFpgaDmaTransfer (nHandle, GXFPGA_DMA_READ, &adwData, 4, 256, 0, 0, &nStatus);

 

See Also

GxFpgaDmaGetTransferStatus, GxFpgaGetErrorString