<?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>Nordic Thingy 52 - external I2C sensor device driver implementation</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43442/nordic-thingy-52---external-i2c-sensor-device-driver-implementation</link><description>Hello everyone, 
 
 i&amp;#39;m trying to hook up an external i2C sensor to P5 connector (TWI_SCL_EXT, TWI_SDA_EXT) and created a device driver template ( from drv_gas_sensor.c example) . 
 to start with i have created this function in m_environment.c: 
 /**</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 Jul 2019 16:26:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43442/nordic-thingy-52---external-i2c-sensor-device-driver-implementation" /><item><title>RE: Nordic Thingy 52 - external I2C sensor device driver implementation</title><link>https://devzone.nordicsemi.com/thread/198787?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2019 16:26:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a86d48c-8322-4e63-83ff-c220f8927b68</guid><dc:creator>Kartik</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&amp;quot;external&amp;nbsp;&lt;span&gt;I2C sensor to the thingy project (&lt;/span&gt;&lt;em&gt;pca20020_s132&lt;/em&gt;&lt;span&gt;)&amp;quot; integration code that you shared above is not working with my sensor (MAX30105). &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It goes into infinite loop while executing the nrf_drv_twi_init() function within twi_init(). &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you please help me with this?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Nordic Thingy 52 - external I2C sensor device driver implementation</title><link>https://devzone.nordicsemi.com/thread/172440?ContentTypeID=1</link><pubDate>Fri, 22 Feb 2019 08:29:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96e7a218-d378-4a36-b5c2-2b8537debd44</guid><dc:creator>BlueTech</dc:creator><description>&lt;p&gt;Hello Simon,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;thank you so much, yes above procedure works once on ble notification event from ble_tes_evt_handler(..). let me check my scheduler configuration for repeated event trigger.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;thanks again and have a great weekend.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Nordic Thingy 52 - external I2C sensor device driver implementation</title><link>https://devzone.nordicsemi.com/thread/172352?ContentTypeID=1</link><pubDate>Thu, 21 Feb 2019 16:11:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8dff2246-b97b-44db-ba17-ce1eb13cfc14</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Why are you starting and stopping the timer? Isn&amp;#39;t it possible to create a repeated timer that fires every 1 second?&lt;/p&gt;
&lt;p&gt;I have not tested this myself,&amp;nbsp;and I am not sure if this is the best way to go about it, but here I will present an approach that might work&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;In&amp;nbsp;drv_mysensor.c&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create an enable function&amp;nbsp;( similar to &lt;em&gt;drv_humidity_enable(..)&lt;/em&gt;&amp;nbsp;where you create and start a repeated timer that triggers&amp;nbsp;&lt;em&gt;idle_timer_evt_scheduler()&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Inside&amp;nbsp;&lt;em&gt;idle_timer_evt_scheduler()&amp;nbsp;&lt;/em&gt;run&amp;nbsp;&lt;em&gt;app_sched_event_put(NULL, NULL, reset_idle_timer_event)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;In the function&amp;nbsp;&lt;em&gt;reset_idle_timer_event()&amp;nbsp;&lt;/em&gt;only run&amp;nbsp;&lt;em&gt;m_drv_pm.evt_handler(DRV_MYSENSOR_EVT_DATA);&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Create in init function (similar to &lt;em&gt;drv_humidity_init(..)&lt;/em&gt; )
&lt;ul&gt;
&lt;li&gt;Here you can create the repeated timer (not start it)&lt;/li&gt;
&lt;li&gt;In addition you set your event handler&amp;nbsp;&lt;em&gt;m_drv_pm.evt_handler&amp;nbsp;&lt;/em&gt;here&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;In&amp;nbsp;m_environment.c&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create the event handler (similar to &lt;em&gt;humidity_timeout_handler()&lt;/em&gt; )&lt;/li&gt;
&lt;li&gt;Run the init and enable function that you created in &lt;em&gt;drv_mysensor.c&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Nordic Thingy 52 - external I2C sensor device driver implementation</title><link>https://devzone.nordicsemi.com/thread/172002?ContentTypeID=1</link><pubDate>Wed, 20 Feb 2019 04:06:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9df90eb8-d475-4090-b724-2c3e8172ed7d</guid><dc:creator>BlueTech</dc:creator><description>&lt;p&gt;Hello Simon,&lt;/p&gt;
&lt;p&gt;here is what i&amp;#39;m attempting to do.&lt;/p&gt;
&lt;p&gt;//i have written a drv_mysensor.c and created following event scheduler.&lt;/p&gt;
&lt;p&gt;APP_TIMER_DEF(m_idle_timer_id);&lt;/p&gt;
&lt;p&gt;void reset_idle_timer(void)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t err_code;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Stop timer&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; err_code = app_timer_stop(m_idle_timer_id);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Start timer&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; err_code = app_timer_start(m_idle_timer_id,APP_TIMER_TICKS(1000),NULL);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**@brief event handler&lt;br /&gt;&amp;nbsp;*/&lt;br /&gt;void reset_idle_timer_event(void * p_event_data, uint16_t event_size)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reset_idle_timer();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Data ready&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_drv_pm.evt_handler(DRV_MYSENSOR_EVT_DATA);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/**@brief event scheduler&lt;br /&gt;&amp;nbsp;*/&lt;br /&gt;static void idle_timer_evt_scheduler()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t err_code;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Reset idle timer&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; err_code = app_sched_event_put(NULL, NULL, reset_idle_timer_event);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;br /&gt;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;// and&amp;nbsp; i&amp;#39;m expecting following function to be called from m_environment.c file every 1 second&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;/**@brief My sensor event handler.&lt;br /&gt;&amp;nbsp;*/&lt;br /&gt;static void drv_mysensor_evt_handler(drv_mysensor_evt_t event)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t err_code;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (event == DRV_MYSENSOR_EVT_DATA)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ble_tes_mysensor_t dat;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; float value = drv_mysensor_get();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (m_get_mysensor== true)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; err_code = ble_tes_mysensor_set(&amp;amp;m_tes, &amp;amp;value);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_get_mysensor = false;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; APP_ERROR_CHECK_BOOL(false);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;// but my problem is i&amp;#39;m not hitting following case statement which i have added in&amp;nbsp; m_environment.c file, because of which idle_timer_evt_scheduler() function is not started. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case BLE_TES_EVT_NOTIF_MYSENSOR:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NRF_LOG_DEBUG(&amp;quot;tes_evt_handler: BLE_TES_EVT_NOTIF_MYSENSOR: %d\r\n&amp;quot;, p_tes-&amp;gt;is_mysensor_notif_enabled);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (p_tes-&amp;gt;is_mysensor_notif_enabled)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; err_code = mysensor_start();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; err_code = mysensor_stop(p_tes-&amp;gt;is_mysensor_notif_enabled == false);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Nordic Thingy 52 - external I2C sensor device driver implementation</title><link>https://devzone.nordicsemi.com/thread/172001?ContentTypeID=1</link><pubDate>Wed, 20 Feb 2019 03:36:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18e588b8-260f-4c09-90ec-d03440f524ce</guid><dc:creator>BlueTech</dc:creator><description>&lt;p&gt;Hello Simon,&lt;/p&gt;
&lt;p&gt;sorry for the confusion, i&amp;#39;m not using hts221 sensor.&amp;nbsp; i have a sensor which does not have DRDY/INT pin. it has only i2c interface and i&amp;#39;m able to read/write registers&amp;nbsp; through i2c.&amp;nbsp; i was thinking some kind of event scheduler will mimic DRDY/INT functionality and hence i can use rest of the API&amp;#39;s similar to hts221 sensor.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Nordic Thingy 52 - external I2C sensor device driver implementation</title><link>https://devzone.nordicsemi.com/thread/171963?ContentTypeID=1</link><pubDate>Tue, 19 Feb 2019 16:58:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f11d2e89-aecc-4583-9410-d9315f83496b</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I am not too familiar with the &lt;span&gt;hts221&amp;nbsp;&lt;/span&gt;sensor, but I think you can read the temperature output registers without using the interrupt. If you look at the image below, you can see that HTS_INT (P0.24) is connected to DRDY, and according to the &lt;a href="https://www.st.com/resource/en/datasheet/hts221.pdf"&gt;hts221 datasheet&lt;/a&gt;&amp;nbsp;the DRDY signal will go high after new data is available, and goes low after the registers are read.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-81d62ad5fe1e43d9a8e4fbfcfbc36326/hts221.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;However, I don&amp;#39;t think there is anything stopping you from reading the output register without checking the DRDY line, you just risk reading the same data over again. If there is a small delay between the call to&amp;nbsp;&lt;em&gt;drv_humidity_sample(..) &lt;/em&gt;and&amp;nbsp;&lt;em&gt;&amp;nbsp;drv_humidity_temp_get(..)&amp;nbsp;&lt;/em&gt;I think this should be fine.&lt;/p&gt;
&lt;p&gt;Be aware that I might be wrong. Test it out, and give me an update of the result.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Nordic Thingy 52 - external I2C sensor device driver implementation</title><link>https://devzone.nordicsemi.com/thread/171773?ContentTypeID=1</link><pubDate>Tue, 19 Feb 2019 03:50:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63e9c48d-555a-4fbd-8930-42cec0572221</guid><dc:creator>BlueTech</dc:creator><description>&lt;p&gt;Hello Simon,&lt;/p&gt;
&lt;p&gt;Thank you very much for your detailed explanation.&lt;/p&gt;
&lt;p&gt;Do you have any sensor on Thingy that does not have an INTERRUPT pin , curious to know how do you handle such situation?. Just use another timer based interrupt ? Basically my sensor does not have an interrupt pin and&amp;nbsp; i just want to send a start measurement command(similar to &lt;em&gt;drv_humidity_sample(..)&lt;/em&gt; function ) and then wait for 1 second or so before reading the sensor data(similar to &lt;em&gt;drv_humidity_temp_get(..)&lt;/em&gt;). and then i have created a custom characteristics on m_environment.c&amp;nbsp; which will take this value and pass it to ble_tes_mysensor_set(..) in ble_tes.c file.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Nordic Thingy 52 - external I2C sensor device driver implementation</title><link>https://devzone.nordicsemi.com/thread/171617?ContentTypeID=1</link><pubDate>Mon, 18 Feb 2019 12:26:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e556b9d1-23ac-4dc4-9308-240d70051297</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;In &lt;em&gt;m_environment.c&amp;nbsp;&lt;/em&gt;an app timer is created and started, it is a repeated timer that will invoke the function&amp;nbsp;&lt;em&gt;temperature_timeout_handler(..)--&amp;gt;drv_humidity_sample(..)&lt;/em&gt; every 2000 ms. The function&amp;nbsp;&lt;em&gt;drv_humidity_sample(..) &lt;/em&gt;will set the ONE_SHOT bit of the CTRL_REG2 register of the HTS221 sensor, which will start single acquisition of the temperature and store the values in the output registers (Read more in the &lt;a href="https://www.st.com/resource/en/datasheet/hts221.pdf"&gt;HTS221 datasheet&lt;/a&gt;). &lt;strong&gt;So in short, the temperature output registers will be updated every 2 seconds.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In order to read the temperature output registers (TEMP_OUT_L_REG and TEMP_OUT_H_REG), the function&amp;nbsp;&lt;em&gt;drv_hts221_temperature_get(..)&amp;nbsp;&lt;/em&gt;needs to be called, which is done&amp;nbsp;in the following manner:&amp;nbsp;&lt;em&gt;drv_humidity_evt_handler(..)&lt;/em&gt;--&amp;gt;&lt;em&gt;drv_humidity_temp_get(..)..drv_hts221_temperature_get(..).&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The function&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;drv_humidity_evt_handler(..)&amp;nbsp;&lt;/em&gt;is set through&amp;nbsp;&lt;em&gt;drv_humidity_init(..)&amp;nbsp;&lt;/em&gt;inside &lt;em&gt;m_environment.c&lt;/em&gt;, and in &lt;em&gt;drv_humidity.c&amp;nbsp;&lt;/em&gt;you can see that it is set equal&amp;nbsp; to&amp;nbsp;&lt;em&gt;m_drv_humidity.evt_handler.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;That function (&lt;em&gt;m_drv_humidity.evt_handler&lt;/em&gt;) is called from&amp;nbsp;&lt;em&gt;gpiote_evt_handler(..)&lt;/em&gt;--&amp;gt;&lt;em&gt;gpiote_evt_sceduled(..) &lt;/em&gt;in &lt;em&gt;drv_humidity.c, &lt;/em&gt;and through&amp;nbsp;&lt;em&gt;nrf_drv_gpiote_in_init(..)&amp;nbsp;&lt;/em&gt;it is configured to be called very time pin 24 toggles. &lt;strong&gt;So in short, the output registers will be read every time pin 24 toggles.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Hopefully I understood it correctly and explained it in a somehow understandable manner.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Nordic Thingy 52 - external I2C sensor device driver implementation</title><link>https://devzone.nordicsemi.com/thread/171272?ContentTypeID=1</link><pubDate>Fri, 15 Feb 2019 05:03:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f4a2f6c-c51f-4476-aed0-36d2672313c2</guid><dc:creator>BlueTech</dc:creator><description>&lt;p&gt;Hello Simon,&lt;/p&gt;
&lt;p&gt;Thank you very much for sharing example code.&lt;/p&gt;
&lt;p&gt;however i&amp;#39;m able to communicate with my sensor now by changing my mysensor_i2c_write() function.&lt;/p&gt;
&lt;p&gt;int8_t mysensor_i2c_write(uint8_t address, const uint8_t* data, uint16_t count)&lt;br /&gt;{ &lt;br /&gt;m_drv_mysensor.p_drv_mysensor_cfg-&amp;gt;twi_addr to match Thingy52 structure&lt;br /&gt;&amp;nbsp; // int8_t err = nrf_drv_twi_tx(&amp;amp;i2c_instance, address, data, (uint8_t)count, false);&lt;br /&gt;&amp;nbsp;&amp;nbsp; int8_t err = nrf_drv_twi_tx(m_drv_mysensor.p_drv_mysensor_cfg-&amp;gt;p_twi_instance, m_drv_mysensor.p_drv_mysensor_cfg-&amp;gt;twi_addr, data, (uint8_t)count, false);&lt;br /&gt;&amp;nbsp;&amp;nbsp; return err;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;with this modification now i&amp;#39;m able to read write sensor registers.&lt;/p&gt;
&lt;p&gt;Can you please explain how timer timeout and Bluetooth configuration service is handled in Thingy FW architecture. for example how static void temperature_timeout_handler(void * p_context) function in m_environment.c will pulls data from &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; err_code = drv_humidity_sample(); and how it is linked to &amp;nbsp;err_code = drv_hts221_temperature_get(&amp;amp;t_out);.&lt;/p&gt;
&lt;p&gt;Thanks for your time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Nordic Thingy 52 - external I2C sensor device driver implementation</title><link>https://devzone.nordicsemi.com/thread/170903?ContentTypeID=1</link><pubDate>Wed, 13 Feb 2019 13:46:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ee6795f-f8a6-4650-9241-9633a7ea5308</guid><dc:creator>Simon</dc:creator><description>[quote user="DineshNaik"]if i have to connect an exclusive i2c pin using IO expanded, please do&lt;br /&gt; let me know&amp;nbsp; which are the pins can be used from P4 connector.[/quote]
&lt;p&gt;&amp;nbsp;No, you probably don&amp;#39;t need to use the IO expander. I was too quick to answer and forgot that several TWI sensors can be connected to the SDA and SCL lines simultaneously.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;However I managed to integrate the ADXL375 I2C sensor to the thingy project (&lt;em&gt;pca20020_s132&lt;/em&gt;), and have attached the main code (and the drivers for the ADXL375 sensor if that is of interest). Be aware that I only printed the sensor data once, but you should probably implement a timer, and print the twi sensor data in the timer event handler.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/*
  Copyright (c) 2010 - 2017, Nordic Semiconductor ASA
  All rights reserved.

  Redistribution and use in source and binary forms, with or without modification,
  are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this
     list of conditions and the following disclaimer.

  2. Redistributions in binary form, except as embedded into a Nordic
     Semiconductor ASA integrated circuit in a product or a software update for
     such product, must reproduce the above copyright notice, this list of
     conditions and the following disclaimer in the documentation and/or other
     materials provided with the distribution.

  3. Neither the name of Nordic Semiconductor ASA nor the names of its
     contributors may be used to endorse or promote products derived from this
     software without specific prior written permission.

  4. This software, with or without modification, must only be used with a
     Nordic Semiconductor ASA integrated circuit.

  5. Any software provided in binary form under this license must not be reverse
     engineered, decompiled, modified and/or disassembled.

  THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA &amp;quot;AS IS&amp;quot; AND ANY EXPRESS
  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
  DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/** @file
 *
 * @brief    Thingy application main file.
 *
 * This file contains the source code for the Thingy application that uses the Weather Station service.
 */

#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;float.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
#include &amp;quot;nordic_common.h&amp;quot;
#include &amp;quot;nrf.h&amp;quot;
#include &amp;quot;ble_hci.h&amp;quot;
#include &amp;quot;ble_advdata.h&amp;quot;
#include &amp;quot;ble_advertising.h&amp;quot;
#include &amp;quot;ble_conn_params.h&amp;quot;
#include &amp;quot;softdevice_handler.h&amp;quot;
#include &amp;quot;app_scheduler.h&amp;quot;
#include &amp;quot;app_button.h&amp;quot;
#include &amp;quot;app_util_platform.h&amp;quot;
#include &amp;quot;m_ble.h&amp;quot;
#include &amp;quot;m_environment.h&amp;quot;
#include &amp;quot;m_sound.h&amp;quot;
#include &amp;quot;m_motion.h&amp;quot;
#include &amp;quot;m_ui.h&amp;quot;
#include &amp;quot;m_batt_meas.h&amp;quot;
#include &amp;quot;drv_ext_light.h&amp;quot;
#include &amp;quot;drv_ext_gpio.h&amp;quot;
#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;twi_manager.h&amp;quot;
#include &amp;quot;support_func.h&amp;quot;
#include &amp;quot;pca20020.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;

/////Added for TWI/////
#include &amp;quot;nrf_drv_twi.h&amp;quot;
#include &amp;quot;ADXL375_I2C.h&amp;quot;
/////Added for TWI/////

#define  NRF_LOG_MODULE_NAME &amp;quot;main          &amp;quot;
#include &amp;quot;nrf_log.h&amp;quot;
#include &amp;quot;nrf_log_ctrl.h&amp;quot;

#define DEAD_BEEF   0xDEADBEEF          /**&amp;lt; Value used as error code on stack dump, can be used to identify stack location on stack unwind. */
#define SCHED_MAX_EVENT_DATA_SIZE   MAX(APP_TIMER_SCHED_EVENT_DATA_SIZE, BLE_STACK_HANDLER_SCHED_EVT_SIZE) /**&amp;lt; Maximum size of scheduler events. */
#define SCHED_QUEUE_SIZE            60  /**&amp;lt; Maximum number of events in the scheduler queue. */

/////Added for TWI/////
/* TWI instance ID. */
#define TWI_INSTANCE_ID     0
/* TWI instance. */
static const nrf_drv_twi_t m_twi = NRF_DRV_TWI_INSTANCE(TWI_INSTANCE_ID);
/////Added for TWI/////

static const nrf_drv_twi_t     m_twi_sensors = NRF_DRV_TWI_INSTANCE(TWI_SENSOR_INSTANCE);
static m_ble_service_handle_t  m_ble_service_handles[THINGY_SERVICES_MAX];

void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info)
{
    #if NRF_LOG_ENABLED
        error_info_t * err_info = (error_info_t*)info;
        NRF_LOG_ERROR(&amp;quot; id = %d, pc = %d, file = %s, line number: %d, error code = %d = %s \r\n&amp;quot;, \
        id, pc, nrf_log_push((char*)err_info-&amp;gt;p_file_name), err_info-&amp;gt;line_num, err_info-&amp;gt;err_code, nrf_log_push((char*)nrf_strerror_find(err_info-&amp;gt;err_code)));
    #endif
    
    (void)m_ui_led_set_event(M_UI_ERROR);
    NRF_LOG_FINAL_FLUSH();
    nrf_delay_ms(5);
    
    // On assert, the system can only recover with a reset.
    #ifndef DEBUG
        NVIC_SystemReset();
    #endif

    app_error_save_and_stop(id, pc, info);
}


