Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: shields: add tester_nrf52840dk shield #2730

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]