4. Software Programming Model
Scans the device feature chain for DMA BBBs and count all available channels.
|fpgaDMAOpen||Opens a handle to the DMA channel.|
|fpgaDMAClose||Closes a handle to the DMA channel.|
|fpgaGetDMAChannelType||Query DMA channel type.
Possible type of query channel is TX streaming (TX_ST) and RX streaming (RX_ST).
|fpgaDMATransferInit||Initializes an object that represents the DMA transfer.|
|fpgaDMATransferReset||Resets the DMA transfer attribute object to default values.|
|fpgaDMATransferDestroy||Destroys the DMA transfer attribute object.|
|fpgaDMATransferSetSrc||Sets the source address of the transfer. This address must be 64 byte aligned.|
|fpgaDMATransferSetDst||Sets the destination address of the transfer. This address must be 64 byte aligned.|
|fpgaDMATransferSetLen||Sets the transfer lengths in bytes. For non-packet transfers, you must set the transfer length to a multiple of 64 bytes. For packet transfers, this is not a requirement.|
|fpgaDMATransferSetTransferType||Sets the transfer type.
Legal values are:
|fpgaDMATransferSetTxControl||Sets TX control. This allows the driver to optionally generate in-band SOP and EOP in the data stream sent from the TX DMA.
TX control is only valid for HOST_MM_TO_FPGA_ST transfer.
Valid values are:
|fpgaDMATransferSetRxControl||Sets RX control. This allows the driver to handle an unknown amount of receive data from the FPGA, When END_ON_EOP is set, the RX DMA ends the transfer when EOP arrives in the receive stream or when rx_count bytes have been received (whichever occurs first).
RX control is only valid for FPGA_ST_TO_HOST_MM transfer.
Valid values are:
|fpgaDMATransferSetTransferCallback||Registers callback for notification on asynchronous transfer completion. If you specify a callback, fpgaDMATransfer returns immediately (asynchronous transfer).
If you do not specify a callback, fpgaDMATransfer returns after the transfer is complete (synchronous/blocking transfer).
|fpgaDMATransferGetBytesTransferred||Returns the number of bytes transferred by an RX transfer request. The application uses this data when receiving packetized data (rx_control set to END_ON_EOP when transfer request was issued).|
|fpgaDMATransferCheckEopArrived||Retrieves EOP status
Legal vales are:
|fpgaDMATransferSetLast||Indicates the last transfer so the DMA can start processing the prefetched transfers. The default value is 64 transfers in the pipeline before the DMA starts to work on the transfers.|
|fpgaDMATransfer||Performs a DMA transfer.|
For more information about the API, input, and output arguments, refer to the header file located at $OPAE_PLATFORM_ROOT/hw/samples/streaming_dma_afu/sw/fpga_dma.h
To know more about software driver use model, refer to the README file located at $OPAE_PLATFORM_ROOT/hw/samples/streaming_dma_afu/README.md
Did you find the information on this page useful?