Quantcast
Channel: Codewalker
Viewing all articles
Browse latest Browse all 72

How to use GPIO key in ODROID-C2(android).

$
0
0

How to use GPIO key in ODROID-C2(android).


Builtin GPIO polled driver.

CONFIG_KEYBOARD_GPIO_POLLED

linux keycode table

http://www.comptechdoc.org/os/linux/howlinuxworks/linux_hlkeycodes.html

F76541 c165[18~ 1b 5b 31 38 7e[31~ 1b 5b 33 31 7e[18~ 1b 5b 31 38 7e
F86642 c266[19~ 1b 5b 31 39 7e[32~ 1b 5b 33 32 7e[19~ 1b 5b 31 39 7e
F96743 c367[20~ 1b 5b 32 30 7e[33~ 1b 5b 33 33 7e[20~ 1b 5b 32 30 7e
F106844 c468[21~ 1b 5b 32 31 7e[34~ 1b 5b 33 34 7e[21~ 1b 5b 32 32 7e

Expansion Connectors

http://odroid.com/dokuwiki/doku.php?id=en:c2_hardware#expansion_connectors



edit arch/arm64/boot/dts/meson64_odroidc2.dts
gpio_keys_polled {
compatible =
"gpio-keys-polled";
#address-cells = <1>;
#size-cells = <0>;
poll-interval = <100>;
autorepeat;
button@1 {
label = "GPIO Key F7";
linux,code = <65>;
gpios = <&gpio GPIOX_19 1>;
};
button@2 {
label = "GPIO Key F8";
linux,code = <66>;
gpios = <&gpio GPIOX_11 1>;
};
button@3 {
label = "GPIO Key F9";
linux,code = <67>;
gpios = <&gpio GPIOX_9 1>;
};
button@4 {
label = "GPIO Key F10";
linux,code = <68>;
gpios = <&gpio GPIOX_7 1>;
};
};



You can receive key event(scancode) without keycode.

Add keycode in system/usr/keylayout/Vendor_0001_Product_0001.kl.

key 75F3
key 76F4
key 77F5
key 64F6
key 65F7
key 66F8
key 67F9
key 68F10
key 69F11


Android will fill keycode matched scancode in key event.

We will make launcher app with F7 ~ F10 key next.

Viewing all articles
Browse latest Browse all 72

Trending Articles