Hi
The latest KSDK Version is V2 with below I2C_MasterStart() driver:
status_t I2C_MasterStart(I2C_Type *base, uint8_t address, i2c_direction_t direction)
{
status_t result = kStatus_Success;
uint32_t statusFlags = I2C_MasterGetStatusFlags(base);
/* Return an error if the bus is already in use. */
if (statusFlags & kI2C_BusBusyFlag)
{
result = kStatus_I2C_Busy;
}
else
{
/* Send the START signal. */
base->C1 |= I2C_C1_MST_MASK | I2C_C1_TX_MASK;
#if defined(FSL_FEATURE_I2C_HAS_DOUBLE_BUFFERING) && FSL_FEATURE_I2C_HAS_DOUBLE_BUFFERING
while (!(base->S2 & I2C_S2_EMPTY_MASK))
{
}
#endif /* FSL_FEATURE_I2C_HAS_DOUBLE_BUFFERING */
base->D = (((uint32_t)address) << 1U | ((direction == kI2C_Read) ? 1U : 0U));
}
return result;
}
Customer could download the latest KSDK V2.0 software from here.
Wish it helps.
Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------