XilinxProcessorIPLib/drivers/dpdma/src/xdpdma.c
void XDpDma_InitAudioDescriptor(XDpDma_AudioChannel *Channel,
			       XDpDma_AudioBuffer *AudioBuffer)
{
	u32 Size;
	u64 Address;
	Xil_AssertVoid(Channel != NULL);
	Xil_AssertVoid((Channel->Current == &Channel->Descriptor0) ||
		       (Channel->Current == &Channel->Descriptor4));
	Xil_AssertVoid(AudioBuffer != NULL);
	Xil_AssertVoid((AudioBuffer->Size) % XDPDMA_AUDIO_ALIGNMENT == 0U);
	Xil_AssertVoid((AudioBuffer->Address) % XDPDMA_AUDIO_ALIGNMENT == 0U);

	Size = AudioBuffer->Size / 4U;
	Address = AudioBuffer->Address;
	if(Channel->Current == &Channel->Descriptor4) {
		XDpDma_SetupAudioDescriptor(&Channel->Descriptor4, Size,
					    Address,
					    &Channel->Descriptor5);
		XDpDma_SetupAudioDescriptor(&Channel->Descriptor5, Size,
					    Address + Size,
					    &Channel->Descriptor6);
		XDpDma_SetupAudioDescriptor(&Channel->Descriptor6, Size,
					    Address + ((u64)Size * 2UL),
					    &Channel->Descriptor7);
		XDpDma_SetupAudioDescriptor(&Channel->Descriptor7, Size,
					    Address + ((u64)Size * 3UL), NULL);
	}

	else if(Channel->Current == &Channel->Descriptor0) {
		XDpDma_SetupAudioDescriptor(&Channel->Descriptor0, Size,
					    Address,
					    &Channel->Descriptor1);
		XDpDma_SetupAudioDescriptor(&Channel->Descriptor1, Size,
					    Address + Size,
					    &Channel->Descriptor2);
		XDpDma_SetupAudioDescriptor(&Channel->Descriptor2, Size,
					    Address + ((u64)Size * 2UL),
					    &Channel->Descriptor3);
		XDpDma_SetupAudioDescriptor(&Channel->Descriptor3, Size,
					    Address + ((u64)Size * 3UL), NULL);

	} else {
		/* This will never occurs for audio channel */
	}
}
/*************************************************************************/
/**
 *
 * This function intializes Descriptors for transactions on Audio Channel
 *
 * @param    Channel is a pointer to the XDpDma_AudioChannel instance
 *
 * @param    AudioBuffer is a pointer to the Audio Buffer structure
 *
 * @return   None.
 *
 * @note     None.
 *
 * **************************************************************************/
This function intializes Descriptors for transactions on Audio Channel
@param    Channel is a pointer to the XDpDma_AudioChannel instance

@param    AudioBuffer is a pointer to the Audio Buffer structure

@return   None.

