How exactly do you enable i2c0, i2c1 or i2c3 on the nrf9160 dk?

How do you enable any of the i2c peripherals on the nRF9160 dk boards?

I tried changing the device overlay to the code below:

&i2c0 {

    status = "okay";
    compatible = "nordic,nrf-twim";
    sda-pin = < 12 >;
    scl-pin = < 11 >;
    clock-frequency = <I2C_BITRATE_STANDARD>;
};
But I get this error: static assertion failed: "/soc/peripheral@50000000/i2c@8000 has legacy *-pin properties defined although PINCTRL is enabled"
I've seen older posts which change the pinctrl, which looks like something below:
&pinctrl {
    i2c0_default_alt: i2c0_default_alt {
       group1 {
          psels = <NRF_PSEL(TWIM_SDA, 0, 12)>,
                  <NRF_PSEL(TWIM_SCL, 0, 11)>;
       };
    };
    i2c0_sleep_alt: i2c0_sleep_alt {
       group1 {
          psels = <NRF_PSEL(TWIM_SDA, 0, 12)>,
                  <NRF_PSEL(TWIM_SCL, 0, 11)>;
          low-power-enable;
       };
    };
 };

&i2c0 {
    status = "okay";
    compatible = "nordic,nrf-twim";
    pinctrl-0 = <&i2c0_default_alt>;
    pinctrl-1 = <&i2c0_sleep_alt>;
    clock-frequency = <I2C_BITRATE_STANDARD>;  
};
But this gives me this error: 'PINCTRL_STATE_DT_N_S_soc_S_peripheral_50000000_S_i2c_8000_PINCTRL_IDX_0_UPPER_TOKEN' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_peripheral_50000000_S_i2c_a000_PINCTRL_IDX_0_UPPER_TOKEN'?
I just want to be able to use another i2c port. Does anyone know how to configure this? For reference i2c2 is already enabled, which is what I've been using so far.
Related