<?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>TWIS multiple salve address</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39881/twis-multiple-salve-address</link><description>When the TWIS is defined with 2 slave address. 
 On event handler, how it is possible to know on which address the event is related to ?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 25 Jul 2023 14:27:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39881/twis-multiple-salve-address" /><item><title>RE: TWIS multiple salve address</title><link>https://devzone.nordicsemi.com/thread/438109?ContentTypeID=1</link><pubDate>Tue, 25 Jul 2023 14:27:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a26fc3c9-df91-4833-bc92-4dd78135dfcf</guid><dc:creator>jatfc</dc:creator><description>&lt;p&gt;In the newer framework, you should be able to simply invoke the check of MATCH (via hal/nrf_twis.h) from the callback handler:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;fc_uint08_t ub_Idx = nrf_twis_match_get(m_twis.p_reg);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Which will give the address register index.&amp;nbsp; If you want the address you&amp;#39;d have to use that to select it; but for buffering the index is better.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIS multiple salve address</title><link>https://devzone.nordicsemi.com/thread/156161?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2018 13:05:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:227fdb41-db94-4b5d-a936-56df0dedcfe2</guid><dc:creator>mrono</dc:creator><description>&lt;p&gt;Ok, the driver has a function to check which address matched, but the twis state machine doesn&amp;#39;t use it. Let alone forward this information to the callback handler.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIS multiple salve address</title><link>https://devzone.nordicsemi.com/thread/156156?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2018 12:57:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:741dfddd-84fe-4a87-8bd3-d96d02ed3686</guid><dc:creator>mrono</dc:creator><description>&lt;p&gt;At least in the nRF52840 the TWIS peripheral does have two ADDRESS registers. And there is a MATCH register that indicates which of the addresses matched.&lt;/p&gt;
