/* introduce function FLEXIO_I2C_MasterTransferStateMachineStart. This function was deal with Initial state, i2c start state.  */
static void FLEXIO_I2C_MasterTransferStateMachineStart(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle)
/* introduce function FLEXIO_I2C_MasterTransferStateMachineStart. This function was deal with Initial state, i2c start state.  */
static void FLEXIO_I2C_MasterTransferStateMachineStart(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle)
{
    if (handle->needRestart)
    {
        FLEXIO_I2C_MasterStart(base, handle->transfer.slaveAddress, kFLEXIO_I2C_Write);
    }
    else
    {
        FLEXIO_I2C_MasterStart(base, handle->transfer.slaveAddress, handle->transfer.direction);
    }
    if (handle->transfer.subaddressSize == 0U)
    {
        if (handle->transfer.direction == kFLEXIO_I2C_Write)
        {
            handle->state = (uint8_t)kFLEXIO_I2C_SendData;
        }
        else
        {
            handle->state = (uint8_t)kFLEXIO_I2C_ReceiveDataBegin;
        }
    }
    else
    {
        handle->state = (uint8_t)kFLEXIO_I2C_SendCommand;
    }
}