boards: nrf52840dk_nrf52840: default kscan

Adds a default kscan and keymap for the nRF52840DK

Signed-off-by: Kelly Helmut Lord <helmut@helmutlord.com>
This commit is contained in:
Kelly Helmut Lord 2023-10-01 21:02:12 -04:00
parent 8abc449cc2
commit bc6b57b8c0
2 changed files with 48 additions and 0 deletions

View file

@ -0,0 +1,16 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
/ {
keymap {
compatible = "zmk,keymap";
layer_1 {
label = "base";
bindings = <
&kp A &kp B
&kp C &kp D
>;
};
};
};

View file

@ -0,0 +1,32 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/matrix_transform.h>
/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix-transform = &layout_grid_transform;
};
kscan0: kscan {
compatible = "zmk,kscan-gpio-direct";
label = "direct";
input-gpios
= <&gpio0 11 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>,
<&gpio0 12 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>,
<&gpio0 24 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>,
<&gpio0 25 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>
;
};
layout_grid_transform:
keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <2>;
rows = <2>;
map = <
RC(0,0) RC(0,1)
RC(1,0) RC(1,1)
>;
};
};