SPI Communication ( Single Master Multiple Slave)
Dear Community,
I am working on an SPI-based setup where I have one SPI master and four SPI slaves, each connected to the master via their respective Slave Select (SS) lines. The configuration for the SPI master and the chip select lines is set up using SPC5 Studio, with each slave having a separate SPI configuration.
I am using the following function to start SPI communication with each slave:
void spi_lld_start(SPIDriver *spip, SPIConfig *config);
and I'm using this like this
spi_lld_start(&SPID2, &config1);
spi_lld_start(&SPID2, &config2);
spi_lld_start(&SPID2, &config3);
spi_lld_start(&SPID2, &config4);
he challenge arises when I need to start all four SPI slaves simultaneously. Currently, I need to pass a different configuration to this function for each slave. However, when I start one slave, the previous one stops working, as the SPI driver is reconfigured for the new slave.
In my use case, each slave has a watchdog bit that needs to be toggled periodically to keep the slave in normal operation. This necessitates keeping all four slaves active in parallel, but I am unsure how to achieve this with the spi_lld_start function, as it seems to deactivate the previous configuration when a new one is applied.
Is there a way to keep all four slaves running in parallel or to manage the SPI communication in such a way that all slaves remain active? Any guidance or suggestions would be highly appreciated.
Thank you in advance!
Example Setup:

