Hi,
I'm working with LPC55S69 development board and try to use its SPI interface to control a device.
I used FLEXCOMM 8 for this application. And it works fine with ssel0, it's pulled down correctly during the conmmunication.
ThenI was trying to switch to use ssel1 instead of 0 since my next step is driving 3 devices, and it failed.
I didn't use Peripherals in the config tool, since it's not used in the SPI examples provided by the SDK.
What I have tried:
1. changed sselNum in fsl_spi.c
2. added
void SPI3_setSSEL(uint8_t slave) {
SPI3_InterruptDriverState.handle->masterHandle.sselNum = slave;
}in fsl_spi_cmsis.c and call it before calling the transfer. I haved changed SPI3 to SPI8.
This method was mentioned in
SPI: slave select using SDK, e.g., SPI_MasterTransferNonBlocking()?
3. modified spi8_transfer:
static int32_t SPI8_InterruptTransfer(const void *data_out, void *data_in, uint32_t num, uint8_t slave) {
return SPI_InterruptTransfer(data_out, data_in, num, &SPI8_InterruptDriverState); SPI8_InterruptDriverState.handle->masterHandle.sselNum = slave;
}
All above 3 didn't work. It's still SSEL0 that was pulled down during the transfering.
I'm a bignner. And I saw somewhere that to control mutiple device, "Manual Control of CS Lines via GPIO " would work. But it's so confusing that the ssel1-3 was there and I could not use them.
I'm working on the method using GPIO for now, but still want to figure out what the problem with my code that I cannot just switch to SSEL1 from SSEL0 to control only one device. The examples and the documents were not very helpful for me. If you have any working examples, that would be very helpful.
Thanks!