<?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>i.MX ProcessorsのトピックGPIO that enable Interrupt and write string on console</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-that-enable-Interrupt-and-write-string-on-console/m-p/225356#M15807</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;how modified mx53_loco.c for to obtain an interrupt from a GPIO(is a button) and when is enabled write a string on Console?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have found this from the web:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static irqreturn_t button_interrupt(int irq, unsigned long data)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;printk(KERN_INFO "Hello World\n");&lt;/P&gt;&lt;P&gt;tasklet_schedule(&amp;amp;my_tasklet);&lt;/P&gt;&lt;P&gt;return IRQ_HANDLED;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static int __init hello_start(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;int ret;&lt;/P&gt;&lt;P&gt;printk(KERN_INFO "Loaded hello module....\n");&lt;/P&gt;&lt;P&gt;ret = request_irq(gpio_to_irq(163), button_interrupt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; IRQF_DISABLED | IRQF_TRIGGER_FALLING,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; "hello", NULL);&lt;/P&gt;&lt;P&gt;if(ret){&lt;/P&gt;&lt;P&gt;&amp;nbsp; printk(KERN_ERR "Failed to request IRQ\n");&lt;/P&gt;&lt;P&gt;&amp;nbsp; return ret;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;return 0;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont undstand this code:&amp;nbsp; tasklet_schedule(&amp;amp;my_tasklet);&lt;/P&gt;&lt;P&gt;GPIO is 6_3 with interrupt 105.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cat value -----&amp;gt; 0 when is pressed; 1 when isnt pressed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where i must put this code in my mx53_loco.c?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Jan 2013 11:48:47 GMT</pubDate>
    <dc:creator>enaud</dc:creator>
    <dc:date>2013-01-15T11:48:47Z</dc:date>
    <item>
      <title>GPIO that enable Interrupt and write string on console</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-that-enable-Interrupt-and-write-string-on-console/m-p/225356#M15807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;how modified mx53_loco.c for to obtain an interrupt from a GPIO(is a button) and when is enabled write a string on Console?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have found this from the web:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static irqreturn_t button_interrupt(int irq, unsigned long data)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;printk(KERN_INFO "Hello World\n");&lt;/P&gt;&lt;P&gt;tasklet_schedule(&amp;amp;my_tasklet);&lt;/P&gt;&lt;P&gt;return IRQ_HANDLED;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static int __init hello_start(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;int ret;&lt;/P&gt;&lt;P&gt;printk(KERN_INFO "Loaded hello module....\n");&lt;/P&gt;&lt;P&gt;ret = request_irq(gpio_to_irq(163), button_interrupt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; IRQF_DISABLED | IRQF_TRIGGER_FALLING,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; "hello", NULL);&lt;/P&gt;&lt;P&gt;if(ret){&lt;/P&gt;&lt;P&gt;&amp;nbsp; printk(KERN_ERR "Failed to request IRQ\n");&lt;/P&gt;&lt;P&gt;&amp;nbsp; return ret;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;return 0;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont undstand this code:&amp;nbsp; tasklet_schedule(&amp;amp;my_tasklet);&lt;/P&gt;&lt;P&gt;GPIO is 6_3 with interrupt 105.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cat value -----&amp;gt; 0 when is pressed; 1 when isnt pressed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where i must put this code in my mx53_loco.c?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2013 11:48:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-that-enable-Interrupt-and-write-string-on-console/m-p/225356#M15807</guid>
      <dc:creator>enaud</dc:creator>
      <dc:date>2013-01-15T11:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO that enable Interrupt and write string on console</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-that-enable-Interrupt-and-write-string-on-console/m-p/225357#M15808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Where are you defining the GPIO pin in you code? you should use DEFINE function called IMX_GPIO_NR(6, 3)&lt;/P&gt;&lt;P&gt;tasklet_schedule function means that you are starting a tasklet or "small thread" on the kernel to attend the ISR without blocking the whole system.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Apr 2013 15:34:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-that-enable-Interrupt-and-write-string-on-console/m-p/225357#M15808</guid>
      <dc:creator>AlejandroSierra</dc:creator>
      <dc:date>2013-04-15T15:34:22Z</dc:date>
    </item>
  </channel>
</rss>

