AnsweredAssumed Answered

About generateBuff and getBuffPtr

Question asked by XJ Q on Nov 15, 2017
Latest reply on Nov 16, 2017 by XJ Q

Hi everyone,

 

I'm now trying to start establishing communication between STM32F4 Discovery Board and an SPI slave over SPI1.

 

There is an example project named "SPI_Test.slx" in the path \STM32-MAT\STM32\STM32demos\Test\SPI. But I can't well understand, what's the main work of the MATLAB Function block "generateBuff" that is used in this project.

 

My thought:

1) Before transmitting data over SPI, this data must be temporarily stored in a buffer. This MATLAB Function block generates a 32-bit buffer to store the data that is going to be sent. Right?

2) The output "Buff" refers to the address of the generated buffer, in which the data are stored. Right?

3) Another output port "NbChar" indicates how many numbers of data will be sent. Right?

4) The Buffer_Size_Send value in the SPI block must be equal to Nb2Send. Right?

 

Thank you very much!

Outcomes