csudma: xcsudma_intr_example.c File Reference

| csudma Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Macros | Functions | Variables
xcsudma_intr_example.c File Reference

## Overview

This file contains a design example using the XCsuDma driver in interrupt mode.

It sends data and expects to receive the same data through the device using the local loop back mode.

Note
  The example contains an infinite loop such that if interrupts are not working it may hang.

    MODIFICATION HISTORY:

    Ver   Who     Date     Changes

    1.0   vnsld  22/10/14 First release
    1.2   adk    11/22/17 Added peripheral test app support.
    1.4   adk     04/12/17 Added support for PMC DMA.
            adk    11/01/18 Declared static array rather than hard code memory for
                    buffers.
          adk    18/01/18 Remove unnecessary column in XIntc_Connect() API.
    1.5   adk    09/05/19 Added volatile keyword for DstDone variable to disable
                    optimizations.

## Macros
#define | INTG_CSUDMA_INTR_DEVICE_ID XPAR_XCSUDMA_INTR
| Interrupt device ID of CSU DMA device ID. More...
#define | CSU_SSS_CONFIG_OFFSET 0x008
| CSU SSS_CFG Offset. More...
#define | CSUDMA_LOOPBACK_CFG 0x00000050
| LOOP BACK configuration macro. More...
#define | PMC_SSS_CONFIG_OFFSET 0x500
| CSU SSS_CFG Offset. More...
#define | PMCDMA0_LOOPBACK_CFG 0x0000000D
| LOOP BACK configuration macro for PMCDMA0. More...
#define | PMCDMA1_LOOPBACK_CFG 0x00000090
| LOOP BACK configuration macro for PMCDMA1. More...
#define | SIZE 0x100
| Size of the data to be transfered. More...

## Functions
u32 DstBuf[SIZE] | __attribute__ ((aligned(64)))
| Destination buffer. More...
int | XCsuDma_IntrExample (INTC *IntcInstancePtr, XCsuDma *CsuDmaInstance, u16 DeviceId, u16 IntrId)
| This function performs data transfer in loop back mode in interrupt mode and verify the data. More...
void | IntrHandler (void *CallBackRef)
| This function is the interrupt handler for the CSU_DMA driver. More...
int | main (void)
| Main function to call the example. More...

## Variables
XCsuDma | CsuDma
| Instance of the Csu_Dma Device. More...

## Macro Definition Documentation

#define CSU_SSS_CONFIG_OFFSET 0x008

CSU SSS_CFG Offset.

#define CSUDMA_LOOPBACK_CFG 0x00000050

LOOP BACK configuration macro.

#define INTG_CSUDMA_INTR_DEVICE_ID XPAR_XCSUDMA_INTR

Interrupt device ID of CSU DMA device ID.

#define PMC_SSS_CONFIG_OFFSET 0x500

CSU SSS_CFG Offset.

#define PMCDMA0_LOOPBACK_CFG 0x0000000D

LOOP BACK configuration macro for PMCDMA0.

#define PMCDMA1_LOOPBACK_CFG 0x00000090

LOOP BACK configuration macro for PMCDMA1.

#define SIZE 0x100

Size of the data to be transfered.

## Function Documentation

u32 DstBuf [SIZE] __attribute__ | ( | (aligned(64)) |  | ) |

Destination buffer.

Source buffer.

void IntrHandler | ( | void * | CallBackRef | ) |

This function is the interrupt handler for the CSU_DMA driver.

This handler reads the interrupt status from the Status register, determines the source of the interrupts, calls according callbacks, and finally clears the interrupts.

Parameters

  CallBackRef | is the callback reference passed from the interrupt handler, which in our case is a pointer to the driver instance.

Returns
  None.

Note
  None.

int main | ( | void |  | ) |

Main function to call the example.

Returns
  - XST_SUCCESS if successful.
  - XST_FAILURE if failed.

Note
  None.

int XCsuDma_IntrExample | ( | INTC * | IntcInstancePtr,
|  | XCsuDma * | CsuDmaInstance,
|  | u16 | DeviceId,
|  | u16 | IntrId
| ) |  |

This function performs data transfer in loop back mode in interrupt mode and verify the data.

Parameters

  DeviceId | is the XPAR_<CSUDMA Instance>_DEVICE_ID value from xparameters.h.

Returns
  - XST_SUCCESS if successful.
  - XST_FAILURE if failed.

Note
  None.

## Variable Documentation

XCsuDma CsuDma

Instance of the Csu_Dma Device.