Hi @Seunghyup
Can you try another way?
Manual Control of CS Lines via GPIO
Since the configurator locks the CS lines to a single selection, a practical approach would be to control the CS lines (SSEL0, SSEL1, SSEL2) manually using GPIO pins, which will allow you to dynamically select the appropriate slave device in your code.
Steps:
1. Set up SSEL0, SSEL1, and SSEL2 as GPIO outputs:
• Instead of configuring these lines as hardware-controlled CS lines, configure them as regular GPIO pins.
2. Manually control CS lines:
• Before each SPI transfer, manually assert the desired GPIO pin corresponding to the target slave device (set it low).
• Perform the SPI transfer.
• After the transfer, deassert the GPIO pin (set it high).
Example Code:
GPIO_PinWrite(GPIO, portX, SSEL0_PIN, 0); // Assert CS for device 1
SPI_RTOS_Transfer(...); // Perform SPI transfer
GPIO_PinWrite(GPIO, portX, SSEL0_PIN, 1); // Deassert CS for device 1
GPIO_PinWrite(GPIO, portX, SSEL1_PIN, 0); // Assert CS for device 2
SPI_RTOS_Transfer(...); // Perform SPI transfer
GPIO_PinWrite(GPIO, portX, SSEL1_PIN, 1); // Deassert CS for device 2
This method gives you complete flexibility in controlling the CS lines without needing to modify the SPI initialization for each transfer.
BR
Hang