| axicdma Vitis Drivers API Documentation

- Overview
- APIs
- File List
- Examples

Functions
xaxicdma_example_simple_intr.c File Reference

## Overview

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

Modify the NUMBER_OF_TRANSFER constant to have different number of simple transfers done in this test.

This example assumes that the system has an interrupt controller.

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:

     . Updated the debug print on type casting to avoid warnings on u32. Cast
       u32 to (unsigned int) to use the x format.

    Ver   Who  Date     Changes

    1.00a jz   07/30/10 First release
    2.01a rkv  01/28/11 Changed function prototype of XAxiCdma_SimpleIntrExample
                           to a function taking arguments interrupt instance,device
                           instance,device id,device interrupt id
                   Added interrupt support for Cortex A9
    2.01a srt  03/05/12 Modified interrupt support for Zynq.
                           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.4   rsp  02/22/18 Support data buffers above 4GB.Use UINTPTR for
                        typecasting buffer address(CR-995116).
    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.8      sk   09/28/20 Fix the compilation error for xreg_cortexa9.h
                           preprocessor on R5 processor.
    4.11  sa   09/29/22 Fix infinite loops in the example.

## Functions
int | XAxiCdma_SimpleIntrExample (XScuGic *IntcInstancePtr, XAxiCdma *InstancePtr, u16 DeviceId, u32 IntrId)
| The example to do the simple transfer through interrupt. 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_SimpleIntrExample().

int XAxiCdma_SimpleIntrExample | ( | XScuGic * | IntcInstancePtr,
|  | XAxiCdma * | InstancePtr,
|  | u16 | DeviceId,
|  | u32 | IntrId
| ) |  |

The example to do the simple transfer through interrupt.

Parameters

  IntcInstancePtr | is a pointer to the INTC instance
  InstancePtr | is a pointer to the XAxiCdma instance
  DeviceId | is the Device Id of the XAxiCdma instance
  IntrId | is the interrupt Id for the XAxiCdma instance in build

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_IntrEnable(), XAxiCdma_IntrHandler(), XAxiCdma_LookupConfig(), and XAXICDMA_XR_IRQ_ALL_MASK.

Referenced by main().