From c044fe853275a6322834bfdeaf61b9f62becf085 Mon Sep 17 00:00:00 2001 From: Kristoffer Onias Date: Mon, 21 Sep 2020 22:29:54 -0700 Subject: Add RoMac plus v4 support on nice nano v1 --- app/boards/shields/romac_plus/Kconfig.defconfig | 9 ++++ app/boards/shields/romac_plus/Kconfig.shield | 5 ++ .../shields/romac_plus/boards/nice_nano.overlay | 28 ++++++++++ app/boards/shields/romac_plus/romac_plus.conf | 3 ++ app/boards/shields/romac_plus/romac_plus.dtsi | 61 ++++++++++++++++++++++ app/boards/shields/romac_plus/romac_plus.keymap | 48 +++++++++++++++++ app/boards/shields/romac_plus/romac_plus.overlay | 37 +++++++++++++ 7 files changed, 191 insertions(+) create mode 100644 app/boards/shields/romac_plus/Kconfig.defconfig create mode 100644 app/boards/shields/romac_plus/Kconfig.shield create mode 100644 app/boards/shields/romac_plus/boards/nice_nano.overlay create mode 100644 app/boards/shields/romac_plus/romac_plus.conf create mode 100644 app/boards/shields/romac_plus/romac_plus.dtsi create mode 100644 app/boards/shields/romac_plus/romac_plus.keymap create mode 100644 app/boards/shields/romac_plus/romac_plus.overlay diff --git a/app/boards/shields/romac_plus/Kconfig.defconfig b/app/boards/shields/romac_plus/Kconfig.defconfig new file mode 100644 index 0000000..45b15b8 --- /dev/null +++ b/app/boards/shields/romac_plus/Kconfig.defconfig @@ -0,0 +1,9 @@ +# Copyright (c) 2020 Pete Johanson, Richard Jones +# SPDX-License-Identifier: MIT + +if SHIELD_ROMAC_PLUS + +config ZMK_KEYBOARD_NAME + default "RoMac_plus-v4" + +endif \ No newline at end of file diff --git a/app/boards/shields/romac_plus/Kconfig.shield b/app/boards/shields/romac_plus/Kconfig.shield new file mode 100644 index 0000000..c89ef02 --- /dev/null +++ b/app/boards/shields/romac_plus/Kconfig.shield @@ -0,0 +1,5 @@ +# Copyright (c) 2020 Pete Johanson, Richard Jones +# SPDX-License-Identifier: MIT + +config SHIELD_ROMAC_PLUS + def_bool $(shields_list_contains,romac_plus) diff --git a/app/boards/shields/romac_plus/boards/nice_nano.overlay b/app/boards/shields/romac_plus/boards/nice_nano.overlay new file mode 100644 index 0000000..a8dafa2 --- /dev/null +++ b/app/boards/shields/romac_plus/boards/nice_nano.overlay @@ -0,0 +1,28 @@ +&spi1 { + compatible = "nordic,nrf-spi"; + 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 = <10>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; \ No newline at end of file diff --git a/app/boards/shields/romac_plus/romac_plus.conf b/app/boards/shields/romac_plus/romac_plus.conf new file mode 100644 index 0000000..8ec9fa9 --- /dev/null +++ b/app/boards/shields/romac_plus/romac_plus.conf @@ -0,0 +1,3 @@ +# Uncomment to enable encoder +CONFIG_EC11=y +CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y \ No newline at end of file diff --git a/app/boards/shields/romac_plus/romac_plus.dtsi b/app/boards/shields/romac_plus/romac_plus.dtsi new file mode 100644 index 0000000..3895f86 --- /dev/null +++ b/app/boards/shields/romac_plus/romac_plus.dtsi @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2020 Pete Johanson + * + * SPDX-License-Identifier: MIT + */ + +#include + +/ { + chosen { + zmk,kscan = &kscan0; + zmk,matrix_transform = &default_transform; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <3>; + rows = <4>; + + map = < +RC(0,0) RC(0,1) RC(0,2) +RC(1,0) RC(1,1) RC(1,2) +RC(2,0) RC(2,1) RC(2,2) +RC(3,0) RC(3,1) RC(3,2) + >; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + + diode-direction = "col2row"; + row-gpios + = <&pro_micro_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + + }; + + left_encoder: encoder_left { + compatible = "alps,ec11"; + label = "LEFT_ENCODER"; + a-gpios = <&pro_micro_d 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&pro_micro_d 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + resolution = <4>; + status = "disabled"; + }; + + sensors { + compatible = "zmk,keymap-sensors"; + sensors = <&left_encoder>; + }; + + bt_unpair_combo: bt_unpair_combo { + compatible = "zmk,bt-unpair-combo"; + }; + + // TODO: per-key RGB node(s)? +}; \ No newline at end of file diff --git a/app/boards/shields/romac_plus/romac_plus.keymap b/app/boards/shields/romac_plus/romac_plus.keymap new file mode 100644 index 0000000..77485dc --- /dev/null +++ b/app/boards/shields/romac_plus/romac_plus.keymap @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2020 Pete Johanson, Richard Jones + * + * SPDX-License-Identifier: MIT + */ + +#include +#include + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { +// ------------------- +// | 7 | 8 | 9 | +// | 4 | 5 | 6 | +// | 1 | 2 | 3 | +// | MO(1) | 0 | . | +// ---------------------- + bindings = < + &kp NUM_7 &kp NUM_8 &kp NUM_9 + &kp NUM_4 &kp NUM_5 &kp NUM_6 + &kp NUM_1 &kp NUM_2 &kp NUM_3 + &cp M_PLAY &kp NUM_0 &kp DOT + >; + + sensor-bindings = <&inc_dec_cp M_NEXT M_PREV>; + }; + + // nav_layer { +// ----------------------- +// | _ | HOME | PGUP | +// | _ | END | PGDN | +// | _ | _ | _ | +// | _ | _ | RET | +// ----------------------- + // bindings = < + // &trans &kp HOME &kp PGUP + // &trans &kp END &kp PGDN + // &trans &trans &trans .0 + // &trans &trans &kp RET + // >; + + // sensor-bindings = <&inc_dec_kp A B>; + // }; + }; +}; \ No newline at end of file diff --git a/app/boards/shields/romac_plus/romac_plus.overlay b/app/boards/shields/romac_plus/romac_plus.overlay new file mode 100644 index 0000000..23ef3e6 --- /dev/null +++ b/app/boards/shields/romac_plus/romac_plus.overlay @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2020 Pete Johanson, Richard Jones + * + * SPDX-License-Identifier: MIT + */ + +#include "romac_plus.dtsi" + +/ { + chosen { + zmk,kscan = &kscan0; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + + diode-direction = "col2row"; + + col-gpios + = <&pro_micro_a 1 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 2 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 3 GPIO_ACTIVE_HIGH> + ; + + }; + + bt_unpair_combo: bt_unpair_combo { + compatible = "zmk,bt-unpair-combo"; + key-positions = <0 11>; + }; + +}; + +&left_encoder { + status = "okay"; +}; \ No newline at end of file -- cgit v1.2.3 From 551756b0ec7131e6129d31c0a28083d072d160a2 Mon Sep 17 00:00:00 2001 From: Kristoffer Onias Date: Mon, 21 Sep 2020 22:52:50 -0700 Subject: Add romac_plus to build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4a43f5d..9af3d22 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,7 @@ jobs: - iris_left - iris_right - romac + - romac_plus - settings_reset include: - board: proton_c -- cgit v1.2.3 From f1fd71c231ab75d2e2563d7b40cb1460dca0eed7 Mon Sep 17 00:00:00 2001 From: Kristoffer Onias Date: Wed, 23 Sep 2020 12:39:06 -0700 Subject: Disabled ec11 since it's an optional configuration --- app/boards/shields/romac_plus/romac_plus.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/boards/shields/romac_plus/romac_plus.conf b/app/boards/shields/romac_plus/romac_plus.conf index 8ec9fa9..cff5b30 100644 --- a/app/boards/shields/romac_plus/romac_plus.conf +++ b/app/boards/shields/romac_plus/romac_plus.conf @@ -1,3 +1,3 @@ # Uncomment to enable encoder -CONFIG_EC11=y -CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y \ No newline at end of file +#CONFIG_EC11=y +#CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y \ No newline at end of file -- cgit v1.2.3 From 4c092044ce22f0c60c3bf0ef860ecc543328d5bf Mon Sep 17 00:00:00 2001 From: Kristoffer Onias Date: Wed, 23 Sep 2020 16:21:42 -0700 Subject: Adopt single authors headers --- app/boards/shields/romac_plus/Kconfig.defconfig | 2 +- app/boards/shields/romac_plus/Kconfig.shield | 2 +- app/boards/shields/romac_plus/romac_plus.conf | 3 +++ app/boards/shields/romac_plus/romac_plus.dtsi | 2 +- app/boards/shields/romac_plus/romac_plus.keymap | 2 +- app/boards/shields/romac_plus/romac_plus.overlay | 2 +- 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/boards/shields/romac_plus/Kconfig.defconfig b/app/boards/shields/romac_plus/Kconfig.defconfig index 45b15b8..1d04082 100644 --- a/app/boards/shields/romac_plus/Kconfig.defconfig +++ b/app/boards/shields/romac_plus/Kconfig.defconfig @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Pete Johanson, Richard Jones +# Copyright (c) 2020 The ZMK Contributors # SPDX-License-Identifier: MIT if SHIELD_ROMAC_PLUS diff --git a/app/boards/shields/romac_plus/Kconfig.shield b/app/boards/shields/romac_plus/Kconfig.shield index c89ef02..a7c7c61 100644 --- a/app/boards/shields/romac_plus/Kconfig.shield +++ b/app/boards/shields/romac_plus/Kconfig.shield @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Pete Johanson, Richard Jones +# Copyright (c) 2020 The ZMK Contributors # SPDX-License-Identifier: MIT config SHIELD_ROMAC_PLUS diff --git a/app/boards/shields/romac_plus/romac_plus.conf b/app/boards/shields/romac_plus/romac_plus.conf index cff5b30..d784dc4 100644 --- a/app/boards/shields/romac_plus/romac_plus.conf +++ b/app/boards/shields/romac_plus/romac_plus.conf @@ -1,3 +1,6 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + # Uncomment to enable encoder #CONFIG_EC11=y #CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y \ No newline at end of file diff --git a/app/boards/shields/romac_plus/romac_plus.dtsi b/app/boards/shields/romac_plus/romac_plus.dtsi index 3895f86..be05618 100644 --- a/app/boards/shields/romac_plus/romac_plus.dtsi +++ b/app/boards/shields/romac_plus/romac_plus.dtsi @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Pete Johanson + * Copyright (c) 2020 The ZMK Contributors * * SPDX-License-Identifier: MIT */ diff --git a/app/boards/shields/romac_plus/romac_plus.keymap b/app/boards/shields/romac_plus/romac_plus.keymap index 77485dc..947b20a 100644 --- a/app/boards/shields/romac_plus/romac_plus.keymap +++ b/app/boards/shields/romac_plus/romac_plus.keymap @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Pete Johanson, Richard Jones + * Copyright (c) 2020 The ZMK Contributors * * SPDX-License-Identifier: MIT */ diff --git a/app/boards/shields/romac_plus/romac_plus.overlay b/app/boards/shields/romac_plus/romac_plus.overlay index 23ef3e6..7b57001 100644 --- a/app/boards/shields/romac_plus/romac_plus.overlay +++ b/app/boards/shields/romac_plus/romac_plus.overlay @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Pete Johanson, Richard Jones + * Copyright (c) 2020 The ZMK Contributors * * SPDX-License-Identifier: MIT */ -- cgit v1.2.3 From 0ce36865b2026c8739c01cebd3031180aa0f3b1f Mon Sep 17 00:00:00 2001 From: Kristoffer Onias Date: Wed, 23 Sep 2020 16:23:54 -0700 Subject: Update keyboard name to be more user friendly --- app/boards/shields/romac_plus/Kconfig.defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/boards/shields/romac_plus/Kconfig.defconfig b/app/boards/shields/romac_plus/Kconfig.defconfig index 1d04082..c4efdb9 100644 --- a/app/boards/shields/romac_plus/Kconfig.defconfig +++ b/app/boards/shields/romac_plus/Kconfig.defconfig @@ -4,6 +4,6 @@ if SHIELD_ROMAC_PLUS config ZMK_KEYBOARD_NAME - default "RoMac_plus-v4" + default "RoMac+ v4" endif \ No newline at end of file -- cgit v1.2.3 From 9fffebd5dac13d0a57f6f6aaff0654a2bd0986c1 Mon Sep 17 00:00:00 2001 From: Kristoffer Onias Date: Wed, 23 Sep 2020 16:31:02 -0700 Subject: Adopt new BT unpairing standards --- app/boards/shields/romac_plus/romac_plus.dtsi | 3 --- app/boards/shields/romac_plus/romac_plus.keymap | 5 +++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/boards/shields/romac_plus/romac_plus.dtsi b/app/boards/shields/romac_plus/romac_plus.dtsi index be05618..d04b214 100644 --- a/app/boards/shields/romac_plus/romac_plus.dtsi +++ b/app/boards/shields/romac_plus/romac_plus.dtsi @@ -53,9 +53,6 @@ RC(3,0) RC(3,1) RC(3,2) sensors = <&left_encoder>; }; - bt_unpair_combo: bt_unpair_combo { - compatible = "zmk,bt-unpair-combo"; - }; // TODO: per-key RGB node(s)? }; \ No newline at end of file diff --git a/app/boards/shields/romac_plus/romac_plus.keymap b/app/boards/shields/romac_plus/romac_plus.keymap index 947b20a..3fa9441 100644 --- a/app/boards/shields/romac_plus/romac_plus.keymap +++ b/app/boards/shields/romac_plus/romac_plus.keymap @@ -5,6 +5,7 @@ */ #include +#include #include / { @@ -30,13 +31,13 @@ // nav_layer { // ----------------------- -// | _ | HOME | PGUP | +// | BT_CLR | HOME | PGUP | // | _ | END | PGDN | // | _ | _ | _ | // | _ | _ | RET | // ----------------------- // bindings = < - // &trans &kp HOME &kp PGUP + // &bt BT_CLR &kp HOME &kp PGUP // &trans &kp END &kp PGDN // &trans &trans &trans .0 // &trans &trans &kp RET -- cgit v1.2.3 From 641524b1b9564fd2b433b9bc430736fb3205a3c5 Mon Sep 17 00:00:00 2001 From: Kristoffer Onias Date: Wed, 23 Sep 2020 16:37:46 -0700 Subject: Update Keymap legends for consistency --- app/boards/shields/romac_plus/romac_plus.dtsi | 2 -- app/boards/shields/romac_plus/romac_plus.keymap | 44 ++++++++++++------------- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/app/boards/shields/romac_plus/romac_plus.dtsi b/app/boards/shields/romac_plus/romac_plus.dtsi index d04b214..9b148ca 100644 --- a/app/boards/shields/romac_plus/romac_plus.dtsi +++ b/app/boards/shields/romac_plus/romac_plus.dtsi @@ -36,7 +36,6 @@ RC(3,0) RC(3,1) RC(3,2) , <&pro_micro_d 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> , <&pro_micro_d 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> ; - }; left_encoder: encoder_left { @@ -52,7 +51,6 @@ RC(3,0) RC(3,1) RC(3,2) compatible = "zmk,keymap-sensors"; sensors = <&left_encoder>; }; - // TODO: per-key RGB node(s)? }; \ No newline at end of file diff --git a/app/boards/shields/romac_plus/romac_plus.keymap b/app/boards/shields/romac_plus/romac_plus.keymap index 3fa9441..d8d1f78 100644 --- a/app/boards/shields/romac_plus/romac_plus.keymap +++ b/app/boards/shields/romac_plus/romac_plus.keymap @@ -13,37 +13,37 @@ compatible = "zmk,keymap"; default_layer { -// ------------------- -// | 7 | 8 | 9 | -// | 4 | 5 | 6 | -// | 1 | 2 | 3 | -// | MO(1) | 0 | . | -// ---------------------- +// -------------------------- +// | 7 | 8 | 9 | +// | 4 | 5 | 6 | +// | 1 | 2 | 3 | +// | M_PLAY | 0 | MO(1) | +// -------------------------- bindings = < &kp NUM_7 &kp NUM_8 &kp NUM_9 &kp NUM_4 &kp NUM_5 &kp NUM_6 &kp NUM_1 &kp NUM_2 &kp NUM_3 - &cp M_PLAY &kp NUM_0 &kp DOT + &cp M_PLAY &kp NUM_0 &mo 1 >; sensor-bindings = <&inc_dec_cp M_NEXT M_PREV>; }; - // nav_layer { -// ----------------------- -// | BT_CLR | HOME | PGUP | -// | _ | END | PGDN | -// | _ | _ | _ | -// | _ | _ | RET | -// ----------------------- - // bindings = < - // &bt BT_CLR &kp HOME &kp PGUP - // &trans &kp END &kp PGDN - // &trans &trans &trans .0 - // &trans &trans &kp RET - // >; + nav_layer { +// -------------------------- +// | BT_CLR | HOME | PGUP | +// | _ | END | PGDN | +// | _ | _ | _ | +// | _ | _ | _ | +// -------------------------- + bindings = < + &bt BT_CLR &kp HOME &kp PGUP + &trans &kp END &kp PGDN + &trans &trans &trans + &trans &trans &trans + >; - // sensor-bindings = <&inc_dec_kp A B>; - // }; + sensor-bindings = <&inc_dec_kp A B>; + }; }; }; \ No newline at end of file -- cgit v1.2.3