From eca051efa03b1dd533a6086f32699e621d24d337 Mon Sep 17 00:00:00 2001 From: Ryan Butler Date: Mon, 13 Dec 2021 14:41:52 -0500 Subject: [PATCH] Add support for keeb.io fourier split keyboard (#1056) * Add support for keeb.io fourier * Update app/boards/shields/fourier/fourier_right.overlay Co-authored-by: Nick Winans * Update app/boards/shields/fourier/fourier_left.overlay Co-authored-by: Nick Winans * Convert spaces to tabs in .dtsi Co-authored-by: Nick Winans --- app/boards/shields/fourier/Kconfig.defconfig | 20 ++++++ app/boards/shields/fourier/Kconfig.shield | 9 +++ app/boards/shields/fourier/fourier.dtsi | 43 +++++++++++++ app/boards/shields/fourier/fourier.keymap | 64 +++++++++++++++++++ app/boards/shields/fourier/fourier.zmk.yml | 12 ++++ .../shields/fourier/fourier_left.overlay | 18 ++++++ .../shields/fourier/fourier_right.overlay | 23 +++++++ 7 files changed, 189 insertions(+) create mode 100644 app/boards/shields/fourier/Kconfig.defconfig create mode 100644 app/boards/shields/fourier/Kconfig.shield create mode 100644 app/boards/shields/fourier/fourier.dtsi create mode 100644 app/boards/shields/fourier/fourier.keymap create mode 100644 app/boards/shields/fourier/fourier.zmk.yml create mode 100644 app/boards/shields/fourier/fourier_left.overlay create mode 100644 app/boards/shields/fourier/fourier_right.overlay diff --git a/app/boards/shields/fourier/Kconfig.defconfig b/app/boards/shields/fourier/Kconfig.defconfig new file mode 100644 index 00000000..74a186e1 --- /dev/null +++ b/app/boards/shields/fourier/Kconfig.defconfig @@ -0,0 +1,20 @@ +# Copyright (c) 2021 The ZMK Contributors +# SPDX-License-Identifier: MIT + + +if SHIELD_FOURIER_LEFT + +config ZMK_KEYBOARD_NAME + default "Fourier" + +config ZMK_SPLIT_BLE_ROLE_CENTRAL + default y + +endif + +if SHIELD_FOURIER_LEFT || SHIELD_FOURIER_RIGHT + +config ZMK_SPLIT + default y + +endif diff --git a/app/boards/shields/fourier/Kconfig.shield b/app/boards/shields/fourier/Kconfig.shield new file mode 100644 index 00000000..2e337410 --- /dev/null +++ b/app/boards/shields/fourier/Kconfig.shield @@ -0,0 +1,9 @@ +# Copyright (c) 2021 The ZMK Contributors +# SPDX-License-Identifier: MIT + + +config SHIELD_FOURIER_LEFT + def_bool $(shields_list_contains,fourier_left) + +config SHIELD_FOURIER_RIGHT + def_bool $(shields_list_contains,fourier_right) diff --git a/app/boards/shields/fourier/fourier.dtsi b/app/boards/shields/fourier/fourier.dtsi new file mode 100644 index 00000000..99027ea9 --- /dev/null +++ b/app/boards/shields/fourier/fourier.dtsi @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include + +/ { + chosen { + zmk,kscan = &kscan0; + zmk,matrix_transform = &default_transform; + }; + + /* + * This transform correspondsto the 60% left without macro keypad and 65% right, even this + * combination of PCBs can have keys in different locations based on configuration. + */ + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <13>; + rows = <4>; + map = < +RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) /**/ RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0, 11) RC(0,12) +RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) /**/ RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,12) +RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) /**/ RC(2,6) RC(2,8) RC(2,9) RC(2,10) RC(2,11) RC(2,12) +RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) /**/ RC(3,6) RC(3,9) RC(3,10) RC(3,11) RC(3,12) + >; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + + diode-direction = "col2row"; + row-gpios + = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // Row A + , <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // Row B + , <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // Row C + , <&pro_micro 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // Row D + ; + }; +}; diff --git a/app/boards/shields/fourier/fourier.keymap b/app/boards/shields/fourier/fourier.keymap new file mode 100644 index 00000000..f0912bf1 --- /dev/null +++ b/app/boards/shields/fourier/fourier.keymap @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2021 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include +#include + +/ { + keymap { + compatible = "zmk,keymap"; + +// ---------------------------------------------- ---------------------------------------------- +// | ESC | Q | W | E | R | T | | Y | U | I | O | P | | BKSP | +// | TAB | A | S | D | F | G | | H | J | K | L | ' | ENTER | +// | SHIFT | Z | X | C | V | B | | N | M | , | . | / | RSHFT | +// | LCTRL | LALT| LGUI | SPACE | | SPACE/L1 | L2 | RGUI | RALT |RCTRL| +// ------------------------------------------- ----------------------------------------------- + + 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 &none &kp BACKSPACE + &kp TAB &kp A &kp S &kp D &kp F &kp G /**/ &kp H &kp J &kp K &kp L &kp SQT &kp ENTER + &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 LCTRL &kp LALT &kp LGUI &none &kp SPACE /**/ < 1 SPACE &mo 2 &kp RGUI &kp RALT &kp RCTRL + >; + }; + +// ---------------------------------------------- ---------------------------------------------- +// | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | O | PSCR | | DEL | +// | ` | | <- | ^ | -> | Vo+ | | [ | ] | - | = | ; | \ | +// | trans | | | | V | Vo- | | | | | | | trans | +// | trans | trans| trans | trans | | trans | trans | trans | trans|trans| +// ------------------------------------------- ----------------------------------------------- + + symbols_layer { + bindings = < + &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 /**/ &kp N7 &kp N8 &kp N9 &kp N0 &kp PSCRN &none &kp DEL + &kp GRAVE &none &kp LEFT &kp UP &kp RIGHT &kp C_VOL_UP /**/ &kp LBKT &kp RBKT &kp MINUS &kp EQUAL &kp SEMI &kp BACKSLASH + &trans &none &none &none &kp DOWN &kp C_VOL_DN /**/ &none &none &none &none &none &trans + &trans &trans &trans &none &trans /**/ &trans &trans &trans &trans &trans + >; + }; + +// ---------------------------------------------- ---------------------------------------------- +// | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F1O | F11 | | F12 | +// | CAP | | home| PgUp | End | | | | | | | | | +// | trans | RGB T | RGB M | PgDn | | | BT_NXT | BT_CLR | | | | |trans| +// | trans | trans| trans | trans | | trans | trans | trans | trans | trans | +// ------------------------------------------- ----------------------------------------------- + + fn_layer { + bindings = < + &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 /**/ &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &none &kp F12 + &kp CAPS &none &kp HOME &kp PG_UP &kp END &none /**/ &none &none &none &none &none &none + &trans &rgb_ug RGB_TOG &rgb_ug RGB_EFF &none &kp PG_DN &none /**/ &bt BT_NXT &bt BT_CLR &none &none &none &trans + &trans &trans &trans &none &trans /**/ &trans &trans &trans &trans &trans + >; + }; + }; +}; diff --git a/app/boards/shields/fourier/fourier.zmk.yml b/app/boards/shields/fourier/fourier.zmk.yml new file mode 100644 index 00000000..d4e3b3ca --- /dev/null +++ b/app/boards/shields/fourier/fourier.zmk.yml @@ -0,0 +1,12 @@ +file_format: "1" +id: fourier +name: Fourier Rev. 1 +type: shield +url: https://github.com/keebio/fourier +requires: + - pro_micro +features: + - keys +siblings: + - fourier_left + - fourier_right diff --git a/app/boards/shields/fourier/fourier_left.overlay b/app/boards/shields/fourier/fourier_left.overlay new file mode 100644 index 00000000..1d0f2c81 --- /dev/null +++ b/app/boards/shields/fourier/fourier_left.overlay @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2021 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "fourier.dtsi" + +&kscan0 { + col-gpios + = <&pro_micro 20 GPIO_ACTIVE_HIGH> // Col1 + , <&pro_micro 19 GPIO_ACTIVE_HIGH> // Col2 + , <&pro_micro 18 GPIO_ACTIVE_HIGH> // Col3 + , <&pro_micro 15 GPIO_ACTIVE_HIGH> // Col4 + , <&pro_micro 14 GPIO_ACTIVE_HIGH> // Col5 + , <&pro_micro 16 GPIO_ACTIVE_HIGH> // Col6 + ; +}; diff --git a/app/boards/shields/fourier/fourier_right.overlay b/app/boards/shields/fourier/fourier_right.overlay new file mode 100644 index 00000000..77c00d60 --- /dev/null +++ b/app/boards/shields/fourier/fourier_right.overlay @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "fourier.dtsi" + +&default_transform { + col-offset = <6>; +}; + +&kscan0 { + col-gpios + = <&pro_micro 20 GPIO_ACTIVE_HIGH> // Col1 + , <&pro_micro 19 GPIO_ACTIVE_HIGH> // Col2 + , <&pro_micro 18 GPIO_ACTIVE_HIGH> // Col3 + , <&pro_micro 15 GPIO_ACTIVE_HIGH> // Col4 + , <&pro_micro 14 GPIO_ACTIVE_HIGH> // Col5 + , <&pro_micro 16 GPIO_ACTIVE_HIGH> // Col6 + , <&pro_micro 10 GPIO_ACTIVE_HIGH> // Col7 + ; +};