<?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 sensor interrupt driven example?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42295/twi-sensor-interrupt-driven-example</link><description>Hi, I am looking for a recent example for twi sensor driven by interrupt(NRF52840), and specifically looking for an example that works with soft device(15.2) and allows for reading/writing to register as all examples i encountered involved some level</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 10 Jan 2019 14:07:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42295/twi-sensor-interrupt-driven-example" /><item><title>RE: Twi sensor interrupt driven example?</title><link>https://devzone.nordicsemi.com/thread/164948?ContentTypeID=1</link><pubDate>Thu, 10 Jan 2019 14:07:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec6ac594-60df-4371-97ac-e40bc273ad1e</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;The softdevice will always have highest priority, and will preempt the TWI driver. The TWI driver does not support timeouts, and there is no function to stop a transfer (and to be honest, I have never heard about this being an issue). The TWI protocol will report an error if a command is not ACK&amp;#39;ed. The TWI slave will send a NACK to stop the transfer when it is done sending data.&lt;/p&gt;
&lt;p&gt;You can implement a timer that trigger the STOP task manually if you need timeouts, using the TWI HAL function&amp;nbsp;&lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/group__nrf__twi__hal#ga0551d2b00947fd9fd419f934bc97de24"&gt;nrf_twi_task_trigger&lt;/a&gt;&lt;span&gt;&amp;nbsp;(NRF_TWI_Type *p_reg,&amp;nbsp;&lt;/span&gt;&lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/group__nrf__twi__hal#gae6266e8808b35b0569d429787f90b893"&gt;nrf_twi_task_t&lt;/a&gt;&lt;span&gt;&amp;nbsp;task).&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Twi sensor interrupt driven example?</title><link>https://devzone.nordicsemi.com/thread/164727?ContentTypeID=1</link><pubDate>Wed, 09 Jan 2019 13:57:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a743f20a-0179-42b2-9313-f97ed67d0529</guid><dc:creator>Luke.L</dc:creator><description>&lt;p&gt;Thanks for the reply. One of my concerns is the blocking event handling may interrupt ble connections? Or would it not? And what would be the best practice for TWI timeouts?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Twi sensor interrupt driven example?</title><link>https://devzone.nordicsemi.com/thread/164699?ContentTypeID=1</link><pubDate>Wed, 09 Jan 2019 12:12:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c214a2d4-9d92-441e-8be4-0ff45a30929c</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/twi_sensor_example"&gt;TWI Sensor example&lt;/a&gt; in the SDK is interrupt driven. The example do have a blocking while loop that ensures that a transfer is completed before starting a new one, but this you will not be able to avoid anyway. If this example does not meet your requirements, you should include some details about your application and what your requirements are.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>