Guest User

gpio-matrix.dts

a guest
Nov 30th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.67 KB | None | 0 0
  1.  /dts-v1/;
  2.     /plugin/;
  3.     / {
  4.            compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
  5.  
  6.            fragment@0 {
  7.               target-path = "/";
  8.               __overlay__ {
  9.                  keypad: gpio-matrix {
  10.                     compatible = "gpio-matrix-keypad";
  11.                     debounce-delay-ms = <10>;
  12.                     col-scan-delay-us = <10>;
  13.                     /*
  14.                        try to use GPIO only lines
  15.                        to keep SPI and I2C usable
  16.                     */
  17.                     row-gpios = <&gpio 21 0    // 0 &gpio 27 0
  18.                                  &gpio 20 0    // 1 &gpio 22 0
  19.                                  &gpio 26 0    // 2 &gpio 23 0
  20.                                  &gpio 25 0>;  // 3 &gpio 24 0
  21.  
  22.                     col-gpios = <&gpio 27 0    // 0 &gpio 21 0
  23.                                  &gpio 22 0    // 1 &gpio 20 0
  24.                                  &gpio 23 0    // 2 &gpio 26 0
  25.                                  &gpio 24 0>;  // 3 &gpio 25 0
  26.                     /*
  27.                       Keycodes from /usr/include/linux/input-event-codes.h
  28.                       converted to hex using printf '%02x\n'
  29.                     */
  30.  
  31.                     linux,keymap = <
  32.                                  // Keymap Entry     col  row  input  code  hex
  33.                                     0x00000069    // col0 row0 KEY_A  30    69
  34.                                     0x10000070    // col0 row1 KEY_B  48    70
  35.                                     0x20000071    // col0 row2 KEY_C  46    71
  36.                                     0x30000072    // col0 row3 KEY_D  32    72
  37.  
  38.                                     0x01000074    // col1 row0 KEY_E  18    74
  39.                                     0x11000075    // col1 row1 KEY_F  33    75
  40.                                     0x21000076    // col1 row2 KEY_G  34    76
  41.                                     0x31000077    // col1 row3 KEY_H  35    77
  42.  
  43.                                     0x02000079    // col2 row0 KEY_I  23    79
  44.                                     0x12000080    // col2 row1 KEY_J  36    80
  45.                                     0x22000081    // col2 row2 KEY_K  37    81
  46.                                     0x32000082    // col2 row3 KEY_L  38    82
  47.  
  48.                                     0x03000084    // col3 row0 KEY_LEFTSHIFT  42 84
  49.                                     0x13000085    // col3 row1 KEY_N          49 85
  50.                                     0x23000086    // col3 row2 KEY_O          24 86
  51.                                     0x33000087>;  // col3 row3 KEY_ENTER      28 87
  52.                  };
  53.               };
  54.            };
  55.       };
Add Comment
Please, Sign In to add comment