How to use USER1 USER2 Βuttons on i.MX53 lucid linux 10.04LTS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to use USER1 USER2 Βuttons on i.MX53 lucid linux 10.04LTS

Jump to solution
892 Views
TKs
Contributor II

Hi,

I want to use USER1 and USER2 Buttons.

If I push the USER2 button I want that a file named "text.txt" been copied from usb to home folder (after it is done a sound will be played).

If I press USER1 button a sh script will launch.

Any idea how to manage this?

Thanks in advance!

Labels (2)
0 Kudos
1 Solution
718 Views
igorpadykov
NXP Employee
NXP Employee

HI Christos

please look at below link

Using USERDEF1 and USERDEF2 GPIO's on IMX53 Ubuntu

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
2 Replies
719 Views
igorpadykov
NXP Employee
NXP Employee

HI Christos

please look at below link

Using USERDEF1 and USERDEF2 GPIO's on IMX53 Ubuntu

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
718 Views
TKs
Contributor II

thank you Igor!
much appreciated !

Now I get the following error

bash: echo: write error: Device or resource busy

I read that I have to unbind it with:

cd /sys/bus/platform/drivers/  XXX-gpio ; echo XXX-gpio >unbind

but which is our XXX name file for the volume control?

thanks!

EDIT (Solved):

(gpio-46 is USER1/Volume up and gpio-47 is USER2/Volume down, to confirm: cat /sys/kernel/debug/gpio)

here is what I did

cd /sys/bus/platform/drivers/gpio-keys

echo gpio-keys > unbind

echo 46 > /sys/class/gpio/export

with

cat /sys/class/gpio/gpio46/value

we get the value

0 Kudos