Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential to configure buttons with an overlay? #167

Open
shawaj opened this issue Dec 25, 2017 · 1 comment
Open

Potential to configure buttons with an overlay? #167

shawaj opened this issue Dec 25, 2017 · 1 comment

Comments

@shawaj
Copy link
Member

shawaj commented Dec 25, 2017

Similar to here - https://github.com/notro/fbtft/blob/master/dts/overlays/rpi/tinylcd35-overlay.dts

@shawaj
Copy link
Member Author

shawaj commented Jan 3, 2018

also see here - https://github.com/shawaj/linux/blob/a7eca81e0c579885f075549e19abae42408065b6/arch/arm/boot/dts/overlays/gpio-key-overlay.dts

and here - raspberrypi/linux#2329

This has now been implemented in the core kernel. You can call multiple buttons in the /boot/config.txt file using multiple calls to the overlay:

dtoverlay=gpio-key,gpio=13,keycode=59,label="KEY_F1"
dtoverlay=gpio-key,gpio=17,keycode=60,label="KEY_F2"
dtoverlay=gpio-key,gpio=22,keycode=61,label="KEY_F3"
dtoverlay=gpio-key,gpio=26,keycode=62,label="KEY_F4"
dtoverlay=gpio-key,gpio=27,keycode=63,label="KEY_F5"

Or on the command line at runtime like:

sudo dtoverlay gpio-key gpio=21 keycode=4 label="KEY_4" gpio_pull=0

Again, multiple calls can be done to this.

@francesco-vannini do you think we should add info about how to set buttons up like this to the README / docs somewhere? Could be pretty useful for navigating menus potentially?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant