/ Wait till end of transaction.
        while (!I2CMasterBusy(I2C7_BASE));
        while (I2CMasterBusy(I2C7_BASE));
    }
    else
    {
        bool firstEntry = true;
        // Read data.
        while (length-- > 1)
        {
            if (firstEntry)
                I2CMasterControl(I2C7_BASE, I2C_MASTER_CMD_BURST_RECEIVE_START); // Read the first byte.
            else
                I2CMasterControl (I2C7_BASE, I2C_MASTER_CMD_BURST_RECEIVE_CONT); // Read the next byte.
            // Wait till end of transaction.
            while (!I2CMasterBusy(I2C7_BASE));
            while (I2CMasterBusy(I2C7_BASE));

            // Read from FIFO.
            *buffer++ = (uint8_t) I2CMasterDataGet(I2C7_BASE);
        }

        // Read the last byte.
        I2CMasterControl (I2C7_BASE, I2C_MASTER_CMD_BURST_RECEIVE_FINISH);
        // Wait till end of transaction.
        while (!I2CMasterBusy(I2C7_BASE));
        while (I2CMasterBusy(I2C7_BASE));
        // Read from FIFO.
        *buffer = (uint8_t) I2CMasterDataGet(I2C7_BASE);
    }
}
