In a multi slave setting, it is not clear how the API is supposed to work, since only one SS line can be passed on at a time.
The only solution I see right now, is handling the slave selection process manually.
[X] Question
[ ] Enhancement
[ ] Bug
ARM Internal Ref: MBOTRIAGE-958
My understanding of the intent is that you use multiple SPI objects, one for each slave. Those would specify the same MOSI/MISO pins, but different SSEL pins.
If you look at SPI.cpp, you'll see that it tracks the previous SPI object that accessed the HAL, and does reconfiguration of bus frequency/format as required when you switch between objects. So each SPI object and hence slave can have a different configuration.
It would be nice if this could be added to the documentation as an example and explicitly stating that this logic is already part of the SPI class rather than to expect people to dig through the SPI implementation details (if it already exists, I did not find it, so this might be a good point in making it more prominent).
Thanks @drahnr for pointing this out and we will be updating the documentation to capture this. - https://github.com/ARMmbed/mbed-os-5-docs/pull/632
Let us know if you have more questions.
Most helpful comment
It would be nice if this could be added to the documentation as an example and explicitly stating that this logic is already part of the
SPIclass rather than to expect people to dig through the SPI implementation details (if it already exists, I did not find it, so this might be a good point in making it more prominent).