XilinxProcessorIPLib/drivers/uartps/src/xuartps.c
u32 XUartPs_Send(XUartPs *InstancePtr, u8 *BufferPtr,
			   u32 NumBytes)
{
	u32 BytesSent;

	/* Asserts validate the input arguments */
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(BufferPtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);

#if defined  (XCLOCKING)
	Xil_ClockEnable(InstancePtr->Config.RefClk);
#endif
	/*
	 * Disable the UART transmit interrupts to allow this call to stop a
	 * previous operation that may be interrupt driven.
	 */
	XUartPs_WriteReg(InstancePtr->Config.BaseAddress, XUARTPS_IDR_OFFSET,
					  (XUARTPS_IXR_TXEMPTY | XUARTPS_IXR_TXFULL));

	/* Setup the buffer parameters */
	InstancePtr->SendBuffer.RequestedBytes = NumBytes;
	InstancePtr->SendBuffer.RemainingBytes = NumBytes;
	InstancePtr->SendBuffer.NextBytePtr = BufferPtr;

	/*
	 * Transmit interrupts will be enabled in XUartPs_SendBuffer(), after
	 * filling the TX FIFO.
	 */
	BytesSent = XUartPs_SendBuffer(InstancePtr);

	return BytesSent;
}
/****************************************************************************/
/**
*
* This functions sends the specified buffer using the device in either
* polled or interrupt driven mode. This function is non-blocking, if the device
* is busy sending data, it will return and indicate zero bytes were sent.
* Otherwise, it fills the TX FIFO as much as it can, and return the number of
* bytes sent.
*
* In a polled mode, this function will only send as much data as TX FIFO can
* buffer. The application may need to call it repeatedly to send the entire
* buffer.
*
* In interrupt mode, this function will start sending the specified buffer,
* then the interrupt handler will continue sending data 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 XUartPs instance.
* @param	BufferPtr is pointer to a buffer of data to be sent.
* @param  	NumBytes contains the number of bytes to be sent. A value of
*		zero will stop a previous send operation that is in progress
*		in interrupt mode. Any data that was already put into the
*		transmit FIFO will be sent.
*
* @return	The number of bytes actually sent.
*
* @note
*
* The number of bytes is not asserted so that this function may be called with
* a value of zero to stop an operation that is already in progress.
* <br><br>
*
*****************************************************************************/
This functions sends the specified buffer using the device in either
polled or interrupt driven mode. This function is non-blocking, if the device
is busy sending data, it will return and indicate zero bytes were sent.
Otherwise, it fills the TX FIFO as much as it can, and return the number of
bytes sent.

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

In interrupt mode, this function will start sending the specified buffer,
then the interrupt handler will continue sending data 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 functions sends the specified buffer using the device in either polled or interrupt driven mode . This function is non - blocking if the device is busy sending data it will return and indicate zero bytes were sent . Otherwise it fills the TX FIFO as much as it can and return the number of bytes sent . In a polled mode this function will only send as much data as TX FIFO can buffer . The application may need to call it repeatedly to send the entire buffer . In interrupt mode this function will start sending the specified buffer then the interrupt handler will continue sending data 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 XUartPs_Send(XUartPs *InstancePtr, u8 *BufferPtr,
			   u32 NumBytes)
{
	u32 BytesSent;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(BufferPtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
#if defined  (XCLOCKING)
	Xil_ClockEnable(InstancePtr->Config.RefClk);
#endif
	XUartPs_WriteReg(InstancePtr->Config.BaseAddress, XUARTPS_IDR_OFFSET,
					  (XUARTPS_IXR_TXEMPTY | XUARTPS_IXR_TXFULL));
	InstancePtr->SendBuffer.RequestedBytes = NumBytes;
	InstancePtr->SendBuffer.RemainingBytes = NumBytes;
	InstancePtr->SendBuffer.NextBytePtr = BufferPtr;
	BytesSent = XUartPs_SendBuffer(InstancePtr);
	return BytesSent;
}
u32 XUartPs_Send ( XUartPs * InstancePtr , u8 * BufferPtr , u32 NumBytes ) { u32 BytesSent ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( BufferPtr != NULL ) ; Xil_AssertNonvoid ( InstancePtr -> IsReady == XIL_COMPONENT_IS_READY ) ; #if defined ( XCLOCKING ) Xil_ClockEnable ( InstancePtr -> Config . RefClk ) ; #endif XUartPs_WriteReg ( InstancePtr -> Config . BaseAddress , XUARTPS_IDR_OFFSET , ( XUARTPS_IXR_TXEMPTY | XUARTPS_IXR_TXFULL ) ) ; InstancePtr -> SendBuffer . RequestedBytes = NumBytes ; InstancePtr -> SendBuffer . RemainingBytes = NumBytes ; InstancePtr -> SendBuffer . NextBytePtr = BufferPtr ; BytesSent = XUartPs_SendBuffer ( InstancePtr ) ; return BytesSent ; }
This functions sends the specified buffer using the device in either
polled or interrupt driven mode.
This functions sends the specified buffer using the device in either polled or interrupt driven mode .
/* Asserts validate the input arguments */ /*
	 * Disable the UART transmit interrupts to allow this call to stop a
	 * previous operation that may be interrupt driven.
	 */ /* Setup the buffer parameters */ /*
	 * Transmit interrupts will be enabled in XUartPs_SendBuffer(), after
	 * filling the TX FIFO.
	 */