"Slow" is a relative term. However fast the CPU, you can still push it to the limit. To get close to the limit you will need efficient code. 12Mhz is 25% of the CPU clock speed, so you can't afford much overhead.
Function call overhead can be significant, to get higher performance you need to eliminate that. Ideally you want to write to the SPI data register directly in a loop without intervening calls.
Unfortunately the SPI library does not provide a function to send a value repeatedly. You could try transfer (char *, int) to send a block of data repeatedly.
Probably I would create my own version of the SPI library.
12MHz is bit. byte is 1.2Mhz
2us ( 96 instruction ?) for 2 function call and for loop, it seems to me a very bad result, compared to an AVR cpu and the IAR compiler,
I am not good at C++
How can I write this in the library?
sercom->SPI.DATA.bit.DATA = data; // Writing data into Data register
while( sercom->SPI.INTFLAG.bit.RXC == 0 );
error is:
d:\Documenti\Arduino\libraries\ILI9488\ILI9488.cpp: In member function 'void ILI9488::cls()':
d:\Documenti\Arduino\libraries\ILI9488\ILI9488.cpp:495:3: error: 'sercom' was not declared in this scope
sercom->SPI.DATA.bit.DATA = 0; // Writing data into Data register
^~~~~~
d:\Documenti\Arduino\libraries\ILI9488\ILI9488.cpp:495:3: note: suggested alternative: 'sercom5'
sercom->SPI.DATA.bit.DATA = 0; // Writing data into Data register
^~~~~~
sercom5
exit status 1
Compilation error: exit status 1