1.32.26.11 SERCOMx_USART_TransmitComplete Function

C

/* x = SERCOM instance number */

/* Blocking mode */

bool SERCOMx_USART_TransmitComplete( void )

Summary

Returns the hardware status of the USART Transmit Shift Register

Description

This function returns the hardware status associated with the Transmit Shift register of the given USART peripheral instance. When Transmitter is ready, user can submit data to transmit. This function is available only in non-interrupt mode of operation and it should be used to check transmitter readiness before calling SERCOMx_USART_WriteByte function.

Precondition

SERCOMx_USART_Initialize must have been called for the associated USART instance.

Parameters

None.

Returns

true - Transmit Shift register has empty space to accept the data.

false - Transmit Shift register is full.

Example

if(true == SERCOM0_USART_TransmitComplete())
{
    // Empty space is available in Transmitter FIFO, hence can write a byte	
    SERCOM0_USART_WriteByte('A');
}
else
{
    //Transmitter is busy
}

Remarks

None