Closed ynezz closed 11 years ago
SSEL/CS should always be separate from the SPI code in my opinion because the pins are dedicated one per SPI device. If I have 3 SPI devices connected, I will have one SSEL/CS pin per device, and as I use each device I assert its CS line. I have no way of knowing how many SPI devices are connected or where they're connected, so it's the responsibility of the driver to assert and de-assert CS whenever needed (just before and immediately after the SPI transaction).
The only case where SSEL/CS should be managed in the SPI driver is if you are using SPI in slave move, and it is communicating with another MCU in SPI master. This is why there is a dedicated CS pin on the MCU with an interrupt, etc.
Hi,
how is CS/SSEL supposed to work on SSP0/SSP1? As SSEL isn't configured now in the init() functions I assume, that it's responsibility of the user of the SSP code?