Interrupt when transfer complete on SPI Slave

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Interrupt when transfer complete on SPI Slave

跳至解决方案
1,346 次查看
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

标签 (1)
标记 (3)
0 项奖励
回复
1 解答
822 次查看
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 项奖励
回复
1 回复
823 次查看
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 项奖励
回复