<?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>Do GPIO pins always need an interrupt + handler?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97403/do-gpio-pins-always-need-an-interrupt-handler</link><description>I have some GPIOs which will only be read on start-up (option switches) then disabled to save power. Is there another way apart from nrf_drv_gpiote_in_init() to set up &amp;amp; read the pin, or do I need to provide a dummy event handler? 
 (In the same project</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 08 Mar 2023 13:33:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97403/do-gpio-pins-always-need-an-interrupt-handler" /><item><title>RE: Do GPIO pins always need an interrupt + handler?</title><link>https://devzone.nordicsemi.com/thread/414148?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 13:33:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bbcc232-a526-487f-bf25-b5133a7cf63b</guid><dc:creator>Nick_RA</dc:creator><description>&lt;p&gt;OK great, thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Do GPIO pins always need an interrupt + handler?</title><link>https://devzone.nordicsemi.com/thread/414101?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 11:37:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d01986be-fd1c-4e31-bfdd-199e066eb4fe</guid><dc:creator>Frank Viganske</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;to read a GPIO only once at startup you don&amp;#39;t need an interrupt handler. You can use the functions documented here:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__gpio.html"&gt;https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__gpio.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For example to configure a single pin as input you can use&amp;nbsp;&lt;a class="el" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__gpio__hal.html#gaefea00d9967a6026bb462d7e183af1f5"&gt;nrf_gpio_cfg_input&lt;/a&gt;&lt;span&gt;&amp;nbsp;(uint32_t pin_number,&amp;nbsp;&lt;/span&gt;&lt;a class="el" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__gpio__hal.html#ga07e0c8c0b30499cf0a7b79dbe62d3fcc"&gt;nrf_gpio_pin_pull_t&lt;/a&gt;&lt;span&gt;&amp;nbsp;pull_config)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;then read the pin with&amp;nbsp;&lt;a class="el" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__gpio__hal.html#ga76870ecdd68f3e26eeea7ea3c5ad6b55"&gt;nrf_gpio_pin_read&lt;/a&gt;&amp;nbsp;(uint32_t pin_number), and then disable it with&amp;nbsp;&lt;a class="el" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__gpio__hal.html#ga27b1ada8d9f7e3a3db7bc9636582dbc0"&gt;nrf_gpio_cfg_default&lt;/a&gt;&amp;nbsp;(uint32_t pin_number).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Frank&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>