<?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>Interrupt setup in devicetree overlay for I2C device - nrf5340</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/99479/interrupt-setup-in-devicetree-overlay-for-i2c-device---nrf5340</link><description>Hi, 
 I&amp;#39;m developing a library (in the &amp;quot;src&amp;quot; folder of the project) for a I2C sensor. The device is a temperature sensor that has a specific pin for alert (interrupt). I&amp;#39;m trying to understand how to write properly a DTS overlay file to implement such</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 10 May 2023 13:28:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/99479/interrupt-setup-in-devicetree-overlay-for-i2c-device---nrf5340" /><item><title>RE: Interrupt setup in devicetree overlay for I2C device - nrf5340</title><link>https://devzone.nordicsemi.com/thread/424886?ContentTypeID=1</link><pubDate>Wed, 10 May 2023 13:28:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7ab88bf-92b1-44bd-8823-c75456699046</guid><dc:creator>frax84</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;Thank you for your feedback and the useful link. I&amp;#39;ll post my solution when is done for the community, but it will take a bit. In the meantime I&amp;#39;ll mark the post as solved.&lt;/p&gt;
&lt;p&gt;Thx&lt;/p&gt;
&lt;p&gt;Frax&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interrupt setup in devicetree overlay for I2C device - nrf5340</title><link>https://devzone.nordicsemi.com/thread/424874?ContentTypeID=1</link><pubDate>Wed, 10 May 2023 13:11:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef49f7d3-0457-4f95-ae9d-41f91cfb1cb0</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>[quote user=""]I&amp;#39;m developing a library (in the &amp;quot;src&amp;quot; folder of the project) for a I2C sensor.[/quote]
&lt;p&gt;So since your library just use the I2C driver, you do not need to do a fancy out of tree module thing, as you pointed out.&lt;/p&gt;
[quote user="frax84"]1) use gpio bindings (like in the sample for button interrupt) and use them in code with gpio apis. In this case everything is already available out of the box, but i have to&amp;nbsp;map separately&amp;nbsp;the i2c device and its interrupt pin.[/quote]
&lt;p&gt;This for sure sounds like the easiest solution to implement.&lt;/p&gt;
[quote user="frax84"]2) write a custom yaml file for the i2c device i&amp;#39;m working on add a field for interrupt parameters on it, use the &amp;quot;compatible&amp;quot; property in the DTS overlay and use these in code with gpio apis. In this case i need to write an additional file (the custom yaml) but the result is more compact and maintanable.[/quote]
&lt;p&gt;Yes, this would make sense to me. Requires more work, but is more elegant than 1).&lt;/p&gt;
&lt;p&gt;See &lt;a href="https://github.com/martelmy/NCS_examples/tree/main/devicetree/devicetree_custom_device"&gt;this unofficial sample&lt;/a&gt; on how you can add a this yaml file.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interrupt setup in devicetree overlay for I2C device - nrf5340</title><link>https://devzone.nordicsemi.com/thread/424597?ContentTypeID=1</link><pubDate>Tue, 09 May 2023 14:18:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:becb26d5-4a79-40e9-b784-8f8cb1b3d528</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;From a scan of you answer, I see that I indeed misunderstood your question.&lt;/p&gt;
&lt;p&gt;I will look over your statement tomorrow and let you know if it is correct or not.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interrupt setup in devicetree overlay for I2C device - nrf5340</title><link>https://devzone.nordicsemi.com/thread/424467?ContentTypeID=1</link><pubDate>Tue, 09 May 2023 10:30:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae155eb4-8cbd-42fc-bda7-5cf2d51dfdff</guid><dc:creator>frax84</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;thank you for the link! I&amp;#39;m not sure this fits with my request. I already read some (unofficial) guide to OOT drivers and i don&amp;#39;t plan to write one at the moment. By the way i&amp;#39;ll read&amp;nbsp;it a bit more. In the meantime i even looked for more material. If i understood correctly the material i have been able to find until now i have two options to implement interrupt configuration in bindings:&lt;/p&gt;
&lt;p&gt;1) use gpio bindings (like in the sample for button interrupt) and use them in code with gpio apis. In this case everything is already available out of the box, but i have to&amp;nbsp;map separately&amp;nbsp;the i2c device and its interrupt pin.&lt;/p&gt;
&lt;p&gt;2) write a custom yaml file for the i2c device i&amp;#39;m working on add a field for interrupt parameters on it, use the &amp;quot;compatible&amp;quot; property in the DTS overlay and use these in code with gpio apis. In this case i need to write an additional file (the custom yaml) but the result is more compact and maintanable.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Am i correct?&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry if my vocabulary can be still a bit naive, but this is the best way i can explain it at the moment.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you,&lt;/p&gt;
&lt;p&gt;Frax&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interrupt setup in devicetree overlay for I2C device - nrf5340</title><link>https://devzone.nordicsemi.com/thread/424181?ContentTypeID=1</link><pubDate>Mon, 08 May 2023 09:15:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c978285-3980-486d-b388-6dd29455ab1f</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Have a look at &amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/99244/creating-an-out-of-tree-zephyr-driver-with-bindings"&gt;Creating an out-of-tree zephyr driver with bindings...&lt;/a&gt; and see if you can learn what you need from this case.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>