From dcd665999a5ee04372559d56fc22b9a2d0784bf2 Mon Sep 17 00:00:00 2001 From: pbz Date: Sat, 2 Jan 2021 13:52:50 -0500 Subject: [PATCH] feat(shields): add bfo9000 shield PR: #472 --- .github/workflows/build.yml | 2 + app/boards/shields/bfo9000/Kconfig.defconfig | 26 +++++++++ app/boards/shields/bfo9000/Kconfig.shield | 8 +++ app/boards/shields/bfo9000/bfo9000.conf | 0 app/boards/shields/bfo9000/bfo9000.dtsi | 44 +++++++++++++++ app/boards/shields/bfo9000/bfo9000.keymap | 55 +++++++++++++++++++ app/boards/shields/bfo9000/bfo9000_left.conf | 0 .../shields/bfo9000/bfo9000_left.overlay | 21 +++++++ app/boards/shields/bfo9000/bfo9000_right.conf | 0 .../shields/bfo9000/bfo9000_right.overlay | 25 +++++++++ app/boards/shields/bfo9000/readme.md | 13 +++++ docs/docs/hardware.md | 1 + docs/static/setup.ps1 | 6 +- docs/static/setup.sh | 3 +- 14 files changed, 200 insertions(+), 4 deletions(-) create mode 100644 app/boards/shields/bfo9000/Kconfig.defconfig create mode 100644 app/boards/shields/bfo9000/Kconfig.shield create mode 100644 app/boards/shields/bfo9000/bfo9000.conf create mode 100644 app/boards/shields/bfo9000/bfo9000.dtsi create mode 100644 app/boards/shields/bfo9000/bfo9000.keymap create mode 100644 app/boards/shields/bfo9000/bfo9000_left.conf create mode 100644 app/boards/shields/bfo9000/bfo9000_left.overlay create mode 100644 app/boards/shields/bfo9000/bfo9000_right.conf create mode 100644 app/boards/shields/bfo9000/bfo9000_right.overlay create mode 100644 app/boards/shields/bfo9000/readme.md diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1c2a5119..58da8c41 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,6 +23,8 @@ jobs: - nrfmicro_13 - proton_c shield: + - bfo9000_left + - bfo9000_right - boardsource3x4 - corne_left - corne_right diff --git a/app/boards/shields/bfo9000/Kconfig.defconfig b/app/boards/shields/bfo9000/Kconfig.defconfig new file mode 100644 index 00000000..e4b02e8c --- /dev/null +++ b/app/boards/shields/bfo9000/Kconfig.defconfig @@ -0,0 +1,26 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +if SHIELD_BFO9000_LEFT + +config ZMK_SPLIT_BLE_ROLE_CENTRAL + default y + +config ZMK_KEYBOARD_NAME + default "BFO9000 Left" + +endif + +if SHIELD_BFO9000_RIGHT + +config ZMK_KEYBOARD_NAME + default "BFO9000 Right" + +endif + +if SHIELD_BFO9000_LEFT || SHIELD_BFO9000_RIGHT + +config ZMK_SPLIT + default y + +endif \ No newline at end of file diff --git a/app/boards/shields/bfo9000/Kconfig.shield b/app/boards/shields/bfo9000/Kconfig.shield new file mode 100644 index 00000000..4750e43a --- /dev/null +++ b/app/boards/shields/bfo9000/Kconfig.shield @@ -0,0 +1,8 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config SHIELD_BFO9000_LEFT + def_bool $(shields_list_contains,bfo9000_left) + +config SHIELD_BFO9000_RIGHT + def_bool $(shields_list_contains,bfo9000_right) diff --git a/app/boards/shields/bfo9000/bfo9000.conf b/app/boards/shields/bfo9000/bfo9000.conf new file mode 100644 index 00000000..e69de29b diff --git a/app/boards/shields/bfo9000/bfo9000.dtsi b/app/boards/shields/bfo9000/bfo9000.dtsi new file mode 100644 index 00000000..33b364e1 --- /dev/null +++ b/app/boards/shields/bfo9000/bfo9000.dtsi @@ -0,0 +1,44 @@ + /* + * 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"; + columns = <18>; + rows = <6>; + 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(0,13) RC(0,14) RC(0,15) RC(0,16) RC(0,17) + 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,11) RC(1,12) RC(1,13) RC(1,14) RC(1,15) RC(1,16) RC(1,17) + RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) RC(2,12) RC(2,13) RC(2,14) RC(2,15) RC(2,16) RC(2,17) + RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11) RC(3,12) RC(3,13) RC(3,14) RC(3,15) RC(3,16) RC(3,17) + RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(4,6) RC(4,7) RC(4,8) RC(4,9) RC(4,10) RC(4,11) RC(4,12) RC(4,13) RC(4,14) RC(4,15) RC(4,16) RC(4,17) + RC(5,0) RC(5,1) RC(5,2) RC(5,3) RC(5,4) RC(5,5) RC(5,6) RC(5,7) RC(5,8) RC(5,9) RC(5,10) RC(5,11) RC(5,12) RC(5,13) RC(5,14) RC(5,15) RC(5,16) RC(5,17) + >; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + + diode-direction = "col2row"; + row-gpios + = <&pro_micro_d 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + + }; +}; \ No newline at end of file diff --git a/app/boards/shields/bfo9000/bfo9000.keymap b/app/boards/shields/bfo9000/bfo9000.keymap new file mode 100644 index 00000000..fe904931 --- /dev/null +++ b/app/boards/shields/bfo9000/bfo9000.keymap @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include +#include +#include +#include + +#define DEFAULT 0 +#define LOWER 1 + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { + // | Esc | Vol Up | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Del | + // | Home | Vol Dn | ` | 1 | 2 | 3 | 4 | 5 | 6 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bk Spc | + // | End | Tab | Tab | Q | W | E | R | T | Y | T | Y | U | I | O | P | [ | ] | \ | + // | Pg Up | Caps | Ctrl | A | S | D | F | G | H | G | H | J | K | L | ; | ' | Enter | Enter | + // | Pg Dn | Up | Shift | Z | X | C | V | B | N | B | N | M | , | . | / | Shift | Up | | + // | Left | Dn | Right | Ctrl | Alt | Win | Spc | Spc | Enter | Bk Spc | Spc | Spc | Win | Alt | Ctrl | Left | Dn | Right | + bindings = < + &kp ESC &kp C_VOL_UP &kp ESC &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &kp DEL + &kp HOME &kp C_VOL_DN &kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC + &kp END &kp TAB &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp BSLH + &kp PG_UP &kp CAPS &kp LCTRL &kp A &kp S &kp D &kp F &kp G &kp H &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp APOS &kp ENTER &kp ENTER + &kp PG_DN &kp UP &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp B &kp N &kp M &kp COMMA &kp DOT &kp SLASH &kp RSHFT &kp UP &mo LOWER + &kp LEFT &kp DOWN &kp RIGHT &kp LCTRL &kp LALT &kp LMETA &kp SPACE &kp SPACE &kp ENTER &kp BSPC &kp SPACE &kp SPACE &kp RMETA &kp RALT &kp RCTRL &kp LEFT &kp DOWN &kp RIGHT + >; + }; + + lower_layer { + // | | | | | | | | | | | | | | | | | | | + // | | | | | | | | | | | | | | | | | | | + // | | | | | | | | | | | | | | | | | | | + // | | | | | | | | | | | | | | | | | | | + // | | | | | | | | | | | | | | | | | | | + // | | | | | | | | | | | | | | | | | | | + bindings = < + &bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &bt BT_SEL 5 &bt BT_SEL 6 &bt BT_SEL 7 &bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &bt BT_SEL 5 &bt BT_SEL 6 &bt BT_SEL 7 + &out OUT_USB &out OUT_BLE &trans &trans &trans &trans &trans &trans &trans &out OUT_USB &out OUT_BLE &trans &trans &trans &trans &trans &trans &trans + &ext_power EP_ON &ext_power EP_OFF &trans &trans &trans &trans &trans &trans &trans &ext_power EP_ON &ext_power EP_OFF &trans &trans &trans &trans &trans &trans &trans + &reset &bootloader &trans &trans &trans &trans &trans &trans &trans &reset &bootloader &trans &trans &trans &trans &trans &trans &trans + &rgb_ug RGB_TOG &rgb_ug RGB_HUI &rgb_ug RGB_SAI &rgb_ug RGB_BRI &rgb_ug RGB_SPI &rgb_ug RGB_EFF &trans &trans &trans &rgb_ug RGB_TOG &rgb_ug RGB_HUI &rgb_ug RGB_SAI &rgb_ug RGB_BRI &rgb_ug RGB_SPI &rgb_ug RGB_EFF &trans &trans &trans + &trans &rgb_ug RGB_HUD &rgb_ug RGB_SAD &rgb_ug RGB_BRD &rgb_ug RGB_SPD &rgb_ug RGB_EFR &trans &trans &trans &trans &rgb_ug RGB_HUD &rgb_ug RGB_SAD &rgb_ug RGB_BRD &rgb_ug RGB_SPD &rgb_ug RGB_EFR &trans &trans &trans + >; + }; + }; +}; diff --git a/app/boards/shields/bfo9000/bfo9000_left.conf b/app/boards/shields/bfo9000/bfo9000_left.conf new file mode 100644 index 00000000..e69de29b diff --git a/app/boards/shields/bfo9000/bfo9000_left.overlay b/app/boards/shields/bfo9000/bfo9000_left.overlay new file mode 100644 index 00000000..777f0835 --- /dev/null +++ b/app/boards/shields/bfo9000/bfo9000_left.overlay @@ -0,0 +1,21 @@ + /* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "bfo9000.dtsi" + +&kscan0 { + col-gpios + = <&pro_micro_d 9 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 10 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 16 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 14 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 15 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 0 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 1 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 2 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 3 GPIO_ACTIVE_HIGH> + ; +}; diff --git a/app/boards/shields/bfo9000/bfo9000_right.conf b/app/boards/shields/bfo9000/bfo9000_right.conf new file mode 100644 index 00000000..e69de29b diff --git a/app/boards/shields/bfo9000/bfo9000_right.overlay b/app/boards/shields/bfo9000/bfo9000_right.overlay new file mode 100644 index 00000000..ab3fb55f --- /dev/null +++ b/app/boards/shields/bfo9000/bfo9000_right.overlay @@ -0,0 +1,25 @@ + /* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "bfo9000.dtsi" + +&default_transform { + col-offset = <9>; +}; + +&kscan0 { + col-gpios + = <&pro_micro_d 9 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 10 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 16 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 14 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 15 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 0 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 1 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 2 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 3 GPIO_ACTIVE_HIGH> + ; +}; diff --git a/app/boards/shields/bfo9000/readme.md b/app/boards/shields/bfo9000/readme.md new file mode 100644 index 00000000..1e91fdcf --- /dev/null +++ b/app/boards/shields/bfo9000/readme.md @@ -0,0 +1,13 @@ +# [BFO-9000](https://keeb.io/products/bfo-9000-keyboard-customizable-full-size-split-ortholinear) + +Customizable full-size split ortholinear. + +## Features + +* Compatible with MX-compatible, Alps-compatible, and Kailh Low-Profile Choc switches. +* Breakoff pieces to allow for 4 to 6 rows and 7 to 9 columns. +* RGB LED connections + +## Hardware Notes + +[Included default keymap](http://www.keyboard-layout-editor.com/#/gists/51293c31afcd5f1765e8f413a46bfcf8) \ No newline at end of file diff --git a/docs/docs/hardware.md b/docs/docs/hardware.md index 98f8715f..244bdd60 100644 --- a/docs/docs/hardware.md +++ b/docs/docs/hardware.md @@ -38,6 +38,7 @@ That being said, there are currently only a few specific [boards](/docs/faq#what - [CRBN](https://keygem.store/collections/group-buys/products/group-buy-featherlight-40-kit) (`crbn`) - [tidbit](https://nullbits.co/tidbit/) (`tidbit`) - [Eek!](https://www.cbkbd.com/product/eek-keyboard) (`eek`) +- [BFO-9000](https://keeb.io/products/bfo-9000-keyboard-customizable-full-size-split-ortholinear) (`bfo9000_left` and `bfo9000_right`) ## Other Hardware diff --git a/docs/static/setup.ps1 b/docs/static/setup.ps1 index a521934e..ffd938f4 100644 --- a/docs/static/setup.ps1 +++ b/docs/static/setup.ps1 @@ -91,9 +91,9 @@ Write-Host "Keyboard Shield Selection:" $prompt = "Pick a keyboard" # TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos. -$options = "Kyria", "Lily58", "Corne", "Splitreus62", "Sofle", "Iris", "Reviung41", "RoMac", "RoMac+", "makerdiary M60", "Microdox", "TG4X", "QAZ", "NIBBLE", "Jorne", "Jian", "CRBN", "Tidbit", "Eek!" -$names = "kyria", "lily58", "corne", "splitreus62", "sofle", "iris", "reviung41", "romac", "romac_plus", "m60", "microdox", "tg4x", "qaz", "nibble", "jorne", "jian", "crbn", "tidbit", "eek" -$splits = "y", "y", "y", "y", "y", "y", "n", "n", "n", "n", "y", "n", "n", "n", "y", "y", "n", "n", "n" +$options = "Kyria", "Lily58", "Corne", "Splitreus62", "Sofle", "Iris", "Reviung41", "RoMac", "RoMac+", "makerdiary M60", "Microdox", "TG4X", "QAZ", "NIBBLE", "Jorne", "Jian", "CRBN", "Tidbit", "Eek!", "BFO-9000" +$names = "kyria", "lily58", "corne", "splitreus62", "sofle", "iris", "reviung41", "romac", "romac_plus", "m60", "microdox", "tg4x", "qaz", "nibble", "jorne", "jian", "crbn", "tidbit", "eek", "bfo9000" +$splits = "y", "y", "y", "y", "y", "y", "n", "n", "n", "n", "y", "n", "n", "n", "y", "y", "n", "n", "n", "n" $choice = Get-Choice-From-Options -Options $options -Prompt $prompt $shield_title = $($options[$choice]) diff --git a/docs/static/setup.sh b/docs/static/setup.sh index 5ceff674..486bb06c 100644 --- a/docs/static/setup.sh +++ b/docs/static/setup.sh @@ -92,7 +92,7 @@ echo "" echo "Keyboard Shield Selection:" prompt="Pick an keyboard:" -options=("Kyria" "Lily58" "Corne" "Splitreus62" "Sofle" "Iris" "Reviung41" "RoMac" "RoMac+" "makerdiary M60" "Microdox" "TG4X" "QAZ" "Jorne" "Jian" "CRBN" "Tidbit" "Eek!") +options=("Kyria" "Lily58" "Corne" "Splitreus62" "Sofle" "Iris" "Reviung41" "RoMac" "RoMac+" "makerdiary M60" "Microdox" "TG4X" "QAZ" "Jorne" "Jian" "CRBN" "Tidbit" "Eek!" "BF0-9000") PS3="$prompt " # TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos. @@ -120,6 +120,7 @@ select opt in "${options[@]}" "Quit"; do 17 ) shield_title="CRBN" shield="crbn"; split="n"; break;; 18 ) shield_title="Tidbit" shield="tidbit"; split="n" break;; 19 ) shield_title="Eek!" shield="eek"; split="n" break;; + 17 ) shield_title="BFO-9000" shield="bfo9000"; split="y"; break;; # Add link to docs on adding your own custom shield in your ZMK config! # $(( ${#options[@]}+1 )) ) echo "Other!"; break;;