Copied from the fsl_i2C.h
/*! @brief I2C driver version 2.0.3. */
I am using KL03 in slave mode
There is NO issue with anything as long as the master talks to the KL03 first, but, if the master talks to my EEPROM 24C64 first in any way, then the KL03 locks up somewhere around the time kI2C_SlaveTransmitEvent happens. The address arrives, the bus stays low, and nothing happens.
void I2C_Slave_Config(void)
{
i2c_slave_config_t slaveConfig;
/*1.Set up i2c slave first*/
/*
* slaveConfig->addressingMode = kI2C_Address7bit;
* slaveConfig->enableGeneralCall = false;
* slaveConfig->enableWakeUp = false;
* slaveConfig->enableBaudRateCtl = false;
* slaveConfig->enableSlave = true;
*/
I2C_SlaveGetDefaultConfig(&slaveConfig);
slaveConfig.addressingMode = kI2C_Address7bit;
slaveConfig.slaveAddress = EWD_SLAVE_ADDR_7BIT;
slaveConfig.upperAddress = 0;
I2C_SlaveInit(EXAMPLE_I2C_SLAVE_BASEADDR, &slaveConfig, I2C_SLAVE_CLK_FREQ);
memset(&g_s_handle, 0, sizeof(g_s_handle));
I2C_SlaveTransferCreateHandle(EXAMPLE_I2C_SLAVE_BASEADDR, &g_s_handle, i2c_slave_callback, NULL);
I2C_SlaveTransferNonBlocking(EXAMPLE_I2C_SLAVE_BASEADDR, &g_s_handle, kI2C_SlaveCompletionEvent);
}