<?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>two interupts on same gpiote with two different pins nrf5340</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/105815/two-interupts-on-same-gpiote-with-two-different-pins-nrf5340</link><description>hello, 
 i am using sdk 2.4.0 with nrf5340 i want to enable two diffferents buttons with interupts without disabling the one interupt because i need these two button for different scenario i cant basically trun off one interupt while using other 
 
 </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 22 Nov 2023 05:59:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/105815/two-interupts-on-same-gpiote-with-two-different-pins-nrf5340" /><item><title>RE: two interupts on same gpiote with two different pins nrf5340</title><link>https://devzone.nordicsemi.com/thread/456811?ContentTypeID=1</link><pubDate>Wed, 22 Nov 2023 05:59:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e94cb173-2025-40df-82a0-c8a6e4567aa1</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I don&amp;#39;t see any obvious errors in the code. Please try to debug your application in VS code and see if P1.11 becomes configured correctly after&amp;nbsp; the nrfx_gpiote_in_init() function has been run.&lt;/p&gt;
&lt;p&gt;It should look like this:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1700632679239v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: two interupts on same gpiote with two different pins nrf5340</title><link>https://devzone.nordicsemi.com/thread/456683?ContentTypeID=1</link><pubDate>Tue, 21 Nov 2023 13:24:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8403729f-6549-4a46-901d-7ea633a1053a</guid><dc:creator>manikandan</dc:creator><description>&lt;p&gt;hi,thanks for the reply if i set that to flag to flase button interupts were not detected this is how i am doing it&lt;pre class="ui-code" data-mode="text"&gt;#define BUTTON_2_Pin		43//_PINNUM(1, 11)	//B20(P1.11)
static void button_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{

	if (action == NRF_GPIOTE_POLARITY_LOTOHI &amp;amp;&amp;amp; pin == BUTTON_2_Pin)
	{
	//	printk(&amp;quot;MY HANDLING\n&amp;quot;);
		
	}
}
/* API Prototypes */
void gpio_init()
{

	nrfx_err_t err;

	/* Connect GPIOTE_0 IRQ to nrfx_gpiote_irq_handler */
	IRQ_CONNECT(DT_IRQN(DT_NODELABEL(gpiote)),
				DT_IRQ(DT_NODELABEL(gpiote), priority),
				nrfx_isr, nrfx_gpiote_irq_handler, 0);

	/* Initialize GPIOTE (the interrupt priority passed as the parameter
	 * here is ignored, see nrfx_glue.h).
	 */
	err = nrfx_gpiote_init(0);
	if (err != NRFX_SUCCESS)
	{
		// LOG_ERR(&amp;quot;nrfx_gpiote_init error: %08x&amp;quot;, err);
		return;
	}

	nrfx_gpiote_in_config_t const in_config = {
		.sense = NRF_GPIOTE_POLARITY_LOTOHI,
		.pull = NRF_GPIO_PIN_PULLUP,
		.is_watcher = false,
		.hi_accuracy = false,
		.skip_gpio_setup = false,
	};

	/* Initialize input pin to generate event on high to low transition
	 * (falling edge) and call button_handler()
	 */
	err = nrfx_gpiote_in_init(BUTTON_2_Pin, &amp;amp;in_config, button_handler);
	if (err != NRFX_SUCCESS)
	{
		// LOG_ERR(&amp;quot;nrfx_gpiote_in_init error: %08x&amp;quot;, err);
		return;
	}

	nrfx_gpiote_in_event_enable(BUTTON_2_Pin, true);
}

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;manikandan v&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: two interupts on same gpiote with two different pins nrf5340</title><link>https://devzone.nordicsemi.com/thread/456416?ContentTypeID=1</link><pubDate>Mon, 20 Nov 2023 13:00:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dca8fd05-1451-4f2d-b83d-119776509c5a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;That suggests you have used up all&amp;nbsp;8 GPIOTE channels. A solution is to GPIOTE PORT events to detect the button interrupts. This is done by setting the .hi_accuracy flag to &amp;#39;False&amp;#39;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: two interupts on same gpiote with two different pins nrf5340</title><link>https://devzone.nordicsemi.com/thread/456412?ContentTypeID=1</link><pubDate>Mon, 20 Nov 2023 12:58:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e2d892e-3129-4fa0-924e-3c3037955356</guid><dc:creator>manikandan</dc:creator><description>&lt;p&gt;It only happens when I try to enable the both&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: two interupts on same gpiote with two different pins nrf5340</title><link>https://devzone.nordicsemi.com/thread/456410?ContentTypeID=1</link><pubDate>Mon, 20 Nov 2023 12:54:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe64c611-bb93-49aa-9596-b17bfaef08ab</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I misread the code at first.&amp;nbsp;Do you get the&amp;nbsp;&amp;#39;NRFX_ERROR_NO_MEM&amp;#39; error when you only try enable button interrupt for&amp;nbsp;&lt;span&gt;BUTTON_2_pin and not the BUTTON_1_pin, or does it only happen when you try to enable both?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: two interupts on same gpiote with two different pins nrf5340</title><link>https://devzone.nordicsemi.com/thread/456406?ContentTypeID=1</link><pubDate>Mon, 20 Nov 2023 12:49:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6ab2b9e-fa64-4c1d-adff-4b8da9d68b19</guid><dc:creator>manikandan</dc:creator><description>&lt;p&gt;I have mentioned BUTTON_1_PIN and BUTTON_2_pin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: two interupts on same gpiote with two different pins nrf5340</title><link>https://devzone.nordicsemi.com/thread/456402?ContentTypeID=1</link><pubDate>Mon, 20 Nov 2023 12:46:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f19e0f2-48b7-4854-97a0-faead0bedb1e</guid><dc:creator>manikandan</dc:creator><description>&lt;p&gt;Hi sry&amp;nbsp; not same pin two different pins can you verify my code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: two interupts on same gpiote with two different pins nrf5340</title><link>https://devzone.nordicsemi.com/thread/456398?ContentTypeID=1</link><pubDate>Mon, 20 Nov 2023 12:42:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ead1ae34-aeda-4691-8f0d-9d2f36cbd59e</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello &lt;span&gt;Manikandan&lt;/span&gt;,&lt;/p&gt;
&lt;p&gt;It&amp;#39;s not possible to register two callbacks on the same pin. Would it be an option to register a single callback and create a global state flag or similar mechanism, which you can check in the button callback to determine how the event should be handled?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>