SPI_WriteData

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
994件の閲覧回数
_Ferrari_
Contributor IV

 

dear all,

I'm using SPI interface and I set 100000 as baudrate / 16 data bit. I'm using SPI_WriteData to transfer the data to a periferal and it works.

I inserted a delay function SDK_DelayAtLeastUs(160U, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); to avoid any overload error.

Instead of inserting a delay I would like to test a bit of the SPI periphery that indicates that the data transmission is completed

 

// now I'm using the following code
SPI_WriteData(FLEXCOMM4_PERIPHERAL, data, configFlags);
SDK_DelayAtLeastUs(160U, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY);

// but I would like to use the following procedure
SPI_WriteData(FLEXCOMM4_PERIPHERAL, data, configFlags);
while(SPI_checkTransmittedFlag(FLEXCOMM4_PERIPHERAL)) {}

Is there any SPI_chekTransmittedFlag that do that ?

Thank you very much for your help and cooperation

regards

 

タグ(1)
0 件の賞賛
返信
1 解決策
978件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello,

Yes, you can check the register FIFOSTAT,

Alice_Yang_1-1663730446233.png

 

You can also use transmit interrupt:

Alice_Yang_0-1663730208169.png

 

Recommend you refer to SPI demo under SDK, it includes polling and interrupt mode.

 

BR

Alice

 

 

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
937件の閲覧回数
_Ferrari_
Contributor IV

Solved!!

0 件の賞賛
返信
988件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello,

What about the part number of your mcu?

 

BR

Alice

0 件の賞賛
返信
986件の閲覧回数
_Ferrari_
Contributor IV

Dear Alice,

I'm using LPC55S28 assembled in LPC55S28 -EVK board

 

regards

0 件の賞賛
返信
979件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello,

Yes, you can check the register FIFOSTAT,

Alice_Yang_1-1663730446233.png

 

You can also use transmit interrupt:

Alice_Yang_0-1663730208169.png

 

Recommend you refer to SPI demo under SDK, it includes polling and interrupt mode.

 

BR

Alice

 

 

0 件の賞賛
返信