Hi
I would like to use both of the I2C and the SPI on LPC54101.
However, happen an error on use SPI when I2C was initialized.
Do you know the measures?
When you use this code
ROM_I2CS_Init(devMemI2C, &i2csInit);
mXfer.status is ERR_SPI_BASE on endress.
ROM_SPIM_Transfer(spimHandle, &mXfer);
while (mXfer.status == ERR_SPI_BUSY) {}
This is code
SystemCoreClockUpdate();
Init_SPI_PinMux();
Init_I2C_PinMux();
Chip_Clock_EnablePeriphClock(LPC_SPIM_CLOCK);
Chip_SYSCON_PeriphReset(LPC_SPIM_RESET);
Chip_Clock_EnablePeriphClock(LPC_I2CS_CLOCK);
Chip_SYSCON_PeriphReset(LPC_I2CS_RESET);
Board_Init();
...
spimHandle = ROM_SPIM_Init(devMem, &spimInit);
if (ROM_SPIM_SetupTransfer(spimHandle, &spimConfig) != LPC_OK) {
}
NVIC_EnableIRQ(LPC_SPIIRQNUM);
...
i2csHandle = ROM_I2CS_Init(devMemI2C, &i2csInit); // If this line does not exists, program will not happen error.
ROM_I2CS_SetupSlave(i2csHandle, &slaveSetup); // If does not exists it, you should comment out of this line
...
optimalDevI2C = Chip_Clock_GetAsyncSyscon_ClockRate() / 4000000;
LPC_I2C_PORT->CLKDIV = optimalDevI2C;
...
NVIC_EnableIRQ(LPC_I2CS_INT);