<?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>#35: #error directive: &amp;quot;Wrong configuration.&amp;quot; Enabling TWI</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19325/35-error-directive-wrong-configuration-enabling-twi</link><description>Hello, 
 I received the above error using NRF5 SDK 12.2. I have modified &amp;quot;nrf_drv_config.h&amp;quot; so that it reads #define TWI0_ENABLED 1 . Also, I put #include &amp;quot;nrf_drv_config.h&amp;quot; at the top of all my files which use &amp;quot;nrf_drv_twi&amp;quot; where the error occurs. </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 30 Jan 2017 18:06:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19325/35-error-directive-wrong-configuration-enabling-twi" /><item><title>RE: #35: #error directive: "Wrong configuration." Enabling TWI</title><link>https://devzone.nordicsemi.com/thread/74950?ContentTypeID=1</link><pubDate>Mon, 30 Jan 2017 18:06:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7094ae7-f1cb-4835-9357-7b840f049804</guid><dc:creator>Levi</dc:creator><description>&lt;p&gt;Thanks again, Jørgen. I replaced my nrf_drv_twi files and I got rid of this error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: #35: #error directive: "Wrong configuration." Enabling TWI</title><link>https://devzone.nordicsemi.com/thread/74949?ContentTypeID=1</link><pubDate>Mon, 30 Jan 2017 16:02:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f940bfca-1e86-4868-9f6b-8a6b51a01ac4</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;You can find the default sdk_config.h settings for TWI in the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.2.0/twi_sensor_example.html?cp=4_0_1_4_5_35"&gt;TWI sensor example&lt;/a&gt;. You should only edit the sdk_config.h file, and not put the defines in main.c or nrf_drv_twi.c/h.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: #35: #error directive: "Wrong configuration." Enabling TWI</title><link>https://devzone.nordicsemi.com/thread/74948?ContentTypeID=1</link><pubDate>Mon, 30 Jan 2017 15:42:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:782501cf-36fc-418a-b6f4-0e69c4973f51</guid><dc:creator>Levi</dc:creator><description>&lt;p&gt;Thanks, and sorry I am still new with this. I added both &lt;code&gt;#define TWI_ENABLED 1&lt;/code&gt; and
&lt;code&gt;#define TWI0_ENABLED 1&lt;/code&gt; to my main.c file. Also, I modified &amp;quot;sdk_config.h&amp;quot; to define both values as well. However, I am still receiving the error. Not sure what is going wrong.&lt;/p&gt;
&lt;p&gt;EDIT: I should probably note that I also have enabled TWI0_USE_EASY_DMA. Looking at &amp;quot;nrf_drv_twi.h&amp;quot;,&lt;/p&gt;
&lt;p&gt;#if ((TWI0_ENABLED == 1 &amp;amp;&amp;amp; TWI0_USE_EASY_DMA == 1) || &lt;br /&gt;
(TWI1_ENABLED == 1 &amp;amp;&amp;amp; TWI1_USE_EASY_DMA == 1))
#define TWIM_IN_USE
#endif&lt;/p&gt;
&lt;p&gt;Having both enabled should define  TWIM_IN_USE and fix this error, but I&amp;#39;m not sure what&amp;#39;s going wrong.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: #35: #error directive: "Wrong configuration." Enabling TWI</title><link>https://devzone.nordicsemi.com/thread/74947?ContentTypeID=1</link><pubDate>Mon, 30 Jan 2017 15:04:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1fd0c42-f750-4291-8854-16f5305c1525</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;As I answered in your &lt;a href="https://devzone.nordicsemi.com/question/111877/undeclared-identifier-twi0_use_easy_dma-error-still-occurring/"&gt;last case&lt;/a&gt;, &lt;em&gt;nrf_drv_config.h&lt;/em&gt; is no longer used in SDK 12.x.0. You should enable TWI by setting &lt;code&gt;TWI_ENABLED&lt;/code&gt; and &lt;code&gt;TWI0_ENABLED&lt;/code&gt; in, &lt;em&gt;sdk_config.h&lt;/em&gt; as &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.2.0/sdk_config.html?cp=4_0_1_1_6"&gt;described here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>