/**@brief Function for assert macro callback.
 *
 * @details This function will be called in case of an assert in the SoftDevice.
 *
 * @warning On assert from the SoftDevice, the system can only recover on reset.
 *
 * @param[in] line_num    Line number of the failing ASSERT call.
 * @param[in] p_file_name File name of the failing ASSERT call.
 */
void assert_nrf_callback(uint16_t line_num, const uint8_t * p_file_name)
{
    app_error_handler(DEAD_BEEF, line_num, p_file_name);
}

/**@brief Function for putting Thingy into sleep mode.
 *
 * @note This function will not return.
 */
static void sleep_mode_enter(void)
{
    uint32_t err_code;

    NRF_LOG_INFO(&amp;quot;Entering sleep mode \r\n&amp;quot;);
    err_code = m_motion_sleep_prepare(true);
    APP_ERROR_CHECK(err_code);

    err_code = support_func_configure_io_shutdown();
    APP_ERROR_CHECK(err_code);
    
    // Enable wake on button press.
    nrf_gpio_cfg_sense_input(BUTTON, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);
    // Enable wake on low power accelerometer.
    nrf_gpio_cfg_sense_input(LIS_INT1, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_SENSE_HIGH);
   
    NRF_LOG_FLUSH();
    nrf_delay_ms(5);
    // Go to system-off (sd_power_system_off() will not return; wakeup will cause a reset). When debugging, this function may return and code execution will continue.
    err_code = sd_power_system_off();
    NRF_LOG_WARNING(&amp;quot;sd_power_system_off() returned. -Probably due to debugger being used. Instructions will still run. \r\n&amp;quot;);
    NRF_LOG_FLUSH();
    
    #ifdef DEBUG
        if(!support_func_sys_halt_debug_enabled())
        {
            APP_ERROR_CHECK(err_code); // If not in debug mode, return the error and the system will reboot.
        }
        else
        {
            NRF_LOG_WARNING(&amp;quot;Exec stopped, busy wait \r\n&amp;quot;);
            NRF_LOG_FLUSH();
            
            while(true) // Only reachable when entering emulated system off.
            {
                // Infinte loop to ensure that code stops in debug mode.
            }
        }
    #else
        APP_ERROR_CHECK(err_code);
    #endif
}


