1.35.21.11 USARTx_TransmitComplete Function

C

bool USARTx_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 USARTx_WriteByte function.

Precondition

USARTx_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 == USART1_TransmitComplete())
{
    // Empty space is available in Transmitter FIFO, hence can write a byte
    USART1_WriteByte('A');
}
else
{
    //Transmitter is busy
}

Remarks

None.