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
  • Hi

    I would have a look at how we how we use the Zephyrs sensor lib here. The drivers that comes with Zephyr is written with the Zephyr Sensing subsystem in mind, you can the documentation for it here
    Regards

    Runar

  • When using DEVICE_DT_GET, I get the device pointer, but when I use I2C_DT_SPEC_GET as in the example, an error occurs.

    I'm using the 52833 chip, and below is the overlay configuration.

    And in src.c, I accessed it using the device pointer.

    There is no build error, and the device is successfully retrieved.

    Next, I tried using I2C_DT_SPEC_GET as in the example. dts code is the same as before.


    When I execute it, the following error occurs.

    What is the reason for this error and how can it be resolved?
Reply
  • When using DEVICE_DT_GET, I get the device pointer, but when I use I2C_DT_SPEC_GET as in the example, an error occurs.

    I'm using the 52833 chip, and below is the overlay configuration.

    And in src.c, I accessed it using the device pointer.

    There is no build error, and the device is successfully retrieved.

    Next, I tried using I2C_DT_SPEC_GET as in the example. dts code is the same as before.


    When I execute it, the following error occurs.

    What is the reason for this error and how can it be resolved?
Children
Related