SPI API in case of multiple slaves
Posted: Thu Oct 24, 2013 2:38 am
With the whole "chip select" pin idea it seems like having multiple devices on the same bus is a big part of the SPI idea.
What I am having trouble with is finding an elegant way of using current SPI api in a configuration with two devices, say with different speeds. With current API, I would need to startSpi with one configuration, then stop it completely before using another device, re-start it with the new config, stop it again and so on. I guess in real life this happens relatively fast and there is nothing to worry about, but I wonder if we are missing an "spiConfigure" method?
This way "SPIConfig" should NOT be a parameter of "spiStart" - spiStart would only execute the general initialization (DMA etc) while only before using SPI in a particular device I would configure it and later re-configure for another device without stopping it completely.
What I am having trouble with is finding an elegant way of using current SPI api in a configuration with two devices, say with different speeds. With current API, I would need to startSpi with one configuration, then stop it completely before using another device, re-start it with the new config, stop it again and so on. I guess in real life this happens relatively fast and there is nothing to worry about, but I wonder if we are missing an "spiConfigure" method?
This way "SPIConfig" should NOT be a parameter of "spiStart" - spiStart would only execute the general initialization (DMA etc) while only before using SPI in a particular device I would configure it and later re-configure for another device without stopping it completely.
