<?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>Disable and clearing pending GPIO interrupt</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92525/disable-and-clearing-pending-gpio-interrupt</link><description>Hi, 
 
 In my app I want to (for a moment) disable external interrupt for GPIO pin and also clear eventual pending interrupt on it. And in a little moment I want to reenable this interrupt. 
 Now I enable the irq like that: gpio_pin_interrupt_configure_dt</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Oct 2022 14:50:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92525/disable-and-clearing-pending-gpio-interrupt" /><item><title>RE: Disable and clearing pending GPIO interrupt</title><link>https://devzone.nordicsemi.com/thread/389031?ContentTypeID=1</link><pubDate>Mon, 03 Oct 2022 14:50:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4274e3df-3914-4656-9309-9535cb04c481</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Jan,&lt;/p&gt;
[quote user=""]1) How to disable this interrupt?[/quote]
&lt;p&gt;You can call&amp;nbsp;&lt;em&gt;gpio_pin_interrupt_configure_dt(&amp;amp;btn, GPIO_INT_DISABLE)&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
[quote user=""]2) How to clear pending interrupt (I want to do it before I reenable it)?[/quote]
&lt;p&gt;After you disable interrupt, there should be no new ones to worry about.&lt;br /&gt;I can imagine there are some corner cases where an interrupt already pending when you disable the interrupt will slip through. However I don&amp;#39;t know the necessary API to simulate such situations right now.&lt;br /&gt;Do you need to worry about corner cases like that?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>