3.3.13.3 SERCOMx_USART_Read

Submits a read buffer to the given USART peripheral to process

This function submits a read buffer to the USART peripheral to process. A call to this function submits the buffer and the size to the peripheral library and returns immediately. The transfer completion status can either be checked through the callback mechanism or by calling the SERCOMx_USART_ReadIsBusy function. The success of the operation can be obtained by calling the SERCOMx_USART_ErrorGet function. If the SERCOMx_USART_ErrorGet function returns no error, then this means that the requested number of bytes have been processed. If the function returns some error, the SERCOMx_USART_ReadCountGet function can be called to know the number of bytes that were received till the error occurred.

bool 
SERCOMx_USART_Read
(
    void
);

Precondition

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

Parameters

  • void

Returns

  • bool - true - if the Read transaction is successful or if the requested size is 0, otherwise, false if the arguments are not valid or if the device is busy or if an error occurred while receiving data.