While the SPI is sending out the data, the CPU will calculate and fill the other range in place. So the gap between transaction only consists of toggling usr_mosi_highpart and starting a transaction.
However the first transaction using W0 after a transaction using W8 does never complete (actually not starts because nothing is sent out). (transfer C in the example)
Sample code:
Code: Select all
printf("init\n");
// CS handling done with direct IO and omitted in this example as well as any pin and GPIO-matrix setup
periph_ll_enable_clk_clear_rst(SPI_MODULE);
GPSPI3.clk_gate.val = 7;
GPSPI3.ctrl.val = 0;
GPSPI3.user1.val = 0;
GPSPI3.user2.val = 0;
GPSPI3.clock.clkcnt_l = 39;
GPSPI3.clock.clkcnt_h = 19;
GPSPI3.clock.clkcnt_n = 39;
GPSPI3.clock.clkdiv_pre = 1;
GPSPI3.clock.clk_equ_sysclk = 0;
GPSPI3.misc.val = 0;
GPSPI3.user.val = 0;
GPSPI3.user.usr_mosi = 1;
GPSPI3.ms_dlen.val = 7;
printf("transfer lo A\n");
GPSPI3.data_buf[0] = 'A';
SPI_DEV.cmd.update = 1;
while (SPI_DEV.cmd.update) {}
SPI_DEV.cmd.usr = 1;
while (SPI_DEV.cmd.usr) {}
printf("transfer hi B\n");
GPSPI3.user.usr_mosi_highpart = 1;
GPSPI3.data_buf[8] = 'B';
SPI_DEV.cmd.update = 1;
while (SPI_DEV.cmd.update) {}
SPI_DEV.cmd.usr = 1;
while (SPI_DEV.cmd.usr) {}
printf("transfer lo C\n");
GPSPI3.user.usr_mosi_highpart = 0;
GPSPI3.data_buf[0] = 'C';
SPI_DEV.cmd.update = 1;
while (SPI_DEV.cmd.update) {}
SPI_DEV.cmd.usr = 1;
while (SPI_DEV.cmd.usr) {}
printf("done\n");