Skip to content

Instantly share code, notes, and snippets.

@egroj97
Created November 7, 2021 01:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save egroj97/17d8b6ab65f844059a67fc6e13e40479 to your computer and use it in GitHub Desktop.
Save egroj97/17d8b6ab65f844059a67fc6e13e40479 to your computer and use it in GitHub Desktop.
DTS to add GPIO keys as overlay on the Raspberry Pi
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
fragment@0 {
target-path = "/soc";
__overlay__ {
keypad: keypad {
compatible = "gpio-keys";
button@2 {
label = "Test BTN0";
linux,code = <0x100>;
gpios = <&gpio 2 0>;
};
button@3 {
label = "Test BTN1";
linux,code = <0x101>;
gpios = <&gpio 3 0>;
};
};
};
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment