Skip to content

Commit

Permalink
10
Browse files Browse the repository at this point in the history
  • Loading branch information
EricNeiman committed Feb 16, 2024
1 parent f91e997 commit fbf8465
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 0 deletions.
22 changes: 22 additions & 0 deletions boards/shields/3x3macropad/3x3macropad.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>

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

default_layer {
bindings = <
&kp KP_N7 &kp KP_N8 &bootloader
&kp KP_N4 &kp KP_N5 &kp KP_N6
&kp KP_N1 &kp KP_N2 &kp KP_N3
>;
};
};
};
35 changes: 35 additions & 0 deletions boards/shields/3x3macropad/3x3macropad.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include <dt-bindings/zmk/matrix_transform.h>

/ {
chosen {
zmk,kscan = &default_kscan;
zmk,matrix_transform = &default_transform;
};

default_kscan: kscan {
compatible = "zmk,kscan-gpio-matric";
lable = "default_kscan";
diode-direction = "col2row";

row-gpios = <&seeeduino_xiao 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>,
<&seeeduino_xiao 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>,
<&seeeduino_xiao 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;

col-gpios = <&seeeduino_xiao 4 GPIO_ACTIVE_HIGH>,
<&seeeduino_xiao 5 GPIO_ACTIVE_HIGH>,
<&seeeduino_xiao 6 GPIO_ACTIVE_HIGH>;

};

default_transform: matrix_transform {
compatible = "zmk,matrix-transform";
rows = <3>;
cols = <3>;

map = <
RC(0, 0) RC(0, 1) RC(0, 2)
RC(1, 0) RC(1, 1) RC(1, 2)
RC(2, 0) RC(2, 1) RC(2, 2)
>;
};
};
6 changes: 6 additions & 0 deletions boards/shields/3x3macropad/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
if SHIELD_3X3MACROPAD

config ZMK_KEYBOARD_NAME
default "3x3macropad"

endif
2 changes: 2 additions & 0 deletions boards/shields/3x3macropad/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config SHIELD_3X3MACROPAD
def_bool $(shields_list_contains, 3x3macropad)

0 comments on commit fbf8465

Please sign in to comment.