<?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>NCS: nRF I2C driver API documentation</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/104643/ncs-nrf-i2c-driver-api-documentation</link><description>Hi, 
 I got a stupid question which you can probably answer in a millisecond. Sorry... 
 I would like to find the API documenation of the i2c_nrfx_twi_transfer() function (file zephyr\drivers\i2c\i2c_nrfx_twi.c) and, more precisely, the defined return</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 Oct 2023 15:52:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/104643/ncs-nrf-i2c-driver-api-documentation" /><item><title>RE: NCS: nRF I2C driver API documentation</title><link>https://devzone.nordicsemi.com/thread/450652?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2023 15:52:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a5bbf78-ae35-40a2-8df6-ff3444164865</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>[quote user="ngrunert"]I think it is a bit confusing that the documentation refers to modules which are not (necessarily?) present when having installing the NCS. [/quote]
&lt;p&gt;Not sure I understand this. NRFX is integrated in both nRF Connect SDK (which you were linking to) and in nRF5 SDK (documentation found e.g. here: &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrfx__spim.html"&gt;https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrfx__spim.html&lt;/a&gt;). NRFX is released in many versions, as you can see in the GitHub repository:&amp;nbsp;&lt;a href="https://github.com/NordicSemiconductor/nrfx/releases"&gt;https://github.com/NordicSemiconductor/nrfx/releases&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
[quote user="ngrunert"]You mean the nrfx driver which is documented on the site is actually integrated with the nRF5 SDK? Certainly not. The last version of the nRF5 SDK I am aware of is the 17.1.0 and AFAIK its API is slightly different.[/quote]
&lt;p&gt;The documentation you linked to was for the &amp;quot;latest&amp;quot; of NCS, not for nRF5 SDK. You can see which version of nrfx is integrated in the latest NCS release in &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrfx/changelog.html"&gt;nrfx changelog documentation&lt;/a&gt;. For nRF5 SDK, the integrated version of nrfx is mentioned in the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/index.html"&gt;release notes&lt;/a&gt;:&lt;/p&gt;
&lt;pre&gt;- nrfx has been updated to version 1.9.0.
  For details, see .\modules\nrfx\changelog.md.&lt;/pre&gt;
[quote user="ngrunert"]An example for a driver which does not forward error codes but only EIO is the lis2dh driver.[/quote]
&lt;p&gt;This driver is part of Zephyr, which is an open-source RTOS. Nordic does not have control over or influence on all sensor drivers that are implemented as part of the RTOS offerings. I was referring to the HW peripheral drivers for our devices. If the available driver does not work for your needs, you can implement your own sensor driver with more features (this is what you had to do in nRF5 SDK, as the selection of available sensor drivers was very limited).&lt;/p&gt;
[quote user="ngrunert"]I am not sure that logging will work while the initialization is still ongoing. This depends probably on the driver initialization sequence. Anyway, even with log probably the application implementer is forced to dig into the driver code to make sense of the error message. That would be a lot easier with some documentation, at least at the level of the non-Zephyr-driver nrfx (or whatever you call these).[/quote]
&lt;p&gt;Yes, if the error occurs in the sensor driver, and this driver does not forward the error codes, you will likely have to look into the driver implementation. I was referring to the HW peripheral drivers, where you can get logs about failed transfers, etc, with actual error codes from the nrfx drivers.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS: nRF I2C driver API documentation</title><link>https://devzone.nordicsemi.com/thread/450650?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2023 15:36:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:639db992-5bcd-4c7c-8ab2-ac9f21309a77</guid><dc:creator>Norbert</dc:creator><description>&lt;p&gt;I think it is a bit confusing that the documentation refers to modules which are not (necessarily?) present when having installing the NCS. You mean the nrfx driver which is documented on the site is actually integrated with the nRF5 SDK? Certainly not. The last version of the nRF5 SDK I am aware of is the 17.1.0 and AFAIK its API is slightly different.&lt;/p&gt;
&lt;p&gt;An example for a driver which does not forward error codes but only EIO is the lis2dh driver.&lt;/p&gt;
&lt;p&gt;I am not sure that logging will work while the initialization is still ongoing. This depends probably on the driver initialization sequence. Anyway, even with log probably the application implementer is forced to dig into the driver code to make sense of the error message. That would be a lot easier with some documentation, at least at the level of the non-Zephyr-driver nrfx (or whatever you call these).&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Norbert&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS: nRF I2C driver API documentation</title><link>https://devzone.nordicsemi.com/thread/450640?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2023 15:04:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0aef92b-3ed7-466c-87dc-862f44516643</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="ngrunert"]The page &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrfx/drivers/spi/index.html"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/nrfx/drivers/spi/index.html&lt;/a&gt; says it is for the nRF Connect SDK but the API seems to be for the old (completely unrelated) nRF5 SDK.[/quote]
&lt;p&gt;This is incorrect. The nrfx driver module is SDK/OS agnostic and is delivered as a separate module through our GitHub. It is also integrated with both the nRF5 SDK and nRF Connect SDK. nrfx can be used directly in nRF Connect SDK, but the nrfx APIs are also used in the Zephyr driver implementations for nRF devices.&lt;/p&gt;
&lt;p&gt;There is no driver documentation for the device-specific implementations of the Zephyr drivers APIs, as these are meant as internal implementations that interact with the Zephyr driver APIs depending on the configured target/configuration. Most error codes should be forwarded to the application through the Zephyr API interface, if this is not the case, this is something that can be reported and evaluated to be changed. Note that not all errors makes sense to forward directly to the higher layer API. Many of the driver implementations also have logging messages that can be enabled for each module, in case you need to debug what is failing, see for instance &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.2/kconfig/index.html#CONFIG_I2C_LOG_LEVEL_CHOICE"&gt;CONFIG_I2C_LOG_LEVEL_CHOICE&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS: nRF I2C driver API documentation</title><link>https://devzone.nordicsemi.com/thread/450228?ContentTypeID=1</link><pubDate>Fri, 13 Oct 2023 08:26:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e257658-8594-44dd-bf5b-cc89ff4ee4d0</guid><dc:creator>Norbert</dc:creator><description>&lt;p&gt;I am sorry, but I am profoundly confused by your documentation. The page &lt;a id="" href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrfx/drivers/spi/index.html"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/nrfx/drivers/spi/index.html&lt;/a&gt; says it is for the nRF Connect SDK but the API seems to be for the old (completely unrelated) nRF5 SDK. At least, neither HAL nor driver API match the NCS implementation.&lt;/p&gt;
&lt;p&gt;Could you please comment on this?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Norbert&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS: nRF I2C driver API documentation</title><link>https://devzone.nordicsemi.com/thread/450190?ContentTypeID=1</link><pubDate>Fri, 13 Oct 2023 06:17:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:225c30e6-6b21-461b-8f08-f75c88d22522</guid><dc:creator>Norbert</dc:creator><description>&lt;p&gt;Hello Johnny,&lt;/p&gt;
&lt;p&gt;I am using them through the Zephyr drivers. Not directly, but through another layer of more generic Zephyr drivers (sensor class). The problem occurs during initialisation of the driver so even before Zephyr enters the app. The outer Zephyr driver replaces all error messages from underlying drivers with -EIO.&lt;/p&gt;
&lt;p&gt;Meanwhile I solved this issue but my question for documentation is more general. There are tons of things which can go wrong in the driver configuration via DT and Kconfig without the compiler issuing as much as a warning. The only way to know what is wrong is to go inside the driver. The nrfx drivers return an error number which is removed by the outer layer driver which only checks for !=0. But if there is no reliable documentation that debug is pretty much an uphill battle. SDK5 was much more straightforward, much easier to use and better documented.&lt;/p&gt;
&lt;p&gt;Please tell me there is somewhere a driver-specific API documentation of the Zephyr drivers... although I have not much hope left. :-(&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Norbert&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS: nRF I2C driver API documentation</title><link>https://devzone.nordicsemi.com/thread/450154?ContentTypeID=1</link><pubDate>Thu, 12 Oct 2023 21:20:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3bf7f007-f8f0-4c8b-8115-fb97a2e9ba35</guid><dc:creator>Johnny Nguyen</dc:creator><description>&lt;p&gt;Hello Norbert,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Have you seen the following?&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a id="" href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/hardware/peripherals/i2c.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/hardware/peripherals/i2c.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-6-serial-com-i2c/"&gt;Lesson 6 &amp;ndash; Serial communication (I2C) &amp;ndash; Nordic Developer Academy (nordicsemi.com)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As you&amp;#39;ve stated, you can deep dive for that fxn &lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/fd346e846f1474468cd2bd67e7208b9560edd60e/drivers/i2c/i2c_nrfx_twi.c#L40-L148"&gt;here&lt;/a&gt;, but most of the return values you are asking about are in &lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/38e86c8e86f8bc9b0c0794edc26151f7907145cf/lib/libc/armstdc/include/errno.h"&gt;errno.h&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The versions of nrfx driver api documentation exists in the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fdrivers_nrfx_v3.2.0%2Fmodules.html"&gt;infocenter &lt;/a&gt;and &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrfx/drivers/index.html"&gt;documentation center&lt;/a&gt;,&amp;nbsp;but these are not 100% relevant to your original inquiry given that you list the zephyr\... file. (and as such may not contain the relevant returns that you would see from the fxn you are calling)&lt;/p&gt;
&lt;p&gt;Are you trying to use that function directly or through Zephyr&amp;#39;s &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.2/zephyr/hardware/peripherals/i2c.html"&gt;I2C driver&lt;/a&gt;?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>