<?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>nRF9160 gpiote example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/46650/nrf9160-gpiote-example</link><description>Hi, 
 I want to get interrupt on GPIO using gpiote module. 
 I searched for example but couldn&amp;#39;t get it. 
 Can you guide me how to use gpiote in nRF9160 ? 
 
 Regards, 
 Smitesh Mali</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 02 May 2019 12:16:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/46650/nrf9160-gpiote-example" /><item><title>RE: nRF9160 gpiote example</title><link>https://devzone.nordicsemi.com/thread/184884?ContentTypeID=1</link><pubDate>Thu, 02 May 2019 12:16:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2582195-a18c-4c65-ae18-5b1df32d279c</guid><dc:creator>khodidas</dc:creator><description>&lt;p&gt;Hi Martin,&lt;/p&gt;
&lt;p&gt;I was able to configure interrupt on gpio using API provided in &amp;quot;gpio.h&amp;quot;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My code is below.&lt;/p&gt;
&lt;p&gt;struct device *gpio_int1;&lt;/p&gt;
&lt;p&gt;struct gpio_callback gpio_cb;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;gpio_int1 = device_get_binding(DT_GPIO_P0_DEV_NAME);&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; gpio_pin_configure(gpio_int1, INT1_PIN, (GPIO_DIR_IN | GPIO_INT | GPIO_INT_EDGE | GPIO_PUD_PULL_DOWN | GPIO_INT_ACTIVE_HIGH ) );&lt;br /&gt; gpio_init_callback(&amp;amp;gpio_cb, gpiote1_interrupt, BIT(INT1_PIN));&lt;br /&gt; gpio_add_callback(gpio_int1,&amp;amp;gpio_cb);&lt;br /&gt; &lt;br /&gt; error = gpio_pin_enable_callback(gpio_int1,INT1_PIN);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Smitesh Mali&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 gpiote example</title><link>https://devzone.nordicsemi.com/thread/184419?ContentTypeID=1</link><pubDate>Tue, 30 Apr 2019 03:31:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87248a46-ab24-461e-a5bb-cdde4b550f42</guid><dc:creator>khodidas</dc:creator><description>&lt;p&gt;Hi Martin,&lt;/p&gt;
&lt;p&gt;The blinky example and the zephyr documentation seems for configuring input/output mode of GPIO and toggling the GPIO state only.&lt;/p&gt;
&lt;p&gt;I want an example which can configure a pin as gpiote to get interrupt when state of that pin changes. (Just like we are doing in SDK 15.2 for nRF52840 ).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I was trying to add &amp;quot;nrfx_gpiote.c&amp;quot; file to the &amp;quot;asset tracker&amp;quot; project by adding macros to the proj.conf file like below&lt;/p&gt;
&lt;p&gt;CONFIG_GPIO=y&lt;br /&gt;CONFIG_GPIO_NRFX=y&lt;br /&gt;CONFIG_GPIO_NRF_P0=y&lt;br /&gt;CONFIG_NRFX_GPIOTE=y&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I also added below to the .overlay file&lt;/p&gt;
&lt;p&gt;&amp;amp;gpiote {&lt;br /&gt; status = &amp;quot;ok&amp;quot;;&lt;br /&gt; gpio-pin=&amp;lt;2&amp;gt;;&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But &amp;quot;nrfx_gpiote.c&amp;quot; file was not added.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;so can you help me to add that file ?&lt;/p&gt;
&lt;p&gt;Proper example to get gpiote interrupt would be even better.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Smitesh Mali&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 gpiote example</title><link>https://devzone.nordicsemi.com/thread/184341?ContentTypeID=1</link><pubDate>Mon, 29 Apr 2019 13:23:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e59fe3c2-180d-41f3-8a21-e57564158955</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Smitesh,&lt;/p&gt;
&lt;p&gt;You can use the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf9160%2Fgpiote.html&amp;amp;cp=2_0_0_5_4" rel="noopener noreferrer" target="_blank"&gt;GPIOTE&amp;nbsp;&lt;/a&gt;on the nrf9160 by the functions which are &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/peripherals/gpio.html" rel="noopener noreferrer" target="_blank"&gt;documented in zephyr.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can for example look at the &lt;a href="https://github.com/NordicPlayground/fw-nrfconnect-zephyr/tree/master/samples/basic/blinky" rel="noopener noreferrer" target="_blank"&gt;basic blinky sample in zephyr&lt;/a&gt;&amp;nbsp;and use that as reference.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>