S32K3XX SPI AsyncTransmit

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

S32K3XX SPI AsyncTransmit

Jump to solution
1,619 Views
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 Kudos
Reply
1 Solution
1,591 Views
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

View solution in original post

0 Kudos
Reply
2 Replies
1,592 Views
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 Kudos
Reply
1,577 Views
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 Kudos
Reply