Power & Source of Big Ideas

GPIO under Android

Moderators: chensy, FATechsupport

Has anyone been able to do GPIO read or write without using the FriendlyArm library?

The library they have requires you to build your app as part of the system which makes debugging and testing virtually impossible.

I have a driver from the past but the directory structure for the GPIO is different. Under the /sys/class/gpio directory I can see gpiochip64 for GPIOC but I can't figure out how to use this as nothing appears if I LS it. cd into it and it seems to a link.

Any clues as to how to do it without a system build?
I have worked this out and I now have a JNI under Android that requires no signing with the system keys and can be run from normal app level development and no special permissions.

I'll see about putting this up on GITHUB shortly if anyone else is interested.

This code does basic GPIO and I2C. For PWM you will need a different driver.
i would really be interested - is it on github already?
dvoeckler wrote:
i would really be interested - is it on github already?


I've uploaded it this morning. Sorry for the delay.

https://github.com/davemclaughlin/GPIOdriver

Let me know if you have any issues with getting it to work. As long as the export directory is user accessible, it should all work nicely.

Who is online

In total there are 7 users online :: 0 registered, 0 hidden and 7 guests (based on users active over the past 5 minutes)
Most users ever online was 825 on Wed Aug 28, 2019 3:18 pm

Users browsing this forum: No registered users and 7 guests