'Base constructor for ESPLoader bootloader interaction
Don\'t call this constructor, either instantiate ESP8266ROM
or ESP32ROM, or use ESPLoader.detect_chip().
This base class has all of the instance methods for bootloader
functionality supported across various chips & stub
loaders. Subclasses replace the functions they don\'t support
with ones which throw NotImplementedInROMError().'

def __init__(self, port=DEFAULT_PORT, baud=ESP_ROM_BAUD):

    if isinstance(port, serial.Serial):
        self._port = port
    else:
        self._port = serial.serial_for_url(port)
    self._slip_reader = slip_reader(self._port)
    self._set_port_baudrate(baud)
