XilinxProcessorIPLib/drivers/dpdma/src/xdpdma.c
int XDpDma_SetChannelState(XDpDma *InstancePtr, XDpDma_ChannelType Channel,
					XDpDma_ChannelState ChannelState)
{
	u8 Index = 0;
	u8 NumPlanes = 0;
	/* Verify arguments. */
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(ChannelState <= XDPDMA_PAUSE);

	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++) {
				if (XDpDma_ConfigChannelState(InstancePtr,
							      Index,
							      ChannelState) ==
							      XST_FAILURE) {
					return (int)XST_FAILURE;
				}
			}
		}
		break;
	case GraphicsChan:
		if(InstancePtr->Gfx.VideoInfo == NULL) {
			return (int)XST_FAILURE;
		}
		else {
			return	XDpDma_ConfigChannelState(InstancePtr,
					      XDPDMA_GRAPHICS_CHANNEL,
					      ChannelState);
		}
		break;
	case AudioChan0:
		return	XDpDma_ConfigChannelState(InstancePtr,
						  XDPDMA_AUDIO_CHANNEL0,
						  ChannelState);
		break;
	case AudioChan1:
		return XDpDma_ConfigChannelState(InstancePtr,
						 XDPDMA_AUDIO_CHANNEL1,
						 ChannelState);
		break;
	default:
		return (int)XST_FAILURE;
		break;
	}

	return (int)XST_SUCCESS;
}
/*************************************************************************/
/**
 *
 * This functions controls the states in which a channel should go into.
 *
 * @param    InstancePtr is a pointer to the driver instance.
 * @param    Channel is an enum of XDpDma_ChannelType.
 * @param    ChannelState is an enum of type XDpDma_ChannelState.
 *
 * @return   XST_SUCCESS when the mentioned channel is enabled successfully.
 *	     XST_FAILURE when the mentioned channel fails to be enabled.
 *
 * @note     None.
 *
 * **************************************************************************/
This functions controls the states in which a channel should go into.
@param    InstancePtr is a pointer to the driver instance.
@param    Channel is an enum of XDpDma_ChannelType.
@param    ChannelState is an enum of type XDpDma_ChannelState.

@return   XST_SUCCESS when the mentioned channel is enabled successfully.
XST_FAILURE when the mentioned channel fails to be enabled.

@note     None.
This functions controls the states in which a channel should go into . @param InstancePtr is a pointer to the driver instance . @param Channel is an enum of XDpDma_ChannelType . @param ChannelState is an enum of type XDpDma_ChannelState . @return XST_SUCCESS when the mentioned channel is enabled successfully . XST_FAILURE when the mentioned channel fails to be enabled . @note None .
int XDpDma_SetChannelState(XDpDma *InstancePtr, XDpDma_ChannelType Channel,
					XDpDma_ChannelState ChannelState)
{
	u8 Index = 0;
	u8 NumPlanes = 0;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(ChannelState <= XDPDMA_PAUSE);
	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++) {
				if (XDpDma_ConfigChannelState(InstancePtr,
							      Index,
							      ChannelState) ==
							      XST_FAILURE) {
					return (int)XST_FAILURE;
				}
			}
		}
		break;
	case GraphicsChan:
		if(InstancePtr->Gfx.VideoInfo == NULL) {
			return (int)XST_FAILURE;
		}
		else {
			return	XDpDma_ConfigChannelState(InstancePtr,
					      XDPDMA_GRAPHICS_CHANNEL,
					      ChannelState);
		}
		break;
	case AudioChan0:
		return	XDpDma_ConfigChannelState(InstancePtr,
						  XDPDMA_AUDIO_CHANNEL0,
						  ChannelState);
		break;
	case AudioChan1:
		return XDpDma_ConfigChannelState(InstancePtr,
						 XDPDMA_AUDIO_CHANNEL1,
						 ChannelState);
		break;
	default:
		return (int)XST_FAILURE;
		break;
	}
	return (int)XST_SUCCESS;
}
int XDpDma_SetChannelState ( XDpDma * InstancePtr , XDpDma_ChannelType Channel , XDpDma_ChannelState ChannelState ) { u8 Index = 0 ; u8 NumPlanes = 0 ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( ChannelState <= XDPDMA_PAUSE ) ; 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 ++ ) { if ( XDpDma_ConfigChannelState ( InstancePtr , Index , ChannelState ) == XST_FAILURE ) { return ( int ) XST_FAILURE ; } } } break ; case GraphicsChan : if ( InstancePtr -> Gfx . VideoInfo == NULL ) { return ( int ) XST_FAILURE ; } else { return XDpDma_ConfigChannelState ( InstancePtr , XDPDMA_GRAPHICS_CHANNEL , ChannelState ) ; } break ; case AudioChan0 : return XDpDma_ConfigChannelState ( InstancePtr , XDPDMA_AUDIO_CHANNEL0 , ChannelState ) ; break ; case AudioChan1 : return XDpDma_ConfigChannelState ( InstancePtr , XDPDMA_AUDIO_CHANNEL1 , ChannelState ) ; break ; default : return ( int ) XST_FAILURE ; break ; } return ( int ) XST_SUCCESS ; }
This functions controls the states in which a channel should go into.
This functions controls the states in which a channel should go into .
/* Verify arguments. */