XilinxProcessorIPLib/drivers/axicdma/examples/xaxicdma_example_simple_poll.c
int XAxiCdma_SimplePollExample(u16 DeviceId)
{
	XAxiCdma_Config *CfgPtr;
	int Status;
	int SubmitTries = 10;	/* try 10 times on submission */
	int Tries = NUMBER_OF_TRANSFERS;
	int Index;

	/* Initialize the XAxiCdma device.
	 */
	CfgPtr = XAxiCdma_LookupConfig(DeviceId);
	if (!CfgPtr) {
		return XST_FAILURE;
	}

	Status = XAxiCdma_CfgInitialize(&AxiCdmaInstance, CfgPtr,
		CfgPtr->BaseAddress);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/* Disable interrupts, we use polling mode
	 */
	XAxiCdma_IntrDisable(&AxiCdmaInstance, XAXICDMA_XR_IRQ_ALL_MASK);

	for (Index = 0; Index < Tries; Index++) {
		Status = DoSimplePollTransfer(&AxiCdmaInstance,
			BUFFER_BYTESIZE, SubmitTries);
		if (Status != XST_SUCCESS) {
				return XST_FAILURE;
		}
	}

	/* Test finishes successfully
	 */
	return XST_SUCCESS;
}
/*****************************************************************************/
/**
* The example to do the simple transfer through polling. The constant
* NUMBER_OF_TRANSFERS defines how many times a simple transfer is repeated.
*
* @param	DeviceId is the Device Id of the XAxiCdma instance
*
* @return
*		- XST_SUCCESS if example finishes successfully
*		- XST_FAILURE if error occurs
*
* @note		If the hardware build has problems with interrupt,
*			then this function hangs
*
*
******************************************************************************/
The example to do the simple transfer through polling. The constant
NUMBER_OF_TRANSFERS defines how many times a simple transfer is repeated.
The example to do the simple transfer through polling . The constant NUMBER_OF_TRANSFERS defines how many times a simple transfer is repeated .
int XAxiCdma_SimplePollExample(u16 DeviceId)
{
	XAxiCdma_Config *CfgPtr;
	int Status;
	int SubmitTries = 10;	
	int Tries = NUMBER_OF_TRANSFERS;
	int Index;
	CfgPtr = XAxiCdma_LookupConfig(DeviceId);
	if (!CfgPtr) {
		return XST_FAILURE;
	}
	Status = XAxiCdma_CfgInitialize(&AxiCdmaInstance, CfgPtr,
		CfgPtr->BaseAddress);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	XAxiCdma_IntrDisable(&AxiCdmaInstance, XAXICDMA_XR_IRQ_ALL_MASK);
	for (Index = 0; Index < Tries; Index++) {
		Status = DoSimplePollTransfer(&AxiCdmaInstance,
			BUFFER_BYTESIZE, SubmitTries);
		if (Status != XST_SUCCESS) {
				return XST_FAILURE;
		}
	}
	return XST_SUCCESS;
}
int XAxiCdma_SimplePollExample ( u16 DeviceId ) { XAxiCdma_Config * CfgPtr ; int Status ; int SubmitTries = 10 ; int Tries = NUMBER_OF_TRANSFERS ; int Index ; CfgPtr = XAxiCdma_LookupConfig ( DeviceId ) ; if ( ! CfgPtr ) { return XST_FAILURE ; } Status = XAxiCdma_CfgInitialize ( & AxiCdmaInstance , CfgPtr , CfgPtr -> BaseAddress ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } XAxiCdma_IntrDisable ( & AxiCdmaInstance , XAXICDMA_XR_IRQ_ALL_MASK ) ; for ( Index = 0 ; Index < Tries ; Index ++ ) { Status = DoSimplePollTransfer ( & AxiCdmaInstance , BUFFER_BYTESIZE , SubmitTries ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } } return XST_SUCCESS ; }
The example to do the simple transfer through polling.
The example to do the simple transfer through polling .
/* try 10 times on submission */ /* Initialize the XAxiCdma device.
	 */ /* Disable interrupts, we use polling mode
	 */ /* Test finishes successfully
	 */