&lt;p&gt;You&amp;#39;d think that the SDK would provide a way to use this feature, but I don&amp;#39;t see anything in the nrfx_twis driver that would read the MATCH register. So I think this feature is simply missing from the driver.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIS multiple salve address</title><link>https://devzone.nordicsemi.com/thread/156148?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2018 12:17:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49c4c484-e59e-4f7f-ad8c-bd4c40adb30f</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/fletort"&gt;fletort&lt;/a&gt; -&amp;nbsp;&amp;nbsp;&amp;nbsp;Why do you want 2 Slave addresses?&lt;/p&gt;
&lt;p&gt;A more usual approach is for the Slave to define its &amp;quot;internal&amp;quot; addressing within the message.&lt;/p&gt;
&lt;p&gt;This is also illustrated in&amp;nbsp; the thread I linked earlier.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIS multiple salve address</title><link>https://devzone.nordicsemi.com/thread/156146?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2018 12:14:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1f9de47-320c-4ae7-8e59-523f103f7a0a</guid><dc:creator>awneil</dc:creator><description>[quote userid="14528" url="~/f/nordic-q-a/39881/twis-multiple-salve-address/156142"]In I2C addresses are only assigned to slave devices.[/quote]
&lt;p&gt;There&amp;#39;s nothing, in principle, to stop a Slave responding to multiple addresses.&lt;/p&gt;
&lt;p&gt;For example, &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/40161/address-designation-method-for-reading-data-from-the-acceleration-sensor-twi_sensor-example" rel="noopener noreferrer" target="_blank"&gt;this recent thread&lt;/a&gt; uses an ST&amp;nbsp;&lt;a href="https://www.st.com/resource/en/datasheet/lsm303dlhc.pdf"&gt;LSM303DLHC&lt;/a&gt; - which is a gyroscope and accelerometer. It has separate Slave addresses for the&amp;nbsp;&lt;span&gt;gyroscope function, and the accelerometer function&amp;nbsp; - even thought they are physically in the same device!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;When a Slave &lt;em&gt;does&lt;/em&gt; have multiple addresses, then it seems obvious that it would need to know which address is currently being &amp;quot;called&amp;quot; ...&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIS multiple salve address</title><link>https://devzone.nordicsemi.com/thread/156144?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2018 12:04:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f642b8b7-7227-4bb0-b335-09fdf1f2c3d1</guid><dc:creator>fletort</dc:creator><description>&lt;p&gt;I am not talking about the master adresses. But out nrf Slave device can be reachable on 2 adresses. Is it possible to know on which adresses (on these 2) our slave device is currently adresses ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIS multiple salve address</title><link>https://devzone.nordicsemi.com/thread/156142?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2018 11:59:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25dd4259-7007-4a87-badf-67a7beb98d20</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;In I2C addresses are only assigned to slave devices. I dont think there is a standard way to&amp;nbsp;distinguish&amp;nbsp;data coming from different master devices.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIS multiple salve address</title><link>https://devzone.nordicsemi.com/thread/156119?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2018 10:52:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0390a4ca-1888-4d03-9eed-793607a87e7d</guid><dc:creator>fletort</dc:creator><description>&lt;p&gt;I am slave adresse, as indicated in the title. So i receive the&amp;nbsp;&lt;span&gt;nrfx_twi&lt;/span&gt;&lt;strong&gt;s&lt;/strong&gt;&lt;span&gt;_evt_t event. But when&amp;nbsp;nerf is slave it is possible for it to listen on two adresses. I would like to know if it is possible to know on which adresses the incoming request is.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIS multiple salve address</title><link>https://devzone.nordicsemi.com/thread/156116?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2018 10:38:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd52af48-b148-4d10-8f17-e214c9e2fae7</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;twiS stands&amp;nbsp;Slave device. If you are slave then you have your assigned address&amp;nbsp;which you should be aware of. If you are implementing master with nrf you should use twi (with no s) driver. So it looks like you are using wrong driver, so I guess you didnt make it working at all on other sdks ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIS multiple salve address</title><link>https://devzone.nordicsemi.com/thread/156023?ContentTypeID=1</link><pubDate>Mon, 05 Nov 2018 16:54:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea171366-5862-446e-9aab-f3f0271585b3</guid><dc:creator>fletort</dc:creator><description>&lt;p&gt;in fact in SDK15 too, i can&amp;#39;t this parameter. The event received is the&amp;nbsp;&lt;span&gt;nrfx_twi&lt;strong&gt;s&lt;/strong&gt;_evt_t&amp;nbsp; not the&amp;nbsp;nrfx_twi_evt_t&amp;nbsp;that you mention&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIS multiple salve address</title><link>https://devzone.nordicsemi.com/thread/156022?ContentTypeID=1</link><pubDate>Mon, 05 Nov 2018 16:38:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad079c86-34d9-4e6c-b531-3af34e3a4287</guid><dc:creator>fletort</dc:creator><description>&lt;p&gt;It this also available on the old SDK 11 ? I can&amp;#39;t find the same parameter in this structure on this version.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIS multiple salve address</title><link>https://devzone.nordicsemi.com/thread/154681?ContentTypeID=1</link><pubDate>Fri, 26 Oct 2018 13:09:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7226b7c4-e1af-4f43-bd99-ab79598a71a3</guid><dc:creator>fletort</dc:creator><description>&lt;p&gt;THanks, it was for what i was looking for, but did not find it !&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks Again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIS multiple salve address</title><link>https://devzone.nordicsemi.com/thread/154664?ContentTypeID=1</link><pubDate>Fri, 26 Oct 2018 11:25:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cef3b61f-d92a-42d6-8ab4-409ca4ba49e4</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am not sure which SDK you are using but eg sdk 15: the event handler function type has parameter structure&amp;nbsp;&lt;em&gt;nrf_drv_twi_evt_t&amp;nbsp;&lt;/em&gt;which has&amp;nbsp;&lt;em&gt;nrf_drv_twi_xfer_desc_t&amp;nbsp;&lt;/em&gt;which has&amp;nbsp;&lt;em&gt;uint8_t&amp;nbsp;&lt;/em&gt;field for slave address. So to print address of device related to event you can instert this snippet to your event handler function:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; NRF_LOG_INFO(&amp;quot;Device addres:%d.&amp;quot;, p_event-&amp;gt;xfer_desc.address);&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>