XilinxProcessorIPLib/drivers/uartlite/src/xuartlite_selftest.c
int XUartLite_SelfTest(XUartLite *InstancePtr)
{
	u32 StatusRegister;

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

	/*
	 * Reset the FIFO's before reading the status register.
	 * It is likely that the Uartlite IP may not always have an 
	 * empty Tx and Rx FIFO when a selftest is performed if more than one 
	 * uartlite instance is present in the h/w design.
	 */
	 	XUartLite_ResetFifos(InstancePtr);
		
	/*
	 * Read the Status register value to check if it is the correct value
	 * after a reset
	 */
	StatusRegister = XUartLite_ReadReg(InstancePtr->RegBaseAddress,
					XUL_STATUS_REG_OFFSET);

	/*
	 * If the status register is any other value other than
	 * XUL_SR_TX_FIFO_EMPTY then the test is a failure since this is
	 * the not the value after reset
	 */
	if (StatusRegister != XUL_SR_TX_FIFO_EMPTY) {
		return XST_FAILURE;
	}

	return XST_SUCCESS;
}
/****************************************************************************/
/**
*
* Runs a self-test on the device hardware. Since there is no way to perform a
* loopback in the hardware, this test can only check the state of the status
* register to verify it is correct. This test assumes that the hardware
* device is still in its reset state, but has been initialized with the
* Initialize function.
*
* @param	InstancePtr is a pointer to the XUartLite instance.
*
* @return
* 		- XST_SUCCESS if the self-test was successful.
* 		- XST_FAILURE if the self-test failed, the status register
*			value was not correct
*
* @note		None.
*
******************************************************************************/
Runs a self-test on the device hardware. Since there is no way to perform a
loopback in the hardware, this test can only check the state of the status
register to verify it is correct. This test assumes that the hardware
device is still in its reset state, but has been initialized with the
Initialize function.
Runs a self - test on the device hardware . Since there is no way to perform a loopback in the hardware this test can only check the state of the status register to verify it is correct . This test assumes that the hardware device is still in its reset state but has been initialized with the Initialize function .
int XUartLite_SelfTest(XUartLite *InstancePtr)
{
	u32 StatusRegister;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	 	XUartLite_ResetFifos(InstancePtr);
	StatusRegister = XUartLite_ReadReg(InstancePtr->RegBaseAddress,
					XUL_STATUS_REG_OFFSET);
	if (StatusRegister != XUL_SR_TX_FIFO_EMPTY) {
		return XST_FAILURE;
	}
	return XST_SUCCESS;
}
int XUartLite_SelfTest ( XUartLite * InstancePtr ) { u32 StatusRegister ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( InstancePtr -> IsReady == XIL_COMPONENT_IS_READY ) ; XUartLite_ResetFifos ( InstancePtr ) ; StatusRegister = XUartLite_ReadReg ( InstancePtr -> RegBaseAddress , XUL_STATUS_REG_OFFSET ) ; if ( StatusRegister != XUL_SR_TX_FIFO_EMPTY ) { return XST_FAILURE ; } return XST_SUCCESS ; }
Runs a self-test on the device hardware.
Runs a self - test on the device hardware .
/*
	 * Assert validates the input arguments
	 */ /*
	 * Reset the FIFO's before reading the status register.
	 * It is likely that the Uartlite IP may not always have an 
	 * empty Tx and Rx FIFO when a selftest is performed if more than one 
	 * uartlite instance is present in the h/w design.
	 */ /*
	 * Read the Status register value to check if it is the correct value
	 * after a reset
	 */ /*
	 * If the status register is any other value other than
	 * XUL_SR_TX_FIFO_EMPTY then the test is a failure since this is
	 * the not the value after reset
	 */