From 3e264e46d4c53ed7198731fcdfefc74396b48f1a Mon Sep 17 00:00:00 2001 From: Derek Date: Sat, 15 Aug 2020 16:01:35 -0400 Subject: [PATCH 01/15] Add splitreus62 shield --- .../shields/splitreus62/Kconfig.defconfig | 54 +++++++++++++++++++ app/boards/shields/splitreus62/Kconfig.shield | 8 +++ .../shields/splitreus62/splitreus62.conf | 2 + .../shields/splitreus62/splitreus62.dtsi | 50 +++++++++++++++++ .../shields/splitreus62/splitreus62.keymap | 25 +++++++++ .../shields/splitreus62/splitreus62_left.conf | 2 + .../splitreus62/splitreus62_left.overlay | 19 +++++++ .../splitreus62/splitreus62_right.conf | 3 ++ .../splitreus62/splitreus62_right.overlay | 22 ++++++++ 9 files changed, 185 insertions(+) create mode 100644 app/boards/shields/splitreus62/Kconfig.defconfig create mode 100644 app/boards/shields/splitreus62/Kconfig.shield create mode 100644 app/boards/shields/splitreus62/splitreus62.conf create mode 100644 app/boards/shields/splitreus62/splitreus62.dtsi create mode 100644 app/boards/shields/splitreus62/splitreus62.keymap create mode 100644 app/boards/shields/splitreus62/splitreus62_left.conf create mode 100644 app/boards/shields/splitreus62/splitreus62_left.overlay create mode 100644 app/boards/shields/splitreus62/splitreus62_right.conf create mode 100644 app/boards/shields/splitreus62/splitreus62_right.overlay diff --git a/app/boards/shields/splitreus62/Kconfig.defconfig b/app/boards/shields/splitreus62/Kconfig.defconfig new file mode 100644 index 00000000..c52752a0 --- /dev/null +++ b/app/boards/shields/splitreus62/Kconfig.defconfig @@ -0,0 +1,54 @@ + +if SHIELD_SPLITREUS62_LEFT + +config ZMK_KEYBOARD_NAME + default "Splitreus62 Left" + +endif + +if SHIELD_SPLITREUS62_RIGHT + +config ZMK_KEYBOARD_NAME + default "Splitreus62 Right" + +endif + +if SHIELD_SPLITREUS62_LEFT || SHIELD_SPLITREUS62_RIGHT + +if ZMK_DISPLAY + +config I2C + default n + +config SSD1306 + default n + +config SSD1306_REVERSE_MODE + default n + +endif # ZMK_DISPLAY + +if LVGL + +config LVGL_HOR_RES + default 128 + +config LVGL_VER_RES + default 32 + +config LVGL_VDB_SIZE + default 64 + +config LVGL_DPI + default 148 + +config LVGL_BITS_PER_PIXEL + default 1 + +choice LVGL_COLOR_DEPTH + default LVGL_COLOR_DEPTH_1 +endchoice + +endif # LVGL + +endif diff --git a/app/boards/shields/splitreus62/Kconfig.shield b/app/boards/shields/splitreus62/Kconfig.shield new file mode 100644 index 00000000..f20f2362 --- /dev/null +++ b/app/boards/shields/splitreus62/Kconfig.shield @@ -0,0 +1,8 @@ +# Copyright (c) 2020 Pete Johanson +# SPDX-License-Identifier: MIT + +config SHIELD_SPLITREUS62_LEFT + def_bool $(shields_list_contains,splitreus62_left) + +config SHIELD_SPLITREUS62_RIGHT + def_bool $(shields_list_contains,splitreus62_right) diff --git a/app/boards/shields/splitreus62/splitreus62.conf b/app/boards/shields/splitreus62/splitreus62.conf new file mode 100644 index 00000000..73f0d9de --- /dev/null +++ b/app/boards/shields/splitreus62/splitreus62.conf @@ -0,0 +1,2 @@ +# Uncomment the following line to enable the Lily58 OLED Display +# CONFIG_ZMK_DISPLAY=y diff --git a/app/boards/shields/splitreus62/splitreus62.dtsi b/app/boards/shields/splitreus62/splitreus62.dtsi new file mode 100644 index 00000000..e1fb40b2 --- /dev/null +++ b/app/boards/shields/splitreus62/splitreus62.dtsi @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2020 Pete Johanson, Derek Schmell + * + * SPDX-License-Identifier: MIT + */ + +#include + +/ { + chosen { + zmk,kscan = &kscan0; + zmk,matrix_transform = &default_transform; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <12>; + rows = <6>; +// | SW0 | SW5 | SW10 | SW15 | SW20 | SW25 | SW25 | SW20 | SW15 | SW10 | SW5 | SW1 | +// | SW1 | SW6 | SW11 | SW16 | SW21 | SW26 | SW26 | SW21 | SW16 | SW11 | SW6 | SW2 | +// | SW2 | SW7 | SW12 | SW17 | SW22 | SW27 | SW27 | SW22 | SW17 | SW12 | SW7 | SW3 | +// | SW3 | SW8 | SW13 | SW18 | SW23 | SW28 | SW28 | SW23 | SW18 | SW13 | SW8 | SW4 | +// | SW4 | SW9 | SW14 | SW19 | SW24 | SW29 | SW29 | SW24 | SW19 | SW14 | SW9 | SW5 | +// SW30 | SW30 + map = < +RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11) +RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11) +RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) +RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11) +RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(4,6) RC(4,7) RC(4,8) RC(4,9) RC(4,10) RC(4,11) + RC(5,5) RC(5,6) + >; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + + diode-direction = "row2col"; + row-gpios + = <&pro_micro_d 1 GPIO_ACTIVE_HIGH > + , <&pro_micro_d 0 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 2 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 4 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 5 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 6 GPIO_ACTIVE_HIGH> + ; + + }; +}; diff --git a/app/boards/shields/splitreus62/splitreus62.keymap b/app/boards/shields/splitreus62/splitreus62.keymap new file mode 100644 index 00000000..cd683a22 --- /dev/null +++ b/app/boards/shields/splitreus62/splitreus62.keymap @@ -0,0 +1,25 @@ +#include +#include + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { +// ------------------------------------------------------------------------------------------------------------ +// | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | +// | TAB | Q | W | E | R | T | | Y | U | I | O | P | \ | +// | CTRL | A | S | D | F | G | | H | J | K | L | ; | ' | +// | SHIFT | Z | X | C | V | B | | N | M | , | . | / | SHIFT | +// | LCTL | LGUI | LALT | GRAV | | EQL | DEL | BKSP| | RET | SPC | LBKT | RBKT | LBKT | HOME | END | + bindings = < +&kp ESC &kp NUM_1 &kp NUM_2 &kp NUM_3 &kp NUM_4 &kp NUM_5 &kp NUM_6 &kp NUM_7 &kp NUM_8 &kp NUM_9 &kp NUM_0 &kp MINUS +&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH +&kp LCTL &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SCLN &kp QUOT +&kp LSFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp CMMA &kp DOT &kp FSLH &kp RSFT +&kp LCTL &kp LGUI &kp LALT &kp GRAV &kp EQL &kp DEL &kp SPC &kp LBKT &kp RBKT &kp MINUS &kp HOME &kp END + &kp BKSP &kp RET + >; + }; + }; +}; diff --git a/app/boards/shields/splitreus62/splitreus62_left.conf b/app/boards/shields/splitreus62/splitreus62_left.conf new file mode 100644 index 00000000..a835adc1 --- /dev/null +++ b/app/boards/shields/splitreus62/splitreus62_left.conf @@ -0,0 +1,2 @@ +CONFIG_ZMK_SPLIT=y +CONFIG_ZMK_SPLIT_BLE_ROLE_PERIPHERAL=y \ No newline at end of file diff --git a/app/boards/shields/splitreus62/splitreus62_left.overlay b/app/boards/shields/splitreus62/splitreus62_left.overlay new file mode 100644 index 00000000..aea374a4 --- /dev/null +++ b/app/boards/shields/splitreus62/splitreus62_left.overlay @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 Pete Johanson + * + * SPDX-License-Identifier: MIT + */ + +#include "splitreus62.dtsi" + +&kscan0 { + col-gpios + = <&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)> + , <&pro_micro_d 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; +}; + diff --git a/app/boards/shields/splitreus62/splitreus62_right.conf b/app/boards/shields/splitreus62/splitreus62_right.conf new file mode 100644 index 00000000..ab43d049 --- /dev/null +++ b/app/boards/shields/splitreus62/splitreus62_right.conf @@ -0,0 +1,3 @@ +CONFIG_ZMK_SPLIT=y +CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL=y +#CONFIG_ZMK_SPLIT_BLE_ROLE_PERIPHERAL=y diff --git a/app/boards/shields/splitreus62/splitreus62_right.overlay b/app/boards/shields/splitreus62/splitreus62_right.overlay new file mode 100644 index 00000000..3c0f9899 --- /dev/null +++ b/app/boards/shields/splitreus62/splitreus62_right.overlay @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 Pete Johanson + * + * SPDX-License-Identifier: MIT + */ + +#include "splitreus62.dtsi" + +&default_transform { + col-offset = <6>; +}; + +&kscan0 { + col-gpios + = <&pro_micro_d 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; +}; \ No newline at end of file From bb5eb51df743bd1c56c814c62f10d022c388df67 Mon Sep 17 00:00:00 2001 From: Derek Date: Sat, 15 Aug 2020 16:11:18 -0400 Subject: [PATCH 02/15] Updated comment and removed display flag --- app/boards/shields/splitreus62/splitreus62.conf | 2 -- app/boards/shields/splitreus62/splitreus62_right.conf | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/app/boards/shields/splitreus62/splitreus62.conf b/app/boards/shields/splitreus62/splitreus62.conf index 73f0d9de..e69de29b 100644 --- a/app/boards/shields/splitreus62/splitreus62.conf +++ b/app/boards/shields/splitreus62/splitreus62.conf @@ -1,2 +0,0 @@ -# Uncomment the following line to enable the Lily58 OLED Display -# CONFIG_ZMK_DISPLAY=y diff --git a/app/boards/shields/splitreus62/splitreus62_right.conf b/app/boards/shields/splitreus62/splitreus62_right.conf index ab43d049..e51dee44 100644 --- a/app/boards/shields/splitreus62/splitreus62_right.conf +++ b/app/boards/shields/splitreus62/splitreus62_right.conf @@ -1,3 +1,2 @@ CONFIG_ZMK_SPLIT=y -CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL=y -#CONFIG_ZMK_SPLIT_BLE_ROLE_PERIPHERAL=y +CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL=y \ No newline at end of file From ce7d7cd51d35bf22cf92a3765e021c10b583c587 Mon Sep 17 00:00:00 2001 From: Derek Date: Sat, 15 Aug 2020 16:21:38 -0400 Subject: [PATCH 03/15] Undo build.yaml changles --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5eb79716..a8bddf63 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,10 @@ jobs: - kyria_right - lily58_left - lily58_right +<<<<<<< HEAD + +======= +>>>>>>> parent of c3164f4... Updated build.yaml include: - board: proton_c shield: clueboard_california From 1fa993fca22860d4706364e72116ffd154d01bac Mon Sep 17 00:00:00 2001 From: Derek Date: Sat, 15 Aug 2020 16:21:54 -0400 Subject: [PATCH 04/15] Update app/boards/shields/splitreus62/splitreus62_right.overlay Co-authored-by: Nick Winans --- app/boards/shields/splitreus62/splitreus62_right.overlay | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/boards/shields/splitreus62/splitreus62_right.overlay b/app/boards/shields/splitreus62/splitreus62_right.overlay index 3c0f9899..35375cca 100644 --- a/app/boards/shields/splitreus62/splitreus62_right.overlay +++ b/app/boards/shields/splitreus62/splitreus62_right.overlay @@ -15,8 +15,8 @@ = <&pro_micro_d 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> , <&pro_micro_d 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> , <&pro_micro_d 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&pro_micro_d 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> , <&pro_micro_d 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> , <&pro_micro_d 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> ; -}; \ No newline at end of file +}; From ba136eb9eed862aefe2cacd83f24194c62a00459 Mon Sep 17 00:00:00 2001 From: Derek Date: Sat, 15 Aug 2020 16:22:00 -0400 Subject: [PATCH 05/15] Update app/boards/shields/splitreus62/splitreus62_left.overlay Co-authored-by: Nick Winans --- app/boards/shields/splitreus62/splitreus62_left.overlay | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/boards/shields/splitreus62/splitreus62_left.overlay b/app/boards/shields/splitreus62/splitreus62_left.overlay index aea374a4..7210ca41 100644 --- a/app/boards/shields/splitreus62/splitreus62_left.overlay +++ b/app/boards/shields/splitreus62/splitreus62_left.overlay @@ -10,10 +10,9 @@ col-gpios = <&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)> + , <&pro_micro_d 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> , <&pro_micro_d 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> , <&pro_micro_d 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> , <&pro_micro_d 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> ; }; - From ff3b1d3fa31d8dbc226ae75e601ba0a9800252b0 Mon Sep 17 00:00:00 2001 From: Derek Date: Sat, 15 Aug 2020 16:26:55 -0400 Subject: [PATCH 06/15] Revert "Undo build.yaml changles" This reverts commit ce7d7cd51d35bf22cf92a3765e021c10b583c587. --- .github/workflows/build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a8bddf63..5eb79716 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,10 +16,6 @@ jobs: - kyria_right - lily58_left - lily58_right -<<<<<<< HEAD - -======= ->>>>>>> parent of c3164f4... Updated build.yaml include: - board: proton_c shield: clueboard_california From caecce62b7805e7fa3db814f2eb1616ba3661262 Mon Sep 17 00:00:00 2001 From: Derek Date: Sat, 15 Aug 2020 16:32:14 -0400 Subject: [PATCH 07/15] Drop OLED support. --- .../shields/splitreus62/Kconfig.defconfig | 36 ------------------- 1 file changed, 36 deletions(-) diff --git a/app/boards/shields/splitreus62/Kconfig.defconfig b/app/boards/shields/splitreus62/Kconfig.defconfig index c52752a0..1f5b324d 100644 --- a/app/boards/shields/splitreus62/Kconfig.defconfig +++ b/app/boards/shields/splitreus62/Kconfig.defconfig @@ -15,40 +15,4 @@ endif if SHIELD_SPLITREUS62_LEFT || SHIELD_SPLITREUS62_RIGHT -if ZMK_DISPLAY - -config I2C - default n - -config SSD1306 - default n - -config SSD1306_REVERSE_MODE - default n - -endif # ZMK_DISPLAY - -if LVGL - -config LVGL_HOR_RES - default 128 - -config LVGL_VER_RES - default 32 - -config LVGL_VDB_SIZE - default 64 - -config LVGL_DPI - default 148 - -config LVGL_BITS_PER_PIXEL - default 1 - -choice LVGL_COLOR_DEPTH - default LVGL_COLOR_DEPTH_1 -endchoice - -endif # LVGL - endif From 5bb01c802b792dd016b2cd091b0983806b658f43 Mon Sep 17 00:00:00 2001 From: Derek Date: Sun, 16 Aug 2020 08:49:17 -0400 Subject: [PATCH 08/15] Update setup.sh --- docs/static/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/static/setup.sh b/docs/static/setup.sh index 27dcb0b3..45eccd68 100644 --- a/docs/static/setup.sh +++ b/docs/static/setup.sh @@ -37,7 +37,7 @@ echo "" echo "Keyboard Shield Selection:" prompt="Pick an keyboard:" -options=("Kyria" "Lily58" "Corne") +options=("Kyria" "Lily58" "Corne" "Splitreus62") PS3="$prompt " # TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos. From 7aea57328c1f48e95de2013843e8947c1eb0e752 Mon Sep 17 00:00:00 2001 From: Mega Mind <68985133+megamind4089@users.noreply.github.com> Date: Fri, 21 Aug 2020 03:12:06 +0800 Subject: [PATCH 09/15] Add KConfig for board battery charger --- app/boards/arm/nrfmicro/Kconfig | 5 +++++ app/boards/arm/nrfmicro/Kconfig.defconfig | 9 ++++++++- app/boards/arm/nrfmicro/pinmux.c | 6 +++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/boards/arm/nrfmicro/Kconfig b/app/boards/arm/nrfmicro/Kconfig index 17a3347e..80039e9c 100644 --- a/app/boards/arm/nrfmicro/Kconfig +++ b/app/boards/arm/nrfmicro/Kconfig @@ -3,3 +3,8 @@ config BOARD_ENABLE_DCDC select SOC_DCDC_NRF52X default y depends on (BOARD_NRFMICRO_11 || BOARD_NRFMICRO_11_FLIPPED || BOARD_NRFMICRO_13) + +config BOARD_ENABLE_CHARGER + bool "Enable battery charger" + default y + depends on (BOARD_NRFMICRO_13) diff --git a/app/boards/arm/nrfmicro/Kconfig.defconfig b/app/boards/arm/nrfmicro/Kconfig.defconfig index 22122772..69b59eeb 100644 --- a/app/boards/arm/nrfmicro/Kconfig.defconfig +++ b/app/boards/arm/nrfmicro/Kconfig.defconfig @@ -29,5 +29,12 @@ config ZMK_USB config PINMUX default y - + +if BOARD_NRFMICRO_13 + +config BOARD_ENABLE_CHARGER + default y + +endif # BOARD_NRFMICRO_13 + endif # BOARD_NRFMICRO_11 || BOARD_NRFMICRO_11_FLIPPED || BOARD_NRFMICRO_13 diff --git a/app/boards/arm/nrfmicro/pinmux.c b/app/boards/arm/nrfmicro/pinmux.c index c02ca922..be1a4de4 100644 --- a/app/boards/arm/nrfmicro/pinmux.c +++ b/app/boards/arm/nrfmicro/pinmux.c @@ -23,9 +23,13 @@ static int pinmux_nrfmicro_init(struct device *port) gpio_pin_configure(p1, 9, GPIO_OUTPUT); gpio_pin_set(p1, 9, 0); - // enable charger (nRFMicro 1.3 only) +#if CONFIG_BOARD_ENABLE_CHARGER gpio_pin_configure(p0, 5, GPIO_OUTPUT); gpio_pin_set(p0, 5, 0); +#else + gpio_pin_configure(p0, 5, GPIO_INPUT); +#endif + #else // enable EXT_VCC (use 0 for nRFMicro 1.3, use 1 for nRFMicro 1.1) gpio_pin_configure(p1, 9, GPIO_OUTPUT); From 94c7d27f04263b42669ae6d1777765ba811ed6bf Mon Sep 17 00:00:00 2001 From: Derek Date: Thu, 20 Aug 2020 15:13:51 -0400 Subject: [PATCH 10/15] Updated files as per request Updated --- app/boards/shields/splitreus62/Kconfig.defconfig | 7 ++++++- app/boards/shields/splitreus62/Kconfig.shield | 2 +- app/boards/shields/splitreus62/splitreus62.dtsi | 2 +- app/boards/shields/splitreus62/splitreus62.keymap | 6 ++++++ app/boards/shields/splitreus62/splitreus62_left.overlay | 2 +- app/boards/shields/splitreus62/splitreus62_right.overlay | 4 ++-- docs/static/setup.sh | 1 + 7 files changed, 18 insertions(+), 6 deletions(-) diff --git a/app/boards/shields/splitreus62/Kconfig.defconfig b/app/boards/shields/splitreus62/Kconfig.defconfig index 1f5b324d..6e35b06a 100644 --- a/app/boards/shields/splitreus62/Kconfig.defconfig +++ b/app/boards/shields/splitreus62/Kconfig.defconfig @@ -1,4 +1,9 @@ - +/* + * Copyright (c) 2020 Derek Schmell + * + * SPDX-License-Identifier: MIT + */ + if SHIELD_SPLITREUS62_LEFT config ZMK_KEYBOARD_NAME diff --git a/app/boards/shields/splitreus62/Kconfig.shield b/app/boards/shields/splitreus62/Kconfig.shield index f20f2362..762d991b 100644 --- a/app/boards/shields/splitreus62/Kconfig.shield +++ b/app/boards/shields/splitreus62/Kconfig.shield @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Pete Johanson +# Copyright (c) 2020 Derek Schmell # SPDX-License-Identifier: MIT config SHIELD_SPLITREUS62_LEFT diff --git a/app/boards/shields/splitreus62/splitreus62.dtsi b/app/boards/shields/splitreus62/splitreus62.dtsi index e1fb40b2..c2bfbc40 100644 --- a/app/boards/shields/splitreus62/splitreus62.dtsi +++ b/app/boards/shields/splitreus62/splitreus62.dtsi @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Pete Johanson, Derek Schmell + * Copyright (c) 2020 Derek Schmell * * SPDX-License-Identifier: MIT */ diff --git a/app/boards/shields/splitreus62/splitreus62.keymap b/app/boards/shields/splitreus62/splitreus62.keymap index cd683a22..920e61ad 100644 --- a/app/boards/shields/splitreus62/splitreus62.keymap +++ b/app/boards/shields/splitreus62/splitreus62.keymap @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2020 Derek Schmell + * + * SPDX-License-Identifier: MIT + */ + #include #include diff --git a/app/boards/shields/splitreus62/splitreus62_left.overlay b/app/boards/shields/splitreus62/splitreus62_left.overlay index 7210ca41..b156d608 100644 --- a/app/boards/shields/splitreus62/splitreus62_left.overlay +++ b/app/boards/shields/splitreus62/splitreus62_left.overlay @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Pete Johanson + * Copyright (c) 2020 Derek Schmell * * SPDX-License-Identifier: MIT */ diff --git a/app/boards/shields/splitreus62/splitreus62_right.overlay b/app/boards/shields/splitreus62/splitreus62_right.overlay index 35375cca..5db87cc3 100644 --- a/app/boards/shields/splitreus62/splitreus62_right.overlay +++ b/app/boards/shields/splitreus62/splitreus62_right.overlay @@ -1,9 +1,9 @@ /* - * Copyright (c) 2020 Pete Johanson + * Copyright (c) 2020 Derek Schmell * * SPDX-License-Identifier: MIT */ - + #include "splitreus62.dtsi" &default_transform { diff --git a/docs/static/setup.sh b/docs/static/setup.sh index 45eccd68..e75b5297 100644 --- a/docs/static/setup.sh +++ b/docs/static/setup.sh @@ -49,6 +49,7 @@ select opt in "${options[@]}" "Quit"; do 1 ) shield_title="Kyria" shield="kyria"; split="y"; break;; 2 ) shield_title="Lily58" shield="lily58"; split="y"; break;; 3 ) shield_title="Corne" shield="corne"; split="y"; break;; + 4 ) shield_title="Splitreus62" shield="splitreus62"; split="y"; break;; # Add link to docs on adding your own custom shield in your ZMK config! # $(( ${#options[@]}+1 )) ) echo "Other!"; break;; From 3b71c4311bae62c2e14b028324f831837742d1f5 Mon Sep 17 00:00:00 2001 From: Derek Date: Thu, 20 Aug 2020 17:27:41 -0400 Subject: [PATCH 11/15] Update Kconfig.defconfig --- app/boards/shields/splitreus62/Kconfig.defconfig | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/boards/shields/splitreus62/Kconfig.defconfig b/app/boards/shields/splitreus62/Kconfig.defconfig index 6e35b06a..a2464a79 100644 --- a/app/boards/shields/splitreus62/Kconfig.defconfig +++ b/app/boards/shields/splitreus62/Kconfig.defconfig @@ -1,8 +1,7 @@ -/* - * Copyright (c) 2020 Derek Schmell - * - * SPDX-License-Identifier: MIT - */ + +#Copyright (c) 2020 Derek Schmell +#SPDX-License-Identifier: MIT + if SHIELD_SPLITREUS62_LEFT From 805ea770053269278fe0ed443b68f600021d82d1 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Fri, 21 Aug 2020 00:33:48 -0400 Subject: [PATCH 12/15] feat(behaviors): Add `&bootloader` behavior. * Allow reset behavior to have a type property. * Add `bootloader` node that triggers DFU UF2 bootloader mode using the AdaFruit nrf52 bootloader. --- app/dts/behaviors/reset.dtsi | 9 ++++ .../behaviors/zmk,behavior-reset.yaml | 5 +++ app/include/dt-bindings/zmk/reset.h | 12 ++++++ app/src/behaviors/behavior_reset.c | 29 +++++++------ docs/docs/behavior/reset.md | 43 +++++++++++++++++++ docs/sidebars.js | 1 + 6 files changed, 87 insertions(+), 12 deletions(-) create mode 100644 app/include/dt-bindings/zmk/reset.h create mode 100644 docs/docs/behavior/reset.md diff --git a/app/dts/behaviors/reset.dtsi b/app/dts/behaviors/reset.dtsi index 4e3b4446..fc4fa149 100644 --- a/app/dts/behaviors/reset.dtsi +++ b/app/dts/behaviors/reset.dtsi @@ -1,3 +1,5 @@ +#include + / { behaviors { reset: behavior_reset { @@ -5,5 +7,12 @@ label = "RESET"; #binding-cells = <0>; }; + + bootloader: behavior_reset_dfu { + compatible = "zmk,behavior-reset"; + label = "BOOTLOADER_RESET"; + type = ; + #binding-cells = <0>; + }; }; }; diff --git a/app/dts/bindings/behaviors/zmk,behavior-reset.yaml b/app/dts/bindings/behaviors/zmk,behavior-reset.yaml index c8e5e6fb..061b15e3 100644 --- a/app/dts/bindings/behaviors/zmk,behavior-reset.yaml +++ b/app/dts/bindings/behaviors/zmk,behavior-reset.yaml @@ -6,3 +6,8 @@ description: Keyboard Reset Behavior compatible: "zmk,behavior-reset" include: zero_param.yaml + +properties: + type: + type: int + default: 0 diff --git a/app/include/dt-bindings/zmk/reset.h b/app/include/dt-bindings/zmk/reset.h new file mode 100644 index 00000000..b5136492 --- /dev/null +++ b/app/include/dt-bindings/zmk/reset.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2020 Peter Johanson + * + * SPDX-License-Identifier: MIT + */ + +#define RST_WARM 0x00 +#define RST_COLD 0x01 + +// AdaFruit nrf52 Bootloader Specific. See https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/d6b28e66053eea467166f44875e3c7ec741cb471/src/main.c#L107 + +#define RST_UF2 0x57 \ No newline at end of file diff --git a/app/src/behaviors/behavior_reset.c b/app/src/behaviors/behavior_reset.c index 44cbc219..30a96ea8 100644 --- a/app/src/behaviors/behavior_reset.c +++ b/app/src/behaviors/behavior_reset.c @@ -13,8 +13,9 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); -struct behavior_reset_config { }; -struct behavior_reset_data { }; +struct behavior_reset_config { + int type; +}; static int behavior_reset_init(struct device *dev) { @@ -23,9 +24,11 @@ static int behavior_reset_init(struct device *dev) static int on_keymap_binding_pressed(struct device *dev, u32_t position, u32_t _param1, u32_t _param2) { + const struct behavior_reset_config *cfg = dev->config_info; + // TODO: Correct magic code for going into DFU? // See https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/d6b28e66053eea467166f44875e3c7ec741cb471/src/main.c#L107 - sys_reboot(0); + sys_reboot(cfg->type); return 0; } @@ -34,12 +37,14 @@ static const struct behavior_driver_api behavior_reset_driver_api = { }; -static const struct behavior_reset_config behavior_reset_config = {}; - -static struct behavior_reset_data behavior_reset_data; - -DEVICE_AND_API_INIT(behavior_reset, DT_INST_LABEL(0), behavior_reset_init, - &behavior_reset_data, - &behavior_reset_config, - APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, - &behavior_reset_driver_api); \ No newline at end of file +#define RST_INST(n) \ + static const struct behavior_reset_config behavior_reset_config_##n = { \ + .type = DT_INST_PROP(n, type) \ + }; \ + DEVICE_AND_API_INIT(behavior_reset_##n, DT_INST_LABEL(n), behavior_reset_init, \ + NULL, \ + &behavior_reset_config_##n, \ + APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ + &behavior_reset_driver_api); + +DT_INST_FOREACH_STATUS_OKAY(RST_INST) \ No newline at end of file diff --git a/docs/docs/behavior/reset.md b/docs/docs/behavior/reset.md new file mode 100644 index 00000000..8cf122b4 --- /dev/null +++ b/docs/docs/behavior/reset.md @@ -0,0 +1,43 @@ +--- +title: Reset Behaviors +sidebar_label: Reset +--- + +## Summary + +There are two available behaviors that can be used to trigger a reset of the keyboard. +The first is a soft reset, that will simply reset and re-run the currently flashed +firmware; the second when triggered will reset into the bootloader, allowing you to +flash a new firmware to the keyboard. + +## Reset + +The basic reset behavior will reset the keyboard and re-run the firmware flashed +to the device + +### Behavior Binding + +- Reference: `&reset` +- Parameters: None + +Example: + +``` +&reset +``` + +## Bootloader Reset + +The bootloader reset behavior will reset the keyboard and put it into bootloader mode, allowing +you to flash a new firmware. + +### Behavior Binding + +- Reference: `&bootloader` +- Parameters: None + +Example: + +``` +&bootloader +``` diff --git a/docs/sidebars.js b/docs/sidebars.js index 8c7c97f2..51313fc5 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -12,6 +12,7 @@ module.exports = { "behavior/layers", "behavior/misc", "behavior/mod-tap", + "behavior/reset", "behavior/lighting", ], Development: [ From 39fd98236763bd325059ec0d775bad08babcd332 Mon Sep 17 00:00:00 2001 From: Derek Date: Fri, 21 Aug 2020 17:29:18 -0400 Subject: [PATCH 13/15] Swap central back to left hand --- app/boards/shields/splitreus62/splitreus62_left.conf | 2 +- app/boards/shields/splitreus62/splitreus62_right.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/boards/shields/splitreus62/splitreus62_left.conf b/app/boards/shields/splitreus62/splitreus62_left.conf index a835adc1..e51dee44 100644 --- a/app/boards/shields/splitreus62/splitreus62_left.conf +++ b/app/boards/shields/splitreus62/splitreus62_left.conf @@ -1,2 +1,2 @@ CONFIG_ZMK_SPLIT=y -CONFIG_ZMK_SPLIT_BLE_ROLE_PERIPHERAL=y \ No newline at end of file +CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL=y \ No newline at end of file diff --git a/app/boards/shields/splitreus62/splitreus62_right.conf b/app/boards/shields/splitreus62/splitreus62_right.conf index e51dee44..a835adc1 100644 --- a/app/boards/shields/splitreus62/splitreus62_right.conf +++ b/app/boards/shields/splitreus62/splitreus62_right.conf @@ -1,2 +1,2 @@ CONFIG_ZMK_SPLIT=y -CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL=y \ No newline at end of file +CONFIG_ZMK_SPLIT_BLE_ROLE_PERIPHERAL=y \ No newline at end of file From 0c255aee84155405741ba8fa0c81c6d711106033 Mon Sep 17 00:00:00 2001 From: crd Date: Sat, 22 Aug 2020 09:29:23 -0700 Subject: [PATCH 14/15] [docs] Add bzip to deps --- docs/docs/dev-setup.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/docs/dev-setup.md b/docs/docs/dev-setup.md index 6e893b3f..fae0aa09 100644 --- a/docs/docs/dev-setup.md +++ b/docs/docs/dev-setup.md @@ -52,6 +52,7 @@ sudo apt install -y \ autoconf \ automake \ build-essential \ + bzip2 \ ccache \ device-tree-compiler \ dfu-util \ @@ -91,6 +92,7 @@ sudo apt install -y \ autoconf \ automake \ build-essential \ + bzip2 \ ccache \ device-tree-compiler \ dfu-util \ @@ -130,6 +132,7 @@ sudo dnf install -y \ wget \ autoconf \ automake \ + bzip2 \ ccache \ dtc \ dfu-util \ From bc023baa7d0a319c5468f0ce4839d1722f17b905 Mon Sep 17 00:00:00 2001 From: Mega Mind <68985133+megamind4089@users.noreply.github.com> Date: Sun, 23 Aug 2020 12:59:39 +0800 Subject: [PATCH 15/15] Incorporate comments - Change config name to nrfmicro specific --- app/boards/arm/nrfmicro/Kconfig | 2 +- app/boards/arm/nrfmicro/Kconfig.defconfig | 2 +- app/boards/arm/nrfmicro/pinmux.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/boards/arm/nrfmicro/Kconfig b/app/boards/arm/nrfmicro/Kconfig index 80039e9c..35019722 100644 --- a/app/boards/arm/nrfmicro/Kconfig +++ b/app/boards/arm/nrfmicro/Kconfig @@ -4,7 +4,7 @@ config BOARD_ENABLE_DCDC default y depends on (BOARD_NRFMICRO_11 || BOARD_NRFMICRO_11_FLIPPED || BOARD_NRFMICRO_13) -config BOARD_ENABLE_CHARGER +config BOARD_NRFMICRO_CHARGER bool "Enable battery charger" default y depends on (BOARD_NRFMICRO_13) diff --git a/app/boards/arm/nrfmicro/Kconfig.defconfig b/app/boards/arm/nrfmicro/Kconfig.defconfig index 69b59eeb..9cce5a9b 100644 --- a/app/boards/arm/nrfmicro/Kconfig.defconfig +++ b/app/boards/arm/nrfmicro/Kconfig.defconfig @@ -32,7 +32,7 @@ config PINMUX if BOARD_NRFMICRO_13 -config BOARD_ENABLE_CHARGER +config BOARD_NRFMICRO_CHARGER default y endif # BOARD_NRFMICRO_13 diff --git a/app/boards/arm/nrfmicro/pinmux.c b/app/boards/arm/nrfmicro/pinmux.c index be1a4de4..3792b597 100644 --- a/app/boards/arm/nrfmicro/pinmux.c +++ b/app/boards/arm/nrfmicro/pinmux.c @@ -23,7 +23,7 @@ static int pinmux_nrfmicro_init(struct device *port) gpio_pin_configure(p1, 9, GPIO_OUTPUT); gpio_pin_set(p1, 9, 0); -#if CONFIG_BOARD_ENABLE_CHARGER +#if CONFIG_BOARD_NRFMICRO_CHARGER gpio_pin_configure(p0, 5, GPIO_OUTPUT); gpio_pin_set(p0, 5, 0); #else