From 1c822754c018ad88e281f834f62b38a690ce38c2 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Tue, 29 Dec 2020 23:30:30 -0500 Subject: [PATCH 01/24] fix(west): Restore atmel west module. --- app/west.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/west.yml b/app/west.yml index d49eee9a..ca5efad2 100644 --- a/app/west.yml +++ b/app/west.yml @@ -15,7 +15,6 @@ manifest: # TODO: Rename once upstream offers option like `exclude` or `denylist` name-blacklist: - ci-tools - - hal_atmel - hal_altera - hal_cypress - hal_infineon From d6988477692f6892096885ed39953a7814a8f53a Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Wed, 30 Dec 2020 09:29:57 -0500 Subject: [PATCH 02/24] fix(power): Fix for 2.4 API changes. --- app/src/ext_power_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/ext_power_generic.c b/app/src/ext_power_generic.c index c2e89ab8..d8e7844e 100644 --- a/app/src/ext_power_generic.c +++ b/app/src/ext_power_generic.c @@ -178,7 +178,7 @@ static int ext_power_generic_init(const struct device *dev) { static int ext_power_generic_pm_control(const struct device *dev, uint32_t ctrl_command, void *context, device_pm_cb cb, void *arg) { int rc; - struct ext_power_generic_data *data = dev->driver_data; + struct ext_power_generic_data *data = dev->data; switch (ctrl_command) { case DEVICE_PM_SET_POWER_STATE: From 5072590af523cf25941e05945d490d350f148797 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Wed, 30 Dec 2020 15:43:46 -0500 Subject: [PATCH 03/24] fix(sensors): Use status filter on sensors node. --- app/include/zmk/sensors.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/include/zmk/sensors.h b/app/include/zmk/sensors.h index 63dcade0..8c6c28b3 100644 --- a/app/include/zmk/sensors.h +++ b/app/include/zmk/sensors.h @@ -7,6 +7,6 @@ #pragma once #define ZMK_KEYMAP_SENSORS_NODE DT_INST(0, zmk_keymap_sensors) -#define ZMK_KEYMAP_HAS_SENSORS DT_NODE_EXISTS(ZMK_KEYMAP_SENSORS_NODE) +#define ZMK_KEYMAP_HAS_SENSORS DT_NODE_HAS_STATUS(ZMK_KEYMAP_SENSORS_NODE, okay) #define ZMK_KEYMAP_SENSORS_LEN DT_PROP_LEN(ZMK_KEYMAP_SENSORS_NODE, sensors) -#define ZMK_KEYMAP_SENSORS_BY_IDX(idx) DT_PHANDLE_BY_IDX(ZMK_KEYMAP_SENSORS_NODE, sensors, idx) \ No newline at end of file +#define ZMK_KEYMAP_SENSORS_BY_IDX(idx) DT_PHANDLE_BY_IDX(ZMK_KEYMAP_SENSORS_NODE, sensors, idx) From 39490552f2a84282143e0ec039fdaf4b2f309539 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Wed, 30 Dec 2020 15:44:03 -0500 Subject: [PATCH 04/24] feat(boards): Add BDN9 Rev2 board. * Onboard stm32f072. * 3 possible encoder positions. * Underglow/per-key not yet support. --- .github/workflows/build.yml | 1 + app/boards/arm/bdn9/Kconfig.board | 8 ++ app/boards/arm/bdn9/Kconfig.defconfig | 17 ++++ app/boards/arm/bdn9/README.md | 37 ++++++++ app/boards/arm/bdn9/bdn9_rev2.dts | 107 ++++++++++++++++++++++++ app/boards/arm/bdn9/bdn9_rev2.keymap | 38 +++++++++ app/boards/arm/bdn9/bdn9_rev2.yaml | 14 ++++ app/boards/arm/bdn9/bdn9_rev2_defconfig | 29 +++++++ app/boards/arm/bdn9/board.cmake | 7 ++ docs/docs/hardware.md | 1 + 10 files changed, 259 insertions(+) create mode 100644 app/boards/arm/bdn9/Kconfig.board create mode 100644 app/boards/arm/bdn9/Kconfig.defconfig create mode 100644 app/boards/arm/bdn9/README.md create mode 100644 app/boards/arm/bdn9/bdn9_rev2.dts create mode 100644 app/boards/arm/bdn9/bdn9_rev2.keymap create mode 100644 app/boards/arm/bdn9/bdn9_rev2.yaml create mode 100644 app/boards/arm/bdn9/bdn9_rev2_defconfig create mode 100644 app/boards/arm/bdn9/board.cmake diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0aee5d7f..288a2dee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,6 +57,7 @@ jobs: - tidbit cmake-args: [""] include: + - board: bdn9_rev2 - board: dz60rgb_rev1 - board: nrf52840_m2 shield: m60 diff --git a/app/boards/arm/bdn9/Kconfig.board b/app/boards/arm/bdn9/Kconfig.board new file mode 100644 index 00000000..a67e9a51 --- /dev/null +++ b/app/boards/arm/bdn9/Kconfig.board @@ -0,0 +1,8 @@ +# keeb.io BDN9 board configuration + +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config BOARD_BDN9 + bool "BDN9 rev2" + depends on SOC_STM32F072XB diff --git a/app/boards/arm/bdn9/Kconfig.defconfig b/app/boards/arm/bdn9/Kconfig.defconfig new file mode 100644 index 00000000..9af7ca4c --- /dev/null +++ b/app/boards/arm/bdn9/Kconfig.defconfig @@ -0,0 +1,17 @@ +# keeb.io BDN9 board configuration + +# Copyright (c) 2020 Pete Johanson +# SPDX-License-Identifier: MIT + +if BOARD_BDN9 + +config BOARD + default "bdn9_rev2" + +config ZMK_KEYBOARD_NAME + default "BDN9 Rev2" + +config ZMK_USB + default y + +endif # BOARD_BDN9 diff --git a/app/boards/arm/bdn9/README.md b/app/boards/arm/bdn9/README.md new file mode 100644 index 00000000..7b4ef441 --- /dev/null +++ b/app/boards/arm/bdn9/README.md @@ -0,0 +1,37 @@ +# Building ZMK for the BDN9 + +Some general notes/commands for building standard BDN9 layouts from the assembly documentation. + +## Standard Build + +``` +west build -p -d build/bdn9 --board bdn9_rev2 +``` + +## Encoder Notes + +If you built your BDN9 with encoders, you'll need to change the following in your local BDN9 config or add them to the end of the file. + +``` +CONFIG_EC11=y +CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y +``` + +Then, you'll want to uncomment the necessary encoder lines in your `bdn9_rev2.keymap`: + +``` +&sensors { + status = "okay"; + sensors = <&left_encoder &mid_encoder &right_encoder>; +}; + +&left_encoder { status = "okay"; }; +&mid_encoder { status = "okay"; }; +&right_encoder { status = "okay"; }; +``` + +And then add the correct `sensor-bindings` array to each keymap layer, e.g.: + +``` +sensor-bindings = <&inc_dec_kp PG_UP PG_DN &inc_dec_kp M_VOLU M_VOLD &inc_dec_kp C_PREV C_NEXT>; +``` diff --git a/app/boards/arm/bdn9/bdn9_rev2.dts b/app/boards/arm/bdn9/bdn9_rev2.dts new file mode 100644 index 00000000..43854a16 --- /dev/null +++ b/app/boards/arm/bdn9/bdn9_rev2.dts @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +/dts-v1/; +#include + +/ { + model = "Keeb.io BDN9 rev2"; + compatible = "keebio,bdn9", "st,stm32f072"; + + chosen { + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zmk,kscan = &kscan; + /* TODO: Enable once the GPIO bitbanging driver supports STM32 + zmk,underglow = &led_strip; + */ + }; + + kscan: kscan { + compatible = "zmk,kscan-gpio-direct"; + label = "KSCAN"; + + input-gpios + = <&gpiob 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpiob 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpiob 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpiob 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpiob 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpiob 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpioa 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpiof 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpiof 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + ; + }; + + /* + led_strip: ws2812 { + compatible = "worldsemi,ws2812-gpio"; + label = "WS2812"; + + in-gpios = <&gpiob 15 0>; + + chain-length = <9>; + }; + */ + + left_encoder: encoder_left { + compatible = "alps,ec11"; + label = "LEFT_ENCODER"; + a-gpios = <&gpioa 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&gpioa 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + resolution = <4>; + status = "disabled"; + }; + mid_encoder: encoder_mid { + compatible = "alps,ec11"; + label = "MID_ENCODER"; + a-gpios = <&gpioa 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&gpioa 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + resolution = <4>; + status = "disabled"; + }; + right_encoder: encoder_right { + compatible = "alps,ec11"; + label = "RIGHT_ENCODER"; + a-gpios = <&gpioa 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&gpiob 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + resolution = <4>; + status = "disabled"; + }; + + sensors: sensors { + compatible = "zmk,keymap-sensors"; + status = "disabled"; + sensors = <>; + }; +}; + +&usb { + status = "okay"; +}; + +&rtc { + status = "okay"; +}; + +&flash0 { + /* + * For more information, see: + * http://docs.zephyrproject.org/latest/guides/dts/index.html#flash-partitions + */ + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Set 6Kb of storage at the end of the 128Kb of flash */ + storage_partition: partition@3e800 { + label = "storage"; + reg = <0x0001e800 0x00001800>; + }; + }; +}; diff --git a/app/boards/arm/bdn9/bdn9_rev2.keymap b/app/boards/arm/bdn9/bdn9_rev2.keymap new file mode 100644 index 00000000..50c273c7 --- /dev/null +++ b/app/boards/arm/bdn9/bdn9_rev2.keymap @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include +#include + +/* Uncomment and keep whatever encoders are on your BDN9 +&sensors { + status = "okay"; + sensors = <&left_encoder &mid_encoder &right_encoder>; +}; +*/ + +// Uncomment each encoder installed on your BDN9 +// &left_encoder { status = "okay"; }; +// &mid_encoder { status = "okay"; }; +// &right_encoder { status = "okay"; }; + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { + bindings = < + &kp HOME &kp K_PP &kp END + &kp PG_UP &kp UP &kp PG_DN + &kp LEFT &kp DOWN &kp RIGHT + >; + /* Uncomment and add necessary bindings. This examples is for one encoder + sensor-bindings = <&inc_dec_kp PG_UP PG_DN>; + */ + }; + }; +}; + diff --git a/app/boards/arm/bdn9/bdn9_rev2.yaml b/app/boards/arm/bdn9/bdn9_rev2.yaml new file mode 100644 index 00000000..bbae8833 --- /dev/null +++ b/app/boards/arm/bdn9/bdn9_rev2.yaml @@ -0,0 +1,14 @@ +identifier: bdn9 +name: keeb.io BDN9 +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb + - xtools +ram: 40 +supported: + - encoders + - switches + - underglow + - per_key diff --git a/app/boards/arm/bdn9/bdn9_rev2_defconfig b/app/boards/arm/bdn9/bdn9_rev2_defconfig new file mode 100644 index 00000000..139cf853 --- /dev/null +++ b/app/boards/arm/bdn9/bdn9_rev2_defconfig @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: MIT + +CONFIG_SOC_SERIES_STM32F0X=y +CONFIG_SOC_STM32F072XB=y +# 72MHz system clock +CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=72000000 + +# Floating Point Options +CONFIG_FPU=y + +# enable GPIO +CONFIG_GPIO=y + +# Needed to reduce this to size that will fit on F072 +CONFIG_HEAP_MEM_POOL_SIZE=1024 + +# clock configuration +CONFIG_CLOCK_CONTROL=y + +# Clock configuration for Cube Clock control driver +CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y +# use HSI as PLL input +CONFIG_CLOCK_STM32_PLL_SRC_HSI=y +# produce 72MHz clock at PLL output +CONFIG_CLOCK_STM32_PLL_PREDIV=1 +CONFIG_CLOCK_STM32_PLL_MULTIPLIER=12 +CONFIG_CLOCK_STM32_AHB_PRESCALER=1 +CONFIG_CLOCK_STM32_APB1_PRESCALER=2 +CONFIG_CLOCK_STM32_APB2_PRESCALER=1 diff --git a/app/boards/arm/bdn9/board.cmake b/app/boards/arm/bdn9/board.cmake new file mode 100644 index 00000000..4f430e12 --- /dev/null +++ b/app/boards/arm/bdn9/board.cmake @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: MIT + +board_runner_args(dfu-util "--pid=0483:df11" "--alt=0" "--dfuse") +board_runner_args(jlink "--device=STM32F072CB" "--speed=4000") + +include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake) +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/docs/docs/hardware.md b/docs/docs/hardware.md index 406b9ad8..89761c42 100644 --- a/docs/docs/hardware.md +++ b/docs/docs/hardware.md @@ -19,6 +19,7 @@ That being said, there are currently only a few specific [boards](/docs/faq#what - [nrfMicro](https://github.com/joric/nrfmicro) (`nrfmicro_13`, `nrfmicro_11`, `nrfmicro_11_flipped`) - [BlueMicro840](https://store.jpconstantineau.com/#/group/bluemicro) (`bluemicro840_v1`) - [QMK Proton-C](https://qmk.fm/proton-c/) (`proton_c`) +- [BDN9 Rev2](https://keeb.io/products/bdn9-rev-2-3x3-9-key-macropad-rotary-encoder-and-rgb) (`bdn9_rev2`) ## Keyboard Shields From 2b4fda6948970ef236791472c0f3e461a23abf33 Mon Sep 17 00:00:00 2001 From: Stephen Wu Date: Fri, 1 Jan 2021 03:06:40 -0800 Subject: [PATCH 05/24] docs(codes): improve macOS support data (volume, brightness, media controls) Codes: - K_VOLUME_UP, C_VOLUME_UP, K_VOLUME_DOWN, C_VOLUME_DOWN, K_MUTE - C_BRIGHTNESS_INC, C_BRIGHTNESS_DEC - C_PLAY_PAUSE, C_NEXT, C_PREVIOUS Tested on: - Catalina 10.15.7 - Big Sur 11.2 Beta PR: #541 See: #375 --- docs/src/data/hid.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/src/data/hid.js b/docs/src/data/hid.js index 35fc7fb7..ba3d2bf6 100644 --- a/docs/src/data/hid.js +++ b/docs/src/data/hid.js @@ -3218,7 +3218,7 @@ export default [ windows: null, linux: true, android: true, - macos: null, + macos: true, ios: null, }, footnotes: {}, @@ -3239,7 +3239,7 @@ export default [ windows: null, linux: true, android: true, - macos: null, + macos: false, ios: null, }, footnotes: {}, @@ -3260,7 +3260,7 @@ export default [ windows: null, linux: true, android: true, - macos: null, + macos: false, ios: null, }, footnotes: {}, @@ -5172,7 +5172,7 @@ export default [ windows: null, linux: true, android: null, - macos: null, + macos: true, ios: null, }, footnotes: {}, @@ -5193,7 +5193,7 @@ export default [ windows: null, linux: true, android: null, - macos: null, + macos: true, ios: null, }, footnotes: {}, @@ -5886,7 +5886,7 @@ export default [ windows: null, linux: true, android: true, - macos: null, + macos: true, ios: null, }, footnotes: {}, @@ -5907,7 +5907,7 @@ export default [ windows: null, linux: true, android: true, - macos: null, + macos: true, ios: null, }, footnotes: {}, @@ -6054,7 +6054,7 @@ export default [ windows: null, linux: true, android: true, - macos: null, + macos: true, ios: null, }, footnotes: {}, @@ -6138,7 +6138,7 @@ export default [ windows: null, linux: true, android: true, - macos: null, + macos: true, ios: null, }, footnotes: {}, @@ -6159,7 +6159,7 @@ export default [ windows: null, linux: true, android: true, - macos: null, + macos: true, ios: null, }, footnotes: {}, From 5752b4fbda757768e5356a99750066df53aee0a7 Mon Sep 17 00:00:00 2001 From: Mango The Fourth <40720523+MangoIV@users.noreply.github.com> Date: Fri, 1 Jan 2021 15:33:19 +0100 Subject: [PATCH 06/24] feat(shields): add eek shield PR: #529 --- .github/workflows/build.yml | 1 + app/boards/shields/eek/Kconfig.defconfig | 12 +++++ app/boards/shields/eek/Kconfig.shield | 8 ++++ app/boards/shields/eek/eek.conf | 0 app/boards/shields/eek/eek.keymap | 56 ++++++++++++++++++++++++ app/boards/shields/eek/eek.overlay | 52 ++++++++++++++++++++++ app/boards/shields/eek/readme.md | 1 + docs/docs/hardware.md | 1 + docs/static/setup.ps1 | 6 +-- docs/static/setup.sh | 3 +- 10 files changed, 136 insertions(+), 4 deletions(-) create mode 100644 app/boards/shields/eek/Kconfig.defconfig create mode 100644 app/boards/shields/eek/Kconfig.shield create mode 100644 app/boards/shields/eek/eek.conf create mode 100644 app/boards/shields/eek/eek.keymap create mode 100644 app/boards/shields/eek/eek.overlay create mode 100644 app/boards/shields/eek/readme.md diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 288a2dee..1c2a5119 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,6 +29,7 @@ jobs: - cradio_left - cradio_right - crbn + - eek - iris_left - iris_right - jian_left diff --git a/app/boards/shields/eek/Kconfig.defconfig b/app/boards/shields/eek/Kconfig.defconfig new file mode 100644 index 00000000..65d69b7d --- /dev/null +++ b/app/boards/shields/eek/Kconfig.defconfig @@ -0,0 +1,12 @@ +# +# Copyright (c) 2020 The ZMK Contributors +# +# SPDX-License-Identifier: MIT +# + +if SHIELD_EEK + +config ZMK_KEYBOARD_NAME + default "eek! ~ Keyboard" + +endif \ No newline at end of file diff --git a/app/boards/shields/eek/Kconfig.shield b/app/boards/shields/eek/Kconfig.shield new file mode 100644 index 00000000..220b63ea --- /dev/null +++ b/app/boards/shields/eek/Kconfig.shield @@ -0,0 +1,8 @@ + # + # Copyright (c) 2020 The ZMK Contributors + # + # SPDX-License-Identifier: MIT + # + +config SHIELD_EEK + def_bool $(shields_list_contains,eek) \ No newline at end of file diff --git a/app/boards/shields/eek/eek.conf b/app/boards/shields/eek/eek.conf new file mode 100644 index 00000000..e69de29b diff --git a/app/boards/shields/eek/eek.keymap b/app/boards/shields/eek/eek.keymap new file mode 100644 index 00000000..f54dc013 --- /dev/null +++ b/app/boards/shields/eek/eek.keymap @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include +#include + +/ { + keymap { + compatible = "zmk,keymap"; + + default { +// -------------------------------------------------------------------------------------------------------------------------------------------------------------------- +// Q | W | E | R | T | | Y | U | I | O | P | +// A | S | D | F | G | | H | J | K | L | ; | +// Lsft/Z| X | C | V | B | | N | M | , | . |Rsft//| +// | LCTL | Bspc/LMOD | SPC | | Del/Num | Ent | Sym | + bindings = < + &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P + &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI + &mt LSHFT Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &mt RSHFT FSLH + &kp LCTRL &mt LGUI BSPC &kp SPACE < 1 DEL &kp RET &mo 2 + >; + }; + numbers { +// -------------------------------------------------------------------------------------------------------------------------------------------------------------------- +// 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | +// TAB | BT_PRV | BT_NXT | VOL-| VOL+| | < | v | ∧ | > | ' | +// Lsft| BT_SEL0| BT_CLR | MUTE| | | HOME| END | PGUP| PGDN| Rsft| +// | LCTL | LMOD| LALT | | Num | | BL-reset | + bindings = < + &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 + &kp TAB &bt BT_PRV &bt BT_NXT &kp C_VOL_DN &kp C_VOL_UP &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp SQT + &kp LSHFT &bt BT_SEL 0 &bt BT_CLR &kp C_MUTE &none &kp HOME &kp END &kp PG_UP &kp PG_DN &kp RSHFT + &kp LCTRL &kp LGUI &kp LALT &trans &none &bootloader + >; + }; + symbols { +// -------------------------------------------------------------------------------------------------------------------------------------------------------------------- +// ESC | F1 | F2 | F3 | F4 | | OUT_USB | OUT_BLE | | = | - | +// CAPS| F5 | F6 | F7 | F8 | | [ | ] | | ` | \ | +// LSFT| F9 | F10 | F11 | F12 | | | | | | RSFT | +// | LCTL | LMOD| LALT | | RESET | | SYM | + bindings = < + &kp ESC &kp F1 &kp F2 &kp F3 &kp F4 &out OUT_USB &out OUT_BLE &none &kp EQUAL &kp MINUS + &kp CAPS &kp F5 &kp F6 &kp F7 &kp F8 &kp LBKT &kp RBKT &none &kp GRAVE &kp BSLH + &kp LSHFT &kp F9 &kp F10 &kp F11 &kp F12 &none &none &none &kp RSHFT + &kp LCTRL &kp LGUI &kp LALT &reset &none &trans + >; + }; + }; +}; \ No newline at end of file diff --git a/app/boards/shields/eek/eek.overlay b/app/boards/shields/eek/eek.overlay new file mode 100644 index 00000000..11b98686 --- /dev/null +++ b/app/boards/shields/eek/eek.overlay @@ -0,0 +1,52 @@ +/* + * 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 = <10>; + rows = <4>; + map = < + RC(0,9) RC(0,8) RC(0,7) RC(0,6) RC(0,5) RC(0,4) RC(0,3) RC(0,2) RC(0,1) RC(0,0) + RC(1,9) RC(1,8) RC(1,7) RC(1,6) RC(1,5) RC(1,4) RC(1,3) RC(1,2) RC(1,1) RC(1,0) + RC(2,9) RC(2,8) RC(2,7) RC(2,6) RC(2,5) RC(2,4) RC(2,3) RC(2,2) RC(2,1) RC(2,0) + RC(3,7) RC(3,6) RC(3,5) RC(3,4) RC(3,3) RC(3,2) + >; + }; + + kscan0: kscan_0 { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + diode-direction = "col2row"; + + col-gpios + = <&pro_micro_d 4 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 5 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> + ; + + row-gpios + = <&pro_micro_d 6 (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)> + , <&pro_micro_d 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + }; +}; \ No newline at end of file diff --git a/app/boards/shields/eek/readme.md b/app/boards/shields/eek/readme.md new file mode 100644 index 00000000..77e7be06 --- /dev/null +++ b/app/boards/shields/eek/readme.md @@ -0,0 +1 @@ +A fixed split 36key-board with a typing angle of 90 degrees distributed by cbkbd \ No newline at end of file diff --git a/docs/docs/hardware.md b/docs/docs/hardware.md index 89761c42..98f8715f 100644 --- a/docs/docs/hardware.md +++ b/docs/docs/hardware.md @@ -37,6 +37,7 @@ That being said, there are currently only a few specific [boards](/docs/faq#what - [QAZ](https://www.cbkbd.com/product/qaz-keyboard-kit) (`qaz`) - [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`) ## Other Hardware diff --git a/docs/static/setup.ps1 b/docs/static/setup.ps1 index a2193228..a521934e 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" -$names = "kyria", "lily58", "corne", "splitreus62", "sofle", "iris", "reviung41", "romac", "romac_plus", "m60", "microdox", "tg4x", "qaz", "nibble", "jorne", "jian", "crbn", "tidbit" -$splits = "y", "y", "y", "y", "y", "y", "n", "n", "n", "n", "y", "n", "n", "n", "y", "y", "n", "n" +$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" $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 5768fa6b..5ceff674 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") +options=("Kyria" "Lily58" "Corne" "Splitreus62" "Sofle" "Iris" "Reviung41" "RoMac" "RoMac+" "makerdiary M60" "Microdox" "TG4X" "QAZ" "Jorne" "Jian" "CRBN" "Tidbit" "Eek!") PS3="$prompt " # TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos. @@ -119,6 +119,7 @@ select opt in "${options[@]}" "Quit"; do 16 ) shield_title="Jian" shield="jian"; split="y"; break;; 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;; # Add link to docs on adding your own custom shield in your ZMK config! # $(( ${#options[@]}+1 )) ) echo "Other!"; break;; From a3ac0cb5be0f7918179bc422404a1d7d1f050ad1 Mon Sep 17 00:00:00 2001 From: KemoNine Date: Fri, 1 Jan 2021 21:16:20 +0000 Subject: [PATCH 07/24] feat(shields): add ws2812 underglow support to lily58 (nice_nano) --- .../shields/lily58/boards/nice_nano.overlay | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 app/boards/shields/lily58/boards/nice_nano.overlay diff --git a/app/boards/shields/lily58/boards/nice_nano.overlay b/app/boards/shields/lily58/boards/nice_nano.overlay new file mode 100644 index 00000000..0d28726d --- /dev/null +++ b/app/boards/shields/lily58/boards/nice_nano.overlay @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + mosi-pin = <6>; + // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. + sck-pin = <5>; + miso-pin = <7>; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <5>; /* number of LEDs */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; From 61893e453b90dcb8fb84745b009457375764f7f4 Mon Sep 17 00:00:00 2001 From: innovaker <66737976+innovaker@users.noreply.github.com> Date: Sat, 2 Jan 2021 03:55:52 +0000 Subject: [PATCH 08/24] refactor(app): format with prettier (#563) prettier --write . PR: #563 --- app/boards/shields/eek/readme.md | 2 +- .../zephyr/dts/bindings/sensor/zmk,battery-voltage-divider.yaml | 1 - app/dts/bindings/behaviors/zmk,behavior-sticky-key.yaml | 2 +- app/dts/bindings/zmk,ext-power-generic.yaml | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/boards/shields/eek/readme.md b/app/boards/shields/eek/readme.md index 77e7be06..2a1b46b4 100644 --- a/app/boards/shields/eek/readme.md +++ b/app/boards/shields/eek/readme.md @@ -1 +1 @@ -A fixed split 36key-board with a typing angle of 90 degrees distributed by cbkbd \ No newline at end of file +A fixed split 36key-board with a typing angle of 90 degrees distributed by cbkbd diff --git a/app/drivers/zephyr/dts/bindings/sensor/zmk,battery-voltage-divider.yaml b/app/drivers/zephyr/dts/bindings/sensor/zmk,battery-voltage-divider.yaml index 3f391d78..c4c6f80c 100644 --- a/app/drivers/zephyr/dts/bindings/sensor/zmk,battery-voltage-divider.yaml +++ b/app/drivers/zephyr/dts/bindings/sensor/zmk,battery-voltage-divider.yaml @@ -11,4 +11,3 @@ properties: label: required: true type: string - \ No newline at end of file diff --git a/app/dts/bindings/behaviors/zmk,behavior-sticky-key.yaml b/app/dts/bindings/behaviors/zmk,behavior-sticky-key.yaml index d73a107d..df9c423c 100644 --- a/app/dts/bindings/behaviors/zmk,behavior-sticky-key.yaml +++ b/app/dts/bindings/behaviors/zmk,behavior-sticky-key.yaml @@ -12,4 +12,4 @@ properties: type: phandles required: true release-after-ms: - type: int \ No newline at end of file + type: int diff --git a/app/dts/bindings/zmk,ext-power-generic.yaml b/app/dts/bindings/zmk,ext-power-generic.yaml index 5a38a09a..6d36d213 100644 --- a/app/dts/bindings/zmk,ext-power-generic.yaml +++ b/app/dts/bindings/zmk,ext-power-generic.yaml @@ -17,4 +17,3 @@ properties: label: type: string required: true - From 5a7266289879c429982e33b80a33a11f4485c0da Mon Sep 17 00:00:00 2001 From: innovaker <66737976+innovaker@users.noreply.github.com> Date: Fri, 1 Jan 2021 23:56:40 +0000 Subject: [PATCH 09/24] chore: standardize C style headers Changes made with regex plus some manual tweaks. Find: /^\/\*.*\n(?:^\*.*\n)*^.*\*.*?[Cc]opyright.*?(\d{4}) *([0-9A-z,_\- ]+).*?\n(?:^.*\*.*\n)*^.*\*.*?SPDX-License-Identifier:? *(.+) *?\n(?:^.*\*.*\n)*.*\*\//gm Replace: /* * Copyright (c) $1 $2 * * SPDX-License-Identifier: $3 */ PR: #565 --- app/boards/arm/nrf52840_m2/nrf52840_m2.dts | 1 + app/boards/shields/jorne/jorne.dtsi | 2 +- app/boards/shields/jorne/jorne_left.overlay | 2 +- app/boards/shields/jorne/jorne_right.overlay | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/boards/arm/nrf52840_m2/nrf52840_m2.dts b/app/boards/arm/nrf52840_m2/nrf52840_m2.dts index f9354edf..e090842c 100644 --- a/app/boards/arm/nrf52840_m2/nrf52840_m2.dts +++ b/app/boards/arm/nrf52840_m2/nrf52840_m2.dts @@ -1,5 +1,6 @@ /* * Copyright (c) 2020 The ZMK Contributors + * * SPDX-License-Identifier: MIT */ diff --git a/app/boards/shields/jorne/jorne.dtsi b/app/boards/shields/jorne/jorne.dtsi index 67ea9d1c..c782d520 100644 --- a/app/boards/shields/jorne/jorne.dtsi +++ b/app/boards/shields/jorne/jorne.dtsi @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 The ZMK Contributors + * Copyright (c) 2020 The ZMK Contributors * * SPDX-License-Identifier: MIT */ diff --git a/app/boards/shields/jorne/jorne_left.overlay b/app/boards/shields/jorne/jorne_left.overlay index ca6ad431..065a23da 100644 --- a/app/boards/shields/jorne/jorne_left.overlay +++ b/app/boards/shields/jorne/jorne_left.overlay @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 The ZMK Contributors + * Copyright (c) 2020 The ZMK Contributors * * SPDX-License-Identifier: MIT */ diff --git a/app/boards/shields/jorne/jorne_right.overlay b/app/boards/shields/jorne/jorne_right.overlay index 6ae232eb..5a0be2cc 100644 --- a/app/boards/shields/jorne/jorne_right.overlay +++ b/app/boards/shields/jorne/jorne_right.overlay @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 The ZMK Contributors + * Copyright (c) 2020 The ZMK Contributors * * SPDX-License-Identifier: MIT */ From caa285852adc2d18ebd925171d11d0fd20d88dc8 Mon Sep 17 00:00:00 2001 From: Okke Formsma Date: Wed, 16 Dec 2020 19:41:53 +0100 Subject: [PATCH 10/24] refactor(events): return 'ZMK_EV_EVENT_BUBBLE' instead of magic number 0 --- app/include/zmk/event_manager.h | 1 + app/src/behaviors/behavior_hold_tap.c | 14 +++++++------- app/src/behaviors/behavior_sticky_key.c | 4 ++-- app/src/display/widgets/battery_status.c | 2 +- app/src/display/widgets/output_status.c | 2 +- app/src/split_listener.c | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/include/zmk/event_manager.h b/app/include/zmk/event_manager.h index 31c53228..e5b6ed53 100644 --- a/app/include/zmk/event_manager.h +++ b/app/include/zmk/event_manager.h @@ -19,6 +19,7 @@ struct zmk_event_header { uint8_t last_listener_index; }; +#define ZMK_EV_EVENT_BUBBLE 0 #define ZMK_EV_EVENT_HANDLED 1 #define ZMK_EV_EVENT_CAPTURED 2 diff --git a/app/src/behaviors/behavior_hold_tap.c b/app/src/behaviors/behavior_hold_tap.c index d3039605..7ad1d32b 100644 --- a/app/src/behaviors/behavior_hold_tap.c +++ b/app/src/behaviors/behavior_hold_tap.c @@ -392,16 +392,16 @@ static int position_state_changed_listener(const struct zmk_event_header *eh) { if (undecided_hold_tap == NULL) { LOG_DBG("%d bubble (no undecided hold_tap active)", ev->position); - return 0; + return ZMK_EV_EVENT_BUBBLE; } if (undecided_hold_tap->position == ev->position) { if (ev->state) { // keydown LOG_ERR("hold-tap listener should be called before before most other listeners!"); - return 0; + return ZMK_EV_EVENT_BUBBLE; } else { // keyup LOG_DBG("%d bubble undecided hold-tap keyrelease event", undecided_hold_tap->position); - return 0; + return ZMK_EV_EVENT_BUBBLE; } } @@ -418,7 +418,7 @@ static int position_state_changed_listener(const struct zmk_event_header *eh) { // we'll catch modifiers later in modifier_state_changed_listener LOG_DBG("%d bubbling %d %s event", undecided_hold_tap->position, ev->position, ev->state ? "down" : "up"); - return 0; + return ZMK_EV_EVENT_BUBBLE; } LOG_DBG("%d capturing %d %s event", undecided_hold_tap->position, ev->position, @@ -439,12 +439,12 @@ static int keycode_state_changed_listener(const struct zmk_event_header *eh) { if (undecided_hold_tap == NULL) { // LOG_DBG("0x%02X bubble (no undecided hold_tap active)", ev->keycode); - return 0; + return ZMK_EV_EVENT_BUBBLE; } if (!only_mods(ev)) { // LOG_DBG("0x%02X bubble (not a mod)", ev->keycode); - return 0; + return ZMK_EV_EVENT_BUBBLE; } // only key-up events will bubble through position_state_changed_listener @@ -461,7 +461,7 @@ int behavior_hold_tap_listener(const struct zmk_event_header *eh) { } else if (is_keycode_state_changed(eh)) { return keycode_state_changed_listener(eh); } - return 0; + return ZMK_EV_EVENT_BUBBLE; } ZMK_LISTENER(behavior_hold_tap, behavior_hold_tap_listener); diff --git a/app/src/behaviors/behavior_sticky_key.c b/app/src/behaviors/behavior_sticky_key.c index 643ae48b..271b168b 100644 --- a/app/src/behaviors/behavior_sticky_key.c +++ b/app/src/behaviors/behavior_sticky_key.c @@ -177,7 +177,7 @@ static const struct behavior_driver_api behavior_sticky_key_driver_api = { static int sticky_key_keycode_state_changed_listener(const struct zmk_event_header *eh) { if (!is_keycode_state_changed(eh)) { - return 0; + return ZMK_EV_EVENT_BUBBLE; } struct keycode_state_changed *ev = cast_keycode_state_changed(eh); for (int i = 0; i < ZMK_BHV_STICKY_KEY_MAX_HELD; i++) { @@ -222,7 +222,7 @@ static int sticky_key_keycode_state_changed_listener(const struct zmk_event_head } } } - return 0; + return ZMK_EV_EVENT_BUBBLE; } ZMK_LISTENER(behavior_sticky_key, sticky_key_keycode_state_changed_listener); diff --git a/app/src/display/widgets/battery_status.c b/app/src/display/widgets/battery_status.c index 346c5193..f1f1c9f1 100644 --- a/app/src/display/widgets/battery_status.c +++ b/app/src/display/widgets/battery_status.c @@ -78,7 +78,7 @@ lv_obj_t *zmk_widget_battery_status_obj(struct zmk_widget_battery_status *widget int battery_status_listener(const struct zmk_event_header *eh) { struct zmk_widget_battery_status *widget; SYS_SLIST_FOR_EACH_CONTAINER(&widgets, widget, node) { set_battery_symbol(widget->obj); } - return 0; + return ZMK_EV_EVENT_BUBBLE; } ZMK_LISTENER(widget_battery_status, battery_status_listener) diff --git a/app/src/display/widgets/output_status.c b/app/src/display/widgets/output_status.c index 9a725113..716228b7 100644 --- a/app/src/display/widgets/output_status.c +++ b/app/src/display/widgets/output_status.c @@ -82,7 +82,7 @@ lv_obj_t *zmk_widget_output_status_obj(struct zmk_widget_output_status *widget) int output_status_listener(const struct zmk_event_header *eh) { struct zmk_widget_output_status *widget; SYS_SLIST_FOR_EACH_CONTAINER(&widgets, widget, node) { set_status_symbol(widget->obj); } - return 0; + return ZMK_EV_EVENT_BUBBLE; } ZMK_LISTENER(widget_output_status, output_status_listener) diff --git a/app/src/split_listener.c b/app/src/split_listener.c index 153ed99d..f475002c 100644 --- a/app/src/split_listener.c +++ b/app/src/split_listener.c @@ -29,7 +29,7 @@ int split_listener(const struct zmk_event_header *eh) { return zmk_split_bt_position_released(ev->position); } } - return 0; + return ZMK_EV_EVENT_BUBBLE; } ZMK_LISTENER(split_listener, split_listener); From fa07ba9d32ab65c4443f1b315beff621c8cf0a9a Mon Sep 17 00:00:00 2001 From: Okke Formsma Date: Fri, 18 Dec 2020 14:24:28 +0100 Subject: [PATCH 11/24] refactor(behaviors): use ZMK_BEHAVIOR_OPAQUE and ZMK_BEHAVIOR_TRANSPARENT Use these instead of the magic return values 0 and 1 for behavior_driver_api return values. --- app/include/zmk/behavior.h | 3 +++ app/src/behaviors/behavior_bt.c | 2 +- app/src/behaviors/behavior_ext_power.c | 2 +- app/src/behaviors/behavior_hold_tap.c | 10 +++++----- app/src/behaviors/behavior_none.c | 4 ++-- app/src/behaviors/behavior_reset.c | 2 +- app/src/behaviors/behavior_rgb_underglow.c | 2 +- app/src/behaviors/behavior_sticky_key.c | 8 ++++---- app/src/behaviors/behavior_toggle_layer.c | 2 +- app/src/behaviors/behavior_transparent.c | 4 ++-- 10 files changed, 21 insertions(+), 18 deletions(-) diff --git a/app/include/zmk/behavior.h b/app/include/zmk/behavior.h index f00ea4f9..31fb43ed 100644 --- a/app/include/zmk/behavior.h +++ b/app/include/zmk/behavior.h @@ -6,6 +6,9 @@ #pragma once +#define ZMK_BEHAVIOR_OPAQUE 0 +#define ZMK_BEHAVIOR_TRANSPARENT 1 + struct zmk_behavior_binding { char *behavior_dev; uint32_t param1; diff --git a/app/src/behaviors/behavior_bt.c b/app/src/behaviors/behavior_bt.c index bfafc4b3..3149c8ce 100644 --- a/app/src/behaviors/behavior_bt.c +++ b/app/src/behaviors/behavior_bt.c @@ -39,7 +39,7 @@ static int behavior_bt_init(const struct device *dev) { return 0; }; static int on_keymap_binding_released(struct zmk_behavior_binding *binding, struct zmk_behavior_binding_event event) { - return 0; + return ZMK_BEHAVIOR_OPAQUE; } static const struct behavior_driver_api behavior_bt_driver_api = { diff --git a/app/src/behaviors/behavior_ext_power.c b/app/src/behaviors/behavior_ext_power.c index dbc6fd94..18520f7d 100644 --- a/app/src/behaviors/behavior_ext_power.c +++ b/app/src/behaviors/behavior_ext_power.c @@ -43,7 +43,7 @@ static int on_keymap_binding_pressed(struct zmk_behavior_binding *binding, static int on_keymap_binding_released(struct zmk_behavior_binding *binding, struct zmk_behavior_binding_event event) { - return 0; + return ZMK_BEHAVIOR_OPAQUE; } static int behavior_ext_power_init(const struct device *dev) { return 0; }; diff --git a/app/src/behaviors/behavior_hold_tap.c b/app/src/behaviors/behavior_hold_tap.c index 7ad1d32b..9b62eb15 100644 --- a/app/src/behaviors/behavior_hold_tap.c +++ b/app/src/behaviors/behavior_hold_tap.c @@ -310,7 +310,7 @@ static int on_hold_tap_binding_pressed(struct zmk_behavior_binding *binding, if (undecided_hold_tap != NULL) { LOG_DBG("ERROR another hold-tap behavior is undecided."); // if this happens, make sure the behavior events occur AFTER other position events. - return 0; + return ZMK_BEHAVIOR_OPAQUE; } struct active_hold_tap *hold_tap = @@ -318,7 +318,7 @@ static int on_hold_tap_binding_pressed(struct zmk_behavior_binding *binding, if (hold_tap == NULL) { LOG_ERR("unable to store hold-tap info, did you press more than %d hold-taps?", ZMK_BHV_HOLD_TAP_MAX_HELD); - return 0; + return ZMK_BEHAVIOR_OPAQUE; } LOG_DBG("%d new undecided hold_tap", event.position); @@ -331,7 +331,7 @@ static int on_hold_tap_binding_pressed(struct zmk_behavior_binding *binding, k_delayed_work_submit(&hold_tap->work, K_MSEC(tapping_term_ms_left)); } - return 0; + return ZMK_BEHAVIOR_OPAQUE; } static int on_hold_tap_binding_released(struct zmk_behavior_binding *binding, @@ -339,7 +339,7 @@ static int on_hold_tap_binding_released(struct zmk_behavior_binding *binding, struct active_hold_tap *hold_tap = find_hold_tap(event.position); if (hold_tap == NULL) { LOG_ERR("ACTIVE_HOLD_TAP_CLEANED_UP_TOO_EARLY"); - return 0; + return ZMK_BEHAVIOR_OPAQUE; } // If these events were queued, the timer event may be queued too late or not at all. @@ -379,7 +379,7 @@ static int on_hold_tap_binding_released(struct zmk_behavior_binding *binding, clear_hold_tap(hold_tap); } - return 0; + return ZMK_BEHAVIOR_OPAQUE; } static const struct behavior_driver_api behavior_hold_tap_driver_api = { diff --git a/app/src/behaviors/behavior_none.c b/app/src/behaviors/behavior_none.c index 12542f05..e0eaa159 100644 --- a/app/src/behaviors/behavior_none.c +++ b/app/src/behaviors/behavior_none.c @@ -22,12 +22,12 @@ static int behavior_none_init(const struct device *dev) { return 0; }; static int on_keymap_binding_pressed(struct zmk_behavior_binding *binding, struct zmk_behavior_binding_event event) { - return 0; + return ZMK_BEHAVIOR_OPAQUE; } static int on_keymap_binding_released(struct zmk_behavior_binding *binding, struct zmk_behavior_binding_event event) { - return 0; + return ZMK_BEHAVIOR_OPAQUE; } static const struct behavior_driver_api behavior_none_driver_api = { diff --git a/app/src/behaviors/behavior_reset.c b/app/src/behaviors/behavior_reset.c index cb77a838..e4b720f7 100644 --- a/app/src/behaviors/behavior_reset.c +++ b/app/src/behaviors/behavior_reset.c @@ -30,7 +30,7 @@ static int on_keymap_binding_pressed(struct zmk_behavior_binding *binding, // See // https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/d6b28e66053eea467166f44875e3c7ec741cb471/src/main.c#L107 sys_reboot(cfg->type); - return 0; + return ZMK_BEHAVIOR_OPAQUE; } static const struct behavior_driver_api behavior_reset_driver_api = { diff --git a/app/src/behaviors/behavior_rgb_underglow.c b/app/src/behaviors/behavior_rgb_underglow.c index a0db9a9b..399123a3 100644 --- a/app/src/behaviors/behavior_rgb_underglow.c +++ b/app/src/behaviors/behavior_rgb_underglow.c @@ -50,7 +50,7 @@ static int on_keymap_binding_pressed(struct zmk_behavior_binding *binding, static int on_keymap_binding_released(struct zmk_behavior_binding *binding, struct zmk_behavior_binding_event event) { - return 0; + return ZMK_BEHAVIOR_OPAQUE; } static const struct behavior_driver_api behavior_rgb_underglow_driver_api = { diff --git a/app/src/behaviors/behavior_sticky_key.c b/app/src/behaviors/behavior_sticky_key.c index 271b168b..15c9e21c 100644 --- a/app/src/behaviors/behavior_sticky_key.c +++ b/app/src/behaviors/behavior_sticky_key.c @@ -138,12 +138,12 @@ static int on_sticky_key_binding_pressed(struct zmk_behavior_binding *binding, if (sticky_key == NULL) { LOG_ERR("unable to store sticky key, did you press more than %d sticky_key?", ZMK_BHV_STICKY_KEY_MAX_HELD); - return 0; + return ZMK_BEHAVIOR_OPAQUE; } press_sticky_key_behavior(sticky_key, event.timestamp); LOG_DBG("%d new sticky_key", event.position); - return 0; + return ZMK_BEHAVIOR_OPAQUE; } static int on_sticky_key_binding_released(struct zmk_behavior_binding *binding, @@ -151,7 +151,7 @@ static int on_sticky_key_binding_released(struct zmk_behavior_binding *binding, struct active_sticky_key *sticky_key = find_sticky_key(event.position); if (sticky_key == NULL) { LOG_ERR("ACTIVE STICKY KEY CLEARED TOO EARLY"); - return 0; + return ZMK_BEHAVIOR_OPAQUE; } if (sticky_key->modified_key_usage_page != 0 && sticky_key->modified_key_keycode != 0) { @@ -167,7 +167,7 @@ static int on_sticky_key_binding_released(struct zmk_behavior_binding *binding, if (ms_left > 0) { k_delayed_work_submit(&sticky_key->release_timer, K_MSEC(ms_left)); } - return 0; + return ZMK_BEHAVIOR_OPAQUE; } static const struct behavior_driver_api behavior_sticky_key_driver_api = { diff --git a/app/src/behaviors/behavior_toggle_layer.c b/app/src/behaviors/behavior_toggle_layer.c index 32833775..21daa004 100644 --- a/app/src/behaviors/behavior_toggle_layer.c +++ b/app/src/behaviors/behavior_toggle_layer.c @@ -29,7 +29,7 @@ static int tog_keymap_binding_pressed(struct zmk_behavior_binding *binding, static int tog_keymap_binding_released(struct zmk_behavior_binding *binding, struct zmk_behavior_binding_event event) { LOG_DBG("position %d layer %d", event.position, binding->param1); - return 0; + return ZMK_BEHAVIOR_OPAQUE; } static const struct behavior_driver_api behavior_tog_driver_api = { diff --git a/app/src/behaviors/behavior_transparent.c b/app/src/behaviors/behavior_transparent.c index 17a5e436..ca3d279f 100644 --- a/app/src/behaviors/behavior_transparent.c +++ b/app/src/behaviors/behavior_transparent.c @@ -22,12 +22,12 @@ static int behavior_transparent_init(const struct device *dev) { return 0; }; static int on_keymap_binding_pressed(struct zmk_behavior_binding *binding, struct zmk_behavior_binding_event event) { - return 1; + return ZMK_BEHAVIOR_TRANSPARENT; } static int on_keymap_binding_released(struct zmk_behavior_binding *binding, struct zmk_behavior_binding_event event) { - return 1; + return ZMK_BEHAVIOR_TRANSPARENT; } static const struct behavior_driver_api behavior_transparent_driver_api = { From 319ce302700eec9bf2a38b308ac1320aea548453 Mon Sep 17 00:00:00 2001 From: Okke Formsma Date: Sat, 2 Jan 2021 13:45:36 +0100 Subject: [PATCH 12/24] chore(behavior): use ZMK_BEHAVIOR_OPAQUE in to-layer behavior --- app/src/behaviors/behavior_to_layer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/behaviors/behavior_to_layer.c b/app/src/behaviors/behavior_to_layer.c index 3ec1bf81..bb64026d 100644 --- a/app/src/behaviors/behavior_to_layer.c +++ b/app/src/behaviors/behavior_to_layer.c @@ -20,13 +20,14 @@ static int behavior_to_init(const struct device *dev) { return 0; }; static int to_keymap_binding_pressed(struct zmk_behavior_binding *binding, struct zmk_behavior_binding_event event) { LOG_DBG("position %d layer %d", event.position, binding->param1); - return zmk_keymap_layer_to(binding->param1); + zmk_keymap_layer_to(binding->param1); + return ZMK_BEHAVIOR_OPAQUE; } static int to_keymap_binding_released(struct zmk_behavior_binding *binding, struct zmk_behavior_binding_event event) { LOG_DBG("position %d layer %d", event.position, binding->param1); - return 0; + return ZMK_BEHAVIOR_OPAQUE; } static const struct behavior_driver_api behavior_to_driver_api = { From dcd665999a5ee04372559d56fc22b9a2d0784bf2 Mon Sep 17 00:00:00 2001 From: pbz Date: Sat, 2 Jan 2021 13:52:50 -0500 Subject: [PATCH 13/24] 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;; From 4ddda7e024996480051c2c24cf1302a7d0685533 Mon Sep 17 00:00:00 2001 From: Nick Winans Date: Sun, 3 Jan 2021 18:13:49 -0600 Subject: [PATCH 14/24] docs(shield): Remove SPLIT_BLE_ROLE_PERIPHERAL Removes CONFIG_ZMK_SPLIT_BLE_ROLE_PERIPHERAL from the new shield docs See: #510 Refs: 4db5b169bff1f3de5353324baef5724be4f9a6a5 --- docs/docs/development/new-shield.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/docs/development/new-shield.md b/docs/docs/development/new-shield.md index 18f8b420..9de05b7a 100644 --- a/docs/docs/development/new-shield.md +++ b/docs/docs/development/new-shield.md @@ -278,7 +278,6 @@ CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL=y // Peripheral Half (Usually the right side: my_awesome_split_board_right.conf) CONFIG_ZMK_SPLIT=y -CONFIG_ZMK_SPLIT_BLE_ROLE_Peripheral=y ``` Using the .conf file that affects both halves of a split board would be for adding features like deep-sleep or rotary encoders. From 74b397ab9136ba23b96e1fd8120bd7e32a1944af Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Mon, 4 Jan 2021 11:59:25 -0500 Subject: [PATCH 15/24] fix(docs): Add closing bracket for new shield. --- docs/docs/development/new-shield.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/docs/development/new-shield.md b/docs/docs/development/new-shield.md index 9de05b7a..acc636fd 100644 --- a/docs/docs/development/new-shield.md +++ b/docs/docs/development/new-shield.md @@ -203,6 +203,7 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,2) RC(4,9) RC(3,6) RC(3,7) ; }; +}; ``` :::note From a55b1397c9558cead989dfc5920b162f7c8b4c8b Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Tue, 29 Dec 2020 00:19:25 -0500 Subject: [PATCH 16/24] feat(keymap): API for retrieving label for a layer --- app/include/zmk/keymap.h | 1 + app/src/keymap.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/app/include/zmk/keymap.h b/app/include/zmk/keymap.h index 9192772f..4bcdc2b4 100644 --- a/app/include/zmk/keymap.h +++ b/app/include/zmk/keymap.h @@ -16,5 +16,6 @@ int zmk_keymap_layer_activate(uint8_t layer); int zmk_keymap_layer_deactivate(uint8_t layer); int zmk_keymap_layer_toggle(uint8_t layer); int zmk_keymap_layer_to(uint8_t layer); +const char *zmk_keymap_layer_label(uint8_t layer); int zmk_keymap_position_state_changed(uint32_t position, bool pressed, int64_t timestamp); diff --git a/app/src/keymap.c b/app/src/keymap.c index 786a1773..322a9369 100644 --- a/app/src/keymap.c +++ b/app/src/keymap.c @@ -59,6 +59,8 @@ static uint8_t _zmk_keymap_layer_default = 0; #endif /* ZMK_KEYMAP_HAS_SENSORS */ +#define LAYER_LABEL(node) COND_CODE_0(DT_NODE_HAS_PROP(node, label), (NULL), (DT_LABEL(node))), + // State // When a behavior handles a key position "down" event, we record the layer state @@ -69,6 +71,9 @@ static uint32_t zmk_keymap_active_behavior_layer[ZMK_KEYMAP_LEN]; static struct zmk_behavior_binding zmk_keymap[ZMK_KEYMAP_LAYERS_LEN][ZMK_KEYMAP_LEN] = { DT_INST_FOREACH_CHILD(0, TRANSFORMED_LAYER)}; +static const char *zmk_keymap_layer_names[ZMK_KEYMAP_LAYERS_LEN] = { + DT_INST_FOREACH_CHILD(0, LAYER_LABEL)}; + #if ZMK_KEYMAP_HAS_SENSORS static struct zmk_behavior_binding zmk_sensor_keymap[ZMK_KEYMAP_LAYERS_LEN] @@ -143,6 +148,18 @@ int zmk_keymap_layer_to(uint8_t layer) { return 0; } +bool is_active_layer(uint8_t layer, zmk_keymap_layers_state_t layer_state) { + return (layer_state & BIT(layer)) == BIT(layer) || layer == _zmk_keymap_layer_default; +} + +const char *zmk_keymap_layer_label(uint8_t layer) { + if (layer >= ZMK_KEYMAP_LAYERS_LEN) { + return NULL; + } + + return zmk_keymap_layer_names[layer]; +} + int zmk_keymap_apply_position_state(int layer, uint32_t position, bool pressed, int64_t timestamp) { struct zmk_behavior_binding *binding = &zmk_keymap[layer][position]; const struct device *behavior; From 992cee1bac816696839e52eb1f7c4e5f3e51c4db Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Tue, 29 Dec 2020 00:19:51 -0500 Subject: [PATCH 17/24] feat(display): Show layer label in widget. --- app/src/display/widgets/layer_status.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/app/src/display/widgets/layer_status.c b/app/src/display/widgets/layer_status.c index fb9f6897..6700bb30 100644 --- a/app/src/display/widgets/layer_status.c +++ b/app/src/display/widgets/layer_status.c @@ -33,12 +33,23 @@ void layer_status_init() { void set_layer_symbol(lv_obj_t *label) { int active_layer_index = zmk_keymap_highest_layer_active(); - char text[6] = {}; LOG_DBG("Layer changed to %i", active_layer_index); - sprintf(text, LV_SYMBOL_KEYBOARD "%i ", active_layer_index); - lv_label_set_text(label, text); + const char *layer_label = zmk_keymap_layer_label(active_layer_index); + if (layer_label == NULL) { + char text[6] = {}; + + sprintf(text, LV_SYMBOL_KEYBOARD "%i", active_layer_index); + + lv_label_set_text(label, text); + } else { + char text[12] = {}; + + snprintf(text, 12, LV_SYMBOL_KEYBOARD "%s", layer_label); + + lv_label_set_text(label, text); + } } int zmk_widget_layer_status_init(struct zmk_widget_layer_status *widget, lv_obj_t *parent) { From e5b1f1e1beb3ca9ad11de2cc3aac64bfa8b4ca4c Mon Sep 17 00:00:00 2001 From: Nick Winans Date: Mon, 4 Jan 2021 12:20:31 -0600 Subject: [PATCH 18/24] fix(shield): BFO9000 uses USB on right --- app/boards/shields/bfo9000/Kconfig.defconfig | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/boards/shields/bfo9000/Kconfig.defconfig b/app/boards/shields/bfo9000/Kconfig.defconfig index e4b02e8c..1251113f 100644 --- a/app/boards/shields/bfo9000/Kconfig.defconfig +++ b/app/boards/shields/bfo9000/Kconfig.defconfig @@ -3,12 +3,12 @@ if SHIELD_BFO9000_LEFT -config ZMK_SPLIT_BLE_ROLE_CENTRAL - default y - config ZMK_KEYBOARD_NAME default "BFO9000 Left" +config ZMK_SPLIT_BLE_ROLE_CENTRAL + default y + endif if SHIELD_BFO9000_RIGHT @@ -16,6 +16,9 @@ if SHIELD_BFO9000_RIGHT config ZMK_KEYBOARD_NAME default "BFO9000 Right" +config USB + default y + endif if SHIELD_BFO9000_LEFT || SHIELD_BFO9000_RIGHT From a4703537603d1ae7f5a904fc57d61af7382b6f9f Mon Sep 17 00:00:00 2001 From: Nick Winans Date: Mon, 4 Jan 2021 12:42:22 -0600 Subject: [PATCH 19/24] docs(shield): Add docs based on #510 changes --- docs/docs/development/new-shield.md | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/docs/development/new-shield.md b/docs/docs/development/new-shield.md index acc636fd..ceb81d10 100644 --- a/docs/docs/development/new-shield.md +++ b/docs/docs/development/new-shield.md @@ -91,6 +91,9 @@ endif ``` Similarly to defining the halves of a split board in `Kconfig.shield` it is important to set the `ZMK_KEYBOARD_NAME` for each half of a split keyboard. +You'll also want to set which half is the central side. Most boards set it to the left. +Then on the peripheral half, you'll want to turn USB on so that it shows USB status on displays properly. +Finally, you'll want to turn on the split option for both sides. This can all be seen below. ``` if SHIELD_MY_BOARD_LEFT @@ -98,6 +101,9 @@ if SHIELD_MY_BOARD_LEFT config ZMK_KEYBOARD_NAME default "My Awesome Keyboard Left" +config ZMK_SPLIT_BLE_ROLE_CENTRAL + default y + endif if SHIELD_MY_BOARD_RIGHT @@ -105,6 +111,16 @@ if SHIELD_MY_BOARD_RIGHT config ZMK_KEYBOARD_NAME default "My Awesome Keyboard Right" +config USB + default y + +endif + +if SHIELD_MY_BOARD_LEFT || SHIELD_MY_BOARD_RIGHT + +config ZMK_SPLIT + default y + endif ``` @@ -265,23 +281,7 @@ For example, a split board called `my_awesome_split_board` would have the follow - `my_awesome_split_board_left.conf` - Configuration elements only affect left half - `my_awesome_split_board_right.conf` - Configuration elements only affect right half -For proper communication between keyboard halves and that between the central half and the computer, -the **the central and peripheral halves of the keyboard must be defined**. This can be seen below. - -``` -// Central Half (Usually the left side: my_awesome_split_board_left.conf) - -CONFIG_ZMK_SPLIT=y -CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL=y -``` - -``` -// Peripheral Half (Usually the right side: my_awesome_split_board_right.conf) - -CONFIG_ZMK_SPLIT=y -``` - -Using the .conf file that affects both halves of a split board would be for adding features like deep-sleep or rotary encoders. +In most case you'll only need to use the .conf file that affects both halves of a split board. It's used for adding features like deep-sleep or rotary encoders. ``` // my_awesome_split_board.conf From 5c11962d986753d5da9244cf572242f43f4d126c Mon Sep 17 00:00:00 2001 From: KingCoinless <33333456+KingCoinless@users.noreply.github.com> Date: Tue, 5 Jan 2021 10:56:47 -0800 Subject: [PATCH 20/24] feat(shields): add helix shield PR: #429 --- .github/workflows/build.yml | 2 + app/boards/shields/helix/Kconfig.defconfig | 29 ++++++ app/boards/shields/helix/Kconfig.shield | 8 ++ app/boards/shields/helix/README.md | 12 +++ .../shields/helix/boards/nice_nano.overlay | 34 +++++++ app/boards/shields/helix/helix.conf | 6 ++ app/boards/shields/helix/helix.dtsi | 47 ++++++++++ app/boards/shields/helix/helix.keymap | 88 +++++++++++++++++++ app/boards/shields/helix/helix_left.overlay | 19 ++++ app/boards/shields/helix/helix_right.overlay | 23 +++++ docs/docs/hardware.md | 1 + docs/static/setup.ps1 | 6 +- docs/static/setup.sh | 5 +- 13 files changed, 275 insertions(+), 5 deletions(-) create mode 100644 app/boards/shields/helix/Kconfig.defconfig create mode 100644 app/boards/shields/helix/Kconfig.shield create mode 100644 app/boards/shields/helix/README.md create mode 100644 app/boards/shields/helix/boards/nice_nano.overlay create mode 100644 app/boards/shields/helix/helix.conf create mode 100644 app/boards/shields/helix/helix.dtsi create mode 100644 app/boards/shields/helix/helix.keymap create mode 100644 app/boards/shields/helix/helix_left.overlay create mode 100644 app/boards/shields/helix/helix_right.overlay diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 58da8c41..d7011283 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,6 +32,8 @@ jobs: - cradio_right - crbn - eek + - helix_left + - helix_right - iris_left - iris_right - jian_left diff --git a/app/boards/shields/helix/Kconfig.defconfig b/app/boards/shields/helix/Kconfig.defconfig new file mode 100644 index 00000000..f58684a8 --- /dev/null +++ b/app/boards/shields/helix/Kconfig.defconfig @@ -0,0 +1,29 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +if SHIELD_HELIX_LEFT + +config ZMK_KEYBOARD_NAME + default "Helix Left" + +config ZMK_SPLIT_BLE_ROLE_CENTRAL + default y + +endif + +if SHIELD_HELIX_RIGHT + +config ZMK_KEYBOARD_NAME + default "Helix Right" + +config USB + default y + +endif + +if SHIELD_HELIX_LEFT || SHIELD_HELIX_RIGHT + +config ZMK_SPLIT + default y + +endif \ No newline at end of file diff --git a/app/boards/shields/helix/Kconfig.shield b/app/boards/shields/helix/Kconfig.shield new file mode 100644 index 00000000..7e5bb9ae --- /dev/null +++ b/app/boards/shields/helix/Kconfig.shield @@ -0,0 +1,8 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config SHIELD_HELIX_LEFT + def_bool $(shields_list_contains,helix_left) + +config SHIELD_HELIX_RIGHT + def_bool $(shields_list_contains,helix_right) \ No newline at end of file diff --git a/app/boards/shields/helix/README.md b/app/boards/shields/helix/README.md new file mode 100644 index 00000000..f8b0e13f --- /dev/null +++ b/app/boards/shields/helix/README.md @@ -0,0 +1,12 @@ +#### Note to user: + +- If desired, RGB underglow must be manually enabled before building and flashing. Check 'helix.conf' to do so. +- Peripheral RGB function is impaired until full support is implemented in the master branch. +- OLED displays are not currently included in this shield. This will be updated after OLED support is live. +- 'KANA' and 'EISUU' input is currently utilized under the 'LANG1' and 'LANG2' keycodes respectively. + +--- + +Thanks to Nicell, KemoNine, petejohanson, TJ "Chormbo The Great", joelspadin/Rinh, Wofiel, Okke, innovaker, +and the rest of the ZMK contributors for their support in constructing this shield. I appreciate your assistance greatly. +This has been a valuable learning experience for me. May this contribution serve the community well. diff --git a/app/boards/shields/helix/boards/nice_nano.overlay b/app/boards/shields/helix/boards/nice_nano.overlay new file mode 100644 index 00000000..78576d13 --- /dev/null +++ b/app/boards/shields/helix/boards/nice_nano.overlay @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + mosi-pin = <6>; + // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. + sck-pin = <5>; + miso-pin = <7>; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <32>; /* number of LEDs */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/app/boards/shields/helix/helix.conf b/app/boards/shields/helix/helix.conf new file mode 100644 index 00000000..a8e57338 --- /dev/null +++ b/app/boards/shields/helix/helix.conf @@ -0,0 +1,6 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +# Enables RGB functionality (Uncomment lines below to enable.) +# CONFIG_ZMK_RGB_UNDERGLOW=y +# CONFIG_WS2812_STRIP=y \ No newline at end of file diff --git a/app/boards/shields/helix/helix.dtsi b/app/boards/shields/helix/helix.dtsi new file mode 100644 index 00000000..8df943f0 --- /dev/null +++ b/app/boards/shields/helix/helix.dtsi @@ -0,0 +1,47 @@ +/* + * 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 = <14>; + rows = <5>; +// | SW1 | SW2 | SW3 | SW4 | SW5 | SW6 | | SW6 | SW5 | SW4 | SW3 | SW2 | SW1 | +// | SW7 | SW8 | SW9 | SW10 | SW11 | SW12 | | SW12 | SW11 | SW10 | SW9 | SW8 | SW7 | +// | SW13 | SW14 | SW15 | SW16 | SW17 | SW18 | | SW18 | SW17 | SW16 | SW15 | SW14 | SW13 | +// | SW19 | SW20 | SW21 | SW22 | SW23 | SW24 | SW25 | | SW25 | SW24 | SW23 | SW22 | SW21 | SW20 | SW19 | +// | SW26 | SW27 | SW28 | SW29 | SW30 | SW31 | SW32 | | SW32 | SW31 | SW30 | SW29 | SW28 | SW27 | SW26 | + map = < +RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,8) RC(0,9) RC(0,10) RC(0,11) RC(0,12) RC(0,13) +RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,8) RC(1,9) RC(1,10) RC(1,11) RC(1,12) RC(1,13) +RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,8) RC(2,9) RC(2,10) RC(2,11) RC(2,12) RC(2,13) +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(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) + >; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + + diode-direction = "col2row"; + row-gpios + = <&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)> + , <&pro_micro_d 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + + }; +}; \ No newline at end of file diff --git a/app/boards/shields/helix/helix.keymap b/app/boards/shields/helix/helix.keymap new file mode 100644 index 00000000..82327c32 --- /dev/null +++ b/app/boards/shields/helix/helix.keymap @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + + #include + #include + #include + #include + #include + #include + + #define DEFAULT 0 + #define LOWER 1 + #define RAISE 2 + #define ADJUST 3 + +/* NOTE: At the time of the creation of this keymap, there are no specified codes for 'eisuu' and 'kana' input in ZMK. +However, 'LANG1' and 'LANG2' are fully-functioning candidates for 'kana' and 'eisuu' input respectively. +As such, those are in use within the default layer at this time.*/ + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { + // --------------------------------------------------------------------------------------------------------------------------------- + // | GRAVE | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | DEL | + // | TAB | Q | W | E | R | T | | Y | U | I | O | P | BSPC | + // | CTRL | A | S | D | F | G | | H | J | K | L | ; | ' | + // | SHIFT | Z | X | C | V | B | LBKT | | RBKT | N | M | , | . | / | RET | + // | ADJUST | ESC | ALT | LGUI | EISUU | LOWER | SPACE | | SPACE | RAISE | KANA | LEFT | DOWN | UP | RIGHT | + bindings = < + &kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp DEL + &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSPC + &kp LCTRL &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT + &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp LBKT &kp RBKT &kp N &kp M &kp COMMA &kp PERIOD &kp SLASH &kp RET + &mo ADJUST &kp ESC &kp LALT &kp LGUI &kp LANG2 &mo LOWER &kp SPACE &kp SPACE &mo RAISE &kp LANG1 &kp LEFT &kp DOWN &kp UP &kp RIGHT + >; + }; + lower_layer { + // --------------------------------------------------------------------------------------------------------------------------------- + // | | | | | | | | | | | | | | + // | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + // | | | | | | | | | _ | + | { | } | PIPE | + // | | | | | | | ( | | ) | | | | HOME | END | | + // | | | | | | | | | | | | | | | | + bindings = < + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &kp TILDE &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp ASTRK &kp LPAR &kp RPAR &trans + &trans &trans &trans &trans &trans &trans &trans &kp UNDER &kp PLUS &kp LBRC &kp RBRC &kp PIPE + &trans &trans &trans &trans &trans &trans &kp LPAR &kp RPAR &trans &trans &trans &kp HOME &kp END &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + >; + }; + raise_layer { + // --------------------------------------------------------------------------------------------------------------------------------- + // | | | | | | | | | | | | | | + // | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | DEL | + // | | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ | + // | | F7 | F8 | F9 | F10 | F11 | | | | F12 | | PSCRN | PG_DN | PG_UP | | + // | | | | | | | | | | | | NEXT | VOL- | VOL+ | PLAY | + bindings = < + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp DEL + &trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp MINUS &kp EQUAL &kp LBKT &kp RBKT &kp BSLH + &trans &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &trans &trans &kp F12 &trans &kp PSCRN &kp PG_DN &kp PG_UP &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &kp C_NEXT &kp C_VOL_DN &kp C_VOL_UP &kp C_PP + >; + }; + adjust_layer { + // --------------------------------------------------------------------------------------------------------------------------------- + // | ` | ! | @ | # | $ | % | | ^ | & | * | ( | ) | EP TOG | + // | BT CLR | BT SEL0 | BT SEL1 | BT SEL2 | BGT SEL3 | BT SEL4 | | RGB EFF+ | RGB HUE+ | RGB SAT+ | RGB SPD+ | RGB BRI+ | RGB TOG | + // | BT NXT | OUT TOG | OUT USB | OUT BLE | | | | RGB EFF- | RGB HUE- | RGB SAT- | RGB SPD- | RGB BRI- | | + // | BT PRV | | | | | | { | | } | | | | | | | + // | | | | | | | | | | | | | | | | + bindings = < + &kp GRAVE &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp ASTRK &kp LPAR &kp RPAR &ext_power EP_TOG + &bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &rgb_ug RGB_EFF &rgb_ug RGB_HUI &rgb_ug RGB_SAI &rgb_ug RGB_SPI &rgb_ug RGB_BRI &rgb_ug RGB_TOG + &bt BT_NXT &out OUT_TOG &out OUT_USB &out OUT_BLE &trans &trans &rgb_ug RGB_EFR &rgb_ug RGB_HUD &rgb_ug RGB_SAD &rgb_ug RGB_SPD &rgb_ug RGB_BRD &trans + &bt BT_PRV &trans &trans &trans &trans &trans &kp LBRC &kp RBRC &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + >; + }; + }; +}; \ No newline at end of file diff --git a/app/boards/shields/helix/helix_left.overlay b/app/boards/shields/helix/helix_left.overlay new file mode 100644 index 00000000..733e55f9 --- /dev/null +++ b/app/boards/shields/helix/helix_left.overlay @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "helix.dtsi" + +&kscan0 { + col-gpios + = <&pro_micro_a 3 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 2 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 1 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 0 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 15 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 14 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 16 GPIO_ACTIVE_HIGH> + ; +}; diff --git a/app/boards/shields/helix/helix_right.overlay b/app/boards/shields/helix/helix_right.overlay new file mode 100644 index 00000000..2383a30e --- /dev/null +++ b/app/boards/shields/helix/helix_right.overlay @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "helix.dtsi" + +&default_transform { + col-offset = <7>; +}; + +&kscan0 { + col-gpios + = <&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/docs/docs/hardware.md b/docs/docs/hardware.md index 244bdd60..0dc17782 100644 --- a/docs/docs/hardware.md +++ b/docs/docs/hardware.md @@ -25,6 +25,7 @@ That being said, there are currently only a few specific [boards](/docs/faq#what - [Kyria](https://splitkb.com/products/kyria-pcb-kit) (`kyria_left` and `kyria_right`) - [Corne](https://github.com/foostan/crkbd) (`corne_left` and `corne_right`) +- [Helix](https://github.com/mcmadhatter/helix) (`helix_left` and `helix_right`) - [Lily58](https://github.com/kata0510/Lily58) (`lily58_left` and `lily58_right`) - [Sofle](https://github.com/josefadamcik/SofleKeyboard) (`sofle_left` and `sofle_right`) - [Splitreus62](https://github.com/Na-Cly/splitreus62) (`splitreus62_left` and `splitreus62_right`) diff --git a/docs/static/setup.ps1 b/docs/static/setup.ps1 index ffd938f4..63cdb725 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!", "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" +$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" $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 486bb06c..89fd1af2 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!" "BF0-9000") +options=("Kyria" "Lily58" "Corne" "Splitreus62" "Sofle" "Iris" "Reviung41" "RoMac" "RoMac+" "makerdiary M60" "Microdox" "TG4X" "QAZ" "Jorne" "Jian" "CRBN" "Tidbit" "Eek!" "BF0-9000" "Helix") PS3="$prompt " # TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos. @@ -120,7 +120,8 @@ 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;; + 20 ) shield_title="BFO-9000" shield="bfo9000"; split="y"; break;; + 21 ) shield_title="Helix" shield="helix"; split"y"; break;; # Add link to docs on adding your own custom shield in your ZMK config! # $(( ${#options[@]}+1 )) ) echo "Other!"; break;; From 4c1f615714e84a5b05fe76af69faf446cd09fb45 Mon Sep 17 00:00:00 2001 From: Okke Formsma Date: Tue, 5 Jan 2021 20:29:47 +0100 Subject: [PATCH 21/24] docs(troubleshooting): fix reset uf2 download instructions PR: #512 Co-authored-by: innovaker <66737976+innovaker@users.noreply.github.com> --- docs/docs/troubleshooting.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/docs/troubleshooting.md b/docs/docs/troubleshooting.md index 0fe0b665..23403eec 100644 --- a/docs/docs/troubleshooting.md +++ b/docs/docs/troubleshooting.md @@ -54,7 +54,10 @@ Since then, a much simpler procedure of performing a bluetooth reset for split k **New Procedure:** -1. Log into Github and download the "settings clear" UF2 image from the [latest build in Github Actions](https://github.com/zmkfirmware/zmk/actions?query=workflow%3ABuild+branch%3Amain) +1. [Open the GitHub `Actions` tab and select the `Build` workflow](https://github.com/zmkfirmware/zmk/actions?query=workflow%3ABuild+branch%3Amain). +1. Select the top 'result' on that page. +1. From the next page under "Artifacts", download the `$boardname-settings_reset-zmk` zip file. +1. Unzip the downloaded file. 1. Put each half of the split keyboard into bootloader mode 1. Flash one of the halves of the split with the "settings clear" UF2 image from step 1. Immediately after flashing "settings clear" to the chosen half, immediately put it into bootloader mode to avoid accidental bonding between the halves. From ad238d63dff93bcf33c9f91256699cc4ace09c4b Mon Sep 17 00:00:00 2001 From: Nick Winans Date: Wed, 30 Dec 2020 19:07:03 -0600 Subject: [PATCH 22/24] docs(intro): Update feature table --- docs/docs/intro.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/docs/intro.md b/docs/docs/intro.md index 564eedb7..1e801a46 100644 --- a/docs/docs/intro.md +++ b/docs/docs/intro.md @@ -23,16 +23,16 @@ ZMK is currently missing some features found in other popular firmware. This tab | [Keyboard Codes](codes/#keyboard) | ✅ | ✅ | ✅ | | [Media](codes/#media-controls) & [Consumer](codes/#consumer-controls) Codes | ✅ | ✅ | ✅ | | [Encoders](features/encoders)[^1] | ✅ | | ✅ | -| [OLED Display Support](features/displays)[^2] | 🚧 | 🚧 | ✅ | +| [Display Support](features/displays)[^2] | 🚧 | 🚧 | ✅ | | [RGB Underglow](features/underglow) | ✅ | ✅ | ✅ | -| One Shot Keys | 🚧 | ✅ | ✅ | -| Combo Keys | 🚧 | | ✅ | +| One Shot Keys | ✅ | ✅ | ✅ | +| [Combo Keys](https://github.com/zmkfirmware/zmk/pull/504) | 🚧 | | ✅ | | Macros | 🚧 | ✅ | ✅ | | Mouse Keys | | ✅ | ✅ | | Low Active Power Usage | ✅ | | | -| [Low Power Sleep States](https://github.com/zmkfirmware/zmk/pull/211) | 🚧 | ✅ | | -| [Low Power Mode (VCC Shutoff)](https://github.com/zmkfirmware/zmk/pull/242) | 🚧 | | | -| [Battery Reporting](https://github.com/zmkfirmware/zmk/issues/47) | 🚧 | ✅ | | +| Low Power Sleep States | ✅ | ✅ | | +| [Low Power Mode (VCC Shutoff)](behaviors/power) | ✅ | | | +| Battery Reporting | ✅ | ✅ | | | Shell over BLE | | | | | Realtime Keymap Updating | 💡 | | ✅ | | AVR/8 Bit | | | ✅ | From 56ec200bae7610bae32c558cf1302b02d433471d Mon Sep 17 00:00:00 2001 From: Nick Winans Date: Mon, 4 Jan 2021 15:29:55 -0600 Subject: [PATCH 23/24] =?UTF-8?q?docs(intro):=20Add=20=F0=9F=92=A1=20to=20?= =?UTF-8?q?Mouse=20Keys=20and=20BLE=20Shell?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs/intro.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/intro.md b/docs/docs/intro.md index 1e801a46..57670ea0 100644 --- a/docs/docs/intro.md +++ b/docs/docs/intro.md @@ -28,12 +28,12 @@ ZMK is currently missing some features found in other popular firmware. This tab | One Shot Keys | ✅ | ✅ | ✅ | | [Combo Keys](https://github.com/zmkfirmware/zmk/pull/504) | 🚧 | | ✅ | | Macros | 🚧 | ✅ | ✅ | -| Mouse Keys | | ✅ | ✅ | +| Mouse Keys | 💡 | ✅ | ✅ | | Low Active Power Usage | ✅ | | | | Low Power Sleep States | ✅ | ✅ | | | [Low Power Mode (VCC Shutoff)](behaviors/power) | ✅ | | | | Battery Reporting | ✅ | ✅ | | -| Shell over BLE | | | | +| Shell over BLE | 💡 | | | | Realtime Keymap Updating | 💡 | | ✅ | | AVR/8 Bit | | | ✅ | | [Wide Range of ARM Chips Supported](https://docs.zephyrproject.org/latest/boards/index.html) | ✅ | | | From f17584ca0ee4d6bbc0893c0a62a0dc2fa293d2b8 Mon Sep 17 00:00:00 2001 From: innovaker <66737976+innovaker@users.noreply.github.com> Date: Fri, 1 Jan 2021 22:37:34 +0000 Subject: [PATCH 24/24] chore: standardize # style headers Changes made with regex plus some manual tweaks. Find: /(?:(?" exit 1 diff --git a/app/scripts/west-commands.yml b/app/scripts/west-commands.yml index 75be89da..81d6946f 100644 --- a/app/scripts/west-commands.yml +++ b/app/scripts/west-commands.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2020, ZMK Contributors +# Copyright (c) 2020 ZMK Contributors # SPDX-License-Identifier: MIT west-commands: diff --git a/app/scripts/west_commands/test.py b/app/scripts/west_commands/test.py index f79547b9..ac64bb6f 100644 --- a/app/scripts/west_commands/test.py +++ b/app/scripts/west_commands/test.py @@ -1,5 +1,4 @@ # Copyright (c) 2020 The ZMK Contributors -# # SPDX-License-Identifier: MIT '''Test runner for ZMK.''' diff --git a/docs/static/setup.ps1 b/docs/static/setup.ps1 index 63cdb725..bcea9f7a 100644 --- a/docs/static/setup.ps1 +++ b/docs/static/setup.ps1 @@ -1,5 +1,4 @@ # Copyright (c) 2020 The ZMK Contributors -# # SPDX-License-Identifier: MIT $ErrorActionPreference = "Stop" diff --git a/docs/static/setup.sh b/docs/static/setup.sh index 89fd1af2..652160b4 100644 --- a/docs/static/setup.sh +++ b/docs/static/setup.sh @@ -1,7 +1,6 @@ #!/bin/bash # Copyright (c) 2020 The ZMK Contributors -# # SPDX-License-Identifier: MIT set -e