From be1d824d1ef709aa219e376788e2b3e1541f1032 Mon Sep 17 00:00:00 2001 From: DonPavlov <1541649+DonPavlov@users.noreply.github.com> Date: Sat, 24 Apr 2021 00:18:27 +0200 Subject: [PATCH] Add BlueHand Keyboard macropad --- .github/workflows/build.yml | 1 + app/boards/shields/bluehand/Kconfig.defconfig | 6 +++ app/boards/shields/bluehand/Kconfig.shield | 8 ++++ app/boards/shields/bluehand/README.md | 12 +++++ app/boards/shields/bluehand/bluehand.conf | 8 ++++ app/boards/shields/bluehand/bluehand.keymap | 37 ++++++++++++++++ app/boards/shields/bluehand/bluehand.overlay | 44 +++++++++++++++++++ docs/docs/hardware.md | 1 + docs/static/setup.ps1 | 12 ++--- docs/static/setup.sh | 3 +- 10 files changed, 125 insertions(+), 7 deletions(-) create mode 100644 app/boards/shields/bluehand/Kconfig.defconfig create mode 100644 app/boards/shields/bluehand/Kconfig.shield create mode 100644 app/boards/shields/bluehand/README.md create mode 100644 app/boards/shields/bluehand/bluehand.conf create mode 100644 app/boards/shields/bluehand/bluehand.keymap create mode 100644 app/boards/shields/bluehand/bluehand.overlay diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d7011283..032c8d85 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,6 +25,7 @@ jobs: shield: - bfo9000_left - bfo9000_right + - bluehand - boardsource3x4 - corne_left - corne_right diff --git a/app/boards/shields/bluehand/Kconfig.defconfig b/app/boards/shields/bluehand/Kconfig.defconfig new file mode 100644 index 00000000..d1bd2c79 --- /dev/null +++ b/app/boards/shields/bluehand/Kconfig.defconfig @@ -0,0 +1,6 @@ +if SHIELD_BLUEHAND + +config ZMK_KEYBOARD_NAME + default "BlueHand" + +endif \ No newline at end of file diff --git a/app/boards/shields/bluehand/Kconfig.shield b/app/boards/shields/bluehand/Kconfig.shield new file mode 100644 index 00000000..599aea3b --- /dev/null +++ b/app/boards/shields/bluehand/Kconfig.shield @@ -0,0 +1,8 @@ +# Copyright (c) 2021 Mike "KemoNine" Crosson +# Copyright (c) 2021 jpconstantineau +# Copyright (c) 2021 DonPavlov + +# SPDX-License-Identifier: MIT + +config SHIELD_BLUEHAND + def_bool $(shields_list_contains,bluehand) \ No newline at end of file diff --git a/app/boards/shields/bluehand/README.md b/app/boards/shields/bluehand/README.md new file mode 100644 index 00000000..082ceadc --- /dev/null +++ b/app/boards/shields/bluehand/README.md @@ -0,0 +1,12 @@ +# BlueHand + +This directory contains a macropad implementation for `BlueHand` hardware being developed by Pierre Constantineau (jpconstantineau) + +Shop: +https://www.tindie.com/products/jpconstantineau/2x4-ble-macropad-for-mechanical-switches/ + +Documentation: +http://nrf52.jpconstantineau.com/docs/macropad/bluehand/ + + +Layout developed by (DonPavlov) \ No newline at end of file diff --git a/app/boards/shields/bluehand/bluehand.conf b/app/boards/shields/bluehand/bluehand.conf new file mode 100644 index 00000000..397ac719 --- /dev/null +++ b/app/boards/shields/bluehand/bluehand.conf @@ -0,0 +1,8 @@ +# Copyright (c) 2021 Mike "KemoNine" Crosson +# Copyright (c) 2021 jpconstantineau +# Copyright (c) 2021 DonPavlov +# SPDX-License-Identifier: MIT + +# Turn on deep sleep +CONFIG_ZMK_SLEEP=y +CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000 \ No newline at end of file diff --git a/app/boards/shields/bluehand/bluehand.keymap b/app/boards/shields/bluehand/bluehand.keymap new file mode 100644 index 00000000..766a3214 --- /dev/null +++ b/app/boards/shields/bluehand/bluehand.keymap @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2021 DonPavlov + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { +// ------------------- +// | F13 | F14 | F15 | LCTRL+ALT+A | +// | MO(1) | F16 | F17 | F18 | +// ---------------------- + bindings = < + &kp F13 &kp F14 &kp F15 &kp LC(LA(A)) + &mo 1 &kp F16 &kp F17 &kp F18 + >; + }; + + nav_layer { +// ----------------------- +// | F19 | F20 | F21 | F22 | +// | - | F23 | F24 | - | +// ----------------------- + bindings = < + &kp F19 &kp F20 &kp F21 &kp F22 + &trans &kp F23 &kp F24 &trans + >; + }; + }; +}; \ No newline at end of file diff --git a/app/boards/shields/bluehand/bluehand.overlay b/app/boards/shields/bluehand/bluehand.overlay new file mode 100644 index 00000000..a888b509 --- /dev/null +++ b/app/boards/shields/bluehand/bluehand.overlay @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2021 Mike "KemoNine" Crosson + * Copyright (c) 2021 jpconstantineau + * + * SPDX-License-Identifier: MIT + */ + +#include + +/ { + chosen { + zmk,kscan = &kscan0; + }; + + kscan0: kscan_0 { + compatible = "zmk,kscan-gpio-direct"; + + label = "KSCAN"; + + input-gpios + = <&gpio0 29 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 28 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 24 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + ; + + }; + + leds { + compatible = "gpio-leds"; + actled: led_a { + gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; + label = "ACT LED"; + }; + powerled: led_p { + gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; + label = "PWR LED"; + }; + }; +}; \ No newline at end of file diff --git a/docs/docs/hardware.md b/docs/docs/hardware.md index 0dc17782..99696e70 100644 --- a/docs/docs/hardware.md +++ b/docs/docs/hardware.md @@ -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`) +- [Bluehand](http://nrf52.jpconstantineau.com/docs/macropad/bluehand/) (`bluehand`) ## Other Hardware diff --git a/docs/static/setup.ps1 b/docs/static/setup.ps1 index bcea9f7a..b7f8ff6c 100644 --- a/docs/static/setup.ps1 +++ b/docs/static/setup.ps1 @@ -58,11 +58,11 @@ catch [System.Management.Automation.CommandNotFoundException] { Test-Git-Config -Option "user.name" -ErrMsg "Git username not set!`nRun: git config --global user.name 'My Name'" Test-Git-Config -Option "user.email" -ErrMsg "Git email not set!`nRun: git config --global user.email 'example@myemail.com'" -$permission = (Get-Acl $pwd).Access | +$permission = (Get-Acl $pwd).Access | ?{$_.IdentityReference -match $env:UserName ` -and $_.FileSystemRights -match "FullControl" ` - -or $_.FileSystemRights -match "Write" } | - + -or $_.FileSystemRights -match "Write" } | + Select IdentityReference,FileSystemRights If (-Not $permission){ @@ -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", "BlueHand" +$names = "kyria", "lily58", "corne", "splitreus62", "sofle", "iris", "reviung41", "romac", "romac_plus", "m60", "microdox", "tg4x", "qaz", "nibble", "jorne", "jian", "crbn", "tidbit", "eek", "bfo9000", "helix", "bluehand" +$splits = "y", "y", "y", "y", "y", "y", "n", "n", "n", "n", "y", "n", "n", "n", "y", "y", "n", "n", "n", "n", "y", "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 2078ff3e..90eb3e8b 100644 --- a/docs/static/setup.sh +++ b/docs/static/setup.sh @@ -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!" "BFO-9000" "Helix") +options=("Kyria" "Lily58" "Corne" "Splitreus62" "Sofle" "Iris" "Reviung41" "RoMac" "RoMac+" "makerdiary M60" "Microdox" "TG4X" "QAZ" "NIBBLE" "Jorne" "Jian" "CRBN" "Tidbit" "Eek!" "BFO-9000" "Helix" "BlueHand") PS3="$prompt " # TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos. @@ -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="BlueHand" shield "bluehand"; split="n"; break;; # Add link to docs on adding your own custom shield in your ZMK config! # $(( ${#options[@]}+1 )) ) echo "Other!"; break;;