If I generate an SDK for an SKU that has FLEXIO (1.0 or 1.1), the resulting fsl_flexio_i2c_master.h contains the following definition:
status_t FLEXIO_I2C_MasterTransferBlocking(FLEXIO_I2C_Type *base,
flexio_i2c_master_handle_t *handle,
flexio_i2c_master_transfer_t *xfer);
However the corresponding fsl_flexio_i2c_master.c does not have the implementation. Obviously, I can implement it myself using FLEXIO_I2C_MasterTransferNonBlocking and a loop, but it looks like an unintentional omission that needs to be corrected
Hi Alex,
Good find.
I will notify the KSDK_v2 team.
UPDATE:
status_t FLEXIO_I2C_MasterTransferBlocking(FLEXIO_I2C_Type *base, flexio_i2c_master_transfer_t *xfer)
{
assert(xfer);
flexio_i2c_master_handle_t tmpHandle;
uint32_t statusFlags;
uint32_t result = kStatus_Success;
FLEXIO_I2C_MasterTransferCreateHandle(base, &tmpHandle, NULL, NULL);
/* Set up transfer machine. */
FLEXIO_I2C_MasterTransferInitStateMachine(base, &tmpHandle, xfer);
do
{
/* Wait either tx empty or rx full flag is asserted. */
while (!((statusFlags = FLEXIO_I2C_MasterGetStatusFlags(base)) &
(kFLEXIO_I2C_TxEmptyFlag | kFLEXIO_I2C_RxFullFlag)))
{
}
result = FLEXIO_I2C_MasterTransferRunStateMachine(base, &tmpHandle, statusFlags);
} while ((tmpHandle.state != kFLEXIO_I2C_Idle) && (result == kStatus_Success));
return result;
}
The KSDK_v2 team is looking into the issue.
Regards,
David
David,
This appears to be taken from the K80 SDK. It seems that unlike FLEXIO 1.1, the SDKs for FLEXIO 1.0 parts, such as KL17 I am using, are based on older code and do not have some of the calls referenced here implemented (e.g. FLEXIO_I2C_MasterTransferInitStateMachine)
UPDATE: Sorry, was looking it the wrong place. This works fine. Thank you. Hoping to see this in the SDK eventually.