SPI_WriteData

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

SPI_WriteData

Jump to solution
1,147 Views
_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

 

Tags (1)
0 Kudos
Reply
1 Solution
1,131 Views
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

 

 

View solution in original post

0 Kudos
Reply
4 Replies
1,090 Views
_Ferrari_
Contributor IV

Solved!!

0 Kudos
Reply
1,141 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello,

What about the part number of your mcu?

 

BR

Alice

0 Kudos
Reply
1,139 Views
_Ferrari_
Contributor IV

Dear Alice,

I'm using LPC55S28 assembled in LPC55S28 -EVK board

 

regards

0 Kudos
Reply
1,132 Views
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 Kudos
Reply