Interrupt when transfer complete on SPI Slave

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Interrupt when transfer complete on SPI Slave

ソリューションへジャンプ
1,386件の閲覧回数
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 解決策
862件の閲覧回数
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 返信
863件の閲覧回数
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 件の賞賛
返信