/* brief Returns number of bytes transferred so far. param base The I2C peripheral base address. param handle Pointer to the I2C master driver handle. param count Number of bytes transferred so far by the non-blocking transaction. retval kStatus_Success retval #kStatus_I2C_Busy  */
status_t I2C_MasterTransferGetCount(I2C_Type *base, i2c_master_handle_t *handle, size_t *count)
/* brief Returns number of bytes transferred so far. param base The I2C peripheral base address. param handle Pointer to the I2C master driver handle. param count Number of bytes transferred so far by the non-blocking transaction. retval kStatus_Success retval #kStatus_I2C_Busy  */
status_t I2C_MasterTransferGetCount(I2C_Type *base, i2c_master_handle_t *handle, size_t *count)
{
    assert(handle != NULL);
    if (NULL == count)
    {
        return kStatus_InvalidArgument;
    }
    if (handle->state == (uint8_t)kIdleState)
    {
        *count = 0;
        return kStatus_NoTransferInProgress;
    }
    *count = handle->transferCount;
    return kStatus_Success;
}