1.5.25.20 SERCOMx_USART_ReadByte Function

C

/* x = SERCOM instance number */

/* Blocking mode */

int SERCOMx_USART_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 SERCOMx_USART_ReceiverIsReady API to check if a byte is available with the receiver before calling this API.

Precondition

SERCOMx_USART_Initialize must have been called for the associated USART instance.

Parameters

None

Returns

Read byte.

Example

//Example to use in non-interrupt
char rxData;

if(SERCOM0_USART_ReceiverIsReady() == true)
{
    rxData = SERCOM0_USART_ReadByte();
}

Remarks

None