XilinxProcessorIPLib/drivers/audio_formatter/src/xaudioformatter.c
u32 XAudioFormatter_CfgInitialize(XAudioFormatter *InstancePtr,
	XAudioFormatter_Config *CfgPtr)
{
	u32 val;
	/* Verify arguments. */
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(CfgPtr != NULL);

	/* Setup the instance */
	InstancePtr->Config = *CfgPtr;
	InstancePtr->BaseAddress = CfgPtr->BaseAddress;
	val = XAudioFormatter_ReadReg(CfgPtr->BaseAddress,
		XAUD_FORMATTER_CORE_CONFIG);
	if (val & XAUD_CFG_MM2S_MASK) {
		InstancePtr->mm2s_presence = TRUE;
		InstancePtr->ChannelId = XAudioFormatter_MM2S;
		XAudioFormatterDMAReset(InstancePtr);
	}
	if (val & XAUD_CFG_S2MM_MASK) {
		InstancePtr->s2mm_presence = TRUE;
		InstancePtr->ChannelId = XAudioFormatter_S2MM;
		XAudioFormatterDMAReset(InstancePtr);
	}
	InstancePtr->IsReady = (u32)(XIL_COMPONENT_IS_READY);

	return XST_SUCCESS;

}
/*****************************************************************************/
/**
*
* This function initializes the audio formatter core instance.
*
* @param	InstancePtr is a pointer to the XAudioFormatter instance.
* @param	CfgPtr is a reference to a structure containing information
*		about a specific XAudioFormatter instance.
*
* @return
*		- XST_SUCCESS if initialization was successful.
*
* @note		None.
*
******************************************************************************/
This function initializes the audio formatter core instance.
This function initializes the audio formatter core instance .
u32 XAudioFormatter_CfgInitialize(XAudioFormatter *InstancePtr,
	XAudioFormatter_Config *CfgPtr)
{
	u32 val;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(CfgPtr != NULL);
	InstancePtr->Config = *CfgPtr;
	InstancePtr->BaseAddress = CfgPtr->BaseAddress;
	val = XAudioFormatter_ReadReg(CfgPtr->BaseAddress,
		XAUD_FORMATTER_CORE_CONFIG);
	if (val & XAUD_CFG_MM2S_MASK) {
		InstancePtr->mm2s_presence = TRUE;
		InstancePtr->ChannelId = XAudioFormatter_MM2S;
		XAudioFormatterDMAReset(InstancePtr);
	}
	if (val & XAUD_CFG_S2MM_MASK) {
		InstancePtr->s2mm_presence = TRUE;
		InstancePtr->ChannelId = XAudioFormatter_S2MM;
		XAudioFormatterDMAReset(InstancePtr);
	}
	InstancePtr->IsReady = (u32)(XIL_COMPONENT_IS_READY);
	return XST_SUCCESS;
}
u32 XAudioFormatter_CfgInitialize ( XAudioFormatter * InstancePtr , XAudioFormatter_Config * CfgPtr ) { u32 val ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( CfgPtr != NULL ) ; InstancePtr -> Config = * CfgPtr ; InstancePtr -> BaseAddress = CfgPtr -> BaseAddress ; val = XAudioFormatter_ReadReg ( CfgPtr -> BaseAddress , XAUD_FORMATTER_CORE_CONFIG ) ; if ( val & XAUD_CFG_MM2S_MASK ) { InstancePtr -> mm2s_presence = TRUE ; InstancePtr -> ChannelId = XAudioFormatter_MM2S ; XAudioFormatterDMAReset ( InstancePtr ) ; } if ( val & XAUD_CFG_S2MM_MASK ) { InstancePtr -> s2mm_presence = TRUE ; InstancePtr -> ChannelId = XAudioFormatter_S2MM ; XAudioFormatterDMAReset ( InstancePtr ) ; } InstancePtr -> IsReady = ( u32 ) ( XIL_COMPONENT_IS_READY ) ; return XST_SUCCESS ; }
This function initializes the audio formatter core instance.
This function initializes the audio formatter core instance .
/* Verify arguments. */ /* Setup the instance */