/*
 * DMA.h
 *
 *  Created on: Feb 20, 2017
 *      Author: Kasun
 */

#ifndef SRC_DMA_H_
#define SRC_DMA_H_

#include <stdio.h>
//#include "platform.h"
#include "xil_printf.h"
#include "xaxidma.h"
#include "xparameters.h"
#include "xtime_l.h"

//#define CHECK_DATA

/*
 * Device hardware build related constants.
 */
// *** DMA parameters ****//
#define DMA_DEV_ID		XPAR_AXIDMA_0_DEVICE_ID

#define TEST_START_VALUE	0xC

#define NUMBER_OF_TRANSFERS	1

int n;

//**** tlast parameter ****//
#define PACKET_LENGTH_BASEADDR	XPAR_GPIO_0_BASEADDR

/************************** Function Prototypes ******************************/

int XAxiDma_SimplePollExample(u16 DeviceId);
#ifdef CHECK_DATA
static int CheckData(void);
#endif
int DMA_init(unsigned int PKT_LEN_WORDS);
int DMA_Transfer(unsigned int Intan_RX_BUF_BASE, unsigned int PKT_LEN_BYTES);
void DMA_Tranfer_sim(unsigned int DMA_addr, int DMA_size);

/************************** Variable Definitions *****************************/
/*
 * Device instance definitions
 */
//static struct XAxiDma *AxiDma;
XAxiDma *AxiDma;

#endif /* SRC_DMA_H_ */
