XilinxProcessorIPLib/drivers/ttcps/src/xttcps_selftest.c
s32 XTtcPs_SelfTest(XTtcPs *InstancePtr)
{
	s32 Status;
	u32 TempReg;

	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);

	/*
	 * All the TTC registers should be in their default state right now.
	 */
	TempReg = XTtcPs_ReadReg(InstancePtr->Config.BaseAddress,
				   XTTCPS_CNT_CNTRL_OFFSET);
	if (XTTCPS_CNT_CNTRL_RESET_VALUE != (u32)TempReg) {
		Status = XST_FAILURE;
	}
	else {
		Status = XST_SUCCESS;
	}
	return Status;
}
/*****************************************************************************/
/**
*
* Runs a self-test on the driver/device.
*
*
* @param	InstancePtr is a pointer to the XTtcPs instance.
*
* @return
*
*	- XST_SUCCESS if successful
*	- XST_FAILURE indicates a register did not read or write correctly
*
* @note		This test fails if it is not called right after initialization.
*
******************************************************************************/
Runs a self-test on the driver/device.
Runs a self - test on the driver / device .
s32 XTtcPs_SelfTest(XTtcPs *InstancePtr)
{
	s32 Status;
	u32 TempReg;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	TempReg = XTtcPs_ReadReg(InstancePtr->Config.BaseAddress,
				   XTTCPS_CNT_CNTRL_OFFSET);
	if (XTTCPS_CNT_CNTRL_RESET_VALUE != (u32)TempReg) {
		Status = XST_FAILURE;
	}
	else {
		Status = XST_SUCCESS;
	}
	return Status;
}
s32 XTtcPs_SelfTest ( XTtcPs * InstancePtr ) { s32 Status ; u32 TempReg ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( InstancePtr -> IsReady == XIL_COMPONENT_IS_READY ) ; TempReg = XTtcPs_ReadReg ( InstancePtr -> Config . BaseAddress , XTTCPS_CNT_CNTRL_OFFSET ) ; if ( XTTCPS_CNT_CNTRL_RESET_VALUE != ( u32 ) TempReg ) { Status = XST_FAILURE ; } else { Status = XST_SUCCESS ; } return Status ; }
Runs a self-test on the driver/device.
Runs a self - test on the driver / device .
/*
	 * All the TTC registers should be in their default state right now.
	 */