/**@brief Function for placing the application in low power state while waiting for events.
 */
#define FPU_EXCEPTION_MASK 0x0000009F
static void power_manage(void)
{
    __set_FPSCR(__get_FPSCR()  &amp;amp; ~(FPU_EXCEPTION_MASK));
    (void) __get_FPSCR();
    NVIC_ClearPendingIRQ(FPU_IRQn);

    uint32_t err_code = sd_app_evt_wait();
    APP_ERROR_CHECK(err_code);
}


/**@brief Battery module data handler.
 */
static void m_batt_meas_handler(m_batt_meas_event_t const * p_batt_meas_event)
{
    NRF_LOG_INFO(&amp;quot;Voltage: %d V, Charge: %d %%, Event type: %d \r\n&amp;quot;,
                p_batt_meas_event-&amp;gt;voltage_mv, p_batt_meas_event-&amp;gt;level_percent, p_batt_meas_event-&amp;gt;type);
   
    if (p_batt_meas_event != NULL)
    {
        if( p_batt_meas_event-&amp;gt;type == M_BATT_MEAS_EVENT_LOW)
        {
            uint32_t err_code;

            err_code = support_func_configure_io_shutdown();
            APP_ERROR_CHECK(err_code);
            
            // Enable wake on USB detect only.
            nrf_gpio_cfg_sense_input(USB_DETECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_SENSE_HIGH);

            NRF_LOG_WARNING(&amp;quot;Battery voltage low, shutting down Thingy. Connect USB to charge \r\n&amp;quot;);
            NRF_LOG_FINAL_FLUSH();
            // Go to system-off mode (This function will not return; wakeup will cause a reset).
            err_code = sd_power_system_off();

            #ifdef DEBUG
                if(!support_func_sys_halt_debug_enabled())
                {
                    APP_ERROR_CHECK(err_code); // If not in debug mode, return the error and the system will reboot.
                }
                else
                {
                    NRF_LOG_WARNING(&amp;quot;Exec stopped, busy wait \r\n&amp;quot;);
                    NRF_LOG_FLUSH();
                    while(true) // Only reachable when entering emulated system off.
                    {
                        // Infinte loop to ensure that code stops in debug mode.
                    }
                }
            #else
                APP_ERROR_CHECK(err_code);
            #endif
        }
    }
}


