<?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>how to get a repeated start using zephyr I2c functions.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/101963/how-to-get-a-repeated-start-using-zephyr-i2c-functions</link><description>I am using a nrf5340 and want to use I2c to talk to a LC709 battery charge IC. I was able to do this 
 using nrf_drv_twi_tx(..., ..., ..., ..., true ); to ger a repeated start and now I want to do it 
 in zephyr. I see the zephyr function 
 
 i2c_burst_write_dt</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 20 Jul 2023 19:39:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/101963/how-to-get-a-repeated-start-using-zephyr-i2c-functions" /><item><title>RE: how to get a repeated start using zephyr I2c functions.</title><link>https://devzone.nordicsemi.com/thread/437543?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2023 19:39:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a91e597d-0b2e-4434-afa7-bd78324ad36f</guid><dc:creator>weightwatcherphil</dc:creator><description>&lt;p&gt;I am going to try an use the nrfx_twim_xfer function so you can close this ticket.&lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;
&lt;p&gt;phil&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to get a repeated start using zephyr I2c functions.</title><link>https://devzone.nordicsemi.com/thread/437536?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2023 17:04:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:520bd364-8025-4ea3-a45b-536bc49700b9</guid><dc:creator>Raoul</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yep, I see from your newest ticket that you have started work on implementing the nrfx_twim driver.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t have experience with using that, I see that this case &amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/96625/continuous-background-i2c-process/410980"&gt;RE: Continuous Background I2C process&lt;/a&gt; mentions NRFX_TWIM_FLAG_REPEATED_XFER in the context of repeated starts.&lt;/p&gt;
&lt;p&gt;I hope that gets you further.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Raoul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to get a repeated start using zephyr I2c functions.</title><link>https://devzone.nordicsemi.com/thread/437528?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2023 15:21:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:226c7aa3-b318-4e3e-bf47-dbac0916e199</guid><dc:creator>weightwatcherphil</dc:creator><description>&lt;p&gt;i have found that the I2 driver is really using the TWIM hardware and so now I am looking into how to use the&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;nrfx_twim_xfer&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;function which as near as I can tell supports the repeated start option.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I will let you know how it turns out.&amp;nbsp; it will take me a day or two to implement it.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;if you think it will not work let me know.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;thanks&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;phil&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to get a repeated start using zephyr I2c functions.</title><link>https://devzone.nordicsemi.com/thread/437510?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2023 14:28:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc1dff15-f730-40f4-9653-e4a67ada8d92</guid><dc:creator>Raoul</dc:creator><description>&lt;p&gt;Hi Philip,&lt;/p&gt;
&lt;p&gt;Try setting the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.0/zephyr/hardware/peripherals/i2c.html#c.I2C_MSG_RESTART"&gt;I2C_MSG_RESTART&lt;/a&gt; flag for the Zephyr I2C driver. The Zephyr docs warn that &amp;quot;Not all I2C drivers have or require explicit support for this feature&amp;quot;, but according to &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.3.99-ncs1/drivers/i2c/i2c_nrfx_twim.c#L80"&gt;this line&lt;/a&gt;, the nrfx driver seems to take it into account.&lt;/p&gt;
&lt;p&gt;You could try performing an &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.0/zephyr/hardware/peripherals/i2c.html#c.i2c_write_read"&gt;i2c_write_read&lt;/a&gt;() with your sensor, with that flag set.&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re new to using I2C through Zephyr, please check out this answer by my colleague: &amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/81019/how-to-use-i2c-on-the-nrf5340-dk"&gt;How to use I2C on the nRF5340 DK ?&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Raoul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to get a repeated start using zephyr I2c functions.</title><link>https://devzone.nordicsemi.com/thread/436851?ContentTypeID=1</link><pubDate>Mon, 17 Jul 2023 22:19:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb52ad8c-3b92-47c4-8435-834cc432cc82</guid><dc:creator>weightwatcherphil</dc:creator><description>&lt;p&gt;attached is the actual I2C bus protocol i need.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/LC709_5F00_I2c_5F00_bus_5F00_protocol.docx"&gt;devzone.nordicsemi.com/.../LC709_5F00_I2c_5F00_bus_5F00_protocol.docx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;thanks for your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to get a repeated start using zephyr I2c functions.</title><link>https://devzone.nordicsemi.com/thread/436850?ContentTypeID=1</link><pubDate>Mon, 17 Jul 2023 22:01:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c63dc97-b6fc-4beb-9b96-81986b62f806</guid><dc:creator>weightwatcherphil</dc:creator><description>&lt;p&gt;does the function&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;static&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;inline&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;int&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;i2c_write_read&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;struct&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;device&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt;dev&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;uint16_t&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;addr&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;void&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt;write_buf&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;size_t&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;num_write&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;void&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt;read_buf&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;size_t&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;num_read&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;do a repeated start ?&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>