Hello,
I am using KL27 SPI Slave. I am receiving messages of unknown length and I was hoping to get an interrupt when the SS pin is deasserted, or in other words when the master is done sending.
Both the DMA and Non-DMA API will not give me a callback or interrupt when the SS pin is high and the callback only gets called when the buffer is completely full, even if it takes a few SPI transactions.
The KL27 reference manual 35.5.5.2 SPI Receive by DMA says:
"After that, RX DMA DONE is asserted to clear SPRF automatically. This process repeats until all data to be received (the number is decided by configuration register[s] of the DMA controller) is received or no receive DMA request is generated again because the SPI transmission is finished."
Is there any special configuration for the client or for the SS pin to get this functionality? I want RX DMA DONE to be asserted before RX buffer is full - if master is done with the SPI transmission.
Thanks
已解决! 转到解答。
Ok, I realized I can get a pin change interrupt on the SS pin transition to HIGH and then manually abort the DMA transfer. Works great.
Thanks!