def __init__(self, i2c_bus, address=0x50, write_protect=False,
                 wp_pin=None):
        from adafruit_bus_device.i2c_device import I2CDevice as i2cdev
        dev_id_addr = 0xF8 >> 1
        read_buf = bytearray(3)
        with i2cdev(i2c_bus, dev_id_addr) as dev_id:
            dev_id.write(bytearray([(address << 1)]), stop=False)
            dev_id.readinto(read_buf)
        manf_id = (((read_buf[0] << 4) +(read_buf[1] >> 4)))
        prod_id = (((read_buf[1] & 0x0F) << 8) + read_buf[2])
        if (manf_id != _I2C_MANF_ID) and (prod_id != _I2C_PROD_ID):
            raise OSError("FRAM I2C device not found.")

        self._i2c = i2cdev(i2c_bus, address)
        super().__init__(_MAX_SIZE_I2C, write_protect, wp_pin)
    def __init__(
        self,
        i2c_bus: I2C,
        address: int = 0x50,
        write_protect: bool = False,
        wp_pin: Optional[DigitalInOut] = None,
    ) -> None:
        from adafruit_bus_device.i2c_device import (  # pylint: disable=import-outside-toplevel
            I2CDevice as i2cdev, )

        dev_id_addr = 0xF8 >> 1
        read_buf = bytearray(3)
        with i2cdev(i2c_bus, dev_id_addr) as dev_id:
            dev_id.write_then_readinto(bytearray([(address << 1)]), read_buf)
        manf_id = (read_buf[0] << 4) + (read_buf[1] >> 4)
        prod_id = ((read_buf[1] & 0x0F) << 8) + read_buf[2]
        if (manf_id != _I2C_MANF_ID) and (prod_id != _I2C_PROD_ID):
            raise OSError("FRAM I2C device not found.")

        self._i2c = i2cdev(i2c_bus, address)
        super().__init__(_MAX_SIZE_I2C, write_protect, wp_pin)