SPI API slave select functionality
Posted: Wed May 11, 2016 4:29 am
I've been working with the SPI API for a while now and I had a couple of questions about slave select functionality.
First, it seems inefficient to reload all driver configuration just to select a new device. In my experience it's not at all uncommon to have multiple SPI devices on the same bus all using identical data rates, CPOL/CPHA, etc., with different slave selects. Calling spiStart works fine, but seems like overkill - is there another way?
Second, different devices expect different kinds of slave select framing - some expect it to be toggled per frame (which works fine with the current architecture) but some expect it to be toggled per byte. I can't see a way to achieve that behavior with the current API, short of calling spiPolledExchange over and over, which is pretty inefficient. Is there a way to make that happen?
Thanks!
First, it seems inefficient to reload all driver configuration just to select a new device. In my experience it's not at all uncommon to have multiple SPI devices on the same bus all using identical data rates, CPOL/CPHA, etc., with different slave selects. Calling spiStart works fine, but seems like overkill - is there another way?
Second, different devices expect different kinds of slave select framing - some expect it to be toggled per frame (which works fine with the current architecture) but some expect it to be toggled per byte. I can't see a way to achieve that behavior with the current API, short of calling spiPolledExchange over and over, which is pretty inefficient. Is there a way to make that happen?
Thanks!