XilinxProcessorIPLib/drivers/uartlite/examples/xuartlite_low_level_example.c
int UartLiteLowLevelExample(u32 UartliteBaseAddress)
{
	int Index;

	/*
	 * Initialize the send buffer bytes with a pattern to send and the
	 * the receive buffer bytes to zero.
	 */
	for (Index = 0; Index < TEST_BUFFER_SIZE; Index++) {
		SendBuffer[Index] = Index + 'B';
		RecvBuffer[Index] = 0;
	}


	/*
	 * Send the entire transmit buffer.
	 */
	for (Index = 0; Index < TEST_BUFFER_SIZE; Index++) {
		XUartLite_SendByte(UartliteBaseAddress, SendBuffer[Index]);
	}

	/*
	 * Receive the entire buffer's worth. Note that the RecvByte function
	 * blocks waiting for a character.
	 */
	for (Index = 0; Index < TEST_BUFFER_SIZE; Index++) {
		RecvBuffer[Index] = XUartLite_RecvByte(UartliteBaseAddress);
	}

	/*
	 * Check the receive buffer data against the send buffer and verify the
	 * data was correctly received.
	 */
	for (Index = 0; Index < TEST_BUFFER_SIZE; Index++) {
		if (SendBuffer[Index] != RecvBuffer[Index]) {
			return XST_FAILURE;
		}
	}

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
*
* This function does a minimal test on the UartLite device using the low-level
* driver macros and functions. This function sends data and expects to receive
* the data through the UartLite. A physical loopback must be done by the user
* with the transmit and receive signals of the UartLite.
*
* @param	UartliteBaseAddress is the base address of the UartLite device
*		and is the XPAR_<UARTLITE_instance>_BASEADDR value from
*		xparameters.h.
*
* @return	XST_SUCCESS if successful, XST_FAILURE if unsuccessful.
*
* @note		None.
*
******************************************************************************/
This function does a minimal test on the UartLite device using the low-level
driver macros and functions. This function sends data and expects to receive
the data through the UartLite. A physical loopback must be done by the user
with the transmit and receive signals of the UartLite.
This function does a minimal test on the UartLite device using the low - level driver macros and functions . This function sends data and expects to receive the data through the UartLite . A physical loopback must be done by the user with the transmit and receive signals of the UartLite .
int UartLiteLowLevelExample(u32 UartliteBaseAddress)
{
	int Index;
	for (Index = 0; Index < TEST_BUFFER_SIZE; Index++) {
		SendBuffer[Index] = Index + 'B';
		RecvBuffer[Index] = 0;
	}
	for (Index = 0; Index < TEST_BUFFER_SIZE; Index++) {
		XUartLite_SendByte(UartliteBaseAddress, SendBuffer[Index]);
	}
	for (Index = 0; Index < TEST_BUFFER_SIZE; Index++) {
		RecvBuffer[Index] = XUartLite_RecvByte(UartliteBaseAddress);
	}
	for (Index = 0; Index < TEST_BUFFER_SIZE; Index++) {
		if (SendBuffer[Index] != RecvBuffer[Index]) {
			return XST_FAILURE;
		}
	}
	return XST_SUCCESS;
}
int UartLiteLowLevelExample ( u32 UartliteBaseAddress ) { int Index ; for ( Index = 0 ; Index < TEST_BUFFER_SIZE ; Index ++ ) { SendBuffer [ Index ] = Index + ' ' ; RecvBuffer [ Index ] = 0 ; } for ( Index = 0 ; Index < TEST_BUFFER_SIZE ; Index ++ ) { XUartLite_SendByte ( UartliteBaseAddress , SendBuffer [ Index ] ) ; } for ( Index = 0 ; Index < TEST_BUFFER_SIZE ; Index ++ ) { RecvBuffer [ Index ] = XUartLite_RecvByte ( UartliteBaseAddress ) ; } for ( Index = 0 ; Index < TEST_BUFFER_SIZE ; Index ++ ) { if ( SendBuffer [ Index ] != RecvBuffer [ Index ] ) { return XST_FAILURE ; } } return XST_SUCCESS ; }
This function does a minimal test on the UartLite device using the low-level
driver macros and functions.
This function does a minimal test on the UartLite device using the low - level driver macros and functions .
/*
	 * Initialize the send buffer bytes with a pattern to send and the
	 * the receive buffer bytes to zero.
	 */ /*
	 * Send the entire transmit buffer.
	 */ /*
	 * Receive the entire buffer's worth. Note that the RecvByte function
	 * blocks waiting for a character.
	 */ /*
	 * Check the receive buffer data against the send buffer and verify the
	 * data was correctly received.
	 */