SPI_WriteData

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

SPI_WriteData

跳至解决方案
863 次查看
_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 解答
847 次查看
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 回复数
806 次查看
_Ferrari_
Contributor IV

Solved!!

0 项奖励
857 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello,

What about the part number of your mcu?

 

BR

Alice

0 项奖励
855 次查看
_Ferrari_
Contributor IV

Dear Alice,

I'm using LPC55S28 assembled in LPC55S28 -EVK board

 

regards

0 项奖励
848 次查看
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 项奖励