1.35.21.8 USARTx_WriteBufferSizeGet Function

C

/* x = USART instance number */

/* Ring buffer mode */
size_t USARTx_WriteBufferSizeGet(void)

Summary

Returns the size of the internal transmit ring buffer

Description

This function returns the size of the transmit ring buffer, which is same as the size of the transmit ring buffer configured in MHC.

Precondition

USARTx_Initialize must have been called for the associated USART instance.

Parameters

None

Returns

The API returns the size of the transmit ring buffer. If 9-bit mode is enabled, then the return value indicates the number of 9-bit data that can be copied to the internal transmit ring buffer.

Example

size_t txBufferSize;

txBufferSize = USART1_WriteBufferSizeGet();

// Set a threshold to get notification when the transmit ring buffer is empty
USART1_WriteThresholdSet(txBufferSize);

Remarks

None