how can I program SPI to select more than only one slave device with any GPIO ?
SPI Routine "spi_master_int" can select SPI0 or SPI1 only with one dedicated GPIO as Slave-Select Signal.
how can I program SPI to select more than only one slave device with any GPIO ?
SPI Routine "spi_master_int" can select SPI0 or SPI1 only with one dedicated GPIO as Slave-Select Signal.
Hi Reinhard,
The SPI master module only sets CLK/MISO/MOSI. It does not hard-code the chip select. The chip-select is a GPIO (or several) that must be handled in your application to differentiate between several SPI-slaves.
Very basic pseudo code:
CS_SLAVE_0 = active; SPI_COMMUNICATION(); CS_SLAVE_0 = inactive;
CS_SLAVE_1 = active: SPI_COMMUNICATION(); CS_SLAVE_1 = inactive;
Best regards Håkon
Hi Reinhard,
The SPI master module only sets CLK/MISO/MOSI. It does not hard-code the chip select. The chip-select is a GPIO (or several) that must be handled in your application to differentiate between several SPI-slaves.
Very basic pseudo code:
CS_SLAVE_0 = active; SPI_COMMUNICATION(); CS_SLAVE_0 = inactive;
CS_SLAVE_1 = active: SPI_COMMUNICATION(); CS_SLAVE_1 = inactive;
Best regards Håkon
I don't think this is accurate, at least not with the 6.1 SDK. The spi_master module takes a chip select pin as a parameter. It would be great if you could just pass SPI_PIN_DISCONNECTED
and have the module ignore the select pin so the app can control it, but if you do that it looks like the module will just treat it as a valid pin number and call the GPIO config on it.