<?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>NRF_DRV_TWI_INSTANCE</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39324/nrf_drv_twi_instance</link><description>Hi, I am trying to interface MPU6050 IMU module with NRF52832 DK. 
 I need to send the Accelerometer and gyroscope data to mobile app by using BLE_UART program 
 this is my code 
 
 
 and the compile error and drivers that i used are shown in this picture</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 15 Oct 2018 13:06:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39324/nrf_drv_twi_instance" /><item><title>RE: NRF_DRV_TWI_INSTANCE</title><link>https://devzone.nordicsemi.com/thread/152888?ContentTypeID=1</link><pubDate>Mon, 15 Oct 2018 13:06:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5e48c77-c9d5-4bf1-9fd0-599eec4da3dd</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;You&amp;nbsp;have to&amp;nbsp;include the header file &lt;em&gt;nrf_drv_twi.h&lt;/em&gt; at the top of the main file,&amp;nbsp;in addition to adding the location to the path (see &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/37534/why-can-not-compile-the-h-from-the-nrf5_sdk_15-0-0_a53641a-to-the-nrf5_sdk_for_mesh_v2-1-1_src-s-light_switch--server-project"&gt;this&lt;/a&gt;&amp;nbsp;link). Then you must add &lt;em&gt;nrf_drv_twi.c&lt;/em&gt;&amp;nbsp;&lt;em&gt;&lt;/em&gt;to your project, by adding it in the Project Explorer window to the left. If you encounter any more errors like this, just follow these steps.&lt;/p&gt;
&lt;p&gt;I would recommend you to look at one of the provided TWI examples in the sdk, for example the&amp;nbsp;&lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk51.v10.0.0%2Ftwi_sensor_example.html&amp;amp;cp=4_1_0_4_5_25"&gt;TWI Sensor Example&lt;/a&gt;. Then you can see what files needs to be included for the different functions used.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF_DRV_TWI_INSTANCE</title><link>https://devzone.nordicsemi.com/thread/152641?ContentTypeID=1</link><pubDate>Fri, 12 Oct 2018 09:22:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ddbc704-3f98-433a-bafb-0003508addf4</guid><dc:creator>Sunil vignesh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I just enable&lt;/p&gt;
&lt;p&gt;#define TWI0_ENABLED 1&lt;/p&gt;
&lt;p&gt;#define TWI_ENABLED 1&lt;/p&gt;
&lt;p&gt;#define NRFX_TWI_ENABLED 1&lt;/p&gt;
&lt;p&gt;#define NRFX_TWI0_ENABLED 1&lt;/p&gt;
&lt;p&gt;now the&amp;nbsp; NRF_DRV_TWI_INSTANCE(TWI_INSTANCE_ID) error not came but&lt;/p&gt;
&lt;p&gt;it shows&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/segger2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF_DRV_TWI_INSTANCE</title><link>https://devzone.nordicsemi.com/thread/152444?ContentTypeID=1</link><pubDate>Thu, 11 Oct 2018 08:11:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba7dffba-85db-49b4-96d4-d9ebeaa5caa8</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Let me try to explain why it fails.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First NRF_DRV_TWI_INSTANCE(TWI_INSTANCE_ID); is called in main, with an argument of 0&lt;/li&gt;
&lt;li&gt;Then inside nrf_drv_twi.h the following line will be called&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define NRF_DRV_TWI_INSTANCE_(id)   NRF_DRV_TWI_INSTANCE_ ## id&lt;/pre&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It looks for the definition of&amp;nbsp;NRF_DRV_TWI_INSTANCE_0, but as you can see in the code snippet down below, it is grayed out. This is because NRFX_TWI0_ENABLED is not set to 1&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-10f4fd9091fe42ad9c6acac0c2c6e48d/image.PNG" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Inside the file apply_old_config.h NRFX_TWI0_ENABLED is defined in the following manner&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define NRFX_TWIM0_ENABLED  (TWI0_ENABLED &amp;amp;&amp;amp; TWI0_USE_EASY_DMA)&lt;/pre&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If you enable both of these definitions inside sdk_config.h, it should be fine&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Something that may cause confusion is that there is two different kinds of definitions in the sdk_config.h file (e.g. TWI_ENABLED and NRFX_TWI_ENABLED). If&amp;nbsp;the&amp;nbsp;former is present (legacy), then the other definitions will be ignored.&lt;/p&gt;
&lt;p&gt;Hopefully this made sense.&lt;/p&gt;
&lt;p&gt;Best regards, Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>