SPI read

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决
1,223 次查看
pietrodicastri
Senior Contributor II

Good morning

I use the SPI0, without any interrupt, I have this effect.

It will never go out of the while loop, even after a clear.

Is there an explanation ????

DSPI_HAL_ClearStatusFlag( baseAddr, kDspiRxFifoDrainRequest );

while( DSPI_HAL_GetStatusFlag( baseAddr, kDspiRxFifoDrainRequest ) )

{

       uint32_t b = DSPI_HAL_ReadData( baseAddr );

}

    Thank You

Pietro

1 解答
1,053 次查看
adriancano
NXP Employee
NXP Employee

Hi,

I recommend you to have a look at the examples provided in the KSDK folder. In the path C:\Freescale\KSDK_1.2.0\examples\frdmk64f\driver_examples\dspi\dspi_polling\master

you will find an example for the SPI usage.


Hope this information can help you

Best Regards,
Adrian Sanchez Cano
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

2 回复数
1,054 次查看
adriancano
NXP Employee
NXP Employee

Hi,

I recommend you to have a look at the examples provided in the KSDK folder. In the path C:\Freescale\KSDK_1.2.0\examples\frdmk64f\driver_examples\dspi\dspi_polling\master

you will find an example for the SPI usage.


Hope this information can help you

Best Regards,
Adrian Sanchez Cano
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,053 次查看
pietrodicastri
Senior Contributor II

Hello

Ok , the suggestion is qualified. The example outlines it is necessary to read and clear the flag. the flag will not definitely clear until everything is sucked out.

I think a short suggestion like this could be helpful, we work stressed for delivering results, not always we have time to read carefully the datasheet or test in a good order.

Thank You

Pietro