@note     None.
This function intializes Descriptors for transactions on Audio Channel @param Channel is a pointer to the XDpDma_AudioChannel instance @param AudioBuffer is a pointer to the Audio Buffer structure @return None . @note None .
void XDpDma_InitAudioDescriptor(XDpDma_AudioChannel *Channel,
			       XDpDma_AudioBuffer *AudioBuffer)
{
	u32 Size;
	u64 Address;
	Xil_AssertVoid(Channel != NULL);
	Xil_AssertVoid((Channel->Current == &Channel->Descriptor0) ||
		       (Channel->Current == &Channel->Descriptor4));
	Xil_AssertVoid(AudioBuffer != NULL);
	Xil_AssertVoid((AudioBuffer->Size) % XDPDMA_AUDIO_ALIGNMENT == 0U);
	Xil_AssertVoid((AudioBuffer->Address) % XDPDMA_AUDIO_ALIGNMENT == 0U);
	Size = AudioBuffer->Size / 4U;
	Address = AudioBuffer->Address;
	if(Channel->Current == &Channel->Descriptor4) {
		XDpDma_SetupAudioDescriptor(&Channel->Descriptor4, Size,
					    Address,
					    &Channel->Descriptor5);
		XDpDma_SetupAudioDescriptor(&Channel->Descriptor5, Size,
					    Address + Size,
					    &Channel->Descriptor6);
		XDpDma_SetupAudioDescriptor(&Channel->Descriptor6, Size,
					    Address + ((u64)Size * 2UL),
					    &Channel->Descriptor7);
		XDpDma_SetupAudioDescriptor(&Channel->Descriptor7, Size,
					    Address + ((u64)Size * 3UL), NULL);
	}
	else if(Channel->Current == &Channel->Descriptor0) {
		XDpDma_SetupAudioDescriptor(&Channel->Descriptor0, Size,
					    Address,
					    &Channel->Descriptor1);
		XDpDma_SetupAudioDescriptor(&Channel->Descriptor1, Size,
					    Address + Size,
					    &Channel->Descriptor2);
		XDpDma_SetupAudioDescriptor(&Channel->Descriptor2, Size,
					    Address + ((u64)Size * 2UL),
					    &Channel->Descriptor3);
		XDpDma_SetupAudioDescriptor(&Channel->Descriptor3, Size,
					    Address + ((u64)Size * 3UL), NULL);
	} else {
	}
}
void XDpDma_InitAudioDescriptor ( XDpDma_AudioChannel * Channel , XDpDma_AudioBuffer * AudioBuffer ) { u32 Size ; u64 Address ; Xil_AssertVoid ( Channel != NULL ) ; Xil_AssertVoid ( ( Channel -> Current == & Channel -> Descriptor0 ) || ( Channel -> Current == & Channel -> Descriptor4 ) ) ; Xil_AssertVoid ( AudioBuffer != NULL ) ; Xil_AssertVoid ( ( AudioBuffer -> Size ) % XDPDMA_AUDIO_ALIGNMENT == 0U ) ; Xil_AssertVoid ( ( AudioBuffer -> Address ) % XDPDMA_AUDIO_ALIGNMENT == 0U ) ; Size = AudioBuffer -> Size / 4U ; Address = AudioBuffer -> Address ; if ( Channel -> Current == & Channel -> Descriptor4 ) { XDpDma_SetupAudioDescriptor ( & Channel -> Descriptor4 , Size , Address , & Channel -> Descriptor5 ) ; XDpDma_SetupAudioDescriptor ( & Channel -> Descriptor5 , Size , Address + Size , & Channel -> Descriptor6 ) ; XDpDma_SetupAudioDescriptor ( & Channel -> Descriptor6 , Size , Address + ( ( u64 ) Size * 2UL ) , & Channel -> Descriptor7 ) ; XDpDma_SetupAudioDescriptor ( & Channel -> Descriptor7 , Size , Address + ( ( u64 ) Size * 3UL ) , NULL ) ; } else if ( Channel -> Current == & Channel -> Descriptor0 ) { XDpDma_SetupAudioDescriptor ( & Channel -> Descriptor0 , Size , Address , & Channel -> Descriptor1 ) ; XDpDma_SetupAudioDescriptor ( & Channel -> Descriptor1 , Size , Address + Size , & Channel -> Descriptor2 ) ; XDpDma_SetupAudioDescriptor ( & Channel -> Descriptor2 , Size , Address + ( ( u64 ) Size * 2UL ) , & Channel -> Descriptor3 ) ; XDpDma_SetupAudioDescriptor ( & Channel -> Descriptor3 , Size , Address + ( ( u64 ) Size * 3UL ) , NULL ) ; } else { } }
This function intializes Descriptors for transactions on Audio Channel
 @param    Channel is a pointer to the XDpDma_AudioChannel instance
This function intializes Descriptors for transactions on Audio Channel @param Channel is a pointer to the XDpDma_AudioChannel instance
/* This will never occurs for audio channel */