/**@brief Function for handling BLE events.
 */
static void thingy_ble_evt_handler(m_ble_evt_t * p_evt)
{
    switch (p_evt-&amp;gt;evt_type)
    {
        case thingy_ble_evt_connected:
            NRF_LOG_INFO(NRF_LOG_COLOR_CODE_GREEN &amp;quot;Thingy_ble_evt_connected \r\n&amp;quot;);
            break;

        case thingy_ble_evt_disconnected:
            NRF_LOG_INFO(NRF_LOG_COLOR_CODE_YELLOW &amp;quot;Thingy_ble_evt_disconnected \r\n&amp;quot;);
            NRF_LOG_FINAL_FLUSH();
            nrf_delay_ms(5);
            NVIC_SystemReset();
            break;

        case thingy_ble_evt_timeout:
            NRF_LOG_INFO(NRF_LOG_COLOR_CODE_YELLOW &amp;quot;Thingy_ble_evt_timeout \r\n&amp;quot;);
            sleep_mode_enter();
            NVIC_SystemReset();
            break;
    }
}


/**@brief Function for initializing the Thingy.
 */
static void thingy_init(void)
{
    uint32_t                 err_code;
    m_ui_init_t              ui_params;
    m_environment_init_t     env_params;
    m_motion_init_t          motion_params;
    m_ble_init_t             ble_params;
    batt_meas_init_t         batt_meas_init = BATT_MEAS_PARAM_CFG;

    /**@brief Initialize the TWI manager. */
    err_code = twi_manager_init(APP_IRQ_PRIORITY_THREAD);
    APP_ERROR_CHECK(err_code);

    /**@brief Initialize LED and button UI module. */
    ui_params.p_twi_instance = &amp;amp;m_twi_sensors;
    err_code = m_ui_init(&amp;amp;m_ble_service_handles[THINGY_SERVICE_UI],
                         &amp;amp;ui_params);
    APP_ERROR_CHECK(err_code);

    /**@brief Initialize environment module. */
    env_params.p_twi_instance = &amp;amp;m_twi_sensors;
    err_code = m_environment_init(&amp;amp;m_ble_service_handles[THINGY_SERVICE_ENVIRONMENT],
                                  &amp;amp;env_params);
    APP_ERROR_CHECK(err_code);

    /**@brief Initialize motion module. */
    motion_params.p_twi_instance = &amp;amp;m_twi_sensors;

    err_code = m_motion_init(&amp;amp;m_ble_service_handles[THINGY_SERVICE_MOTION],
                             &amp;amp;motion_params);
    APP_ERROR_CHECK(err_code);

    err_code = m_sound_init(&amp;amp;m_ble_service_handles[THINGY_SERVICE_SOUND]);
    APP_ERROR_CHECK(err_code);

    /**@brief Initialize the battery measurement. */
    batt_meas_init.evt_handler = m_batt_meas_handler;
    err_code = m_batt_meas_init(&amp;amp;m_ble_service_handles[THINGY_SERVICE_BATTERY], &amp;amp;batt_meas_init);
    APP_ERROR_CHECK(err_code);

    err_code = m_batt_meas_enable(BATT_MEAS_INTERVAL_MS);
    APP_ERROR_CHECK(err_code);

    /**@brief Initialize BLE handling module. */
    ble_params.evt_handler       = thingy_ble_evt_handler;
    ble_params.p_service_handles = m_ble_service_handles;
    ble_params.service_num       = THINGY_SERVICES_MAX;

    err_code = m_ble_init(&amp;amp;ble_params);
    APP_ERROR_CHECK(err_code);

    err_code = m_ui_led_set_event(M_UI_BLE_DISCONNECTED);
    APP_ERROR_CHECK(err_code);
}


