trans = trans_buf->trans;
host->cur_cs = dev_id;
- //We should be done with the transmission.
+
+ //Reconfigure according to device settings, the function only has effect when the dev_id is changed.
+ spi_setup_device(host, dev_id);
hal->tx_bitlen = trans->length;
hal->rx_bitlen = trans->rxlength;
hal->dummy_bits = dev->cfg.dummy_bits;
}
- //Reconfigure according to device settings, the function only has effect when the dev_id is changed.
- spi_setup_device(host, dev_id);
spi_hal_setup_trans(hal);
spi_hal_prepare_data(hal);
{
spi_dev_t *hw = hal->hw;
+ //clear int bit
spi_ll_clear_int_stat(hal->hw);
+ //We should be done with the transmission.
assert(spi_ll_get_running_cmd(hw) == 0);
- //clear int bit
- spi_ll_master_set_io_mode(hw, SPI_LL_IO_MODE_NORMAL);
+ spi_ll_master_set_io_mode(hw, hal->io_mode);
int extra_dummy = 0;
//when no_dummy is not set and in half-duplex mode, sets the dummy bit if RX phase exist