BUG Community

Welcome! Log In

Forums BUGmodules VonHippel GPIO Question

Subscribe to VonHippel GPIO Question  4 posts, 2 voices

Log in to reply to this topic
 
Feb 17, 2009 9:40pm
Img_missing_medium mgurr 2 posts

I’m having difficulties understanding how to use these pins. I can set them to make them inputs and outputs. I can also set each output pin to a 1 or 0. What I’m struggling with is how to read in from the input pins.

Thank you for your help. :D

Feb 19, 2009 11:23am
Medium Bug Labs team jconnolly 285 posts

mgurr
I'm having difficulties understanding how to use these pins. I can set them to make them inputs and outputs. I can also set each output pin to a 1 or 0. What I'm struggling with is how to read in from the input pins.

Thank you for your help. :D


Greetings mgurr,

The way to get the GPIO information from the VH device is to use the IVonHippelModuleControl interface, and getStatus() method. This returns an integer with the status of the GPIO pins encoded.

http://svn.buglabs.net/svn/!source/8228/bug/tags/release_candidates/RC1.4.7/com.buglabs.bug.module.vonhippel/com/buglabs/bug/module/vonhippel/pub/IVonHippelModuleControl.java#79

The encoding format can be found here:

http://svn.buglabs.net/svn/!source/8228/bug/tags/release_candidates/RC1.4.7/bug-linux-2.6.27.2/drivers/bmi/pims/vonhippel/bmi_vh.c#501

I'll get back to you about specifically which bits in the integer are the GPIO pin status bits.

It's bears mentioning that the bitwise operations will be abstracted out in a more Object Oriented manner with the next Von Hippel API enhancement.

Hope this helps.

-John
Feb 24, 2009 2:36pm
Medium Bug Labs team jconnolly 285 posts

mgurr,

I’ve posted an app on BUGnet that should clarify the use of the GPIO pins on the VonHippel module. http://buglabs.net/applications/VHGPIOExample

It just spawns two threads: one to read the GPIO state, the other to intermittently toggle GPIO pin 0 to high/low. You can wire pin 0 to any other pin to verify.

Feb 25, 2009 5:06pm
Img_missing_medium mgurr 2 posts

Thank you very much. :D

Log in to reply to this topic
Forums BUGmodules VonHippel GPIO Question

Powered by Community Engine

Top
Login