Configure D-Pad
#19
Thanks again for your reply Porcinus.

Okay, so this is the DTS file I've arrived at;
Code:
// Definitions for Freeplay Zero/CM3 gpio-keys
/dts-v1/;
/plugin/;

/ {
compatible = "brcm,bcm2708";

fragment@0 {
// Configure the gpio pin controller
target = <&gpio>;
__overlay__ {
pin_state: button_pins@0 {
brcm,pins =     <6 5 4 17 16 24 19 26 14 23>; // gpio number
brcm,function = <0 0 0  0  0  0  0  0  0  0>; // 0 = input, 1 = output
brcm,pull =     <2 2 2  2  2  2  2  2  2  2>; // 0 = none, 1 = pull down, 2 = pull up
};
};
};
fragment@1 {
target-path = "/";
__overlay__ {
button: Freeplay_GPIO_Keys {
compatible = "gpio-keys";
pinctrl-names = "default";
pinctrl-0 = <&pin_state>;
status = "okay";

key@6 {
linux,code = <28>; //KEY_ENTER
gpios = <&gpio 19 1>;
};

key@7 {
linux,code = <57>; //KEY_SPACE
gpios = <&gpio 26 1>;
};


key@20 { //shoulder-l
linux,code = <38>;
gpios = <&gpio 14 1>;
label = "KEY_L";
};
key@21 { //shoulder-r
linux,code = <19>;
gpios = <&gpio 23 1>;
label = "KEY_R";
};
};
};
};
fragment@2 {
target-path = "/";
__overlay__ {
gpio-mouse {
compatible = "gpio-mouse";
scan-interval-ms = <50>;
        up-gpios = <&gpio 4 1>;
        down-gpios = <&gpio 17 1>;
        left-gpios = <&gpio 6 1>;
        right-gpios = <&gpio 5 1>;
        button-left-gpios = <&gpio 16 1>;
        button-right-gpios = <&gpio 24 1>;
};
};
};
};

(sorry pasting the code hasn't preserved the indents, but they are there!)


It compiles to binary, and I've updated /boot/config.txt

But it still doesn't work Undecided

I've downloaded the the evtest and input-utils packages
And when I enter the command lsinput I get the following:
Code:
/dev/input/event0
  bustype : BUS_PARPORT
  vendor  : 0x1
  product : 0x4
  version : 256
  name    : "GPIO Controller 1"
  phys    : "input0"
  bits ev : EV_SYN EV_KEY EV_ABS

/dev/input/event1
  bustype : BUS_HOST
  vendor  : 0x1
  product : 0x1
  version : 256
  name    : "Freeplay_GPIO_Keys"
  phys    : "gpio-keys/input0"
  bits ev : EV_SYN EV_KEY

So it isn't showing up as an input device...

Do you have any other recommendations for things I could try? I feel like we're so close to cracking it! Wink
Reply


Messages In This Thread
Configure D-Pad - by billsuncle - 11-06-2019, 07:11 PM
RE: Configure D-Pad - by Porcinus - 11-06-2019, 08:21 PM
RE: Configure D-Pad - by Porcinus - 11-06-2019, 08:24 PM
RE: Configure D-Pad - by billsuncle - 11-06-2019, 11:00 PM
RE: Configure D-Pad - by Porcinus - 11-07-2019, 03:59 AM
RE: Configure D-Pad - by Flavor - 11-07-2019, 04:05 AM
RE: Configure D-Pad - by Porcinus - 11-08-2019, 03:03 AM
RE: Configure D-Pad - by Flavor - 11-08-2019, 03:32 AM
RE: Configure D-Pad - by Porcinus - 11-09-2019, 12:37 AM
RE: Configure D-Pad - by Flavor - 11-09-2019, 01:26 AM
RE: Configure D-Pad - by billsuncle - 11-10-2019, 09:36 PM
RE: Configure D-Pad - by Porcinus - 11-12-2019, 05:34 PM
RE: Configure D-Pad - by billsuncle - 11-22-2019, 11:16 AM
RE: Configure D-Pad - by billsuncle - 11-22-2019, 01:42 PM
RE: Configure D-Pad - by billsuncle - 11-25-2019, 05:12 PM
RE: Configure D-Pad - by Porcinus - 11-25-2019, 05:39 PM
RE: Configure D-Pad - by billsuncle - 11-25-2019, 07:40 PM
RE: Configure D-Pad - by Porcinus - 11-25-2019, 07:49 PM
RE: Configure D-Pad - by billsuncle - 11-25-2019, 11:54 PM
RE: Configure D-Pad - by Porcinus - 11-26-2019, 01:07 AM
RE: Configure D-Pad - by billsuncle - 11-26-2019, 01:16 AM
RE: Configure D-Pad - by Porcinus - 11-26-2019, 01:20 AM
RE: Configure D-Pad - by billsuncle - 11-26-2019, 01:32 AM
RE: Configure D-Pad - by Porcinus - 11-26-2019, 01:36 AM
RE: Configure D-Pad - by billsuncle - 11-26-2019, 01:48 AM
RE: Configure D-Pad - by Porcinus - 11-26-2019, 06:14 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)