1.2.21.10 1.3.25.10 1.4.21.10 1.5.25.10 1.6.22.10 1.7.23.10 1.9.19.10 1.29.23.10 1.30.18.10 1.31.18.10 1.32.26.10 1.33.16.10 1.37.18.10 1.38.21.10 1.39.18.10 1.40.20.10 SERCOMx_USART_TransmitterIsReady Function

C

/* x = SERCOM instance number */

/* Blocking mode */

bool SERCOMx_USART_TransmitterIsReady( void )

Summary

Returns the hardware status of the USART Transmitter

Description

This function returns the hardware status associated with the transmit hardware FIFO of the given USART peripheral instance. When the transmitter is ready, user can submit data to be transmitted. This function is available only in blocking (non-interrupt) mode of operation. It can be used to achieve non-blocking behavior of write request in the non-interrupt mode. If non-blocking behavior is desired, this function should be called to check if the transmitter is ready and then the SERCOMx_USART_Write() function should be called with a buffer size of 1.

Precondition

SERCOMx_USART_Initialize must have been called for the associated USART instance.

Parameters

None.

Returns

true - if transmit hardware FIFO has empty space to accept data.

false - if transmit hardware FIFO is full.

Example

if(true == SERCOM0_USART_TransmitterIsReady())
{
    // Empty space is available in Transmitter FIFO, hence can write a byte
    SERCOM0_USART_Write("A", 1);
}
else
{
    //Transmitter is busy
}

Remarks

None