Jump to main content

##

# 2.130.21 UARTx_ReadFreeBufferCountGet Function

## C

    /* x = UART instance number */

    /* Ring buffer mode */

    size_t UARTx_ReadFreeBufferCountGet(void)

## Summary

Returns the number of bytes of free space available in the internal receive buffer

## Description

This API returns the number of bytes of free space available in the internal receive buffer. This API can be used to determine how many bytes can be received before the receive buffer becomes full.

## Precondition

UARTx_Initialize must have been called for the associated UART instance.

## Parameters

None

## Returns

The API returns the number of bytes of free space in the receive buffer. If 9-bit mode is enabled, then the return value indicates number of 9-bit data that can be copied into the internal receive buffer.

## Example

    size_t nRxFreeSpace;

    nRxFreeSpace = UART1_ReadFreeBufferCountGet();

## Remarks

None