static void board_init(void)
{
    uint32_t            err_code;
    drv_ext_gpio_init_t ext_gpio_init;

    #if defined(THINGY_HW_v0_7_0)
        #error   &amp;quot;HW version v0.7.0 not supported.&amp;quot;
    #elif defined(THINGY_HW_v0_8_0)
        NRF_LOG_WARNING(&amp;quot;FW compiled for depricated Thingy HW v0.8.0 \r\n&amp;quot;);
    #elif defined(THINGY_HW_v0_9_0)
        NRF_LOG_WARNING(&amp;quot;FW compiled for depricated Thingy HW v0.9.0 \r\n&amp;quot;);
    #endif

    static const nrf_drv_twi_config_t twi_config =
    {
        .scl                = TWI_SCL,
        .sda                = TWI_SDA,
        .frequency          = NRF_TWI_FREQ_400K,
        .interrupt_priority = APP_IRQ_PRIORITY_LOW
    };

    static const drv_sx1509_cfg_t sx1509_cfg =
    {
        .twi_addr       = SX1509_ADDR,
        .p_twi_instance = &amp;amp;m_twi_sensors,
        .p_twi_cfg      = &amp;amp;twi_config
    };

    ext_gpio_init.p_cfg = &amp;amp;sx1509_cfg;
    
    err_code = support_func_configure_io_startup(&amp;amp;ext_gpio_init);
    APP_ERROR_CHECK(err_code);

    nrf_delay_ms(100);
}

