AnsweredAssumed Answered

LPSPI  how to send and receive data from three slave devices

Question asked by 鹏 全 on Jul 20, 2017
Latest reply on Jul 27, 2017 by 鹏 全

Hello, My project uses SPI2 to connect three slave devices, use LPSPI_PCS0, LPSPI_PCS1, LPSPI_PCS2, how to send and receive data to each slave device.

...

LPSPI_DRV_MasterInit(SPI2_0, &masterState, &lpspiCom3_MasterConfig0);
LPSPI_DRV_MasterInit(SPI2_1, &masterState, &lpspiCom3_MasterConfig1);
LPSPI_DRV_MasterInit(SPI2_2, &masterState, &lpspiCom3_MasterConfig2);
while(1)
{

 

   delay(1000);
   LPSPI_DRV_MasterTransferBlocking(SPI2_0, &masterDataSend, &masterDataReceive, BUFFER_SIZE, TIMEOUT);

   LPSPI_DRV_MasterTransferBlocking(SPI2_1, &masterDataSend, &masterDataReceive, BUFFER_SIZE, TIMEOUT);

   LPSPI_DRV_MasterTransferBlocking(SPI2_2, &masterDataSend, &masterDataReceive, BUFFER_SIZE, TIMEOUT);
}

Is that right?     SPI2_0, SPI2_1,SPI2_2 value is how much?

 

 

Please help me.

Thank you.

Best Regards.

Outcomes