XilinxProcessorIPLib/drivers/rtcpsu/src/xrtcpsu_selftest.c
s32 XRtcPsu_SelfTest(XRtcPsu *InstancePtr)
{
	s32 Status = (s32)XST_SUCCESS;
	u32 SafetyCheck;

	/* Assert validates the input arguments */
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);

	/*
	 * Write the reset value in safety check register and
	 * try reading back. If mismatch happens, return failure.
	 */
	XRtcPsu_WriteReg(InstancePtr->RtcConfig.BaseAddr + XRTC_SFTY_CHK_OFFSET,
			XRTC_SFTY_CHK_RSTVAL);
	SafetyCheck = XRtcPsu_ReadReg(InstancePtr->RtcConfig.BaseAddr +
			XRTC_SFTY_CHK_OFFSET);

	if (SafetyCheck != XRTC_SFTY_CHK_RSTVAL) {
		Status = (s32)XST_FAILURE;
	}

	return Status;
}
/****************************************************************************/
/**
*
* This function runs a self-test on the driver and hardware device. This self
* test writes reset value into safety check register and read backs the same.
* If mismatch offers, returns the failure.
*
* @param	InstancePtr is a pointer to the XRtcPsu instance
*
* @return
*		 - XST_SUCCESS if the test was successful
*
* @note
*
* This function can hang if the hardware is not functioning properly.
*
******************************************************************************/
This function runs a self-test on the driver and hardware device. This self
test writes reset value into safety check register and read backs the same.
If mismatch offers, returns the failure.
This function runs a self - test on the driver and hardware device . This self test writes reset value into safety check register and read backs the same . If mismatch offers returns the failure .
s32 XRtcPsu_SelfTest(XRtcPsu *InstancePtr)
{
	s32 Status = (s32)XST_SUCCESS;
	u32 SafetyCheck;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	XRtcPsu_WriteReg(InstancePtr->RtcConfig.BaseAddr + XRTC_SFTY_CHK_OFFSET,
			XRTC_SFTY_CHK_RSTVAL);
	SafetyCheck = XRtcPsu_ReadReg(InstancePtr->RtcConfig.BaseAddr +
			XRTC_SFTY_CHK_OFFSET);
	if (SafetyCheck != XRTC_SFTY_CHK_RSTVAL) {
		Status = (s32)XST_FAILURE;
	}
	return Status;
}
s32 XRtcPsu_SelfTest ( XRtcPsu * InstancePtr ) { s32 Status = ( s32 ) XST_SUCCESS ; u32 SafetyCheck ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( InstancePtr -> IsReady == XIL_COMPONENT_IS_READY ) ; XRtcPsu_WriteReg ( InstancePtr -> RtcConfig . BaseAddr + XRTC_SFTY_CHK_OFFSET , XRTC_SFTY_CHK_RSTVAL ) ; SafetyCheck = XRtcPsu_ReadReg ( InstancePtr -> RtcConfig . BaseAddr + XRTC_SFTY_CHK_OFFSET ) ; if ( SafetyCheck != XRTC_SFTY_CHK_RSTVAL ) { Status = ( s32 ) XST_FAILURE ; } return Status ; }
This function runs a self-test on the driver and hardware device.
This function runs a self - test on the driver and hardware device .
/* Assert validates the input arguments */ /*
	 * Write the reset value in safety check register and
	 * try reading back. If mismatch happens, return failure.
	 */