<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: 2 lwgpio interrupt handlers for 2 different pins in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/2-lwgpio-interrupt-handlers-for-2-different-pins/m-p/282461#M8848</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have just responded to the thread with some c and h files to solve this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Albert Calpito &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ayantra&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;47873 Fremont Blvd,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fremont. CA 94538&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;lt;http://www.ayantra.com&amp;gt; &lt;A href="https://community.nxp.com/www.ayantra.com" target="test_blank"&gt;www.ayantra.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;510-623-7526 Office&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;510-552-4399 Cell&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;510-623-7839 &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Jul 2013 19:01:26 GMT</pubDate>
    <dc:creator>albertcalpito</dc:creator>
    <dc:date>2013-07-23T19:01:26Z</dc:date>
    <item>
      <title>2 lwgpio interrupt handlers for 2 different pins</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/2-lwgpio-interrupt-handlers-for-2-different-pins/m-p/282457#M8844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been trying to initialize 2 separate gpio pins to have 2 separate interrupt handlers, however they seem to only be linked to the 2nd handler i initialize.&amp;nbsp; Is there some hardware restriction I am missing where 2 pins of the same port must share 1 interrupt hander?&amp;nbsp; I am seeing that although they are different pins, that the lwgpio_int_get_vector function is returning the same value for both.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LWGPIO_STRUCT column_1;&lt;/P&gt;&lt;P&gt;LWGPIO_STRUCT column_2;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lwgpio_init(&amp;amp;column_1, (GPIO_PORT_B | GPIO_PIN17), LWGPIO_DIR_INPUT, LWGPIO_VALUE_NOCHANGE);&lt;BR /&gt;lwgpio_set_functionality(&amp;amp;column_1, 1);&lt;BR /&gt;lwgpio_set_attribute(&amp;amp;column_1, LWGPIO_ATTR_PULL_DOWN, LWGPIO_AVAL_ENABLE);&lt;BR /&gt;lwgpio_int_init(&amp;amp;column_1, LWGPIO_INT_MODE_RISING);&lt;BR /&gt;_int_install_isr(lwgpio_int_get_vector(&amp;amp;column_1), column_1_button_pressed_function, (void *) &amp;amp;column_1);&lt;BR /&gt;_bsp_int_init(lwgpio_int_get_vector(&amp;amp;column_1), 3, 0, TRUE);&lt;BR /&gt;lwgpio_int_enable(&amp;amp;column_1, TRUE);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lwgpio_init(&amp;amp;column_2, (GPIO_PORT_B | GPIO_PIN18), LWGPIO_DIR_INPUT, LWGPIO_VALUE_NOCHANGE);&lt;BR /&gt;lwgpio_set_functionality(&amp;amp;column_2, 1);&lt;BR /&gt;lwgpio_set_attribute(&amp;amp;column_2, LWGPIO_ATTR_PULL_DOWN, LWGPIO_AVAL_ENABLE);&lt;BR /&gt;lwgpio_int_init(&amp;amp;column_2, LWGPIO_INT_MODE_RISING);&lt;BR /&gt;_int_install_isr(lwgpio_int_get_vector(&amp;amp;column_2), column_2_button_pressed_function, (void *) &amp;amp;column_2);&lt;BR /&gt;_bsp_int_init(lwgpio_int_get_vector(&amp;amp;column_2), 3, 0, TRUE);&lt;BR /&gt;lwgpio_int_enable(&amp;amp;column_2, TRUE);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;vector_value = lwgpio_int_get_vector(&amp;amp;column_1);&lt;BR /&gt;vector_value = lwgpio_int_get_vector(&amp;amp;column_2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void column_1_button_pressed_function(void *pin)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; printf("1\r\n");&lt;BR /&gt;&amp;nbsp; lwgpio_int_clear_flag((LWGPIO_STRUCT_PTR) pin);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void column_2_button_pressed_function(void *pin)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; printf("2\r\n");&lt;BR /&gt;&amp;nbsp; lwgpio_int_clear_flag((LWGPIO_STRUCT_PTR) pin);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13706530224107646" jivemacro_uid="_13706530224107646"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Jun 2013 01:00:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/2-lwgpio-interrupt-handlers-for-2-different-pins/m-p/282457#M8844</guid>
      <dc:creator>albertcalpito</dc:creator>
      <dc:date>2013-06-08T01:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: 2 lwgpio interrupt handlers for 2 different pins</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/2-lwgpio-interrupt-handlers-for-2-different-pins/m-p/282458#M8845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello albert calpito,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you almost answered your question. I would recommend read NVIC part in a reference manual. Each port has own interrupt handler which indicates that your two buttons on PORTB share same ISR.&lt;/P&gt;&lt;P&gt;There is even here a discussion about it and how they solved an identification which button was pushed in ISR. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;c0170&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Jun 2013 06:17:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/2-lwgpio-interrupt-handlers-for-2-different-pins/m-p/282458#M8845</guid>
      <dc:creator>c0170</dc:creator>
      <dc:date>2013-06-08T06:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: 2 lwgpio interrupt handlers for 2 different pins</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/2-lwgpio-interrupt-handlers-for-2-different-pins/m-p/282459#M8846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I am having similar issue, can you please point to the discussion of how to resolve it.&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Nikhil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2013 10:10:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/2-lwgpio-interrupt-handlers-for-2-different-pins/m-p/282459#M8846</guid>
      <dc:creator>nikhilsarnaik</dc:creator>
      <dc:date>2013-07-23T10:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: Re: 2 lwgpio interrupt handlers for 2 different pins</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/2-lwgpio-interrupt-handlers-for-2-different-pins/m-p/282460#M8847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hello Nikhil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see the attached files.&amp;nbsp; I've written an init function that will map interrupt events for the gpio's to their specific interrupt handlers.&amp;nbsp; The interrupt handlers will set the event that was specified in the init structure. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tested this for a few gpios at a time, and basic functionality seems to be working. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2013 19:00:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/2-lwgpio-interrupt-handlers-for-2-different-pins/m-p/282460#M8847</guid>
      <dc:creator>albertcalpito</dc:creator>
      <dc:date>2013-07-23T19:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: 2 lwgpio interrupt handlers for 2 different pins</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/2-lwgpio-interrupt-handlers-for-2-different-pins/m-p/282461#M8848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have just responded to the thread with some c and h files to solve this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Albert Calpito &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ayantra&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;47873 Fremont Blvd,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fremont. CA 94538&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;lt;http://www.ayantra.com&amp;gt; &lt;A href="https://community.nxp.com/www.ayantra.com" target="test_blank"&gt;www.ayantra.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;510-623-7526 Office&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;510-552-4399 Cell&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;510-623-7839 &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2013 19:01:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/2-lwgpio-interrupt-handlers-for-2-different-pins/m-p/282461#M8848</guid>
      <dc:creator>albertcalpito</dc:creator>
      <dc:date>2013-07-23T19:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: 2 lwgpio interrupt handlers for 2 different pins</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/2-lwgpio-interrupt-handlers-for-2-different-pins/m-p/282462#M8849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Albert for your info, I fixed it, it was error in my code. I was not clearing the correct interrupt flag.&lt;/P&gt;&lt;P&gt;Nikhil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jul 2013 14:20:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/2-lwgpio-interrupt-handlers-for-2-different-pins/m-p/282462#M8849</guid>
      <dc:creator>nikhilsarnaik</dc:creator>
      <dc:date>2013-07-31T14:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Re: 2 lwgpio interrupt handlers for 2 different pins</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/2-lwgpio-interrupt-handlers-for-2-different-pins/m-p/282463#M8850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Albert&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your sharing.&lt;/P&gt;&lt;P&gt;But still need your help.&lt;/P&gt;&lt;P&gt;I got an issue on lwevent settings.&lt;/P&gt;&lt;P&gt;I have assign a lwevent to a gpio.&lt;/P&gt;&lt;P&gt;But the handler task can not receive the lwevent even if interrupt occur and set the event.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 02:44:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/2-lwgpio-interrupt-handlers-for-2-different-pins/m-p/282463#M8850</guid>
      <dc:creator>kyleyang</dc:creator>
      <dc:date>2014-08-14T02:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: Re: 2 lwgpio interrupt handlers for 2 different pins</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/2-lwgpio-interrupt-handlers-for-2-different-pins/m-p/282464#M8851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Albert&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for bother you.&lt;/P&gt;&lt;P&gt;I fix this issue just now.&lt;/P&gt;&lt;P&gt;I find that missing some address map code in the "register_gpio_file".&lt;/P&gt;&lt;P&gt;It is works fine now.&lt;/P&gt;&lt;P&gt;Many thanks for your effort again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 03:13:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/2-lwgpio-interrupt-handlers-for-2-different-pins/m-p/282464#M8851</guid>
      <dc:creator>kyleyang</dc:creator>
      <dc:date>2014-08-14T03:13:13Z</dc:date>
    </item>
  </channel>
</rss>

