<?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>I2C: How can I read and write data from my VL6180X sensor through nrf51 kit under nrf_drv_twi_tx() and rx() functions?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/22007/i2c-how-can-i-read-and-write-data-from-my-vl6180x-sensor-through-nrf51-kit-under-nrf_drv_twi_tx-and-rx-functions</link><description>The default I2C address of my sensor is 0x29 (7-bit).
If the least significant bit is low (0x52) the message is a master write to the slave. If the lsb is set (0x53) then the message is a master read from the slave.
The part of my code is below. I need</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 15 May 2017 09:40:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/22007/i2c-how-can-i-read-and-write-data-from-my-vl6180x-sensor-through-nrf51-kit-under-nrf_drv_twi_tx-and-rx-functions" /><item><title>RE: I2C: How can I read and write data from my VL6180X sensor through nrf51 kit under nrf_drv_twi_tx() and rx() functions?</title><link>https://devzone.nordicsemi.com/thread/86363?ContentTypeID=1</link><pubDate>Mon, 15 May 2017 09:40:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d381a02d-5bfb-4879-b6e6-416416f1d26d</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Just define it&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define I2C_DEV_ADDR    0x29
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and then pass it as an argument in the function calls, e.g.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;err_code = nrf_drv_twi_tx(&amp;amp;I2C_instance I2C_DEV_ADDR,&amp;amp;reg, sizeof(reg), true);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C: How can I read and write data from my VL6180X sensor through nrf51 kit under nrf_drv_twi_tx() and rx() functions?</title><link>https://devzone.nordicsemi.com/thread/86362?ContentTypeID=1</link><pubDate>Mon, 15 May 2017 09:16:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cdcff356-afda-4b03-9b96-c5a3add9e201</guid><dc:creator>mert</dc:creator><description>&lt;p&gt;how can I write that address in my code to be able to read/write data from my sensor?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C: How can I read and write data from my VL6180X sensor through nrf51 kit under nrf_drv_twi_tx() and rx() functions?</title><link>https://devzone.nordicsemi.com/thread/86361?ContentTypeID=1</link><pubDate>Mon, 15 May 2017 08:51:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60bd08a9-c9e2-45f5-b65c-6974d00d184a</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;The nrf_twi_drv_rx/tx function calls will set the Read/Write bit automatically, i.e. you should only have to provide the I2C address of your device, which in your case is 0x29.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>