| axicdma Vitis Drivers API Documentation

- Overview
- APIs
- File List
- Examples

Functions
xaxicdma_example_simple_poll.c File Reference

## Overview

This file demonstrates how to use xaxicdma driver on the Xilinx AXI CDMA core (AXICDMA) to transfer packets in simple transfer mode without interrupt.

The completion of the transfer is checked through polling. Using polling mode can give better performance on an idle system, where the DMA engine is lowly loaded, and the application has nothing else to do. The polling mode can yield better turn-around time for DMA transfers.

Modify NUMBER_OF_TRANSFERS for a different number of simple transfer to be done in this test.

To see the debug print, you need a Uart16550 or uartlite in your system, and please set "-DDEBUG" in your compiler options for the example, also comment out the "#undef DEBUG" in xdebug.h. You need to rebuild your software executable.

    MODIFICATION HISTORY:

    Ver   Who  Date     Changes

    1.00a jz   07/30/10 First release
    2.01a rkv  01/28/11 Modified function prototype of
                           XAxiCdma_SimplePollExample to function taking only one
                           arguments i.e. device id.
    2.01a srt  03/06/12 Modified Flushing and Invalidation of Caches to fix CRs
                   648103, 648701.
    4.3   ms   01/22/17 Modified xil_printf statement in main function to
               ensure that "Successfully ran" and "Failed" strings are
               available in all examples. This is a fix for CR-965028.
          ms   04/05/17 Modified Comment lines in functions to
                        recognize it as documentation block for doxygen
                        generation of examples.
    4.6   rsp  09/13/19 Add error prints for failing scenarios.
                        Fix cache maintenance ops for source and dest buffer.
    4.7   rsp  12/06/19 For aarch64 include xil_mmu.h. Fixes gcc warning.
    4.11  sa   09/29/22 Fix infinite loops in the example.

## Functions
int | XAxiCdma_SimplePollExample (u16 DeviceId)
| The example to do the simple transfer through polling. More...
int | main ()
| The entry point for this example. More...

## Function Documentation

int main | ( | void |  | ) |

The entry point for this example.

It invokes the example function, and reports the execution status.

Parameters

  None. |

Returns
  - XST_SUCCESS if example finishes successfully
  - XST_FAILURE if example fails.

Note
  None.

References XAxiCdma_SimplePollExample().

int XAxiCdma_SimplePollExample | ( | u16 | DeviceId | ) |

The example to do the simple transfer through polling.

The constant NUMBER_OF_TRANSFERS defines how many times a simple transfer is repeated.

Parameters

  DeviceId | is the Device Id of the XAxiCdma instance

Returns
  - XST_SUCCESS if example finishes successfully
  - XST_FAILURE if error occurs

Note
  If the hardware build has problems with interrupt, then this function hangs

References XAxiCdma_CfgInitialize(), XAxiCdma_IntrDisable(), XAxiCdma_LookupConfig(), and XAXICDMA_XR_IRQ_ALL_MASK.

Referenced by main().