Skip to content

Commit

Permalink
feat: shields: add tester_nrf52840dk shield
Browse files Browse the repository at this point in the history
Adds similar shield as seen with XIAO, ProMicro to
the nRF52840-DK.

Signed-off-by: Helmut Lord <[email protected]>
  • Loading branch information
hlord2000 committed Dec 22, 2024
1 parent 3f6841c commit 8c356fc
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/boards/shields/tester_nrf52840dk/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
if SHIELD_TESTER_NRF52840DK

config ZMK_KEYBOARD_NAME
default "ZMK Tester"

config ZMK_BLE
def_bool n

config SETTINGS
def_bool n

endif
2 changes: 2 additions & 0 deletions app/boards/shields/tester_nrf52840dk/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config SHIELD_TESTER_NRF52840DK
def_bool $(shields_list_contains,tester_nrf52840dk)
33 changes: 33 additions & 0 deletions app/boards/shields/tester_nrf52840dk/tester_nrf52840dk.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>

#define PIN_MACRO(name, pin) \
/ { \
macros { \
name: name { \
compatible = "zmk,behavior-macro"; \
wait-ms = <5>; \
tap-ms = <5>; \
#binding-cells = <0>; \
bindings = <&kp P &kp I &kp N &kp SPACE>, pin, <&kp ENTER>; \
}; \
}; \
};

PIN_MACRO(pin0, <&kp N0>)
PIN_MACRO(pin1, <&kp N1>)
PIN_MACRO(pin2, <&kp N2>)
PIN_MACRO(pin3, <&kp N3>)

/ {
keymap {
compatible = "zmk,keymap";

default_layer {
bindings = <&pin0
&pin1
&pin2
&pin3>;
};
};
};
27 changes: 27 additions & 0 deletions app/boards/shields/tester_nrf52840dk/tester_nrf52840dk.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <dt-bindings/zmk/matrix_transform.h>

/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix-transform = &transform0;
};

kscan0: kscan {
compatible = "zmk,kscan-gpio-direct";
wakeup-source;
debounce-press-ms = <10>;
debounce-release-ms = <10>;
input-gpios
= <&gpio0 11 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&gpio0 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&gpio0 24 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&gpio0 25 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
};

transform0: keymap_transform {
compatible = "zmk,matrix-transform";
columns = <4>;
rows = <1>;
map = <RC(0,0) RC(0,1) RC(0,2) RC(0,3)>;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
file_format: "1"
id: tester_nrf52840dk
name: TesternRF52840DK
type: shield
url: https://zmk.dev/docs/troubleshooting/hardware-issues
requires: [nrf52840dk_nrf52840]

0 comments on commit 8c356fc

Please sign in to comment.