/* Check interrupt flag of RXC and update transaction runtime information.  */
static bool _spi_rx_check_and_receive(void *const hw, const uint32_t iflag, struct _spi_trans_ctrl *ctrl)
/* Check interrupt flag of RXC and update transaction runtime information.  */
static bool _spi_rx_check_and_receive(void *const hw, const uint32_t iflag, struct _spi_trans_ctrl *ctrl)
{
	uint32_t data;
	if (!(iflag & SERCOM_SPI_INTFLAG_RXC)) {
		return false;
	}
	data = hri_sercomspi_read_DATA_reg(hw);
	if (ctrl->rxbuf) {
		*ctrl->rxbuf++ = (uint8_t)data;
		if (ctrl->char_size > 1) {
			*ctrl->rxbuf++ = (uint8_t)(data >> 8);
		}
	}
	ctrl->rxcnt++;
	return true;
}