<?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 use old TWI API on SDK15.0.0?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/34336/how-to-use-old-twi-api-on-sdk15-0-0</link><description>Hi, 
 
 I have code for NRF51822 which used TWI form sdk 8. 
 Now I want to port it into NRF52840, but I have issues with using old TWI api. 
 They are located at path .. nRF5_SDK_1500\components\drivers_nrf\twi_master\deprecated\twi_master.h and I&amp;#39;m</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 15 May 2018 13:33:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/34336/how-to-use-old-twi-api-on-sdk15-0-0" /><item><title>RE: How to use old TWI API on SDK15.0.0?</title><link>https://devzone.nordicsemi.com/thread/132061?ContentTypeID=1</link><pubDate>Tue, 15 May 2018 13:33:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c16ed7d9-bf01-44a8-b8cb-8c205b80228a</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;In SDK15 the sdk_config.h files are often used to define these, although you could probably do it in the preprocessor defines as well.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I suggest that you look at the example found in:&lt;/p&gt;
&lt;p&gt;SDK15\examples\peripheral\twi_scanner&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;in this project folder, you will find the file sdk_config.h under twi_scanner\pca10056\blank\config&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Look at how the defines under nRF_Drivers are defined. You should&amp;nbsp;have both NRFX_TWI_ENABLED = 1 and TWI_ENABLED = 1. Depending on what functions you use, you may also need NRFX_TWIM_ENABLED = 1. You should see in the files that have the implementations that you want to use, that they have a line close to the top saying something like:&lt;/p&gt;
&lt;p&gt;#if NRFX_CHECK(NRFX_TWI_ENABLED)&lt;/p&gt;
&lt;p&gt;which will return true if NRFX_TWI_ENABLED is defined to 1, and so on.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So try to include these defines in your sdk_config.h file.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>