1.34.27.20 1.35.21.20 USARTx_ReadByte Function

C

/* x = USART instance number */

/* Blocking mode */
int USARTx_ReadByte( void )

Summary

Submits request to read a byte of data to the given USART peripheral.

Description

This function submits request to read a byte of data to the given USART peripheral. This Function is available only in blocking mode. Application must call the USARTx_ReceiverIsReady API to check if a byte is available with the receiver before calling this API.

Precondition

  • USARTx_Initialize must have been called for the associated USART instance.

  • Receiver readiness must be confirmed using USARTx_ReceiverIsReady.

Parameters

None

Returns

Read byte.

Example

char rxData;

if(USART1_ReceiverIsReady() == true)
{
    rxData = USART1_ReadByte();
}

Remarks

None.