Hello,

Thanks again Conor for the quick information. Yes I already read your wiki page that was pretty useful.

Through the wiki/Gumstix list, I have got a link "http://wiki.gumstix.org/index.php?title=User_GPIO_Driver", that provides some driver code to serve as GPIO library. As far as I understood, I can just include these files in my code, add bb files path to bblayers.conf and compile as loadable module and then load module using "insmod". Right?

The doubts I have are:

1. "You can use as many pins as you want to as long as they aren't being used already " ==> does it mean that I can use all the 40 pins as GPIO pins and configure them as inputs (using the information on "http://wiki.gumstix.org/index.php?title=Duovero_Multiplexes")?

2. If yes, I am confused about maintaining the order of data from multiple pins. OR I need to program the input device to throw data in particular order over the pins (or fix the bits sent to a pin)? And I suppose I need to concatenate all these bits received on pins to make proper bytes, correct?
Thanks and regards
Gaurav
On 09/12/2013 14:13, Conor O'Rourke wrote:
Doing it this way you could bitbanging. The format of data from sysfs
is ascii. Ie: it's a "1" not a 1 or even a '1'! You can configure the
pins as inputs and outputs either via uboot or via debugfs. I made up
a page describing some of that on the wiki
(http://wiki.gumstix.org/index.php?title=Duovero_Multiplexes) which I
hope will help you. You can use as many pins as you want to as long as
they aren't being used already. Eg: I'm testing right now by switching
MCSPI1_* on the parlor interface and toggling the lines via GPIO. For
an example in C a quick google gave me this:

http://stackoverflow.com/questions/11375884/reading-a-port-gpio-value-in-c-beagleboard-xm

I suppose realistically you are supposed to use a driver to maintain a
sequence at a particular time but you can do direct GPIO register
manipulation using /dev/mem (not for faint hearted). There is an
example for the Raspberry Pi here:
http://elinux.org/RPi_Low-level_peripherals

But bear in mind that the register base numbers are likely different.

Conor.

On Mon, Dec 9, 2013 at 10:33 AM, Gaurav Chaturvedi
<gaurav.chaturvedi@nsl.eu.com> wrote:
Hello All,

I am using Duovero board (OMAP 44xx, Cortex A-9) with Parlor expansion
board. I want to use the GPIO pins as inputs and store the data on
filesystem (through C program). Have been through some tutorials, but
most of them are related to OMAP3xxx.

What I understood is that I can open files e.g.
"/sys/class/gpio/gpio122/value" as binary file and read the value. But,
I am not getting a clear idea about the following:

1. Format of data to be read.
2. How to configure the pins as Input
3. How many pins I can use to get the input stream of data.
4. How will I maintain the sequence of data from multiple pins.

Any quick help is highly appreciated. Thanks in advance.

Cheers
Gaurav


------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
gumstix-users mailing list
gumstix-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gumstix-users

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
gumstix-users mailing list
gumstix-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gumstix-users