1.2.21.8 1.3.25.8 1.4.21.8 1.5.25.8 1.6.22.8 1.7.23.8 1.9.19.8 1.29.23.8 1.30.18.8 1.31.18.8 1.32.26.8 1.33.16.8 1.37.18.8 1.38.21.8 1.39.18.8 1.40.20.8 SERCOMx_USART_WriteBufferSizeGet Function

C

/* x = SERCOM instance number */

/* Ring buffer mode */

size_t SERCOMx_USART_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

SERCOMx_USART_Initialize must have been called for the associated SERCOM_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 = SERCOM0_USART_WriteBufferSizeGet();

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

Remarks

None