<?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>nRF52840-DK GPIOTE with FreeRTOS Tasks</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57319/nrf52840-dk-gpiote-with-freertos-tasks</link><description>Hi all, 
 I am trying to generally gain a better understanding of the GPIOTE module and how it can benefit myself in the project I am working on. 
 I am essentially attempting to leverage the functionality of FreeRTOS Tasks, whilst also using GPIOTE.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 07 Feb 2020 08:12:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57319/nrf52840-dk-gpiote-with-freertos-tasks" /><item><title>RE: nRF52840-DK GPIOTE with FreeRTOS Tasks</title><link>https://devzone.nordicsemi.com/thread/233194?ContentTypeID=1</link><pubDate>Fri, 07 Feb 2020 08:12:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cca0b175-350b-4e50-833f-58f2962b296b</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;An example on how to register for GPIOTE IN event with an event handler is shown in a very simple and clean way in&amp;nbsp;nRF5_SDK_16.0.0_98a08e2/examples/peripheral/pin_change_int/main.c., this is exactly what you seek with GPIOTE as far as I understand.&lt;/p&gt;
&lt;p&gt;Connecting the above example to tasks notifications and event handlers is a very straight forward task. Please attempt to do a template of your work and we can discuss here more on the challenges you are facing once you started to merge GPIOTE and FreeRTOS task notifications.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840-DK GPIOTE with FreeRTOS Tasks</title><link>https://devzone.nordicsemi.com/thread/232998?ContentTypeID=1</link><pubDate>Thu, 06 Feb 2020 09:59:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d70f3bd9-cb94-478b-bebd-efe265644502</guid><dc:creator>mpw</dc:creator><description>&lt;p&gt;Thank you, Susheel.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have spent a few days and I still don&amp;#39;t feel I understand GPIOTE any better with the documentation available for the SDK 16.0.&lt;/p&gt;
&lt;p&gt;It has notes on the documentation saying to use the legacy layer, but then proceeds to say to use GPIOTE registration and initialise the module with:&lt;/p&gt;
&lt;p&gt;&lt;a class="code" title="Macro for initializing the GPIOTE module." href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/group__app__gpiote.html#gaed385f30da9f44fb5bf4591eef4d27d9"&gt;&lt;/a&gt;&lt;pre class="ui-code" data-mode="text"&gt;APP_GPIOTE_INIT(MAX_USERS);&lt;/pre&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;What I am trying to achieve seems simple conceptually, but I wish to use the SDK correctly for future compatibility.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I want to register 1 pin for a transition from HIGH to LOW, then when that takes place I want a handler to be called and clear the interrupt (this is hard to find, too, is it handled automatically?), do some processing/raise a flag, then exit the handler.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The examples in the SDK don&amp;#39;t make use of registration or anything of that sort and most of the handlers in the examples are using dummy handlers.&lt;/p&gt;
&lt;p&gt;What is the correct way to use the GPIOTE module for simply initialisation, setting a config for high to low, passing a handler to GPIOTE module for callback, and then clearing that interrupt when inside the handler? It seems like a very powerful feature to have that I want to utilise properly.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Michael&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840-DK GPIOTE with FreeRTOS Tasks</title><link>https://devzone.nordicsemi.com/thread/232468?ContentTypeID=1</link><pubDate>Tue, 04 Feb 2020 08:41:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a25fab0-d45f-4d62-b0a6-fa07e8a6ecd9</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi mpw,&lt;/p&gt;
&lt;p&gt;What you are trying to achieve is quite simple using GPIOTE interrupts and FreeRTOS &lt;a href="https://www.freertos.org/RTOS-task-notification-API.html"&gt;task notifications&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There are no direct examples of what you wanted to do, but configuring the GPIOTE to generate the interrupt with state changes on the pin you want and controlling which task to resume using the task notification is quite straightforward thing to do.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>