1.1.13.10 1.8.24.12 1.10.23.14 1.11.23.14 1.12.24.14 1.13.22.14 1.14.17.14 1.15.18.14 1.16.25.14 1.17.20.14 1.18.21.14 1.19.21.14 1.20.25.14 1.21.26.14 1.22.28.14 1.23.27.14 1.24.23.14 1.27.26.12 1.34.26.12 1.35.20.12 UARTx_ReceiverIsReady Function

C

/* x = UART instance number */

/* Blocking mode */

bool UARTx_ReceiverIsReady( void )

Summary

Returns the hardware status of the UART Receiver

Description

This function returns the hardware status associated with the Receive hardware FIFO of the given UART peripheral instance. When Receiver is ready, user can read the available data. This function is available only in blocking (non-interrupt) mode of operation. It can be used to achieve non-blocking behavior of UARTx_Read function even if the library is configured for blocking behavior. If this function returns true, calling the UARTx_Read function with a byte count of 1 will result in non-blocking behavior.

Precondition

UARTx_Initialize must have been called for the associated UART instance.

Parameters

None.

Returns

Param Description
true Receive hardware FIFO has at least one data available to read
false Receive hardware FIFO is empty

Example

char rxData;

if(UART1_ReceiverIsReady() == true)
{
    // At least one data is available in Receive FIFO, hence can read a byte
    UART1_Read(&rxData, 1);
}
else
{
    //Receiver is empty
}

Remarks

None