/////Added for TWI/////
/**
 * @brief TWI initialization.
 */
void twi_init (void)
{
    ret_code_t err_code;

    const nrf_drv_twi_config_t twi_config = {
       .scl                = 15,//ARDUINO_SCL_PIN, //27
       .sda                = 14,//ARDUINO_SDA_PIN, //26
       .frequency          = 0x06680000UL,//NRF_DRV_TWI_FREQ_400K,//&amp;lt;-- same as Bjorn, old --&amp;gt;NRF_DRV_TWI_FREQ_100K,
       .interrupt_priority = 2,//APP_IRQ_PRIORITY_HIGH,
       .clear_bus_init     = false
    };

    err_code = nrf_drv_twi_init(&amp;amp;m_twi, &amp;amp;twi_config, NULL, NULL);
    APP_ERROR_CHECK(err_code);

    nrf_drv_twi_enable(&amp;amp;m_twi);
}
/////Added for TWI/////

/**@brief Application main function.
 */
int main(void)
{
    uint32_t err_code;
    err_code = NRF_LOG_INIT(NULL);
    APP_ERROR_CHECK(err_code);

    NRF_LOG_INFO(NRF_LOG_COLOR_CODE_GREEN&amp;quot;===== Thingy started! =====\r\n&amp;quot;);
    
    // Initialize.
    APP_SCHED_INIT(SCHED_MAX_EVENT_DATA_SIZE, SCHED_QUEUE_SIZE);
    err_code = app_timer_init();
    APP_ERROR_CHECK(err_code);

    board_init();
    thingy_init();
	
		/////Added for TWI/////
		twi_init();
		err_code = ADXL375_I2C_init(&amp;amp;m_twi);
    APP_ERROR_CHECK(err_code);
		// Data rate set to 1010, which is 100 Hz
    ADXL375_I2C_data_rate_set(0x0A);
    ADXL375_I2C_offsets_set(0,0,0);

    int16_t x_val;
    int16_t y_val;
    int16_t z_val;
		ADXL375_I2C_acc_data_read(&amp;amp;x_val,&amp;amp;y_val,&amp;amp;z_val);
    NRF_LOG_INFO(&amp;quot;ACC DATA:  X: %d  Y: %d  Z: %d  \n&amp;quot;, x_val ,y_val, z_val);
		/////Added for TWI/////

    for (;;)
    {
        app_sched_execute();
        
        if (!NRF_LOG_PROCESS()) // Process logs
        { 
            power_manage();
        }
    }
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-81d62ad5fe1e43d9a8e4fbfcfbc36326/ADXL375_5F00_I2C.h"&gt;devzone.nordicsemi.com/.../ADXL375_5F00_I2C.h&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-81d62ad5fe1e43d9a8e4fbfcfbc36326/ADXL375_5F00_I2C.c"&gt;devzone.nordicsemi.com/.../ADXL375_5F00_I2C.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Nordic Thingy 52 - external I2C sensor device driver implementation</title><link>https://devzone.nordicsemi.com/thread/170220?ContentTypeID=1</link><pubDate>Sat, 09 Feb 2019 17:11:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d7ba483-3550-4a73-8fd1-040efd139c10</guid><dc:creator>BlueTech</dc:creator><description>&lt;p&gt;Hello Simon, thanks for your response and suggestion.&lt;br /&gt; to clarify i just assume that i2c bus can have multiple i2c sensors on&lt;br /&gt; same bus provided they have unique slave address. with that in mind i&lt;br /&gt; connected my sensor to TWI_SCL_EXT and TWI_SDA_EXT pin which is also&lt;br /&gt; share with LIS2DH12. let me know if this is OK.&lt;br /&gt; &lt;br /&gt; if i have to connect an exclusive i2c pin using IO expanded, please do&lt;br /&gt; let me know&amp;nbsp; which are the pins can be used from P4 connector.&lt;br /&gt; &lt;br /&gt; also&amp;nbsp; i do not have any interrupt pin on my sensor, hence i can not&lt;br /&gt; use io interrupt driven - event handler. let me know best possible&lt;br /&gt; example.&lt;br /&gt; &lt;br /&gt; By the way connecting my sensor to P5 ( TWI_SCL_EXT, TWI_SDA_EXT )&lt;br /&gt; connector and then running my i2c sensor code as a standalone&lt;br /&gt; application ( using ble peripheral example from Sdk 15.0)&amp;nbsp; i&amp;#39;m able to&lt;br /&gt; read sensor data and pass this data to a custom BLE characteristics.&lt;br /&gt; however i do not have any event handling in that standalone&lt;br /&gt; application.&lt;br /&gt; &lt;br /&gt; trouble mounts only when i combine this code with Thingy FW which is&lt;br /&gt; basically non blocking implementation.&lt;br /&gt; &lt;br /&gt; thanks for your time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Nordic Thingy 52 - external I2C sensor device driver implementation</title><link>https://devzone.nordicsemi.com/thread/170113?ContentTypeID=1</link><pubDate>Fri, 08 Feb 2019 12:11:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c711e76-8ef9-4496-93c3-b42bb03d17f2</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I don&amp;#39;t see anything wrong initially, but it is diffiucult to say without seeing your custom made sensor driver. Remember to not use the same pins&amp;nbsp;for the SDA and SCL as any of the already connected sensor. An option is to connect the external sensor using the pins available due I/O expander, as Martin suggested in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/35364/nordic-thingy-52-nrf52840-dk"&gt;this&lt;/a&gt; post.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>