Part Number: RM48L952
Tool/software: Code Composer Studio
Hello,
I am currently working on a CCS project which connects SPI ports 1 and 2 via wire and uses the two ports to communicate. However, I am running into some confusion regarding some of the functions used in the spi_Master_Slave example code. There are two functions I have questions about: (1) spiSendAndGetData() and (2) spiTransmitAndReceiveData(). The example code uses spiSendAndGetData() for SPI1 and spiTransmitAndReceiveData() for SPI2. In my main I have:
So let's look at spiSendAndGetData. My initial understanding of this function was that it was taking the data in TX_Data_Slave and sending it to RX_Data_Slave over SPI, but when I run the debug my buffers end up looking like so:
My intuition tells me that this is right because, in the long run, I want the data from the slave to go to the master. The functions make me think that the data from TX_Data_Master should have gone to RX_Data_Master, which would mean that the TX_Data_Master and RX_Data_Master arrays should contain the same values instead of what I currently have. Is this incorrect? Or is the code functioning as expected and am I just misunderstanding something vital regarding the functionality of the code?