Hi all,
I need to manually set a pin low before a SPI master transmit begins, and the set it back high afterwards.
The micro is a KL03.
At the moment, im doing the following...
GPIO_PortClear(GPIOA, 1<<(PIN2));
SPI0->D = data & 0xFFU;
while ((SPI0->S & SPI_S_SPTEF_MASK) == 0) {}
GPIO_PortSet(GPIOA, 1<<(PIN2));
... but im finding the SPTEF is being set high before the transmission has actually been completed.
How can I reliably wait for the last bit to be sent, before setting that PA2 pin back to high?
Thanks in advance.