From: shashidhara <sha...@gm...> - 2009-07-03 14:28:53
|
Hello , I have written a device driver to make use of the gpio to trigger interrupts. I have attached a part of the whole code. You can try using it. I have attached the makefile as well. Edit the path to kernel source in the makefile. shashi. > Date: Tue, 30 Jun 2009 01:39:42 -0700 (PDT) > From: cruizbugs <cru...@ya...> > Subject: [Gumstix-users] GPIO programming and Interrupts > To: gum...@li... > Message-ID: <242...@ta...> > Content-Type: text/plain; charset=us-ascii > > > Hi, I have a few questions. > > I have a task to make my gumstix to control a switch. > > So, I am using a GPIO 28 to control the external device. > I understand that I can use > # echo "GPIO out set" > /proc/gpio/GPIO28 > # echo "GPIO out clear" > /proc/gpio/GPIO28 > to control the pin output manually, but what I have to do is to make an > automatic on-off. > meaning, > I will have to read from a .txt file that contains all the day and time to > on/off. > this text file will turn on-off the switch every few minutes, i.e. > Monday 01:00 am ON > Monday 01:02 am OFF > Monday 01:05 am ON > Monday 01:59 am OFF > etc.. > > So, regarding this task and since i'm still new to linux, > 1. i was thinking what programming language I should use? C or C++ ? which > one easier? > > 2. i found this http://docwiki.gumstix.org/index.php/Sample_code/C/gpregs > how to run this file ? does this work for verdex pro XL6P ? i'm using GPIO > on consoleLCD16 > > 3. Is there any idea on how to do this effectively? > I was being told to try to use interrupt, for example, for every minute i > will receive an interrupt, then i will read the list of the timing and > check > out if I have to on or off the switch. > but the problem is, how to set this kind of interrupt? i heard about kernel > programming, but i'm still quite lost here. > or is there any other better way to do this task? > I saw http://docwiki.gumstix.org/GPIO_event , but i dont think this is > related to what I have to do, right ?? > > sorry I ask alot. > Thanks you in advance :-) > > > > > |