SPI read

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,225件の閲覧回数
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,055件の閲覧回数
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,056件の閲覧回数
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,055件の閲覧回数
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