lis2dw12 sensor configuration.

Hello,

I have a question regarding sensor configuration. I am planning to use the LIS2DW12 sensor. While reviewing the SDK, I found the source code in the path sdk\zephyr\drivers\sensor\lis2dw12. However, I discovered that the lis2dw12_init function is static, so it cannot be called externally.

Could you please explain how to use this function?

Parents Reply
  • Hi.

    I have resolved the error.

    However, I have an additional question.

    When declaring static struct i2c_dt_spec i2c_lis2dw12 = I2C_DT_SPEC_GET(LIS2DW12_NODE);, I discovered that the bus->config inside i2c_lis2dw12 is void.
    I tried to configure it, but the bus variable is declared as const, making it unmodifiable.

    ///////
    struct i2c_dt_spec {
    const struct device *bus;
    uint16_t addr;
    };
    ////////

    Is there a way to initialize the config or api inside the bus when declaring the static struct i2c_dt_spec i2c_lis2dw12 variable?

Children
Related