Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Bastyl shield #604

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
- nrfmicro_13
- proton_c
shield:
- bastyl_left
- bastyl_right
- bfo9000_left
- bfo9000_right
- boardsource3x4
Expand Down
28 changes: 28 additions & 0 deletions app/boards/shields/bastyl/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

# Copyright (c) 2020 Derek Schmell
# SPDX-License-Identifier: MIT


if SHIELD_BASTYL_LEFT

config ZMK_KEYBOARD_NAME
default "Bastyl Left"

config ZMK_SPLIT_BLE_ROLE_CENTRAL
default y

endif

if SHIELD_BASTYL_RIGHT

config ZMK_KEYBOARD_NAME
default "Bastyl Right"

endif

if SHIELD_BASTYL_LEFT || SHIELD_BASTYL_RIGHT

config ZMK_SPLIT
default y

endif
8 changes: 8 additions & 0 deletions app/boards/shields/bastyl/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2020 ZMK Contributors
# SPDX-License-Identifier: MIT

config SHIELD_BASTYL_LEFT
def_bool $(shields_list_contains,bastyl_left)

config SHIELD_BASTYL_RIGHT
def_bool $(shields_list_contains,bastyl_right)
Empty file.
51 changes: 51 additions & 0 deletions app/boards/shields/bastyl/bastyl.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright (c) 2020 ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include <dt-bindings/zmk/matrix_transform.h>

/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};

default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <12>;
rows = <5>;
// 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(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(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(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(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(5,5) RC(5,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(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(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(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(4,3) RC(4,4) RC(4,1) RC(4,10) RC(4,7) RC(4,8)
RC(4,5) RC(4,2) RC(4,9) RC(4,6)
>;
};

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";

diode-direction = "row2col";
row-gpios
= <&pro_micro_d 6 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 9 GPIO_ACTIVE_HIGH>
, <&pro_micro_a 0 GPIO_ACTIVE_HIGH>
, <&pro_micro_a 1 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 10 GPIO_ACTIVE_HIGH>
;

};
};

72 changes: 72 additions & 0 deletions app/boards/shields/bastyl/bastyl.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
* Copyright (c) 2020 ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/


#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>

/ {
keymap {
compatible = "zmk,keymap";

default_layer {
// ------------------------------------------------------------------------------------------------------------
// | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BKSP |
// | TAB | Q | W | E | R | T | | Y | U | I | O | P | - |
// | SHIFT | A | S | D | F | G | | H | J | K | L | ; | ' |
// | CTRL | Z | X | C | V | B | | N | M | , | . | / | \ |
// | CTRL | SPCE | LOWER| | RAISE| ENTR | RGUI|
// | HOME | BKSP | | DEL | ALT |
bindings = <
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp BSPC
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp MINUS
&kp LSHFT &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
&kp LCTRL &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp BSLH
&kp LCTRL &kp SPACE &mo 1 &mo 2 &kp ENTER &kp RGUI
&kp HOME &kp BSPC &kp DEL &kp RALT
>;
};

lower_layer {
// ------------------------------------------------------------------------------------------------------------
// | TILDE | ! | @ | # | $ | % | | ^ | & | * | ( | ) | DEL |
// | RESET | | | | | [ | | ] | 7 | 8 | 9 | | + |
// | | HOME | PG UP | PG DN | END | ( | | ) | 4 | 5 | 6 | - | "|" |
// | | | | | | | | | | | 1 | 2 | 3 | = | _ |
// | CTRL | SPCE | | | | ENTR | RGUI|
// | HOME | BKSP | | DEL | ALT |

bindings = <
&kp TILDE &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp STAR &kp LPAR &kp RPAR &kp DEL
&reset &trans &trans &trans &trans &kp LBKT &kp RBKT &kp KP_N7 &kp KP_N8 &kp N9 &trans &kp PLUS
&trans &kp HOME &kp PG_UP &kp PG_DN &kp END &kp LPAR &kp RPAR &kp KP_N4 &kp KP_N5 &kp KP_N6 &kp KP_MINUS &kp PIPE
&trans &trans &trans &trans &trans &trans &trans &kp KP_N1 &kp KP_N2 &kp KP_N3 &kp KP_EQUAL &kp UNDER
&kp LCTRL &kp SPACE &trans &trans &kp ENTER &kp RGUI
&kp HOME &kp BSPC &kp DEL &kp RALT
>;
};

raise_layer {
// ------------------------------------------------------------------------------------------------------------
// | F12 | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 |
// | | | | | | [ | | ] | | NUM LOCK | INS | SCL LOCK | MUTE |
// | | LEFT | UP | DOWN | RIGHT | ( | | ) | PREV | PLAY | NEXT | | VOL UP |
// | BT CLR | BT SEL 0 | BT SEL 1 | BT SEL 2 | BT SEL 3 | BT SEL 4 | | | | | | | | | VOL DN |
// | CTRL | SPCE | | | | ENTR | RGUI |
// | HOME | BKSP | | DEL | ALT |

bindings = <
&kp F12 &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11
&trans &trans &trans &trans &trans &kp LBKT &kp RBKT &trans &kp LNLCK &kp INS &kp SLCK &kp K_MUTE
&trans &kp LEFT &kp UP &kp DOWN &kp RIGHT &kp LPAR &kp RPAR &kp K_PREV &kp C_PLAY &kp K_NEXT &trans &kp K_VOL_UP
&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 &kp K_VOL_DN
&kp LCTRL &kp SPACE &trans &trans &kp ENTER &kp RGUI
&kp HOME &kp BSPC &kp DEL &kp RALT
>;
};
};
};
Empty file.
18 changes: 18 additions & 0 deletions app/boards/shields/bastyl/bastyl_left.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright (c) 2020 ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include "bastyl.dtsi"

