Interrupt when transfer complete on SPI Slave

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Interrupt when transfer complete on SPI Slave

Jump to solution
1,173 Views
shlomozippel
Contributor I

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

Labels (1)
0 Kudos
1 Solution
649 Views
shlomozippel
Contributor I

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!

View solution in original post

0 Kudos
1 Reply
650 Views
shlomozippel
Contributor I

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!

0 Kudos