How to access GPIO in Tiny210 board(Android)

kaushal patel
Hello sir
         I am working on Tiny210 board.and i want to access the GPIO of
Tiny 210 board. which method use access GPIO.and please tell me about the
Document which is provide me the information about the GPIO access.

Dave McLaughlin
Hi there,

I have some code that may work. It's a work in progress for me but it
should help you get it working.

Have a look here as I posted the links to the sourceforge entry I put up.

http://www.friendlyarm.net/forum/topic/3419

Kaushal patel
Hello sir 
          i am not that much of familiar with the android environment. and
i would like to create the 4x4 KEYBOARD with use of GPIO.
          so please tell me step by step procedure to implement and how to
access the GPIO of Tiny210 board.


i learn the whole discussion from link provided by you. but i was not able
to digest the discussion.
 
 please help me.

Kaushal patel
i am using eclipse Android environment

Girish
Hello Dave Sir,
    I am working on Tiny210 board and i want to access the GPIO of
Tiny 210 board.
I go for topic http://www.friendlyarm.net/forum/topic/3419 and check your
sourceforge link for GPIO but there are no downloads available
https://sourceforge.net/p/friendlyarmgpio/ 

can you please pm me on girish2k44@gmail.com.

Thanks in advance

Regards
Girish

Dave McLaughlin
Hi Girish,

Click on the CODE icon and you will get the files. You will need SVN to
check it out but it will work.

Try this link.

http://sourceforge.net/p/friendlyarmgpio/code-0/5/tree/

Dave...

Girish
Hello Dave Sir,
Thanks for reply
i run command in shell
$ mkdir gpio
$ cd gpio
$ svn checkout svn://svn.code.sf.net/p/friendlyarmgpio/code-0/trunk
friendlyarmgpio-code-0

but i get only this file tree and no source files, what mistake i am doing

$ df

        ./friendlyarmgpio-code-0/.svn/text-base
  ./friendlyarmgpio-code-0/.svn/props
  ./friendlyarmgpio-code-0/.svn/tmp/text-base
  ./friendlyarmgpio-code-0/.svn/tmp/props
  ./friendlyarmgpio-code-0/.svn/tmp/prop-base
  ./friendlyarmgpio-code-0/.svn/tmp
  ./friendlyarmgpio-code-0/.svn/prop-base
  ./friendlyarmgpio-code-0/.svn
  ./friendlyarmgpio-code-0

Regards
Girish

Dave McLaughlin
OK, I just tried this myself and got the same issue. I am not 100% familiar
with SVN but I will look into why it is not working and get back to you
ASAP.
Sorry for the hassle. 

In the mean time I will send you a copy to your email address!! 

Cheers
Dave...

Girish
Thankyou Dave Sir,

I received your mail with code

but one more problem, i tried it to open with Eclipse which is configured
with ADT tools but it is not taking project, can you please tell me how to
open project

Regards
Girish

Dave McLaughlin
Hi Girish,

This is not a complete Eclipse project. You need to add these files to your
project and then you run the make-jni.bat file to build the JNI.

You will need the Android NDK to build the JNI code. The Android SRC code
is simply added to your existing project.

http://developer.android.com/tools/sdk/ndk/index.html

Dave...

Danijel
Hi Dave,
I finally had enough time to make jni and test this thing. After few hours
I managed to compile jni.
But now I got to the point that I dont know what is happening. Seems that
code is not working, probably becouse I did something wrong.
Here is my Android code:

public void onCreate(Bundle savedInstanceState) {  armio nativeLib;       
  super.onCreate(savedInstanceState);  
  setContentView(R.layout.main); 

  nativeLib = new armio(); 
  Log.v("GPIO10", String.valueOf(nativeLib.readGPIO("GPIO10")));

  nativeLib.setdirectionGPIO("GPIO181", 1);
  nativeLib.setoutputGPIO("GPIO181", 1);

  Log.v("GPIO181", String.valueOf(nativeLib.readGPIO("GPIO181")));
}


But result is always 0
Any hints?
TIA
Danijel

Danijel
My mistake in previous post, code is actually working.
There is another issue, first time I set: 

nativeLib = new AxonIO();
nativeLib.setdirectionGPIO("gpio48", 1);
nativeLib.setoutputGPIO("GPIO181", 1); 
nothing happens, value remains 0 (LOW) but when I do it again, code start
to work and I see GPIO status changes

Any help?

Dave McLaughlin
Hi Danijel

Sorry, have been busy. I was working on it this week but not finished. Off
overseas for 2 weeks so when I return I will have a closer look at this. I
found some stuff on how to debug the NDK so I will try that out at the same
time.

Sorry I can't help just now. Overloaded with other paid work! :)

Dave McLaughlin
Hi Danijel,

Not sure if you are still working on this. I finally got time tonight to
get the JNI working. My error was in the JNI naming convention. It is case
sensitive :)

I will try tomorrow night to see if there is actual GPIO activity but for
now all the calls work. I have not yet tested the GPIO for actual changes
but this is good progress so far.

Dave...
PS.. Next step is to add control into the Kernel so that the power supply
state can be monitored external to my application.

AMA
Hi Dave,

Thank you for the tips so far

Could you please add the rest of the codes for accessing GPIOs in android.
May be upload the java file for it 

Thanks

AMA
Hello Danijel,

Do you have the working codes for accessing GPIO. Could you please upload
the link for it somewhere.

Thanks in advance.