I have a project I’m struggling with. I must create a device that starts and manipulates audio through buttons connected to jumper wires on an Orange.pi board, but programming them has been a big challenge for me as I have no experience in this.
So far I’ve created a circuit for the buttons with help from the internet, as well as making a gpio_keys file and a DTS file called “button-overlay”.
But when I test the buttons using the evtest command in the terminal, nothing happens.
I will describe how my “gpio_keys” and “button overlay” file is.
Gpio:
/dts-v1/;
/plugin/;
/{
compatible = "allwinner, sun8i-h3";
fragment {
target = <&pio>;
_overlay_ {
gpio_keys_user: gpio_keys_user {
compatible = "gpio-keys";
pinctrl-names = "default";
pinctrl-0 = <&pio_button_0>;
play_pause {
label = "Play/Pause";
linux, code = <164>; /*KEY_PLAYPAUSE*/
gpios = <&pio 0 7 0>; /* PA7 */
};
next {
label = "Next";
linux, code = <163>; */KEY_NEXTSONG*/
gpios = < &pio 0 8 0>; /* PA8 */
};
previous {
label = "Previous";
linux, code = <165>; /*KEY_PREVIOUSSONG*/
gpios = <&pio 0 9 0>; /*, PA9 */
};
};
};
};
};
Button overlay:
/dts-v1/;
/plugin/;
/{
compatible = "brcm, bcm2835", "brcm, bcm 2708", "brcm, bcm 2709";
fragment@0 {
target = <&pio>;
_overlay_ {
button8: my_button8 {
compatible = "gpio-keys";
#adress-cells = <1>;
#size-cells =<0>;
pinctrl-names = "default";
pinctrl-0 = <&button8_pin>;
status = "okay";
but-pla {
label = "button-gpio8"
linux, code = <8>;
gpios = <&gpio 8 0>;
};
);
};
};
};
I don’t know if this information is enough, but I can send you anything else you want to note.