diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fe07971 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +.zmk/ diff --git a/boards/shields/numpad3d/Kconfig.defconfig b/boards/shields/numpad3d/Kconfig.defconfig new file mode 100644 index 0000000..60bf36b --- /dev/null +++ b/boards/shields/numpad3d/Kconfig.defconfig @@ -0,0 +1,6 @@ +if SHIELD_NUMPAD3D + +config ZMK_KEYBOARD_NAME + default "numpad3d" + +endif # SHIELD_NUMPAD3D diff --git a/boards/shields/numpad3d/Kconfig.shield b/boards/shields/numpad3d/Kconfig.shield new file mode 100644 index 0000000..54d0d71 --- /dev/null +++ b/boards/shields/numpad3d/Kconfig.shield @@ -0,0 +1,2 @@ +config SHIELD_NUMPAD3D + def_bool $(shields_list_contains,numpad3d) diff --git a/boards/shields/numpad3d/numpad3d-layouts.dtsi b/boards/shields/numpad3d/numpad3d-layouts.dtsi new file mode 100644 index 0000000..3096513 --- /dev/null +++ b/boards/shields/numpad3d/numpad3d-layouts.dtsi @@ -0,0 +1,49 @@ +// See https://zmk.dev/docs/development/hardware-integration/physical-layouts +// for how to configure this. + +#include + +/ { + default_layout: default_layout { + compatible = "zmk,physical-layout"; + display-name = "Numpad3D"; + transform = <&default_transform>; + kscan = <&kscan0>; + + keys + // w h x y rot rx ry + + /* Row 0 */ + = <&key_physical_attrs 100 100 0 0 0 0 0> // ESC + , <&key_physical_attrs 100 100 100 0 0 0 0> // F1 + , <&key_physical_attrs 100 100 200 0 0 0 0> // F2 + , <&key_physical_attrs 100 100 300 0 0 0 0> // F3 + + /* Row 1 */ + , <&key_physical_attrs 100 100 0 100 0 0 0> // NUM + , <&key_physical_attrs 100 100 100 100 0 0 0> // / + , <&key_physical_attrs 100 100 200 100 0 0 0> // * + , <&key_physical_attrs 100 100 300 100 0 0 0> // - + + /* Row 2 */ + , <&key_physical_attrs 100 100 0 200 0 0 0> // 7 + , <&key_physical_attrs 100 100 100 200 0 0 0> // 8 + , <&key_physical_attrs 100 100 200 200 0 0 0> // 9 + , <&key_physical_attrs 100 200 300 200 0 0 0> // ENTER (2u vertical) + + /* Row 3 */ + , <&key_physical_attrs 100 100 0 300 0 0 0> // 4 + , <&key_physical_attrs 100 100 100 300 0 0 0> // 5 + , <&key_physical_attrs 100 100 200 300 0 0 0> // 6 + + /* Row 4 */ + , <&key_physical_attrs 100 100 0 400 0 0 0> // 1 + , <&key_physical_attrs 100 100 100 400 0 0 0> // 2 + , <&key_physical_attrs 100 100 200 400 0 0 0> // 3 + , <&key_physical_attrs 100 200 300 400 0 0 0> // + (2u vertical) + + /* Row 5 */ + , <&key_physical_attrs 200 100 0 500 0 0 0> // 0 (2u horizontal) + , <&key_physical_attrs 100 100 200 500 0 0 0>; // . + }; +}; diff --git a/boards/shields/numpad3d/numpad3d.conf b/boards/shields/numpad3d/numpad3d.conf new file mode 100644 index 0000000..690879f --- /dev/null +++ b/boards/shields/numpad3d/numpad3d.conf @@ -0,0 +1,13 @@ +# This file was generated from a template. Edit it to match your keyboard. +# See https://zmk.dev/docs/development/hardware-integration/new-shield for more +# instructions. + +# This file will be copied into the user's config directory when they add this +# keyboard. Define any Kconfig options users may frequently want to set here, +# but leave them commented out, for example: + +# Uncomment to enable the encoder +# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y + +# Uncomment to enable the display +# CONFIG_ZMK_DISPLAY=y diff --git a/boards/shields/numpad3d/numpad3d.keymap b/boards/shields/numpad3d/numpad3d.keymap new file mode 100644 index 0000000..7901d54 --- /dev/null +++ b/boards/shields/numpad3d/numpad3d.keymap @@ -0,0 +1,22 @@ +// This file was generated from a template. Edit it to match your keyboard. +// See https://zmk.dev/docs/development/hardware-integration/new-shield for more instructions. + +#include +#include + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { + bindings = < + &kp ESC &kp F1 &kp F2 &kp F3 + &kp KP_NUM &kp KP_DIV &kp KP_MULT &kp KP_MINUS + &kp KP_N7 &kp KP_N8 &kp KP_N9 &kp KP_ENTER + &kp KP_N4 &kp KP_N5 &kp KP_N6 &trans + &kp KP_N1 &kp KP_N2 &kp KP_N3 &kp KP_PLUS + &kp KP_N0 &kp KP_DOT &trans &trans + >; + }; + }; +}; diff --git a/boards/shields/numpad3d/numpad3d.overlay b/boards/shields/numpad3d/numpad3d.overlay new file mode 100644 index 0000000..f7e2fd1 --- /dev/null +++ b/boards/shields/numpad3d/numpad3d.overlay @@ -0,0 +1,51 @@ +// This file was generated from a template. Edit it to match your keyboard. +// See https://zmk.dev/docs/development/hardware-integration/new-shield for more +// instructions. + +#include + +#include "numpad3d-layouts.dtsi" + +/ { + chosen { + zmk,kscan = &kscan0; + zmk,matrix-transform = &default_transform; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + + diode-direction = "col2row"; + + col-gpios = < + &gpio1 4 GPIO_ACTIVE_HIGH + &gpio1 6 GPIO_ACTIVE_HIGH + &gpio0 9 GPIO_ACTIVE_HIGH + &gpio0 10 GPIO_ACTIVE_HIGH + >; + + row-gpios = < + &gpio0 31 GPIO_ACTIVE_HIGH + &gpio0 29 GPIO_ACTIVE_HIGH + &gpio0 2 GPIO_ACTIVE_HIGH + &gpio1 15 GPIO_ACTIVE_HIGH + &gpio1 13 GPIO_ACTIVE_HIGH + &gpio1 11 GPIO_ACTIVE_HIGH + >; + }; + + default_transform: matrix_transform { + compatible = "zmk,matrix-transform"; + rows = <6>; + columns = <4>; + + map = < + RC(0,0) RC(0,1) RC(0,2) RC(0,3) + RC(1,0) RC(1,1) RC(1,2) RC(1,3) + RC(2,0) RC(2,1) RC(2,2) RC(2,3) + 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(5,0) RC(5,1) RC(5,2) RC(5,3) + >; + }; +}; diff --git a/boards/shields/numpad3d/numpad3d.zmk.yml b/boards/shields/numpad3d/numpad3d.zmk.yml new file mode 100644 index 0000000..2019cc3 --- /dev/null +++ b/boards/shields/numpad3d/numpad3d.zmk.yml @@ -0,0 +1,20 @@ +# This file was generated from a template. Edit it to match your keyboard. +# See https://zmk.dev/docs/development/hardware-integration/hardware-metadata-files +# for instructions. + +file_format: "1" +id: numpad3d +name: numpad3d +type: shield + +# Set this to a URL that documents the keyboard. +url: https://example.com + +# Add any features your keyboard supports here. +# See https://zmk.dev/docs/development/hardware-integration/hardware-metadata-files#features +features: + - keys + - studio # Remove this line if your keyboard will not support ZMK Studio + +requires: + - pro_micro