Skip to content

Commit

Permalink
refactor: murphpad
Browse files Browse the repository at this point in the history
  • Loading branch information
lesshonor committed Oct 18, 2023
1 parent a9a53e6 commit 54dd853
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 26 deletions.
1 change: 0 additions & 1 deletion app/boards/shields/murphpad/boards/nice_nano.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

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

/* SPI */
reg = <0>; /* ignored, but necessary for SPI bindings */
Expand Down
1 change: 0 additions & 1 deletion app/boards/shields/murphpad/boards/nice_nano_v2.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

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

/* SPI */
reg = <0>; /* ignored, but necessary for SPI bindings */
Expand Down
41 changes: 23 additions & 18 deletions app/boards/shields/murphpad/murphpad.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/outputs.h>
#include <dt-bindings/zmk/rgb.h>


#define TIMEOUT 300

&encoder_1 {
Expand All @@ -25,22 +25,22 @@
compatible = "zmk,combos";
combo_btclr {
timeout-ms = <TIMEOUT>;
key-positions = <1 6>;
key-positions = <0 4>;
bindings = <&bt BT_CLR>;
};
combo_reset {
timeout-ms = <TIMEOUT>;
key-positions = <1 3>;
key-positions = <0 2>;
bindings = <&sys_reset>;
};
combo_bootloader {
timeout-ms = <TIMEOUT>;
key-positions = <1 2>;
key-positions = <0 1>;
bindings = <&bootloader>;
};
combo_bt_nxt {
timeout-ms = <TIMEOUT>;
key-positions = <1 4>;
key-positions = <0 3>;
bindings = <&bt BT_NXT>;
};
};
Expand All @@ -50,19 +50,22 @@
sensors = <&encoder_1 &encoder_2>;
};

chosen { zmk,matrix_transform = &all_1u; };

keymap0: keymap {
compatible = "zmk,keymap";

default_layer {
label = "default layer";
bindings = <
&bt BT_CLR &kp TAB &kp F5 &kp LC(LA(C)) &kp LG(D)
&rgb_ug RGB_TOG &kp ESC &kp KP_DIVIDE &kp KP_MULTIPLY &kp KP_MINUS
&rgb_ug RGB_EFF &kp KP_N7 &kp KP_N8 &kp KP_N9 &kp KP_PLUS
&kp C_MUTE &kp KP_N4 &kp KP_N5 &kp KP_N6 &trans
&mo 1 &kp KP_N1 &kp KP_N2 &kp KP_N3 &kp KP_ENTER
&kp BSPC &kp KP_N0 &trans &kp KP_DOT &trans
&kp F1 &kp F2 &kp F3 &kp F4
&kp KP_NUM &kp KP_DIVIDE &kp KP_MULTIPLY &kp KP_MINUS
&kp KP_N7 &kp KP_N8 &kp KP_N9 &kp KP_PLUS
&kp C_MUTE &kp KP_N4 &kp KP_N5 &kp KP_N6 &trans
&mo 1 &kp KP_N1 &kp KP_N2 &kp KP_N3 &kp KP_ENTER
&kp BSPC &kp KP_N0 &trans &kp KP_DOT &trans

&bt BT_CLR &rgb_ug RGB_TOG &rgb_ug RGB_EFF
>;
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>;

Expand All @@ -71,15 +74,17 @@
fn_layer {
label = "fn layer";
bindings = <
&trans &trans &trans &trans &trans
&trans &kp KP_NUM &trans &trans &trans
&trans &trans &trans &trans &trans
&bt BT_CLR &trans &trans &trans &trans
&trans &trans &trans &trans &trans
&kp DEL &trans &trans &trans &trans
&out OUT_TOG &bt BT_PRV &bt BT_NXT &trans
&trans &trans &trans &trans
&rgb_ug RGB_HUD &rgb_ug RGB_SPI &rgb_ug RGB_HUI &trans
&bt BT_CLR &rgb_ug RGB_EFR &rgb_ug RGB_TOG &rgb_ug RGB_EFF &trans
&trans &rgb_ug RGB_BRD &rgb_ug RGB_SPD &rgb_ug RGB_BRI &trans
&kp DEL &rgb_ug RGB_SAD &trans &rgb_ug RGB_SAI &trans

&trans &trans &trans
>;
sensor-bindings = <&inc_dec_kp PG_UP PG_DN &inc_dec_kp C_VOL_UP C_VOL_DN>;

};
};
};
};
58 changes: 52 additions & 6 deletions app/boards/shields/murphpad/murphpad.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,22 @@

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";

diode-direction = "col2row";
row-gpios
= <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
= <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
col-gpios
= <&pro_micro 9 GPIO_ACTIVE_HIGH>
, <&pro_micro 6 GPIO_ACTIVE_HIGH>
, <&pro_micro 5 GPIO_ACTIVE_HIGH>
, <&pro_micro 4 GPIO_ACTIVE_HIGH>
, <&pro_micro 10 GPIO_ACTIVE_HIGH>
, <&pro_micro 10 GPIO_ACTIVE_HIGH>
;
};

Expand All @@ -52,6 +51,54 @@
status = "disabled";
};

all_1u: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <5>;
rows = <6>;
map = <
RC(0,1) RC(0,2) RC(0,3) RC(0,4)
RC(1,1) RC(1,2) RC(1,3) RC(1,4)
RC(2,1) RC(2,2) RC(2,3) RC(2,4)
RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4)
RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4)
RC(5,0) RC(5,1) RC(5,2) RC(5,3) RC(5,4)

RC(0,0) RC(1,0) RC(2,0)
>;
};

rh_numpad: keymap_transform_1 {
compatible = "zmk,matrix-transform";
columns = <5>;
rows = <6>;
map = <
RC(0,1) RC(0,2) RC(0,3) RC(0,4)
RC(1,1) RC(1,2) RC(1,3) RC(1,4)
RC(2,1) RC(2,2) RC(2,3) RC(2,4)
RC(3,0) RC(3,2) RC(3,3) RC(3,4)
RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4)
RC(5,0) RC(5,2) RC(5,4)

RC(0,0) RC(1,0) RC(2,0)
>;
};

lh_numpad: keymap_transform_2 {
compatible = "zmk,matrix-transform";
columns = <5>;
rows = <6>;
map = <
RC(0,1) RC(0,2) RC(0,3) RC(0,4)
RC(1,1) RC(1,2) RC(1,3) RC(1,4)
RC(2,1) RC(2,2) RC(2,3) RC(2,4)
RC(3,0) RC(3,1) RC(3,2) RC(3,3)
RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4)
RC(5,0) RC(5,1) RC(5,3)

RC(0,0) RC(1,0) RC(2,0)
>;
};

};

&pro_micro_i2c {
Expand All @@ -60,7 +107,6 @@
oled: ssd1306@3c {
compatible = "solomon,ssd1306fb";
reg = <0x3c>;
label = "DISPLAY";
width = <128>;
height = <32>;
segment-offset = <0>;
Expand Down

0 comments on commit 54dd853

Please sign in to comment.