ANDROID GPIO user buttons in Beaglebone for

Skip to first unread message


Aug 22, 2012, 3:08:58 AM8/22/12
Hi everyone

      I'm working with ANDROID ICS  in beglebone, i'm developing my android device. I want to use 4 user buttons thee are
  1. Menu
  2. Back
  3. Home
  4. Power ON/OFF
In my beaglebone header the following gpio are available GPIO0_26 GPIO1_1, GPIO1_2, GPIO1_3, GPIO1_4, GPIO2_1, GPIO2_8 and etc.,

    In these GPIO i wanna use any 4 GPIO for my user buttons. For work properly where i have to change my code.

At where i can activate these gpio for my usage, how the key code can be assign for android, because i'm new to android.

Can any one help me.?

Thanks in advance.

Yu-Ping Dai

Aug 22, 2012, 12:54:33 PM8/22/12
Sorry, I can not sure.
Maybe this can help you something


2012/8/22 chainz <>

You received this message because you are subscribed to the Google Groups "0xlab-devel" group.
To view this discussion on the web visit
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at


Aug 23, 2012, 5:05:43 AM8/23/12
Thanks Mr.cam11505
                 But the links are not helpful for my topic.

This link is the answer for Beagleboard!topic/0xlab-devel/14hrKgjpBKE  this explain  how to modify the source file in AOSP but i'm using TI ANDROID ICS AOSP, the files mentioned in above link is not present in my AOSP.

I need clear idea about gpio configuration.

Aug 24, 2012, 10:38:38 AM8/24/12
I am also trying to the same thing and set certain GPIO pins to be certain keys on the Android Build.
If anyone has a definitive guide on how to do this it would be much appreciated.


Sep 3, 2012, 7:17:48 AM9/3/12
Hi david
            Did you completed this task.? can you tell me a details, i hope i can help yo. I've completed this after long struggle.

Sep 3, 2012, 7:46:18 AM9/3/12
Hi Chainz,
Thanks for the reply.

No as it happens I am still struggling to work out how to do this. If you could help in any way it would be very much appreciated.


Sep 3, 2012, 8:06:26 AM9/3/12
Hi Chainz,

I have not completed this task. I am still stuck, I would like to be able to define any of the GPIO pins on the beaglebone to be a specified button in the Android system. For example GPIO pin 16 is the Home button.

Any help would be much appreciated



Sep 4, 2012, 1:32:06 AM9/4/12
Hey david

Its not a big issue i'll explain you that how to do that. I am assuming that you are you using TI-Android source code.
In that GPIO1_16,17,31 is already implemented in lcd_cape_keys in board-am335xevm.c so its reduce our work. but this pins are active only if you are plugging your beaglebone LCD cape. but i guess you don't have LCD cape. 

I'm assuming you are using BB div cape for display. Do the following steps to make your GPIO work

1--> Configure the GPIO_Buttons in kernel ( its configured default in TI source code)
2--> Copy the lcd_cape_keys_init(DEV_ON_DGHTER_BRD,PROFILE_NONE)          ( line no--2449)
3--> Paste the line below the dvi_init(DEV_ON_DGHTER_BRD,PROFILE_NONE)      ( line no-- 2455)

Then as usual build the source code and boot BB in your android shell screen execute the " getevent" yo will see the 

add device 2: /dev/input/event2
   name: "gpio-keys"

If you can see this you have added the gpio driver node successfully . Then touch the p9-4 pin and gpio1_16 you will get some scanning code in your shell screen. if you can see this code your work is over, its will work for home,back,power off as configured in board.c file.

Note: If you are not using DIV cape paste the init function at where you want call the init function 

After try this let me know that you got it or not, because i wanna know my idea is working or not.

Good luck david.


Reply all
Reply to author
0 new messages