/* Check interrupt flag of DRE and update transaction runtime information.  */
static void _spi_tx_check_and_send(void *const hw, const uint32_t iflag, struct _spi_trans_ctrl *ctrl, uint16_t dummy)
/* Check interrupt flag of DRE and update transaction runtime information.  */
static void _spi_tx_check_and_send(void *const hw, const uint32_t iflag, struct _spi_trans_ctrl *ctrl, uint16_t dummy)
{
	uint32_t data;
	if (!(SERCOM_SPI_INTFLAG_DRE & iflag)) {
		return;
	}
	if (ctrl->txbuf) {
		data = *ctrl->txbuf++;
		if (ctrl->char_size > 1) {
			data |= (*ctrl->txbuf) << 8;
			ctrl->txbuf++;
		}
	} else {
		data = dummy;
	}
	ctrl->txcnt++;
	hri_sercomspi_write_DATA_reg(hw, data);
}