Created
November 7, 2021 01:35
-
-
Save egroj97/17d8b6ab65f844059a67fc6e13e40479 to your computer and use it in GitHub Desktop.
DTS to add GPIO keys as overlay on the Raspberry Pi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/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