S32K3XX SPI AsyncTransmit

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

S32K3XX SPI AsyncTransmit

跳至解决方案
883 次查看
Embedded_novice
Contributor III

When I utilized the asynchronous communication function of the S32K310, by calling the function Spi_AsyncTransmit(), the interrupt was triggered. However, according to the comments of the API, I must schedule the Spi_MainFunction_Handling() function periodically in order to handle asynchronous communication. I would like to know the function of Spi_MainFunction_Handling and the necessity of scheduling it, because currently I can achieve communication even without calling it.

Thank you for your help!P1.pngP2.png

0 项奖励
回复
1 解答
856 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @Embedded_novice 

It seems there may be a misunderstanding regarding the purpose of the Spi_MainFunction_Handling() function. In simpler terms, this function monitors SPI events in the background and, when necessary, it triggers the appropriate ISR to handle the event. Therefore, it does not need to be called manually.

To help rule out any configuration-related issues, could you please share your current SPI configuration? Additionally, it would be helpful if you could let me know which software version you are using.

 

BR, VaneB

在原帖中查看解决方案

0 项奖励
回复
2 回复数
857 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @Embedded_novice 

It seems there may be a misunderstanding regarding the purpose of the Spi_MainFunction_Handling() function. In simpler terms, this function monitors SPI events in the background and, when necessary, it triggers the appropriate ISR to handle the event. Therefore, it does not need to be called manually.

To help rule out any configuration-related issues, could you please share your current SPI configuration? Additionally, it would be helpful if you could let me know which software version you are using.

 

BR, VaneB

0 项奖励
回复
842 次查看
Embedded_novice
Contributor III
Thank you for your help. Currently, my SPI communication is normal, but I just don't quite understand the purpose of this API. In my opinion, SPI is divided into POLLING mode and INTERRUPT mode when configured. When both are used in asynchronous transmission, the POLLING mode requires manual scheduling of the MainFunction periodically to achieve data transmission, while the INTERRUPT mode automatically triggers interrupts to achieve data transmission. I'm not sure if my understanding is correct?(The MCAL version I'm using is SW32K3_S32M27x_RTD_R21-11_5.0.0.)
0 项奖励
回复