/* param base Pointer to FLEXIO_I2C_Type structure. param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state. param count Number of bytes transferred so far by the non-blocking transaction. retval kStatus_InvalidArgument count is Invalid. retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. retval kStatus_Success Successfully return the count.  */
status_t FLEXIO_I2C_MasterTransferGetCount(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle, size_t *count)
/* param base Pointer to FLEXIO_I2C_Type structure. param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state. param count Number of bytes transferred so far by the non-blocking transaction. retval kStatus_InvalidArgument count is Invalid. retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. retval kStatus_Success Successfully return the count.  */
status_t FLEXIO_I2C_MasterTransferGetCount(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle, size_t *count)
{
    if (NULL == count)
    {
        return kStatus_InvalidArgument;
    }
    if (handle->state == (uint8_t)kFLEXIO_I2C_Idle)
    {
        *count = 0;
        return kStatus_NoTransferInProgress;
    }
    *count = handle->transferSize - handle->transfer.dataSize;
    return kStatus_Success;
}