<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>lis2dw12 sensor configuration.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111511/lis2dw12-sensor-configuration</link><description>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</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 May 2024 12:15:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111511/lis2dw12-sensor-configuration" /><item><title>RE: lis2dw12 sensor configuration.</title><link>https://devzone.nordicsemi.com/thread/486419?ContentTypeID=1</link><pubDate>Wed, 29 May 2024 12:15:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8d48e8c-a49d-4870-9ebf-73faf0d4f9ac</guid><dc:creator>runsiv</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The struct is populated at compile time, so it has to be configured then.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m a bit unsure what you are trying to archive. I did forget to link to the zephyr sample for the sensor&amp;nbsp;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/sensor/lis2dh/src/main.c"&gt;https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/sensor/lis2dh/src/main.c&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It could be worth a look&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Runar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: lis2dw12 sensor configuration.</title><link>https://devzone.nordicsemi.com/thread/486322?ContentTypeID=1</link><pubDate>Wed, 29 May 2024 08:09:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4a3247a-0cc5-4ace-bb8e-b5689c14da2e</guid><dc:creator>starlight</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have resolved the error.&lt;/p&gt;
&lt;p&gt;However, I have an additional question.&lt;/p&gt;
&lt;p&gt;When declaring static struct i2c_dt_spec i2c_lis2dw12 = I2C_DT_SPEC_GET(LIS2DW12_NODE);, I discovered that the bus-&amp;gt;config inside i2c_lis2dw12 is void. &lt;br /&gt;I tried to configure it, but the bus variable is declared as const, making it unmodifiable.&lt;/p&gt;
&lt;p&gt;///////&lt;br /&gt;struct i2c_dt_spec {&lt;br /&gt; const struct device *bus;&lt;br /&gt; uint16_t addr;&lt;br /&gt;};&lt;br /&gt;////////&lt;/p&gt;
&lt;p&gt;Is there a way to initialize the config or api inside the bus when declaring the static struct i2c_dt_spec i2c_lis2dw12 variable?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: lis2dw12 sensor configuration.</title><link>https://devzone.nordicsemi.com/thread/486100?ContentTypeID=1</link><pubDate>Tue, 28 May 2024 07:54:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05e333ed-f0bb-485f-a7df-53d777f71e1f</guid><dc:creator>runsiv</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I suspect that it does not like that your struct lis2dw12_spec is defined and if you change it to&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static const struct i2c_dt_spec lis2dw12_spec = I2C_DT_SPEC_GET(I2C_NODE);

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;it will work.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Runar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: lis2dw12 sensor configuration.</title><link>https://devzone.nordicsemi.com/thread/485981?ContentTypeID=1</link><pubDate>Mon, 27 May 2024 09:01:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:404d5774-9954-4924-bdd1-edb0bb1bbccc</guid><dc:creator>starlight</dc:creator><description>&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using the 52833 chip, and below is the overlay configuration.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:225px;max-width:477px;" alt=" " height="225" src="https://devzone.nordicsemi.com/resized-image/__size/954x450/__key/communityserver-discussions-components-files/4/2318.pastedimage1716800454151v6.png" width="477" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And in src.c, I accessed it using the device pointer.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:248px;max-width:493px;" alt=" " height="248" src="https://devzone.nordicsemi.com/resized-image/__size/986x496/__key/communityserver-discussions-components-files/4/4375.pastedimage1716800439832v5.png" width="493" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;There is no build error, and the device is successfully retrieved.&lt;/p&gt;
&lt;p&gt;Next, I tried using I2C_DT_SPEC_GET&amp;nbsp;as in the example.&amp;nbsp;dts code is the same as before.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"&gt;&lt;/div&gt;
&lt;div class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"&gt;&lt;br /&gt;&lt;img style="max-height:269px;max-width:528px;" alt=" " height="269" src="https://devzone.nordicsemi.com/resized-image/__size/1056x538/__key/communityserver-discussions-components-files/4/6318.pastedimage1716800412972v2.png" width="528" /&gt;&lt;/div&gt;
&lt;div class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"&gt;&lt;/div&gt;
&lt;div class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"&gt;&lt;/div&gt;
&lt;div class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"&gt;&lt;/div&gt;
&lt;div class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"&gt;When I execute it, the following error occurs.&lt;/div&gt;
&lt;div class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"&gt;&lt;/div&gt;
&lt;div class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"&gt;&lt;/div&gt;
&lt;div class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"&gt;&lt;img style="max-height:133px;max-width:507px;" alt=" " height="133" src="https://devzone.nordicsemi.com/resized-image/__size/1014x266/__key/communityserver-discussions-components-files/4/8475.pastedimage1716800345963v1.png" width="507" /&gt;&lt;/div&gt;
&lt;div class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"&gt;&lt;/div&gt;
&lt;div class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"&gt;&lt;/div&gt;
&lt;div class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"&gt;&lt;br /&gt;What is the reason for this error and how can it be resolved?&lt;/div&gt;
&lt;div class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"&gt;&lt;/div&gt;
&lt;div class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"&gt;&lt;/div&gt;
&lt;div class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: lis2dw12 sensor configuration.</title><link>https://devzone.nordicsemi.com/thread/485946?ContentTypeID=1</link><pubDate>Mon, 27 May 2024 06:14:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:584b8b26-0d4d-475a-9a3f-25343703ddc3</guid><dc:creator>runsiv</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I would have a look at how we how we use the Zephyrs sensor lib &lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-6-serial-com-i2c/topic/exercise-1-6-2/"&gt;here&lt;/a&gt;. The drivers that comes with Zephyr is written with the Zephyr Sensing subsystem in mind, you can the documentation for it &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/sensing/index.html"&gt;here&lt;/a&gt;.&amp;nbsp;&lt;br /&gt;Regards&lt;/p&gt;
&lt;p&gt;Runar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>