BPI-M2 ZERO + Android + GPIO?

Hi!

https://bananapi.gitbooks.io/bpi-m2-/content/en/androidsoftware.html

Android 4.4 can be installed in M2-ZERO? From this Android image can access to the M2 ZERO 40 pin GPIO header???

Hi Anafry,

I was having exactly same question. After robuts googling I came up with a way.

Please note that following the lower and upper cases is very importnat in naming convention !

  1. dowload the libgpi_jni from /system/lib on android or build it from android sources at \frameworks\base\swextend\gpio\jni

  2. put the libgpi_jni to your projec folder location at app\src\main\jniLibs\armeabi-v7a (I am using android studio, for eclipse might be different)

  3. create new package in you project called com.softwinner

  4. copy the android\frameworks\base\swextend\gpio\java\Gpio.class from android sources in that package

  5. All done - now create a new class and import com.softwinner.Gpio From now you can use the basic functions and comunicate with GPIO.

THE BUG ! Here if found a problem and have no resolution so far. If annyone can help would be more than appreciated.

Function writeGpio and readGpio works well. However trying to set the pin as INPUT using setMulSel not really.

setMulSel should be writing into file mul_sel in respective port directory at /sys/class/gpio_sw/Pxx/mul_sel However none of the pins have such file in their directory.

Any help appreciated !

PS: Apologize my english…