When I run example 'lpspi_transfer_s32k118' project , transfer one byte, will product twice interrupts 'void LPSPI0_IRQHandler(void)'.
Question : How to send byte in main-loop, and receive SPI data in ISR 'void LPSPI0_IRQHandler(void)'?
(purpose : only once go to ISR.)
Hi 王 从伟
The SDK example uses the LPSPI_DRV_MasterTransferBlocking API function, this will set the interrupt mode for the transmission and the reception, these represent two interruptions. If you want to trigger only one time the interruptions when you send, you could set NULL the reception buffer:
LPSPI_DRV_MasterTransferBlocking(SEND, &masterDataSend, NULL, BUFFER_SIZE, TIMEOUT);
But if you pass null, the received bytes are ignored.
Hope this helps
Best regards
Jorge Alcala
Dear Jorge Antonio Alcala Vazquez
I need only reception interrupt to get the slave-chip response word.
So I don't need send word interrupt.
But I can't known how to do ?
Hi 王 从伟
Similar as only sending, you can only receive, but you have to pass NULL to the parameter of sendBuffer.
LPSPI_DRV_MasterTransferBlocking(SEND, NULL, &masterDataReceive, BUFFER_SIZE, TIMEOUT);
Hope this helps
Best regards
Jorge Alcala