csudma
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups Pages
xcsudma_polled_example.c File Reference

Overview

This file contains an example using the XCsuDma driver in polled mode.

This function works in loop back mode and tests whether transfer of data is completed properly or not.

MODIFICATION HISTORY:
Ver   Who     Date     Changes


1.0 vnsld 22/10/14 First release 1.4 adk 04/12/17 Added support for PMC DMA. 1.14 adk 04/05/23 Added support for system device-tree flow.

#include "xcsudma.h"
#include "xparameters.h"

Macros

#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 transferred. More...
 

Functions

int XCsuDma_PolledExample (UINTPTR BaseAddress)
 This function performs data transfer in loop back mode in polled mode and verify the data. More...
 
int main (void)
 Main function to call the example. More...
 

Variables

u32 SrcBuf [SIZE]
 Destination buffer. More...
 
u32 DstBuf [SIZE]
 Source buffer. More...
 
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 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 transferred.

Function Documentation

int main ( void  )

Main function to call the example.

Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if failed.
Note
None.
int XCsuDma_PolledExample ( UINTPTR  BaseAddress)

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

Parameters
BaseAddresscontains the base address of the device
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if failed.
Note
None.

Variable Documentation

XCsuDma CsuDma

Instance of the Csu_Dma Device.

u32 DstBuf[SIZE]

Source buffer.

u32 SrcBuf[SIZE]

Destination buffer.