<?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>Variable-length I2C transmissions</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111256/variable-length-i2c-transmissions</link><description>Hi there, 
 I must interact with an I2C slave that sends variable-length messages. The first byte of the transactions describes the length of the remaining bytes. 
 i2c_write_read_cb() expects a fixed number of bytes to read, so I&amp;#39;m unsure how to use</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 22 May 2024 15:44:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111256/variable-length-i2c-transmissions" /><item><title>RE: Variable-length I2C transmissions</title><link>https://devzone.nordicsemi.com/thread/485484?ContentTypeID=1</link><pubDate>Wed, 22 May 2024 15:44:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c94a0c96-8e0b-4900-aca3-8fee65442846</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, that might be the best solution.&amp;nbsp; Another approach might be to use&amp;nbsp;&lt;span&gt;i2c_write_read_cb() with the max numbers of bytes possible to read, and then discard the&amp;nbsp;excess bytes. But it sounds like creating a new&amp;nbsp;special I2C read function is the best option.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Variable-length I2C transmissions</title><link>https://devzone.nordicsemi.com/thread/485223?ContentTypeID=1</link><pubDate>Tue, 21 May 2024 20:12:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72f04723-dca2-43d5-9a99-e51a3af55cbd</guid><dc:creator>mlac</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;I have to use a single I2C transaction for reading because the slave is implemented this way. Should I extend Zephyr with a special I2C read function&amp;nbsp;that satisfies&amp;nbsp;my requirements? Based on the API reference, I don&amp;#39;t see any other solutions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Variable-length I2C transmissions</title><link>https://devzone.nordicsemi.com/thread/485035?ContentTypeID=1</link><pubDate>Tue, 21 May 2024 10:29:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70ecddaf-b540-49c5-9995-f2bccd3daca9</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;Maybe you could try splitting the operation in 2.&lt;/p&gt;
&lt;p&gt;First a&amp;nbsp;i2c_write_read_cb(), and then a&amp;nbsp;i2c_read() with the rest of the bytes ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Variable-length I2C transmissions</title><link>https://devzone.nordicsemi.com/thread/484843?ContentTypeID=1</link><pubDate>Fri, 17 May 2024 21:13:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3f9f9e5-8fac-45b4-ae37-6d6b46ba4b3c</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Most of the staff is away for a long weekend in Norway, so there will be some delays in response time. I appreciate your patience.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>