<?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>Vishay VCNL4010 device tree</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/120667/vishay-vcnl4010-device-tree</link><description>Hi, 
 
 I&amp;#39;m integrating a VCNL4010 over an I2C connection via an nRF52 DK. 
 
 Noting there is a Vishay VCNL4040 sensor driver, has anyone written one for the VCNL4010? It would be greatly received and save me a stack of time! 
 
 many thanks, Philip</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 15 Apr 2025 12:53:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/120667/vishay-vcnl4010-device-tree" /><item><title>RE: Vishay VCNL4010 device tree</title><link>https://devzone.nordicsemi.com/thread/531844?ContentTypeID=1</link><pubDate>Tue, 15 Apr 2025 12:53:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d5a5fbe-14b0-480b-b23a-7f03fcf99a7f</guid><dc:creator>PhilipH</dc:creator><description>&lt;p&gt;Being cheeky, I&amp;#39;ve realise that the vcnl4010 is basically an obsolete product.&amp;nbsp; So I&amp;#39;ve ordered the vcnl4040 module instead and go from there, hopefully fast tracking my application.&amp;nbsp; The 4040 code sample didn&amp;#39;t build on first attempt but fingers crossed I can solve that.&lt;/p&gt;
&lt;p&gt;I certainly know more about creating device trees and bindings now - quite a journey.&amp;nbsp; Many thanks for your support.&lt;/p&gt;
&lt;p&gt;Ticket being closed off now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Vishay VCNL4010 device tree</title><link>https://devzone.nordicsemi.com/thread/531843?ContentTypeID=1</link><pubDate>Tue, 15 Apr 2025 12:44:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04775481-be35-4078-867c-33052719151c</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Glad to hear that!&lt;/p&gt;
[quote user="PhilipH"]but practically implementing something through device tree is all new to me so any advice is great.[/quote]
&lt;p&gt;It will most likely take some time, but I firmly believe you have everything you need in the academy courses and the samples.&lt;/p&gt;
&lt;p&gt;What you will need to do is&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1. Create your own board overlay, similar to what you find within boards/ in the &lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/sensor/vcnl4040"&gt;vcnl4040 sample&lt;/a&gt;. Name it nrf52dk_nrf52832.overlay&lt;/p&gt;
&lt;p&gt;2. To use the sensor you need to add the same thing that is present within the stm overlay, but you will have to make some modificatiosn&lt;/p&gt;
&lt;p&gt;3. Compare the stm overlay with&amp;nbsp;&lt;a href="https://github.com/NordicDeveloperAcademy/ncs-fund/blob/main/v2.9.0-v2.7.0/l6/l6_e1_sol/boards/nrf52dk_nrf52832.overlay"&gt;https://github.com/NordicDeveloperAcademy/ncs-fund/blob/main/v2.9.0-v2.7.0/l6/l6_e1_sol/boards/nrf52dk_nrf52832.overlay&lt;/a&gt;&amp;nbsp;from the fundamentals lesson 6 w.r.t i2c. This is from the solution of the first exercise in that lesson. Here you can also use the pin-ctrl to change what gpio the i2c sensor should be driven from. Make sure to consult the datasheet and/or the backside of the DK to ensure you don&amp;#39;t use one that is already physically in use on the DK.&lt;/p&gt;
&lt;p&gt;4. build for the nrf52dk build target, either with command line or VS Code extension. If you&amp;#39;ve added the sensor correctly to the board file it should build out of the box. I expect something like this should work. I&amp;#39;ve not tested it, but please feel free to start from step 1 and compare the 2 overlays, the i2c course and finally the suggestion I&amp;#39;ve posted and see if you can understand what&amp;#39;s going on&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;i2c0 {
	status=&amp;quot;okay&amp;quot;;
    pinctrl-0 = &amp;lt;&amp;amp;i2c0_default&amp;gt;;
    pinctrl-1 = &amp;lt;&amp;amp;i2c0_sleep&amp;gt;;
    pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
    vcnl: vcnl4040@60 {    
		compatible = &amp;quot;vishay,vcnl4040&amp;quot;;
		reg = &amp;lt;0x60&amp;gt;;
		#int-gpios = &amp;lt;&amp;amp;feather_header 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)&amp;gt;;
		led-current = &amp;lt;200&amp;gt;;
		led-duty-cycle = &amp;lt;320&amp;gt;;
		proximity-it = &amp;quot;8&amp;quot;;
		proximity-trigger = &amp;quot;close&amp;quot;;
		als-it = &amp;lt;640&amp;gt;;
	};
};
&amp;amp;pinctrl {
	/omit-if-no-ref/ i2c0_default: i2c0_default {
		group1  {
			psels = &amp;lt;NRF_PSEL(TWIM_SCL, 0, 24)&amp;gt;,
					&amp;lt;NRF_PSEL(TWIM_SDA, 0, 25)&amp;gt;;
		};
	};

	/omit-if-no-ref/ i2c0_sleep: i2c0_sleep {
		group1  {
			psels = &amp;lt;NRF_PSEL(TWIM_SCL, 0, 24)&amp;gt;,
					&amp;lt;NRF_PSEL(TWIM_SDA, 0, 25)&amp;gt;;
			low-power-enable;
		};
	};
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Vishay VCNL4010 device tree</title><link>https://devzone.nordicsemi.com/thread/531822?ContentTypeID=1</link><pubDate>Tue, 15 Apr 2025 11:22:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afce9d05-fc67-4d95-bafe-d8d76b318911</guid><dc:creator>PhilipH</dc:creator><description>&lt;p&gt;Hi Andreas,&lt;/p&gt;
&lt;p&gt;Thanks for the response and advice to go to the Zephyr forum.&amp;nbsp; I&amp;#39;ve been through the fundamentals and intermediate course but practically implementing something through device tree is all new to me so any advice is great.&lt;/p&gt;
&lt;p&gt;I did see the vcnl4040 example and it looks as though reworking this&amp;nbsp;is my direction of travel.&amp;nbsp; Fitting this in as a hobby means it may be a few weeks of work!&lt;/p&gt;
&lt;p&gt;Regards, Philip&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Vishay VCNL4010 device tree</title><link>https://devzone.nordicsemi.com/thread/531698?ContentTypeID=1</link><pubDate>Mon, 14 Apr 2025 12:45:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1350cefa-c53c-41ec-af7b-eaccd8196809</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hello Philip,&lt;/p&gt;
&lt;p&gt;I see that you&amp;#39;ve left the case open for the forum to chime in (which is great) since we don&amp;#39;t write drivers for third party devices. All the third party drivers that are present within nRF Connect SDK (NCS) comes through Zephyr, which NCS is based upon.&lt;/p&gt;
&lt;p&gt;But that said, there are a driver present within the SDK. You can find it here:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/main/drivers/sensor/vishay"&gt;https://github.com/nrfconnect/sdk-zephyr/tree/main/drivers/sensor/vishay&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s a couple of samples found within &lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/sensor/vcnl4040"&gt;&amp;lt;SDK&amp;gt;\zephyr\samples\sensor\vcnl4040&lt;/a&gt;&amp;nbsp;which works for the adafruit stm feather, meaning that you will have to add the board support for the nRF52DK yourself.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/"&gt;https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&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;&amp;nbsp;(maybe with focus on Lesson 7 Device driver model) should be very helpful with this.&lt;/p&gt;
&lt;p&gt;In addition, since you&amp;#39;re reaching out to the forums, I would also recommend that you have a look at the Zephyr discord forums (&lt;a href="https://discord.com/invite/Ck7jw53nU2"&gt;https://discord.com/invite/Ck7jw53nU2&lt;/a&gt;) found at&amp;nbsp;&lt;a href="https://zephyrproject.org/learn-about/"&gt;https://zephyrproject.org/learn-about/&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1744634579970v1.png" alt=" " /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There might be other developers who&amp;#39;s done the same thing that you&amp;#39;re trying to do there.&lt;/p&gt;
&lt;p&gt;Let me know if this answers your question and I would recommend you to go through the academy courses if you&amp;#39;re relatively new to Nordic and NCS&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>