XilinxProcessorIPLib/drivers/dpdma/src/xdpdma.c
static void XDpDma_SetDescriptorAddress(XDpDma *InstancePtr, u8 ChannelNum)
{
	u32 AddrOffset;
	u32 AddrEOffset;
	u64 DescAddr;
	Xil_AssertVoid(ChannelNum <= XDPDMA_AUDIO_CHANNEL1);
	AddrOffset = XDPDMA_CH0_DSCR_STRT_ADDR +
					(XDPDMA_CH_OFFSET * (u32)ChannelNum);
	AddrEOffset = XDPDMA_CH0_DSCR_STRT_ADDRE +
					(XDPDMA_CH_OFFSET * (u32)ChannelNum);

	XDpDma_Descriptor *Descriptor = NULL;
	switch(ChannelNum) {
	case XDPDMA_VIDEO_CHANNEL0:
		Descriptor = InstancePtr->Video.Channel[ChannelNum].Current;
		break;
	case XDPDMA_VIDEO_CHANNEL1:
		Descriptor = InstancePtr->Video.Channel[ChannelNum].Current;
		break;
	case XDPDMA_VIDEO_CHANNEL2:
		Descriptor = InstancePtr->Video.Channel[ChannelNum].Current;
		break;
	case XDPDMA_GRAPHICS_CHANNEL:
		Descriptor = InstancePtr->Gfx.Channel.Current;
		break;
	case XDPDMA_AUDIO_CHANNEL0:
		Descriptor = InstancePtr->Audio[0].Current;
		break;
	case XDPDMA_AUDIO_CHANNEL1:
		Descriptor = InstancePtr->Audio[1].Current;
		break;
	default:
		/* This will never occur */
		break;
	}

	DescAddr = (UINTPTR) Descriptor;
	XDpDma_WriteReg(InstancePtr->Config.BaseAddr, AddrEOffset,
		UPPER_32_BITS(DescAddr));
	XDpDma_WriteReg(InstancePtr->Config.BaseAddr, AddrOffset,
			LOWER_32_BITS(DescAddr));
}
/*************************************************************************/
/**
 * This function programs the address of the descriptor about to be active
 *
 * @param    InstancePtr is a pointer to the DPDMA instance.
 * @param    Channel is an enum of the channel for which the descriptor
 *	     address is to be set.
 *
 * @return   Descriptor for next operation.
 *
 * @note     None.
 *
 * **************************************************************************/
This function programs the address of the descriptor about to be active
@param    InstancePtr is a pointer to the DPDMA instance.
@param    Channel is an enum of the channel for which the descriptor
address is to be set.

@return   Descriptor for next operation.

@note     None.
This function programs the address of the descriptor about to be active @param InstancePtr is a pointer to the DPDMA instance . @param Channel is an enum of the channel for which the descriptor address is to be set . @return Descriptor for next operation . @note None .
static void XDpDma_SetDescriptorAddress(XDpDma *InstancePtr, u8 ChannelNum)
{
	u32 AddrOffset;
	u32 AddrEOffset;
	u64 DescAddr;
	Xil_AssertVoid(ChannelNum <= XDPDMA_AUDIO_CHANNEL1);
	AddrOffset = XDPDMA_CH0_DSCR_STRT_ADDR +
					(XDPDMA_CH_OFFSET * (u32)ChannelNum);
	AddrEOffset = XDPDMA_CH0_DSCR_STRT_ADDRE +
					(XDPDMA_CH_OFFSET * (u32)ChannelNum);
	XDpDma_Descriptor *Descriptor = NULL;
	switch(ChannelNum) {
	case XDPDMA_VIDEO_CHANNEL0:
		Descriptor = InstancePtr->Video.Channel[ChannelNum].Current;
		break;
	case XDPDMA_VIDEO_CHANNEL1:
		Descriptor = InstancePtr->Video.Channel[ChannelNum].Current;
		break;
	case XDPDMA_VIDEO_CHANNEL2:
		Descriptor = InstancePtr->Video.Channel[ChannelNum].Current;
		break;
	case XDPDMA_GRAPHICS_CHANNEL:
		Descriptor = InstancePtr->Gfx.Channel.Current;
		break;
	case XDPDMA_AUDIO_CHANNEL0:
		Descriptor = InstancePtr->Audio[0].Current;
		break;
	case XDPDMA_AUDIO_CHANNEL1:
		Descriptor = InstancePtr->Audio[1].Current;
		break;
	default:
		break;
	}
	DescAddr = (UINTPTR) Descriptor;
	XDpDma_WriteReg(InstancePtr->Config.BaseAddr, AddrEOffset,
		UPPER_32_BITS(DescAddr));
	XDpDma_WriteReg(InstancePtr->Config.BaseAddr, AddrOffset,
			LOWER_32_BITS(DescAddr));
}
static void XDpDma_SetDescriptorAddress ( XDpDma * InstancePtr , u8 ChannelNum ) { u32 AddrOffset ; u32 AddrEOffset ; u64 DescAddr ; Xil_AssertVoid ( ChannelNum <= XDPDMA_AUDIO_CHANNEL1 ) ; AddrOffset = XDPDMA_CH0_DSCR_STRT_ADDR + ( XDPDMA_CH_OFFSET * ( u32 ) ChannelNum ) ; AddrEOffset = XDPDMA_CH0_DSCR_STRT_ADDRE + ( XDPDMA_CH_OFFSET * ( u32 ) ChannelNum ) ; XDpDma_Descriptor * Descriptor = NULL ; switch ( ChannelNum ) { case XDPDMA_VIDEO_CHANNEL0 : Descriptor = InstancePtr -> Video . Channel [ ChannelNum ] . Current ; break ; case XDPDMA_VIDEO_CHANNEL1 : Descriptor = InstancePtr -> Video . Channel [ ChannelNum ] . Current ; break ; case XDPDMA_VIDEO_CHANNEL2 : Descriptor = InstancePtr -> Video . Channel [ ChannelNum ] . Current ; break ; case XDPDMA_GRAPHICS_CHANNEL : Descriptor = InstancePtr -> Gfx . Channel . Current ; break ; case XDPDMA_AUDIO_CHANNEL0 : Descriptor = InstancePtr -> Audio [ 0 ] . Current ; break ; case XDPDMA_AUDIO_CHANNEL1 : Descriptor = InstancePtr -> Audio [ 1 ] . Current ; break ; default : break ; } DescAddr = ( UINTPTR ) Descriptor ; XDpDma_WriteReg ( InstancePtr -> Config . BaseAddr , AddrEOffset , UPPER_32_BITS ( DescAddr ) ) ; XDpDma_WriteReg ( InstancePtr -> Config . BaseAddr , AddrOffset , LOWER_32_BITS ( DescAddr ) ) ; }
This function programs the address of the descriptor about to be active
 @param    InstancePtr is a pointer to the DPDMA instance.
This function programs the address of the descriptor about to be active @param InstancePtr is a pointer to the DPDMA instance .
/* This will never occur */