Skip to content

Commit f944c84

Browse files
committed
refactor(shields): MurphPad
* Added matrix transforms for three optional layouts. * Tweaked default keymap to be more immediately useful for ZMK and more closely resemble the default keymaps of non-ZMK firmware. * Removed deprecated label properties and tidied formatting. * Aligned encoder configuration with current standards.
1 parent 34c8b3f commit f944c84

File tree

4 files changed

+89
-36
lines changed

4 files changed

+89
-36
lines changed

app/boards/shields/murphpad/boards/nice_nano.overlay

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
led_strip: ws2812@0 {
2727
compatible = "worldsemi,ws2812-spi";
28-
label = "WS2812";
2928

3029
/* SPI */
3130
reg = <0>; /* ignored, but necessary for SPI bindings */

app/boards/shields/murphpad/boards/nice_nano_v2.overlay

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
led_strip: ws2812@0 {
2727
compatible = "worldsemi,ws2812-spi";
28-
label = "WS2812";
2928

3029
/* SPI */
3130
reg = <0>; /* ignored, but necessary for SPI bindings */

app/boards/shields/murphpad/murphpad.keymap

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,63 +7,64 @@
77
#include <behaviors.dtsi>
88
#include <dt-bindings/zmk/keys.h>
99
#include <dt-bindings/zmk/bt.h>
10+
#include <dt-bindings/zmk/outputs.h>
1011
#include <dt-bindings/zmk/rgb.h>
1112

12-
1313
#define TIMEOUT 300
1414

15-
&encoder_1 {
15+
&left_middle_encoder {
1616
status = "okay";
1717
};
1818

19-
&encoder_2 {
19+
&top_right_encoder {
2020
status = "okay";
2121
};
2222

23+
&sensors {
24+
sensors = <&left_middle_encoder &top_right_encoder>;
25+
};
26+
2327
/ {
2428
combos {
2529
compatible = "zmk,combos";
2630
combo_btclr {
2731
timeout-ms = <TIMEOUT>;
28-
key-positions = <1 6>;
32+
key-positions = <0 4>;
2933
bindings = <&bt BT_CLR>;
3034
};
3135
combo_reset {
3236
timeout-ms = <TIMEOUT>;
33-
key-positions = <1 3>;
37+
key-positions = <0 2>;
3438
bindings = <&sys_reset>;
3539
};
3640
combo_bootloader {
3741
timeout-ms = <TIMEOUT>;
38-
key-positions = <1 2>;
42+
key-positions = <0 1>;
3943
bindings = <&bootloader>;
4044
};
4145
combo_bt_nxt {
4246
timeout-ms = <TIMEOUT>;
43-
key-positions = <1 4>;
47+
key-positions = <0 3>;
4448
bindings = <&bt BT_NXT>;
4549
};
4650
};
4751

48-
sensors {
49-
compatible = "zmk,keymap-sensors";
50-
sensors = <&encoder_1 &encoder_2>;
51-
triggers-per-rotation = <20>;
52-
};
53-
52+
chosen { zmk,matrix_transform = &all_1u; };
5453

5554
keymap0: keymap {
5655
compatible = "zmk,keymap";
5756

5857
default_layer {
5958
label = "default layer";
6059
bindings = <
61-
&bt BT_CLR &kp TAB &kp F5 &kp LC(LA(C)) &kp LG(D)
62-
&rgb_ug RGB_TOG &kp ESC &kp KP_DIVIDE &kp KP_MULTIPLY &kp KP_MINUS
63-
&rgb_ug RGB_EFF &kp KP_N7 &kp KP_N8 &kp KP_N9 &kp KP_PLUS
64-
&kp C_MUTE &kp KP_N4 &kp KP_N5 &kp KP_N6 &trans
65-
&mo 1 &kp KP_N1 &kp KP_N2 &kp KP_N3 &kp KP_ENTER
66-
&kp BSPC &kp KP_N0 &trans &kp KP_DOT &trans
60+
&kp F1 &kp F2 &kp F3 &kp F4
61+
&kp KP_NUM &kp KP_DIVIDE &kp KP_MULTIPLY &kp KP_MINUS
62+
&kp KP_N7 &kp KP_N8 &kp KP_N9 &kp KP_PLUS
63+
&kp C_MUTE &kp KP_N4 &kp KP_N5 &kp KP_N6 &trans
64+
&mo 1 &kp KP_N1 &kp KP_N2 &kp KP_N3 &kp KP_ENTER
65+
&kp BSPC &kp KP_N0 &trans &kp KP_DOT &trans
66+
67+
&bt BT_CLR &rgb_ug RGB_TOG &rgb_ug RGB_EFF
6768
>;
6869
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>;
6970

@@ -72,15 +73,17 @@
7273
fn_layer {
7374
label = "fn layer";
7475
bindings = <
75-
&trans &trans &trans &trans &trans
76-
&trans &kp KP_NUM &trans &trans &trans
77-
&trans &trans &trans &trans &trans
78-
&bt BT_CLR &trans &trans &trans &trans
79-
&trans &trans &trans &trans &trans
80-
&kp DEL &trans &trans &trans &trans
76+
&out OUT_TOG &bt BT_PRV &bt BT_NXT &trans
77+
&trans &trans &trans &trans
78+
&rgb_ug RGB_HUD &rgb_ug RGB_SPI &rgb_ug RGB_HUI &trans
79+
&bt BT_CLR &rgb_ug RGB_EFR &rgb_ug RGB_TOG &rgb_ug RGB_EFF &trans
80+
&trans &rgb_ug RGB_BRD &rgb_ug RGB_SPD &rgb_ug RGB_BRI &trans
81+
&kp DEL &rgb_ug RGB_SAD &trans &rgb_ug RGB_SAI &trans
82+
83+
&trans &trans &trans
8184
>;
8285
sensor-bindings = <&inc_dec_kp PG_UP PG_DN &inc_dec_kp C_VOL_UP C_VOL_DN>;
8386

8487
};
8588
};
86-
};
89+
};

app/boards/shields/murphpad/murphpad.overlay

Lines changed: 60 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,74 @@
1414

1515
kscan0: kscan {
1616
compatible = "zmk,kscan-gpio-matrix";
17-
label = "KSCAN";
1817

1918
diode-direction = "col2row";
2019
row-gpios
21-
= <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
20+
= <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
2221
, <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
2322
, <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
2423
, <&pro_micro 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
25-
, <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
26-
, <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
24+
, <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
25+
, <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
2726
;
2827
col-gpios
2928
= <&pro_micro 9 GPIO_ACTIVE_HIGH>
3029
, <&pro_micro 6 GPIO_ACTIVE_HIGH>
3130
, <&pro_micro 5 GPIO_ACTIVE_HIGH>
3231
, <&pro_micro 4 GPIO_ACTIVE_HIGH>
33-
, <&pro_micro 10 GPIO_ACTIVE_HIGH>
32+
, <&pro_micro 10 GPIO_ACTIVE_HIGH>
3433
;
3534
};
3635

37-
encoder_1: encoder_1 {
36+
all_1u: keymap_transform_0 {
37+
compatible = "zmk,matrix-transform";
38+
columns = <5>;
39+
rows = <6>;
40+
map = <
41+
RC(0,1) RC(0,2) RC(0,3) RC(0,4)
42+
RC(1,1) RC(1,2) RC(1,3) RC(1,4)
43+
RC(2,1) RC(2,2) RC(2,3) RC(2,4)
44+
RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4)
45+
RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4)
46+
RC(5,0) RC(5,1) RC(5,2) RC(5,3) RC(5,4)
47+
48+
RC(0,0) RC(1,0) RC(2,0)
49+
>;
50+
};
51+
52+
rh_numpad: keymap_transform_1 {
53+
compatible = "zmk,matrix-transform";
54+
columns = <5>;
55+
rows = <6>;
56+
map = <
57+
RC(0,1) RC(0,2) RC(0,3) RC(0,4)
58+
RC(1,1) RC(1,2) RC(1,3) RC(1,4)
59+
RC(2,1) RC(2,2) RC(2,3) RC(2,4)
60+
RC(3,0) RC(3,2) RC(3,3) RC(3,4)
61+
RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4)
62+
RC(5,0) RC(5,2) RC(5,4)
63+
64+
RC(0,0) RC(1,0) RC(2,0)
65+
>;
66+
};
67+
68+
lh_numpad: keymap_transform_2 {
69+
compatible = "zmk,matrix-transform";
70+
columns = <5>;
71+
rows = <6>;
72+
map = <
73+
RC(0,1) RC(0,2) RC(0,3) RC(0,4)
74+
RC(1,1) RC(1,2) RC(1,3) RC(1,4)
75+
RC(2,1) RC(2,2) RC(2,3) RC(2,4)
76+
RC(3,0) RC(3,1) RC(3,2) RC(3,3)
77+
RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4)
78+
RC(5,0) RC(5,1) RC(5,3)
79+
80+
RC(0,0) RC(1,0) RC(2,0)
81+
>;
82+
};
83+
84+
encoder_1: left_middle_encoder: encoder_1 {
3885
compatible = "alps,ec11";
3986
label = "Encoder 1";
4087
a-gpios = <&pro_micro 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
@@ -43,7 +90,7 @@
4390
status = "disabled";
4491
};
4592

46-
encoder_2: encoder_2 {
93+
encoder_2: top_right_encoder: encoder_2 {
4794
compatible = "alps,ec11";
4895
label = "Encoder 2";
4996
a-gpios = <&pro_micro 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
@@ -52,6 +99,12 @@
5299
status = "disabled";
53100
};
54101

102+
sensors: sensors {
103+
compatible = "zmk,keymap-sensors";
104+
sensors = <&left_middle_encoder &top_right_encoder>;
105+
triggers-per-rotation = <20>;
106+
};
107+
55108
};
56109

57110
&pro_micro_i2c {
@@ -60,7 +113,6 @@
60113
oled: ssd1306@3c {
61114
compatible = "solomon,ssd1306fb";
62115
reg = <0x3c>;
63-
label = "DISPLAY";
64116
width = <128>;
65117
height = <32>;
66118
segment-offset = <0>;

0 commit comments

Comments
 (0)