How does Zephyr brings dts, kernel, driver & user app together?


Stefan Jaritz
 

Hej,

I like to create an user app that uses 2 IC connected via I2C with my MCU.  Doing this is a bit tricky because I am missing some documentation, that is describing how the whole process goes.

My setup is simple:

1.) custom board based on the stm32f412RG

1.1) the IC are connected via I2C

1.2) dts changes:

&i2c1 {
    status = "ok";
    clock-frequency = <I2C_BITRATE_FAST>;

    codec1@48 {
        compatible = "xxx,codec1";
        reg = <0x48>;
        label = "codec1";
    };

    codec2@46 {
        compatible = "xxx,codec2";
        reg = <0x46>;
        label = "codec2";
        readAddr = <0x8F>;
        writeAddr = <0x8E>;
    };
};

2.) user app

2.1) custom driver (codec1.c and codec2.c)

How can I get the value of the I2C slave address from the dts inside of my source code?

How can I find and access the c-files after the dts compilation?

How Zephyr connects the c code of the dts, kernel, drivers, user drivers and app?


Any help is welcome!


Stefan

Join devel@lists.zephyrproject.org to automatically receive all group messages.