Turning on TWIM/TWIS without devicetree

Hello, im trying to turn on TWIM/TWIS without setting devicetree.

So ill point my problem and what have i currently done.

1. If i turn on my node in DT it works:

&i2c0 {
    status = "okay";
    compatible = "nordic,nrf-twim";

};

2. But i want to use it completely on nrf hal.That's my code(its not actually a code, i just want to somehow enable it)

2. Ive tried various KCONFIG options

CONFIG_NRFX_TWI0=y and so on, with turning off all the peripherals with same address.

it didnt work, i always had error CONFIG_NRFX_TWIM0 was assigned the value y, but got the value n. Missing dependencies:
n

and ofc, i couldnt enable it with Kconfig GUI.

So ive set sth like this:

and thats my error:

Im using nrf connect app to make projects, it might be an issue i guess. The question is what should i do to make i2c0 status = okay(TWIM) in HAL/Kconfig way

  • Hello,

    You need to enable the i2c0 node in your device tree to inform the build system that the hardware is present on your device. However, you should change the 'compatible' field to use the binding for the TWI slave:

    &i2c0 {
        status = "okay";
        compatible = "nordic,nrf-twis";
    };

    After applying the DT overlay, you can enable TWIS instance 0 in your prj.conf file:

     

    CONFIG_NRFX_TWIS0=y

    Best regards,

    Vidar

Related