XilinxProcessorIPLib/drivers/dfeccf/examples/xdfeccf_1xNR100_3xNR20_example.c
int XDfeCcf_1xNR100_3xNR20_Example()
{
	/* Configure the Channel Filter for a 'pass-through' */
	struct metal_init_params init_param = METAL_INIT_DEFAULTS;
	XDfeCcf_Cfg Cfg;
	XDfeCcf *InstancePtr = NULL;
	XDfeCcf_TriggerCfg TriggerCfg = { 0 };
	u32 Shift = 8;

	printf("\r\nChannel Filter \"1xNR100 and 3xNR20 Configuration\" Example - Start\r\n");

	/* Initialize libmetal */
	if (0 != metal_init(&init_param)) {
		(void)printf("ERROR: Failed to run metal initialization\n\r");
		return XST_FAILURE;
	}
	metal_set_log_level(METAL_LOG_WARNING);

	/* Initialize the instance of channel filter driver */
	InstancePtr = XDfeCcf_InstanceInit(XDFECCF_NODE1_NAME);

	/* Go through initialization states of the state machine */
	XDfeCcf_Reset(InstancePtr);
	printf("Reset \n\r");
	XDfeCcf_Configure(InstancePtr, &Cfg);
	printf("Load configuration\n\r");
	XDfeCcf_Initialize(InstancePtr, &Init);
	printf("Initialize\n\r");
	XDfeCcf_SetTriggersCfg(InstancePtr, &TriggerCfg);
	printf("Set Triggers\n\r");
	XDfeCcf_Activate(InstancePtr, false);
	printf("Activate\n\r");

	/* Set coefficients and add channel */
	for (int i = 0; i < Num_coef; i++) {
		XDfeCcf_LoadCoefficients(InstancePtr, i, Shift, pt_coef[i]);
		printf("set coefficients set#%d done!\n\r", i);
	}

	for (int i = 0; i < Num_Carr; i++) {
		u32 status;
		printf("Clear Event Status \n\r");
		XDfeCcf_ClearEventStatus(InstancePtr);
		status = XDfeCcf_AddCC(InstancePtr, CCID_Vals[i],
				       bit_sequence[i], pt_carr[i]);

		if (status == XST_SUCCESS) {
			printf("Add CC%d done!\n\r", i);
		}
	}

	/* Shutdown the block */
	XDfeCcf_Deactivate(InstancePtr);
	XDfeCcf_InstanceClose(InstancePtr);

	printf("Channel Filter \"1xNR100 and 3xNR20 Configuration\" Example: Pass\r\n");
	return XST_SUCCESS;
}
/****************************************************************************/
/**
*
* This function configures Channel Filter driver for one NR100 carrier and
* three NR20.
* The example does the following:
*     - initialize driver from reset to activation
*     - configure filters with the pre-calculated coefficients
*     - add 4 carriers CCID={0,1,2,3}, 1xNR100(122.88Msps) and 3xNR20(30.72Msps)
*     - at this point filters are set and ready to operate
*     - close the driver
*
* @return
*		- XST_SUCCESS if the example has completed successfully.
*		- XST_FAILURE if the example has failed.
*
****************************************************************************/
This function configures Channel Filter driver for one NR100 carrier and
three NR20.
The example does the following:
initialize driver from reset to activation
configure filters with the pre-calculated coefficients
add 4 carriers CCID={0,1,2,3}, 1xNR100(122.88Msps) and 3xNR20(30.72Msps)
at this point filters are set and ready to operate
close the driver
This function configures Channel Filter driver for one NR100 carrier and three NR20 . The example does the following : initialize driver from reset to activation configure filters with the pre - calculated coefficients add 4 carriers CCID = { 0 1 2 3 } 1xNR100 ( 122 . 88Msps ) and 3xNR20 ( 30 . 72Msps ) at this point filters are set and ready to operate close the driver
int XDfeCcf_1xNR100_3xNR20_Example()
{
	struct metal_init_params init_param = METAL_INIT_DEFAULTS;
	XDfeCcf_Cfg Cfg;
	XDfeCcf *InstancePtr = NULL;
	XDfeCcf_TriggerCfg TriggerCfg = { 0 };
	u32 Shift = 8;
	printf("\r\nChannel Filter \"1xNR100 and 3xNR20 Configuration\" Example - Start\r\n");
	if (0 != metal_init(&init_param)) {
		(void)printf("ERROR: Failed to run metal initialization\n\r");
		return XST_FAILURE;
	}
	metal_set_log_level(METAL_LOG_WARNING);
	InstancePtr = XDfeCcf_InstanceInit(XDFECCF_NODE1_NAME);
	XDfeCcf_Reset(InstancePtr);
	printf("Reset \n\r");
	XDfeCcf_Configure(InstancePtr, &Cfg);
	printf("Load configuration\n\r");
	XDfeCcf_Initialize(InstancePtr, &Init);
	printf("Initialize\n\r");
	XDfeCcf_SetTriggersCfg(InstancePtr, &TriggerCfg);
	printf("Set Triggers\n\r");
	XDfeCcf_Activate(InstancePtr, false);
	printf("Activate\n\r");
	for (int i = 0; i < Num_coef; i++) {
		XDfeCcf_LoadCoefficients(InstancePtr, i, Shift, pt_coef[i]);
		printf("set coefficients set#%d done!\n\r", i);
	}
	for (int i = 0; i < Num_Carr; i++) {
		u32 status;
		printf("Clear Event Status \n\r");
		XDfeCcf_ClearEventStatus(InstancePtr);
		status = XDfeCcf_AddCC(InstancePtr, CCID_Vals[i],
				       bit_sequence[i], pt_carr[i]);
		if (status == XST_SUCCESS) {
			printf("Add CC%d done!\n\r", i);
		}
	}
	XDfeCcf_Deactivate(InstancePtr);
	XDfeCcf_InstanceClose(InstancePtr);
	printf("Channel Filter \"1xNR100 and 3xNR20 Configuration\" Example: Pass\r\n");
	return XST_SUCCESS;
}
int XDfeCcf_1xNR100_3xNR20_Example ( ) { struct metal_init_params init_param = METAL_INIT_DEFAULTS ; XDfeCcf_Cfg Cfg ; XDfeCcf * InstancePtr = NULL ; XDfeCcf_TriggerCfg TriggerCfg = { 0 } ; u32 Shift = 8 ; printf ( " \r \n \" \" \r \n " ) ; if ( 0 != metal_init ( & init_param ) ) { ( void ) printf ( " \n \r " ) ; return XST_FAILURE ; } metal_set_log_level ( METAL_LOG_WARNING ) ; InstancePtr = XDfeCcf_InstanceInit ( XDFECCF_NODE1_NAME ) ; XDfeCcf_Reset ( InstancePtr ) ; printf ( " \n \r " ) ; XDfeCcf_Configure ( InstancePtr , & Cfg ) ; printf ( " \n \r " ) ; XDfeCcf_Initialize ( InstancePtr , & Init ) ; printf ( " \n \r " ) ; XDfeCcf_SetTriggersCfg ( InstancePtr , & TriggerCfg ) ; printf ( " \n \r " ) ; XDfeCcf_Activate ( InstancePtr , false ) ; printf ( " \n \r " ) ; for ( int i = 0 ; i < Num_coef ; i ++ ) { XDfeCcf_LoadCoefficients ( InstancePtr , i , Shift , pt_coef [ i ] ) ; printf ( " \n \r " , i ) ; } for ( int i = 0 ; i < Num_Carr ; i ++ ) { u32 status ; printf ( " \n \r " ) ; XDfeCcf_ClearEventStatus ( InstancePtr ) ; status = XDfeCcf_AddCC ( InstancePtr , CCID_Vals [ i ] , bit_sequence [ i ] , pt_carr [ i ] ) ; if ( status == XST_SUCCESS ) { printf ( " \n \r " , i ) ; } } XDfeCcf_Deactivate ( InstancePtr ) ; XDfeCcf_InstanceClose ( InstancePtr ) ; printf ( " \" \" \r \n " ) ; return XST_SUCCESS ; }
This function configures Channel Filter driver for one NR100 carrier and
three NR20.
This function configures Channel Filter driver for one NR100 carrier and three NR20 .
/* Configure the Channel Filter for a 'pass-through' */ /* Initialize libmetal */ /* Initialize the instance of channel filter driver */ /* Go through initialization states of the state machine */ /* Set coefficients and add channel */ /* Shutdown the block */