<?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>Creation of custom driver for an i2c device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/110675/creation-of-custom-driver-for-an-i2c-device</link><description>Hi All, 
 (Edit: I mistakenly referred to drivers included in the project&amp;#39;s structure as &amp;quot;in-tree&amp;quot;) 
 I need to interface with a Monolitic&amp;#39;s MP2731 battery charger, it has an i2c interface, and want to create a custom in-tree out of tree driver for it</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 03 May 2024 12:29:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/110675/creation-of-custom-driver-for-an-i2c-device" /><item><title>RE: Creation of custom driver for an i2c device</title><link>https://devzone.nordicsemi.com/thread/481790?ContentTypeID=1</link><pubDate>Fri, 03 May 2024 12:29:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:771d9aa0-5d3e-432a-b597-fb1f3989dc84</guid><dc:creator>helsing</dc:creator><description>[quote user="V.Lorz"]Could you, please, point me to documentation describing the structure which is required for the tools to recognize and link both, the application and the drivers? Is it mandatory to implement a structure like that of [&lt;a href="https://github.com/nrfconnect/ncs-example-application"&gt;ncs-example-application&lt;/a&gt;]?[/quote]
&lt;p&gt;The &lt;a href="https://github.com/nrfconnect/ncs-example-application/blob/main/CMakeLists.txt#L14C18-L14C25"&gt;top level CMakeLists.txt adds the drivers&lt;/a&gt; folder which loads &lt;a href="https://github.com/nrfconnect/ncs-example-application/blob/main/drivers/CMakeLists.txt"&gt;drivers based on Kconfig options&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The drivers themselves can be in any folder as it is defined in CMakeLists.txt. The bindings, however, need to be in the folder as given in the example. Please see the documentation:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a title="https://github.com/nrfconnect/ncs-example-application/blob/0a178b24e3e13c50754985af430225cb4ded1068/zephyr/module.yml#l20" href="https://github.com/nrfconnect/ncs-example-application/blob/0a178b24e3e13c50754985af430225cb4ded1068/zephyr/module.yml#L20" rel="noopener noreferrer" target="_blank"&gt;https://github.com/nrfconnect/ncs-example-application/blob/0a178b24e3e13c50754985af430225cb4ded1068/zephyr/module.yml#L20&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a title="https://docs.zephyrproject.org/latest/develop/modules.html#module-yaml-file-description" href="https://docs.zephyrproject.org/latest/develop/modules.html#module-yaml-file-description" rel="noopener noreferrer" target="_blank"&gt;https://docs.zephyrproject.org/latest/develop/modules.html#module-yaml-file-description&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Creation of custom driver for an i2c device</title><link>https://devzone.nordicsemi.com/thread/481348?ContentTypeID=1</link><pubDate>Tue, 30 Apr 2024 19:22:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80cbc0d3-0b04-4efd-90fa-758bed0ed924</guid><dc:creator>V.Lorz</dc:creator><description>&lt;p&gt;Hi H&amp;aring;kon,&lt;/p&gt;
&lt;p&gt;Thanks for noting I misspelled Monolithic and for your time and recommendations. I&amp;#39;ll follow the course.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve previously created a structure similar to that described at [&lt;a href="https://docs.zephyrproject.org/latest/develop/application/index.html#dts-root"&gt;DTS_ROOT&lt;/a&gt;], but neither &lt;em&gt;vendor-prefixes.txt&lt;/em&gt; nor the driver&amp;#39;s &lt;em&gt;yaml&lt;/em&gt; seem to be recognized by west (currently using VS Code with nRF Connect plugins).&lt;/p&gt;
&lt;p&gt;Could you, please, point me to documentation describing the structure which is required for the tools to recognize and link both, the application and the drivers? Is it mandatory to implement a structure like that of [&lt;a href="https://github.com/nrfconnect/ncs-example-application"&gt;ncs-example-application&lt;/a&gt;]?&lt;/p&gt;
&lt;p&gt;BR&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Creation of custom driver for an i2c device</title><link>https://devzone.nordicsemi.com/thread/481181?ContentTypeID=1</link><pubDate>Mon, 29 Apr 2024 20:42:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:199290da-a3cd-414c-b195-9f82d311671d</guid><dc:creator>helsing</dc:creator><description>&lt;p&gt;Hi V.Lorz,&lt;/p&gt;
&lt;p&gt;From &lt;a href="https://docs.zephyrproject.org/latest/build/dts/bindings-upstream.html#rules-for-vendor-prefixes"&gt;https://docs.zephyrproject.org/latest/build/dts/bindings-upstream.html#rules-for-vendor-prefixes&lt;/a&gt; :&lt;/p&gt;
&lt;p&gt;&amp;quot;For custom bindings, you can add a custom &lt;code&gt;&lt;span&gt;dts/bindings/vendor-prefixes.txt&lt;/span&gt;&lt;/code&gt; file to any directory in your &lt;a href="https://docs.zephyrproject.org/latest/develop/application/index.html#dts-root"&gt;&lt;span&gt;DTS_ROOT&lt;/span&gt;&lt;/a&gt;. The devicetree tooling will respect these prefixes, and will not generate warnings or errors if you use them in your own bindings or devicetrees.&amp;quot;&lt;/p&gt;
&lt;p&gt;In another&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/110209/node-soc-uart-40028000-fpreader-ffffffff-compatible-zeantec-jm101-has-unknown-vendor-prefix-zeantec"&gt;ticket regarding &amp;quot;unknown vendor prefix&amp;quot;&lt;/a&gt; a couple of links were posted:&lt;/p&gt;
[quote userid="106736" url="~/f/nordic-q-a/110209/node-soc-uart-40028000-fpreader-ffffffff-compatible-zeantec-jm101-has-unknown-vendor-prefix-zeantec/478712"]&lt;p&gt;We recently releaces a device driver tutorial over at &lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/"&gt;https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/&lt;/a&gt;. Maybe that can be useful for you?&lt;/p&gt;
&lt;p&gt;Also, we got this sample app which shows you how to make your own driver: &lt;a href="https://github.com/nrfconnect/ncs-example-application"&gt;https://github.com/nrfconnect/ncs-example-application&lt;/a&gt;&lt;/p&gt;[/quote]
&lt;p&gt;(By the way, I noticed &amp;quot;monolithic&amp;quot; is spelled without an &amp;#39;h&amp;#39;. If you do so consistantly throughout your files, then this should be OK.)&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>