<?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>TWI restart condition after a rx operation (IQS263)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/62049/twi-restart-condition-after-a-rx-operation-iqs263</link><description>Hello, 
 I need to interface with a touch sensor from Azoteq (IQS263). This device allows a communication window during which you can read or write on I2C. The issue is that the sensors closes the communication window as soons as it detects a stop condition</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 10 Jun 2020 16:30:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/62049/twi-restart-condition-after-a-rx-operation-iqs263" /><item><title>RE: TWI restart condition after a rx operation (IQS263)</title><link>https://devzone.nordicsemi.com/thread/254316?ContentTypeID=1</link><pubDate>Wed, 10 Jun 2020 16:30:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3cec372-fcbf-4268-9071-ac74152c71b9</guid><dc:creator>Aurele</dc:creator><description>&lt;p&gt;Hello Kenneth,&lt;/p&gt;
&lt;p&gt;I succeeded to make what i want&amp;nbsp;by modifying the current driver in the SDK16 and also with the deprecated driver but i&amp;#39;m facing other issues with the IQS263 that is internaly reseting because of stalling&amp;nbsp;on&amp;nbsp;I2C line. For instance, now, i&amp;#39;m only&amp;nbsp;doing a single read on each event (and not 3 as i wanted at the beginnig) ...&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI restart condition after a rx operation (IQS263)</title><link>https://devzone.nordicsemi.com/thread/254032?ContentTypeID=1</link><pubDate>Tue, 09 Jun 2020 12:01:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c064d55-1740-4081-bb71-923f1ec973e4</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hmm.. For sure the deprecated software implementation should be able to do this. Have you tried that one also?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI restart condition after a rx operation (IQS263)</title><link>https://devzone.nordicsemi.com/thread/253467?ContentTypeID=1</link><pubDate>Fri, 05 Jun 2020 09:30:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7e4e4c0-92e5-4118-9153-6f6173403aac</guid><dc:creator>Aurele</dc:creator><description>&lt;p&gt;Thank&amp;#39;s for these informations. I tried to modify the legacy driver : nrfx_twi.c file in that way :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;extern bool rx_no_stop;
static bool twi_receive_byte(NRF_TWI_Type         * p_twi,
                             twi_control_block_t  * p_cb)
{
    if (p_cb-&amp;gt;bytes_transferred &amp;lt; p_cb-&amp;gt;curr_length)
    {
        p_cb-&amp;gt;p_curr_buf[p_cb-&amp;gt;bytes_transferred] = nrf_twi_rxd_get(p_twi);
        ++(p_cb-&amp;gt;bytes_transferred);

        if ((p_cb-&amp;gt;bytes_transferred == p_cb-&amp;gt;curr_length - 1) &amp;amp;&amp;amp; (!TWI_FLAG_SUSPEND(p_cb-&amp;gt;flags)))
        {
            nrf_twi_shorts_set(p_twi, NRF_TWI_SHORT_BB_STOP_MASK);
        }
        else if (p_cb-&amp;gt;bytes_transferred == p_cb-&amp;gt;curr_length &amp;amp;&amp;amp; (!TWI_FLAG_SUSPEND(p_cb-&amp;gt;flags)))
        {
            if (rx_no_stop)
            {
                nrf_twi_task_trigger(p_twi, NRF_TWI_TASK_SUSPEND);
                p_cb-&amp;gt;prev_suspend = TWI_SUSPEND_RX;
            }
            return true;
        }
        else if (p_cb-&amp;gt;bytes_transferred == p_cb-&amp;gt;curr_length &amp;amp;&amp;amp; TWI_FLAG_SUSPEND(p_cb-&amp;gt;flags))
        {
            p_cb-&amp;gt;prev_suspend = TWI_SUSPEND_RX;
            return false;
        }
        nrf_twi_task_trigger(p_twi, NRF_TWI_TASK_RESUME);
    }
    return true;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;but without success.&lt;/p&gt;
&lt;p&gt;I tried also to use the deprecated driver but unfortunatly it is still not working. Im still having&amp;nbsp; a stop sent at the end of my RX ...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI restart condition after a rx operation (IQS263)</title><link>https://devzone.nordicsemi.com/thread/253257?ContentTypeID=1</link><pubDate>Thu, 04 Jun 2020 11:05:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e240f86-f859-45c4-af56-6d9cc64ead1e</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;The TWI hardware may operate in two modes; legacy TWI mode (where each byte is loaded from the CPU) and TWIM mode (where each transfer is started using EasyDMA). The mode is controlled by&amp;nbsp;TWI0_USE_EASY_DMA. When using legacy mode you are including the api from nrf_twi.c and not nrfx_twim.c. I would think that using legacy is the preferred here to have better control over this, so make sure that is the case when you are modifying.&lt;/p&gt;
&lt;p&gt;If that doesn&amp;#39;t work, I can also find that in&amp;nbsp;\components\drivers_nrf\twi_master\deprecated there are both older hardware and software implementation that may give better low level control of this. Though they are using hardcoded PPI channels, so you may need to modify that to use one that is available in your application.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI restart condition after a rx operation (IQS263)</title><link>https://devzone.nordicsemi.com/thread/253251?ContentTypeID=1</link><pubDate>Thu, 04 Jun 2020 10:45:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1088c75a-0354-44fb-a86a-ec1a6a2f2935</guid><dc:creator>Aurele</dc:creator><description>&lt;p&gt;Unfortunaly i tried to modify the sdk library (nrfx_twi driver), it was almost working but the bytes i&amp;#39;m receiving&amp;nbsp;don&amp;#39;t&amp;nbsp;look good.&lt;/p&gt;
&lt;p&gt;So i&amp;#39;m still looking for a solution.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI restart condition after a rx operation (IQS263)</title><link>https://devzone.nordicsemi.com/thread/253124?ContentTypeID=1</link><pubDate>Wed, 03 Jun 2020 18:58:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d525893-64cd-48ab-a43c-b85342af0f2a</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Looks like you are right. Then I suppose it may be possible by calling&amp;nbsp;nrfx_twi_xfer()/nrfx_twim_xfer() directly, instead of using the&amp;nbsp;nrf_drv_twi_rx() wrapper.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI restart condition after a rx operation (IQS263)</title><link>https://devzone.nordicsemi.com/thread/252787?ContentTypeID=1</link><pubDate>Tue, 02 Jun 2020 14:23:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b7f55a3-a3a7-4d42-9730-51824d3bbdf8</guid><dc:creator>Aurele</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thank you very much for the reply. The NO_STOP flag seems to be available only for TX mode, not RX mode !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI restart condition after a rx operation (IQS263)</title><link>https://devzone.nordicsemi.com/thread/252730?ContentTypeID=1</link><pubDate>Tue, 02 Jun 2020 12:29:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb3e47fd-c65c-4c1d-b085-4ad14e2270ac</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I believe using the NO_STOP flag should solve this, check out:&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/hardware_driver_twi.html#hardware_driver_twi_advanced"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/hardware_driver_twi.html#hardware_driver_twi_advanced&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>