XilinxProcessorIPLib/drivers/devcfg/src/xdevcfg_selftest.c
int XDcfg_SelfTest(XDcfg *InstancePtr)
{
	u32 OldCfgReg;
	u32 CfgReg;
	int Status = XST_SUCCESS;

	/*
	 * Assert to ensure the inputs are valid and the instance has been
	 * initialized.
	 */
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);

	OldCfgReg = XDcfg_GetControlRegister(InstancePtr);

	XDcfg_SetControlRegister(InstancePtr, XDCFG_CTRL_NIDEN_MASK);

	CfgReg = XDcfg_GetControlRegister(InstancePtr);

	if ((CfgReg & XDCFG_CTRL_NIDEN_MASK) != XDCFG_CTRL_NIDEN_MASK) {

		Status = XST_FAILURE;
	}

	/*
	 * Restore the original values of the register
	 */
	XDcfg_SetControlRegister(InstancePtr, OldCfgReg);

	return Status;
}
/****************************************************************************/
/**
*
* Run a self-test on the Device Configuration Interface. This test does a
* control register write and reads back the same value.
*
* @param	InstancePtr is a pointer to the XDcfg instance.
*
* @return
*		- XST_SUCCESS if self-test was successful.
*		- XST_FAILURE if fails.
*
* @note		None.
*
******************************************************************************/
Run a self-test on the Device Configuration Interface. This test does a
control register write and reads back the same value.
Run a self - test on the Device Configuration Interface . This test does a control register write and reads back the same value .
int XDcfg_SelfTest(XDcfg *InstancePtr)
{
	u32 OldCfgReg;
	u32 CfgReg;
	int Status = XST_SUCCESS;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	OldCfgReg = XDcfg_GetControlRegister(InstancePtr);
	XDcfg_SetControlRegister(InstancePtr, XDCFG_CTRL_NIDEN_MASK);
	CfgReg = XDcfg_GetControlRegister(InstancePtr);
	if ((CfgReg & XDCFG_CTRL_NIDEN_MASK) != XDCFG_CTRL_NIDEN_MASK) {
		Status = XST_FAILURE;
	}
	XDcfg_SetControlRegister(InstancePtr, OldCfgReg);
	return Status;
}
int XDcfg_SelfTest ( XDcfg * InstancePtr ) { u32 OldCfgReg ; u32 CfgReg ; int Status = XST_SUCCESS ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( InstancePtr -> IsReady == XIL_COMPONENT_IS_READY ) ; OldCfgReg = XDcfg_GetControlRegister ( InstancePtr ) ; XDcfg_SetControlRegister ( InstancePtr , XDCFG_CTRL_NIDEN_MASK ) ; CfgReg = XDcfg_GetControlRegister ( InstancePtr ) ; if ( ( CfgReg & XDCFG_CTRL_NIDEN_MASK ) != XDCFG_CTRL_NIDEN_MASK ) { Status = XST_FAILURE ; } XDcfg_SetControlRegister ( InstancePtr , OldCfgReg ) ; return Status ; }
Run a self-test on the Device Configuration Interface.
Run a self - test on the Device Configuration Interface .
/*
	 * Assert to ensure the inputs are valid and the instance has been
	 * initialized.
	 */ /*
	 * Restore the original values of the register
	 */