From be0d49b62d7a423512e6e9052eca037b331109b7 Mon Sep 17 00:00:00 2001 From: Jason Hazel Date: Wed, 27 Jul 2022 11:39:42 -0400 Subject: [PATCH] feat(shields) add support for Spaceman Pancake (#1400) * add support for Spaceman Pancake Co-authored-by: Pete Johanson Co-authored-by: Jason Hazel Co-authored-by: Pete Johanson --- app/boards/shields/pancake/Kconfig.defconfig | 9 ++++ app/boards/shields/pancake/Kconfig.shield | 5 ++ app/boards/shields/pancake/pancake.conf | 1 + app/boards/shields/pancake/pancake.keymap | 57 ++++++++++++++++++++ app/boards/shields/pancake/pancake.overlay | 39 ++++++++++++++ app/boards/shields/pancake/pancake.zmk.yml | 8 +++ 6 files changed, 119 insertions(+) create mode 100644 app/boards/shields/pancake/Kconfig.defconfig create mode 100644 app/boards/shields/pancake/Kconfig.shield create mode 100644 app/boards/shields/pancake/pancake.conf create mode 100644 app/boards/shields/pancake/pancake.keymap create mode 100644 app/boards/shields/pancake/pancake.overlay create mode 100644 app/boards/shields/pancake/pancake.zmk.yml diff --git a/app/boards/shields/pancake/Kconfig.defconfig b/app/boards/shields/pancake/Kconfig.defconfig new file mode 100644 index 00000000..47f5e682 --- /dev/null +++ b/app/boards/shields/pancake/Kconfig.defconfig @@ -0,0 +1,9 @@ +# Copyright (c) 2022 The ZMK Contributors +# SPDX-License-Identifier: MIT + +if SHIELD_PANCAKE + +config ZMK_KEYBOARD_NAME + default "Pancake" + +endif \ No newline at end of file diff --git a/app/boards/shields/pancake/Kconfig.shield b/app/boards/shields/pancake/Kconfig.shield new file mode 100644 index 00000000..784d25a4 --- /dev/null +++ b/app/boards/shields/pancake/Kconfig.shield @@ -0,0 +1,5 @@ +# Copyright (c) 2022 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config SHIELD_PANCAKE + def_bool $(shields_list_contains,pancake) \ No newline at end of file diff --git a/app/boards/shields/pancake/pancake.conf b/app/boards/shields/pancake/pancake.conf new file mode 100644 index 00000000..67b8cb5c --- /dev/null +++ b/app/boards/shields/pancake/pancake.conf @@ -0,0 +1 @@ +# CONFIG_ZMK_USB_LOGGING=y \ No newline at end of file diff --git a/app/boards/shields/pancake/pancake.keymap b/app/boards/shields/pancake/pancake.keymap new file mode 100644 index 00000000..99f2aaff --- /dev/null +++ b/app/boards/shields/pancake/pancake.keymap @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include +#include + +#define DEF 0 +#define LWR 1 +#define RSE 2 +#define FNC 3 + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { + bindings = < + &kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSPC + &kp TAB &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SQT &kp SEMI + &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp UP &kp ENTER + &kp LCTRL &kp LALT &kp LGUI &mo FNC &mo LWR &kp SPACE &kp SPACE &mo RSE &kp SLASH &kp LEFT &kp DOWN &kp RIGHT + >; + }; + + lower_layer { + bindings = < + &kp TILDE &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp STAR &kp LPAR &kp RPAR &kp BSPC + &trans &trans &trans &trans &trans &trans &trans &trans &kp UNDER &kp PLUS &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &kp LBRC &kp RBRC &kp C_VOL_UP &trans + &trans &trans &trans &trans &trans &trans &trans &trans &kp QMARK &trans &kp C_VOL_DN &trans + >; + }; + + raise_layer { + bindings = < + &kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp BSPC + &trans &trans &trans &trans &trans &trans &trans &trans &kp MINUS &kp EQUAL &trans &kp BSLH + &trans &trans &trans &trans &trans &trans &trans &trans &kp LBKT &kp RBKT &kp C_VOL_UP &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &kp C_VOL_DN &trans + >; + }; + + function_layer { + bindings = < + &bootloader &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &trans + &trans &trans &trans &trans &trans &trans &trans &trans &kp MINUS &kp F11 &kp F12 &trans + &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 + &out OUT_BLE &out OUT_USB &out OUT_TOG &trans &trans &trans &trans &trans &trans &trans &trans &trans + >; + }; + }; +}; diff --git a/app/boards/shields/pancake/pancake.overlay b/app/boards/shields/pancake/pancake.overlay new file mode 100644 index 00000000..53e8c8c1 --- /dev/null +++ b/app/boards/shields/pancake/pancake.overlay @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +/ { + chosen { + zmk,kscan = &kscan0; + }; + + kscan0: kscan_0 { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + diode-direction = "col2row"; + + col-gpios + = <&pro_micro 21 GPIO_ACTIVE_HIGH> + , <&pro_micro 20 GPIO_ACTIVE_HIGH> + , <&pro_micro 19 GPIO_ACTIVE_HIGH> + , <&pro_micro 18 GPIO_ACTIVE_HIGH> + , <&pro_micro 7 GPIO_ACTIVE_HIGH> + , <&pro_micro 8 GPIO_ACTIVE_HIGH> + , <&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 3 GPIO_ACTIVE_HIGH> + , <&pro_micro 2 GPIO_ACTIVE_HIGH> + ; + + row-gpios + = <&pro_micro 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + }; +}; diff --git a/app/boards/shields/pancake/pancake.zmk.yml b/app/boards/shields/pancake/pancake.zmk.yml new file mode 100644 index 00000000..21cc5444 --- /dev/null +++ b/app/boards/shields/pancake/pancake.zmk.yml @@ -0,0 +1,8 @@ +file_format: "1" +id: pancake +name: Pancake +type: shield +url: https://mkultra.click/pancake-keyboard-kit +requires: [pro_micro] +features: + - keys