XilinxProcessorIPLib/drivers/uartpsv/src/xuartpsv.c
u32 XUartPsv_SendBuffer(XUartPsv *InstancePtr)
{
	u32 SentCount = 0U;
	u32 IsBusy;

	/*
	 * Check is TX busy
	 */
	IsBusy = (u32)XUartPsv_IsTransmitbusy(InstancePtr->Config.BaseAddress);
	while (IsBusy == (u32)TRUE) {
		IsBusy = (u32)XUartPsv_IsTransmitbusy(InstancePtr->Config.BaseAddress);
	}

	/*
	 * If the TX FIFO is full, send nothing.
	 * Otherwise put bytes into the TX FIFO until it is full, or all of
	 * the data has been put into the FIFO.
	 */
	while ((!XUartPsv_IsTransmitFull(InstancePtr->Config.BaseAddress)) &&
		   (InstancePtr->SendBuffer.RemainingBytes > SentCount)) {

		/* Fill the FIFO from the buffer */
		XUartPsv_WriteReg(InstancePtr->Config.BaseAddress,
				XUARTPSV_UARTDR_OFFSET, ((u32)InstancePtr->
				SendBuffer.NextBytePtr[SentCount]));

		/* Increment the send count. */
		SentCount++;
	}

	/* Update the buffer to reflect the bytes that were sent from it */
	InstancePtr->SendBuffer.NextBytePtr += SentCount;
	InstancePtr->SendBuffer.RemainingBytes -= SentCount;

	return SentCount;
}
/*****************************************************************************/
/**
*
* This function sends a buffer that has been previously specified by setting
* up the instance variables of the instance. This function is an internal
* function for the XUartPsv driver such that it may be called from a shell
* function that sets up the buffer or from an interrupt handler.
*
* This function sends the specified buffer in either polled or interrupt
* driven modes. This function is non-blocking.
*
* In a polled mode, this function only sends as much data as the TX FIFO
* can buffer. The application may need to call it repeatedly to send the
* entire buffer.
*
* In interrupt mode, this function starts the sending of the buffer, if not
* the entire buffer has been sent, then the interrupt handler continues the
* sending until the entire buffer has been sent. A callback function, as
* specified by the application, will be called to indicate the completion of
* sending.
*
* @param	InstancePtr is a pointer to the XUartPsv instance
*
* @return	The number of bytes actually sent
*
* @note 	None.
*
******************************************************************************/
This function sends a buffer that has been previously specified by setting
up the instance variables of the instance. This function is an internal
function for the XUartPsv driver such that it may be called from a shell
function that sets up the buffer or from an interrupt handler.

This function sends the specified buffer in either polled or interrupt
driven modes. This function is non-blocking.

In a polled mode, this function only sends as much data as the TX FIFO
can buffer. The application may need to call it repeatedly to send the
entire buffer.

In interrupt mode, this function starts the sending of the buffer, if not
the entire buffer has been sent, then the interrupt handler continues the
sending until the entire buffer has been sent. A callback function, as
specified by the application, will be called to indicate the completion of
sending.
This function sends a buffer that has been previously specified by setting up the instance variables of the instance . This function is an internal function for the XUartPsv driver such that it may be called from a shell function that sets up the buffer or from an interrupt handler . This function sends the specified buffer in either polled or interrupt driven modes . This function is non - blocking . In a polled mode this function only sends as much data as the TX FIFO can buffer . The application may need to call it repeatedly to send the entire buffer . In interrupt mode this function starts the sending of the buffer if not the entire buffer has been sent then the interrupt handler continues the sending until the entire buffer has been sent . A callback function as specified by the application will be called to indicate the completion of sending .
u32 XUartPsv_SendBuffer(XUartPsv *InstancePtr)
{
	u32 SentCount = 0U;
	u32 IsBusy;
	IsBusy = (u32)XUartPsv_IsTransmitbusy(InstancePtr->Config.BaseAddress);
	while (IsBusy == (u32)TRUE) {
		IsBusy = (u32)XUartPsv_IsTransmitbusy(InstancePtr->Config.BaseAddress);
	}
	while ((!XUartPsv_IsTransmitFull(InstancePtr->Config.BaseAddress)) &&
		   (InstancePtr->SendBuffer.RemainingBytes > SentCount)) {
		XUartPsv_WriteReg(InstancePtr->Config.BaseAddress,
				XUARTPSV_UARTDR_OFFSET, ((u32)InstancePtr->
				SendBuffer.NextBytePtr[SentCount]));
		SentCount++;
	}
	InstancePtr->SendBuffer.NextBytePtr += SentCount;
	InstancePtr->SendBuffer.RemainingBytes -= SentCount;
	return SentCount;
}
u32 XUartPsv_SendBuffer ( XUartPsv * InstancePtr ) { u32 SentCount = 0U ; u32 IsBusy ; IsBusy = ( u32 ) XUartPsv_IsTransmitbusy ( InstancePtr -> Config . BaseAddress ) ; while ( IsBusy == ( u32 ) TRUE ) { IsBusy = ( u32 ) XUartPsv_IsTransmitbusy ( InstancePtr -> Config . BaseAddress ) ; } while ( ( ! XUartPsv_IsTransmitFull ( InstancePtr -> Config . BaseAddress ) ) && ( InstancePtr -> SendBuffer . RemainingBytes > SentCount ) ) { XUartPsv_WriteReg ( InstancePtr -> Config . BaseAddress , XUARTPSV_UARTDR_OFFSET , ( ( u32 ) InstancePtr -> SendBuffer . NextBytePtr [ SentCount ] ) ) ; SentCount ++ ; } InstancePtr -> SendBuffer . NextBytePtr += SentCount ; InstancePtr -> SendBuffer . RemainingBytes -= SentCount ; return SentCount ; }
This function sends a buffer that has been previously specified by setting
up the instance variables of the instance.
This function sends a buffer that has been previously specified by setting up the instance variables of the instance .
/*
	 * Check is TX busy
	 */ /*
	 * If the TX FIFO is full, send nothing.
	 * Otherwise put bytes into the TX FIFO until it is full, or all of
	 * the data has been put into the FIFO.
	 */ /* Fill the FIFO from the buffer */ /* Increment the send count. */ /* Update the buffer to reflect the bytes that were sent from it */