2.3.3.2 COM_FrameTransfer()

com_adapter_result_t COM_FrameTransfer (uint8_t * receiveBufferPtr, uint16_t * receiveIndexPtr)

Receive or send byte over SERCOM.

When receiving this function will push data bytes into the buffer provided until a complete frame is received. When sending this function uses the static send buffer defined in communication adapter file to send out bytes until it is complete.

Note:

For UART, this function does not send data out because it is asynchronous, but for other host driven protocols this function controls the transfer in both directions.

Parameters:
in,out receiveBufferPtr

- Pointer to the buffer provided to SERCOM

in,out receiveIndexPtr

- Pointer to the number of bytes successfully received by SERCOM

Returns:

COM_PASS - SERCOM has received a complete frame and is ready for further processing  

COM_BUSY - SERCOM still loading the buffer  

COM_BUFFER_ERROR - SERCOM received too many or encountered a data error  

COM_FAIL - An error occurred in SERCOM