pub fn new(i2c: impl Instance + 'd, config: Config) -> Result<Self, ConfigError> {
        let guard = PeripheralGuard::new(i2c.info().peripheral);

        let sda_pin = PinGuard::new_unconnected(i2c.info().sda_output);
        let scl_pin = PinGuard::new_unconnected(i2c.info().scl_output);

        let mut i2c = I2c {
            i2c: i2c.degrade(),
            phantom: PhantomData,
            guard,
            config: DriverConfig {
                config,
                sda_pin,
                scl_pin,
            },
        };

        i2c.apply_config(&config)?;

        Ok(i2c)
    }
Create a new I2C instance.

# Errors

A [`ConfigError`] variant will be returned if bus frequency or timeout
passed in config is invalid.
esp-hal/src/i2c/master/mod.rs