&kscan0 {
col-gpios
= <&pro_micro_d 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
Empty file.
22 changes: 22 additions & 0 deletions app/boards/shields/bastyl/bastyl_right.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2020 ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include "bastyl.dtsi"

&default_transform {
col-offset = <6>;
};

&kscan0 {
col-gpios
= <&pro_micro_d 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
1 change: 1 addition & 0 deletions docs/docs/hardware.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ That being said, there are currently only a few specific [boards](/docs/faq#what
- [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`)
- [Bastyl](https://www.hidtech.ca/?product=bastyl) (`bastyl_left` and `bastyl_right`)

## Other Hardware

Expand Down
6 changes: 3 additions & 3 deletions docs/static/setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,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!", "BFO-9000", "Helix"
$names = "kyria", "lily58", "corne", "splitreus62", "sofle", "iris", "reviung41", "romac", "romac_plus", "m60", "microdox", "tg4x", "qaz", "nibble", "jorne", "jian", "crbn", "tidbit", "eek", "bfo9000", "helix"
$splits = "y", "y", "y", "y", "y", "y", "n", "n", "n", "n", "y", "n", "n", "n", "y", "y", "n", "n", "n", "n", "y"
$options = "Kyria", "Lily58", "Corne", "Splitreus62", "Sofle", "Iris", "Reviung41", "RoMac", "RoMac+", "makerdiary M60", "Microdox", "TG4X", "QAZ", "NIBBLE", "Jorne", "Jian", "CRBN", "Tidbit", "Eek!", "BFO-9000", "Helix", "Bastyl"
$names = "kyria", "lily58", "corne", "splitreus62", "sofle", "iris", "reviung41", "romac", "romac_plus", "m60", "microdox", "tg4x", "qaz", "nibble", "jorne", "jian", "crbn", "tidbit", "eek", "bfo9000", "helix", "bastyl"
$splits = "y", "y", "y", "y", "y", "y", "n", "n", "n", "n", "y", "n", "n", "n", "y", "y", "n", "n", "n", "n", "y", "y"

$choice = Get-Choice-From-Options -Options $options -Prompt $prompt
$shield_title = $($options[$choice])
Expand Down
3 changes: 2 additions & 1 deletion docs/static/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,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" "NIBBLE" "Jorne" "Jian" "CRBN" "Tidbit" "Eek!" "BF0-9000" "Helix")
options=("Kyria" "Lily58" "Corne" "Splitreus62" "Sofle" "Iris" "Reviung41" "RoMac" "RoMac+" "makerdiary M60" "Microdox" "TG4X" "QAZ" "NIBBLE" "Jorne" "Jian" "CRBN" "Tidbit" "Eek!" "BF0-9000" "Helix" "Bastyl")

PS3="$prompt "
# TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos.
Expand Down Expand Up @@ -121,6 +121,7 @@ select opt in "${options[@]}" "Quit"; do
19 ) shield_title="Eek!" shield="eek"; split="n" break;;
20 ) shield_title="BFO-9000" shield="bfo9000"; split="y"; break;;
21 ) shield_title="Helix" shield="helix"; split="y"; break;;
22 ) shield_title="Bastyl" shield="bastyl"; split="y"; break;;

# Add link to docs on adding your own custom shield in your ZMK config!
# $(( ${#options[@]}+1 )) ) echo "Other!"; break;;
Expand Down