csudma
Xilinx SDK Drivers API Documentation
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

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 SRC_ADDR   0x04200000
 Source Address. More...
 
#define DST_ADDR   0x04300000
 Destination Address. More...
 
#define SIZE   0x100
 Size of the data to be transfered. More...
 

Functions

int XCsuDma_IntrExample (u16 DeviceId)
 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

◆ CSU_SSS_CONFIG_OFFSET

#define CSU_SSS_CONFIG_OFFSET   0x008

CSU SSS_CFG Offset.

◆ CSUDMA_LOOPBACK_CFG

#define CSUDMA_LOOPBACK_CFG   0x00000050

LOOP BACK configuration macro.

◆ DST_ADDR

#define DST_ADDR   0x04300000

Destination Address.

◆ INTG_CSUDMA_INTR_DEVICE_ID

#define INTG_CSUDMA_INTR_DEVICE_ID   XPAR_XCSUDMA_INTR

Interrupt device ID of CSU DMA device ID.

◆ SIZE

#define SIZE   0x100

Size of the data to be transfered.

◆ SRC_ADDR

#define SRC_ADDR   0x04200000

Source Address.

Function Documentation

◆ IntrHandler()

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
CallBackRefis the callback reference passed from the interrupt handler, which in our case is a pointer to the driver instance.
Returns
None.
Note
None.

◆ main()

int main ( void  )

Main function to call the example.

Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if failed.
Note
None.

◆ XCsuDma_IntrExample()

int XCsuDma_IntrExample ( u16  DeviceId)

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

Parameters
DeviceIdis the XPAR_<CSUDMA Instance>_DEVICE_ID value from xparameters.h.
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if failed.
Note
None.

Variable Documentation

◆ CsuDma

XCsuDma CsuDma

Instance of the Csu_Dma Device.