From 0c89fdea35843849c080fb3d2abb845b512bc8b0 Mon Sep 17 00:00:00 2001 From: Conor Burns Date: Sun, 12 Mar 2023 11:29:13 +0000 Subject: [PATCH] add new shield: new horizons --- .../shields/newhorizons/Kconfig.defconfig | 9 +++ app/boards/shields/newhorizons/Kconfig.shield | 5 ++ .../shields/newhorizons/newhorizons.conf | 4 ++ .../shields/newhorizons/newhorizons.keymap | 36 +++++++++++ .../shields/newhorizons/newhorizons.overlay | 59 +++++++++++++++++++ .../shields/newhorizons/newhorizons.zmk.yml | 8 +++ 6 files changed, 121 insertions(+) create mode 100644 app/boards/shields/newhorizons/Kconfig.defconfig create mode 100644 app/boards/shields/newhorizons/Kconfig.shield create mode 100644 app/boards/shields/newhorizons/newhorizons.conf create mode 100644 app/boards/shields/newhorizons/newhorizons.keymap create mode 100644 app/boards/shields/newhorizons/newhorizons.overlay create mode 100644 app/boards/shields/newhorizons/newhorizons.zmk.yml diff --git a/app/boards/shields/newhorizons/Kconfig.defconfig b/app/boards/shields/newhorizons/Kconfig.defconfig new file mode 100644 index 00000000..c99568aa --- /dev/null +++ b/app/boards/shields/newhorizons/Kconfig.defconfig @@ -0,0 +1,9 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +if SHIELD_NEWHORIZONS + +config ZMK_KEYBOARD_NAME + default "New Horizons" + +endif diff --git a/app/boards/shields/newhorizons/Kconfig.shield b/app/boards/shields/newhorizons/Kconfig.shield new file mode 100644 index 00000000..5ecc1f67 --- /dev/null +++ b/app/boards/shields/newhorizons/Kconfig.shield @@ -0,0 +1,5 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config SHIELD_NEWHORIZONS + def_bool $(shields_list_contains,newhorizons) diff --git a/app/boards/shields/newhorizons/newhorizons.conf b/app/boards/shields/newhorizons/newhorizons.conf new file mode 100644 index 00000000..fe23ad52 --- /dev/null +++ b/app/boards/shields/newhorizons/newhorizons.conf @@ -0,0 +1,4 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +CONFIG_BT_CTLR_TX_PWR_PLUS_8=y \ No newline at end of file diff --git a/app/boards/shields/newhorizons/newhorizons.keymap b/app/boards/shields/newhorizons/newhorizons.keymap new file mode 100644 index 00000000..f46b96e3 --- /dev/null +++ b/app/boards/shields/newhorizons/newhorizons.keymap @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include +#include + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { + bindings = < + &kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC &kp BSPC &kp DEL + &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp BSLH &kp HOME + &kp CLCK &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp RET &kp PG_UP + &kp LSHFT &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT &kp UP &kp PG_DN + &kp LCTRL &kp LGUI &kp LALT &kp SPACE &kp SPACE &kp SPACE &kp RALT &mo 1 &kp RCTRL &kp LEFT &kp DOWN &kp RIGHT + >; + }; + + fn_layer { + bindings = < + &kp GRAVE &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &trans &trans &bootloader + &out OUT_USB &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &out OUT_BLE &bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + >; + }; + }; +}; diff --git a/app/boards/shields/newhorizons/newhorizons.overlay b/app/boards/shields/newhorizons/newhorizons.overlay new file mode 100644 index 00000000..368ba9c4 --- /dev/null +++ b/app/boards/shields/newhorizons/newhorizons.overlay @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include + +/ { + chosen { + zmk,kscan = &kscan0; + zmk,matrix_transform = &default_transform; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + rows = <5>; + columns = <16>; + + map = < + RC(0,0) RC(1,0) RC(0,1) RC(1,1) RC(0,2) RC(1,2) RC(0,3) RC(1,3) RC(0,4) RC(1,4) RC(0,5) RC(1,5) RC(0,6) RC(1,6) RC(0,7) RC(1,7) + RC(2,0) RC(3,0) RC(2,1) RC(3,1) RC(2,2) RC(3,2) RC(2,3) RC(3,3) RC(2,4) RC(3,4) RC(2,5) RC(3,5) RC(2,6) RC(3,6) RC(3,7) + RC(4,0) RC(5,0) RC(4,1) RC(5,1) RC(4,2) RC(5,2) RC(4,3) RC(5,3) RC(4,4) RC(5,4) RC(4,5) RC(5,5) RC(4,7) RC(5,7) + RC(6,0) RC(7,0) RC(6,1) RC(7,1) RC(6,2) RC(7,2) RC(6,3) RC(7,3) RC(6,4) RC(7,4) RC(6,5) RC(7,5) RC(6,6) RC(6,7) RC(7,7) + RC(8,0) RC(9,0) RC(8,1) RC(9,1) RC(8,3) RC(9,3) RC(8,5) RC(9,5) RC(8,6) RC(9,6) RC(8,7) RC(9,7) + >; + }; + + + kscan0: kscan_0 { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + diode-direction = "row2col"; + + row-gpios + = <&pro_micro 1 GPIO_ACTIVE_HIGH> // row 0 + , <&pro_micro 0 GPIO_ACTIVE_HIGH> // row 1 + , <&pro_micro 2 GPIO_ACTIVE_HIGH> // row 2 + , <&pro_micro 3 GPIO_ACTIVE_HIGH> // row 3 + , <&pro_micro 9 GPIO_ACTIVE_HIGH> // row 4 + , <&pro_micro 8 GPIO_ACTIVE_HIGH> // row 5 + , <&pro_micro 7 GPIO_ACTIVE_HIGH> // row 6 + , <&pro_micro 6 GPIO_ACTIVE_HIGH> // row 7 + , <&pro_micro 5 GPIO_ACTIVE_HIGH> // row 8 + , <&pro_micro 4 GPIO_ACTIVE_HIGH> // row 9 + ; + + col-gpios + = <&pro_micro 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // col 0 + , <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // col 1 + , <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // col 2 + , <&pro_micro 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // col 3 + , <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // col 4 + , <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // col 5 + , <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // col 6 + , <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // col 7 + ; + }; +}; \ No newline at end of file diff --git a/app/boards/shields/newhorizons/newhorizons.zmk.yml b/app/boards/shields/newhorizons/newhorizons.zmk.yml new file mode 100644 index 00000000..21b03ea7 --- /dev/null +++ b/app/boards/shields/newhorizons/newhorizons.zmk.yml @@ -0,0 +1,8 @@ +file_format: "1" +id: newhorizons +name: New Horizons +type: shield +url: https://keeb.supply/products/0xcb-new-horizons +requires: [pro_micro] +features: + - keys \ No newline at end of file