Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to generate interrupt by GPIO button
Forum Updated to NodeBB v4.3 + New Features

How to generate interrupt by GPIO button

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 2 Posters 1.4k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rahul Chauhan
    wrote on last edited by
    #1

    Hi
    I am working on ARM AM335x processor and linux operating system.
    I want to make my app Interrupt based.I Want to set the Text on the Qlabel on pressing the gpio button.on pressing the button /sys/gpio/gpioN/value this value file content changes from '1" to "0" and on releasing
    again becomes 0.means by default this value file value is "0".actually I have develop my Application in polling mode i have continiously monitoring the value file content and based on that performing the task. but my requirement is interrupt driven.how can i generate interrupt from this gpio button.

    i used QFileSystemWatcher for monitoring the file and emit the signal filechanged() and connect it to a slot whhich is setting the text.but the problem it is monitor the file and emmit the signal only one time it is not monitoring file again. if i connect it again in the slot.

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      @Rahul-Chauhan AFAIK all the hardware data is read and written by the kernel into the sys virtual filesystem. So you have no other option that polling. If QFileSystemWatcher doesnot suits you needs go more further and try inotify and if that is not sufficient have a look at the kernel sysfs API. I'm not sure how you could do that from kernel space(may be kernel module ?) but from the user space you have no other option than polling IMO.
      Have you tried QSocketNotifier instead ?

      157

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved