XilinxProcessorIPLib/drivers/dpdma/src/xdpdma.c
int XDpDma_Trigger(XDpDma *InstancePtr, XDpDma_ChannelType Channel)
{
	u32 Trigger = 0;
	u8 Index = 0;
	u8 NumPlanes = 0;
	/* Verify arguments. */
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(Channel <= AudioChan1);

	switch(Channel) {
	case VideoChan:
		if(InstancePtr->Video.VideoInfo == NULL) {
			return (int)XST_FAILURE;
		}
		else {
			NumPlanes = (u8)InstancePtr->Video.VideoInfo->Mode;
			for(Index = 0; Index <= NumPlanes; Index++) {
				Trigger |= (u32)XDPDMA_GBL_TRG_CH0_MASK <<
					   (u32)Index;
				InstancePtr->Video.TriggerStatus =
					XDPDMA_TRIGGER_DONE;
			}
		}
		break;
	case GraphicsChan:
		if(InstancePtr->Gfx.VideoInfo == NULL) {
			return (int)XST_FAILURE;
		}
		Trigger = XDPDMA_GBL_TRG_CH3_MASK;
		InstancePtr->Gfx.TriggerStatus = XDPDMA_TRIGGER_DONE;
		break;
	case AudioChan0:
		Trigger = XDPDMA_GBL_TRG_CH4_MASK;
		InstancePtr->Audio[0].TriggerStatus = XDPDMA_TRIGGER_DONE;
		break;
	case AudioChan1:
		Trigger = XDPDMA_GBL_TRG_CH5_MASK;
		InstancePtr->Audio[1].TriggerStatus = XDPDMA_TRIGGER_DONE;
		break;
	default:
		/* This will never occur */
		break;
	}
	XDpDma_WriteReg(InstancePtr->Config.BaseAddr, XDPDMA_GBL, Trigger);

	return (int)XST_SUCCESS;

}
/*************************************************************************/
/**
 *
 * This function Triggers DPDMA to start the transaction.
 *
 * @param	InstancePtr is a pointer to the XDpDma instance.
 * @param	Channel is the XDpDma_ChannelType on which the transaction
 *		is to be triggered.
 *
 * @return	XST_SUCCESS The channel has successfully been Triggered.
 *		XST_FAILURE When the triggering Video and Graphics channel
 *		without setting the Video Formats.
 *
 * @note	None.
 *
 * **************************************************************************/
This function Triggers DPDMA to start the transaction.
@param       InstancePtr is a pointer to the XDpDma instance.
@param       Channel is the XDpDma_ChannelType on which the transaction
is to be triggered.

@return      XST_SUCCESS The channel has successfully been Triggered.
XST_FAILURE When the triggering Video and Graphics channel
without setting the Video Formats.

@note        None.
This function Triggers DPDMA to start the transaction . @param InstancePtr is a pointer to the XDpDma instance . @param Channel is the XDpDma_ChannelType on which the transaction is to be triggered . @return XST_SUCCESS The channel has successfully been Triggered . XST_FAILURE When the triggering Video and Graphics channel without setting the Video Formats . @note None .
int XDpDma_Trigger(XDpDma *InstancePtr, XDpDma_ChannelType Channel)
{
	u32 Trigger = 0;
	u8 Index = 0;
	u8 NumPlanes = 0;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(Channel <= AudioChan1);
	switch(Channel) {
	case VideoChan:
		if(InstancePtr->Video.VideoInfo == NULL) {
			return (int)XST_FAILURE;
		}
		else {
			NumPlanes = (u8)InstancePtr->Video.VideoInfo->Mode;
			for(Index = 0; Index <= NumPlanes; Index++) {
				Trigger |= (u32)XDPDMA_GBL_TRG_CH0_MASK <<
					   (u32)Index;
				InstancePtr->Video.TriggerStatus =
					XDPDMA_TRIGGER_DONE;
			}
		}
		break;
	case GraphicsChan:
		if(InstancePtr->Gfx.VideoInfo == NULL) {
			return (int)XST_FAILURE;
		}
		Trigger = XDPDMA_GBL_TRG_CH3_MASK;
		InstancePtr->Gfx.TriggerStatus = XDPDMA_TRIGGER_DONE;
		break;
	case AudioChan0:
		Trigger = XDPDMA_GBL_TRG_CH4_MASK;
		InstancePtr->Audio[0].TriggerStatus = XDPDMA_TRIGGER_DONE;
		break;
	case AudioChan1:
		Trigger = XDPDMA_GBL_TRG_CH5_MASK;
		InstancePtr->Audio[1].TriggerStatus = XDPDMA_TRIGGER_DONE;
		break;
	default:
		break;
	}
	XDpDma_WriteReg(InstancePtr->Config.BaseAddr, XDPDMA_GBL, Trigger);
	return (int)XST_SUCCESS;
}
int XDpDma_Trigger ( XDpDma * InstancePtr , XDpDma_ChannelType Channel ) { u32 Trigger = 0 ; u8 Index = 0 ; u8 NumPlanes = 0 ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( Channel <= AudioChan1 ) ; switch ( Channel ) { case VideoChan : if ( InstancePtr -> Video . VideoInfo == NULL ) { return ( int ) XST_FAILURE ; } else { NumPlanes = ( u8 ) InstancePtr -> Video . VideoInfo -> Mode ; for ( Index = 0 ; Index <= NumPlanes ; Index ++ ) { Trigger |= ( u32 ) XDPDMA_GBL_TRG_CH0_MASK << ( u32 ) Index ; InstancePtr -> Video . TriggerStatus = XDPDMA_TRIGGER_DONE ; } } break ; case GraphicsChan : if ( InstancePtr -> Gfx . VideoInfo == NULL ) { return ( int ) XST_FAILURE ; } Trigger = XDPDMA_GBL_TRG_CH3_MASK ; InstancePtr -> Gfx . TriggerStatus = XDPDMA_TRIGGER_DONE ; break ; case AudioChan0 : Trigger = XDPDMA_GBL_TRG_CH4_MASK ; InstancePtr -> Audio [ 0 ] . TriggerStatus = XDPDMA_TRIGGER_DONE ; break ; case AudioChan1 : Trigger = XDPDMA_GBL_TRG_CH5_MASK ; InstancePtr -> Audio [ 1 ] . TriggerStatus = XDPDMA_TRIGGER_DONE ; break ; default : break ; } XDpDma_WriteReg ( InstancePtr -> Config . BaseAddr , XDPDMA_GBL , Trigger ) ; return ( int ) XST_SUCCESS ; }
This function Triggers DPDMA to start the transaction.
This function Triggers DPDMA to start the transaction .
/* Verify arguments. */ /* This will never occur */