From 3414a05d216f38afb1d95821fae50cbbcbaeedb8 Mon Sep 17 00:00:00 2001 From: "Chow Castro, Marcos" Date: Fri, 3 Jan 2025 16:58:45 +0100 Subject: [PATCH] sofle support added --- CHANGELOG.txt | 6 + README.md | 18 +- boards/shields/sofle/Kconfig.defconfig | 60 +++++ boards/shields/sofle/Kconfig.shield | 17 ++ boards/shields/sofle/boards/nice_nano.overlay | 50 ++++ .../shields/sofle/boards/nice_nano_v2.overlay | 50 ++++ .../shields/sofle/boards/nrfmicro_11.overlay | 50 ++++ .../shields/sofle/boards/nrfmicro_13.overlay | 50 ++++ boards/shields/sofle/sofle.conf | 17 ++ boards/shields/sofle/sofle.dtsi | 93 ++++++++ boards/shields/sofle/sofle.keymap | 108 +++++++++ boards/shields/sofle/sofle.zmk.yml | 19 ++ .../shields/sofle/sofle_dongle_pro_micro.conf | 30 +++ .../sofle/sofle_dongle_pro_micro.overlay | 187 +++++++++++++++ boards/shields/sofle/sofle_dongle_xiao.conf | 24 ++ .../shields/sofle/sofle_dongle_xiao.overlay | 224 ++++++++++++++++++ boards/shields/sofle/sofle_left.conf | 2 + boards/shields/sofle/sofle_left.overlay | 22 ++ .../shields/sofle/sofle_left_peripheral.conf | 0 .../sofle/sofle_left_peripheral.overlay | 22 ++ boards/shields/sofle/sofle_right.conf | 2 + boards/shields/sofle/sofle_right.overlay | 26 ++ build.yaml | 39 ++- config/sofle.conf | 140 +++++++++++ config/sofle.keymap | 94 ++++++++ 25 files changed, 1339 insertions(+), 11 deletions(-) create mode 100644 boards/shields/sofle/Kconfig.defconfig create mode 100644 boards/shields/sofle/Kconfig.shield create mode 100644 boards/shields/sofle/boards/nice_nano.overlay create mode 100644 boards/shields/sofle/boards/nice_nano_v2.overlay create mode 100644 boards/shields/sofle/boards/nrfmicro_11.overlay create mode 100644 boards/shields/sofle/boards/nrfmicro_13.overlay create mode 100644 boards/shields/sofle/sofle.conf create mode 100644 boards/shields/sofle/sofle.dtsi create mode 100644 boards/shields/sofle/sofle.keymap create mode 100644 boards/shields/sofle/sofle.zmk.yml create mode 100644 boards/shields/sofle/sofle_dongle_pro_micro.conf create mode 100644 boards/shields/sofle/sofle_dongle_pro_micro.overlay create mode 100644 boards/shields/sofle/sofle_dongle_xiao.conf create mode 100644 boards/shields/sofle/sofle_dongle_xiao.overlay create mode 100644 boards/shields/sofle/sofle_left.conf create mode 100644 boards/shields/sofle/sofle_left.overlay create mode 100644 boards/shields/sofle/sofle_left_peripheral.conf create mode 100644 boards/shields/sofle/sofle_left_peripheral.overlay create mode 100644 boards/shields/sofle/sofle_right.conf create mode 100644 boards/shields/sofle/sofle_right.overlay create mode 100644 config/sofle.conf create mode 100644 config/sofle.keymap diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d37336c9..77b8b168 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,12 @@ Changelog file for Structures extra. https://github.com/mctechnology17/zmk-config/blob/main/CHANGELOG.txt +# FEATURES 0.0.2-beta2 (Jan 03, 2025) +======================================= ++ NEW FEATURES +- [x] sofle support +- [x] readme updated + # FEATURES 0.0.2-beta1 (Dec 19, 2024) ======================================= + NEW FEATURES diff --git a/README.md b/README.md index e660ccf5..7cf15d6f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# MC Technology's zmk-config for corne +# MC Technology's zmk-config for corne - sofle - lily58 [![MC Technology](https://github.com/mctechnology17/mctechnology17/blob/main/src/mctechnology_extendido.GIF)](https://www.youtube.com/channel/UC_mYh5PYPHBJ5YYUj8AIkcw) @@ -29,10 +29,10 @@ ---- -- If you already have your corne configured with this repository and want to make +- If you already have your corne - sofle - lily58 configured with this repository and want to make a modification to your keymap, you can do it with the online [ZMK-STUDIO](https://zmk.studio/). -- If you already have your corne configured with this repository and want to make +- If you already have your corne - sofle - lily58 configured with this repository and want to make a modification to your keymap, you can do it with the online [keymap-editor](https://nickcoutsos.github.io/keymap-editor/). - If you already have a repository and you want only the dongle option of this repository with support for `zmk-studio`, just add this repository as a module to your configuration, look the section [THIS REPOSITORY AS A MODULE](#THIS-REPOSITORY-AS-A-MODULE). @@ -55,14 +55,14 @@ a modification to your keymap, you can do it with the online [keymap-editor](htt The objective of this repository is to serve as a base for configuring your -Corne keyboard with the firmware [ZMK firmware] in a simple and fast way. +corne - sofle - lily58 keyboard with the firmware [ZMK firmware] in a simple and fast way. without having to configure everything from scratch. Many of us are fascinated by customizing our keyboards, but sometimes we don't have the time or experience to do it. That is why I have decided to create this repository so that you can have a base configuration and you can modify it to your liking. -This base includes the most recent corne configurations, featuring a setup for -the Corne dongle with/without an OLED screen. +This base includes the most recent corne - sofle - lily58 configurations, featuring a setup for +the corne - sofle - lily58 dongle with/without an OLED screen. You can also use your keyboard WITH / WITHOUT a dongle of course. with any of the plates or screens you have. @@ -100,7 +100,7 @@ peripherals), **[nice_nano_v2]** (used as a dongle and as peripherals), # QUICK START > [!NOTE] > -> 1. With this configuration you can use the corne keyboard practically +> 1. With this configuration you can use the corne - sofle - lily58 keyboard practically > immediately, you just have to follow the following steps and that's it. > > 2. If you need precompiled files you can download them from the [firmware @@ -372,7 +372,7 @@ MACRO(dongle_boot, &bootloader) # USEFUL TIPS > [!TIP] > -> Below are some useful tips for using your corne keyboard with this +> Below are some useful tips for using your corne - sofle - lily58 keyboard with this > configuration. - You can add a reset key on each half, that's useful for when your halves disconnect/desynchronize, or something unusual happens. That way the firmware is loaded again. see reference in [corne.keymap](./config/corne.keymap) @@ -380,7 +380,7 @@ MACRO(dongle_boot, &bootloader) - If both halves were disconnected/unsynchronized, you just have to press the reset button on both halves 10 times in a row and they will reconnect. - If you want to flash the firmware again you just have to connect the keyboard (that is, one half first, usually the left one) press the reset button 2 times in a row and your device is recognized as a hard disk storage drive, then just drag the file to flash and that's it. do the same with the other half. -- Remember that if your corne only has some functional RGB lights you can activate only the ones that you have functional, it is not necessary to activate all the lights. see reference in [led strip](./config/corne.keymap) +- Remember that if your corne - sofle - lily58 only has some functional RGB lights you can activate only the ones that you have functional, it is not necessary to activate all the lights. see reference in [led strip](./config/corne.keymap) - You can combine the boards, for example: on the left you can have a [nice_nano_v2], on the right a [puchi_ble_v1] and on the dongle a [seeeduino_xiao_ble] or some clone [nice_nano_v2], or any combination you can think of. # RELATED PROJECTS diff --git a/boards/shields/sofle/Kconfig.defconfig b/boards/shields/sofle/Kconfig.defconfig new file mode 100644 index 00000000..e4ad9c17 --- /dev/null +++ b/boards/shields/sofle/Kconfig.defconfig @@ -0,0 +1,60 @@ +# Copyright (c) 2020 Ryan Cross +# SPDX-License-Identifier: MIT + +if SHIELD_SOFLE_LEFT || SHIELD_SOFLE_DONGLE_XIAO || SHIELD_SOFLE_DONGLE_PRO_MICRO + +config ZMK_KEYBOARD_NAME + default "Sofle" + +config ZMK_SPLIT_ROLE_CENTRAL + default y + +endif + +if SHIELD_SOFLE_LEFT || SHIELD_SOFLE_RIGHT || SHIELD_SOFLE_LEFT_PERIPHERAL || SHIELD_SOFLE_DONGLE_XIAO || SHIELD_SOFLE_DONGLE_PRO_MICRO + +config ZMK_SPLIT + default y + +if ZMK_DISPLAY + +config I2C + default y + +config SSD1306 + default y + +if SHIELD_SOFLE_DONGLE_XIAO || SHIELD_SOFLE_DONGLE_PRO_MICRO + +choice ZMK_DISPLAY_WORK_QUEUE + default ZMK_DISPLAY_WORK_QUEUE_DEDICATED +endchoice + +endif + +endif # ZMK_DISPLAY + +if LVGL + +config LV_Z_VDB_SIZE + default 64 + +config LV_DPI_DEF + default 148 + +config LV_Z_BITS_PER_PIXEL + default 1 + +choice LV_COLOR_DEPTH + default LV_COLOR_DEPTH_1 +endchoice + +endif # LVGL + +if ZMK_RGB_UNDERGLOW + +config WS2812_STRIP + default y +endif + +endif diff --git a/boards/shields/sofle/Kconfig.shield b/boards/shields/sofle/Kconfig.shield new file mode 100644 index 00000000..464e3ee8 --- /dev/null +++ b/boards/shields/sofle/Kconfig.shield @@ -0,0 +1,17 @@ +# Copyright (c) 2020 Ryan Cross +# SPDX-License-Identifier: MIT + +config SHIELD_SOFLE_LEFT + def_bool $(shields_list_contains,sofle_left) + +config SHIELD_SOFLE_RIGHT + def_bool $(shields_list_contains,sofle_right) + +config SHIELD_SOFLE_LEFT_PERIPHERAL + def_bool $(shields_list_contains,sofle_left_peripheral) + +config SHIELD_SOFLE_DONGLE_XIAO + def_bool $(shields_list_contains,sofle_dongle_xiao) + +config SHIELD_SOFLE_DONGLE_PRO_MICRO + def_bool $(shields_list_contains,sofle_dongle_pro_micro) diff --git a/boards/shields/sofle/boards/nice_nano.overlay b/boards/shields/sofle/boards/nice_nano.overlay new file mode 100644 index 00000000..f00f59f4 --- /dev/null +++ b/boards/shields/sofle/boards/nice_nano.overlay @@ -0,0 +1,50 @@ +#include + +&pinctrl { + spi3_default: spi3_default { + group1 { + psels = ; + }; + }; + + spi3_sleep: spi3_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi3 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi3_default>; + pinctrl-1 = <&spi3_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <36>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = < + LED_COLOR_ID_GREEN + LED_COLOR_ID_RED + LED_COLOR_ID_BLUE + >; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/boards/shields/sofle/boards/nice_nano_v2.overlay b/boards/shields/sofle/boards/nice_nano_v2.overlay new file mode 100644 index 00000000..f00f59f4 --- /dev/null +++ b/boards/shields/sofle/boards/nice_nano_v2.overlay @@ -0,0 +1,50 @@ +#include + +&pinctrl { + spi3_default: spi3_default { + group1 { + psels = ; + }; + }; + + spi3_sleep: spi3_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi3 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi3_default>; + pinctrl-1 = <&spi3_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <36>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = < + LED_COLOR_ID_GREEN + LED_COLOR_ID_RED + LED_COLOR_ID_BLUE + >; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/boards/shields/sofle/boards/nrfmicro_11.overlay b/boards/shields/sofle/boards/nrfmicro_11.overlay new file mode 100644 index 00000000..f00f59f4 --- /dev/null +++ b/boards/shields/sofle/boards/nrfmicro_11.overlay @@ -0,0 +1,50 @@ +#include + +&pinctrl { + spi3_default: spi3_default { + group1 { + psels = ; + }; + }; + + spi3_sleep: spi3_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi3 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi3_default>; + pinctrl-1 = <&spi3_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <36>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = < + LED_COLOR_ID_GREEN + LED_COLOR_ID_RED + LED_COLOR_ID_BLUE + >; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/boards/shields/sofle/boards/nrfmicro_13.overlay b/boards/shields/sofle/boards/nrfmicro_13.overlay new file mode 100644 index 00000000..f00f59f4 --- /dev/null +++ b/boards/shields/sofle/boards/nrfmicro_13.overlay @@ -0,0 +1,50 @@ +#include + +&pinctrl { + spi3_default: spi3_default { + group1 { + psels = ; + }; + }; + + spi3_sleep: spi3_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi3 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi3_default>; + pinctrl-1 = <&spi3_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <36>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = < + LED_COLOR_ID_GREEN + LED_COLOR_ID_RED + LED_COLOR_ID_BLUE + >; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/boards/shields/sofle/sofle.conf b/boards/shields/sofle/sofle.conf new file mode 100644 index 00000000..1f74aa33 --- /dev/null +++ b/boards/shields/sofle/sofle.conf @@ -0,0 +1,17 @@ +# Copyright (c) 2020 Ryan Cross +# SPDX-License-Identifier: MIT + +# Uncomment the following line to enable the Sofle OLED Display +# CONFIG_ZMK_DISPLAY=y + +# Uncomment these two lines to add support for encoders +# CONFIG_EC11=y +# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y + +# Uncomment this line below to add rgb underglow / backlight support +# CONFIG_ZMK_RGB_UNDERGLOW=y + +# Uncomment the line below to disable external power toggling by the underglow. +# By default toggling the underglow on and off also toggles external power +# on and off. This also causes the display to turn off. +# CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=n diff --git a/boards/shields/sofle/sofle.dtsi b/boards/shields/sofle/sofle.dtsi new file mode 100644 index 00000000..9527f26b --- /dev/null +++ b/boards/shields/sofle/sofle.dtsi @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2020 Pete Johanson, Ryan Cross + * + * SPDX-License-Identifier: MIT + */ + +#include +#include + +&josefadamcik_sofle_layout { + transform = <&default_transform>; +}; + +/ { + chosen { + zephyr,display = &oled; + zmk,kscan = &kscan0; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <16>; + rows = <4>; +// | SW6 | SW5 | SW4 | SW3 | SW2 | SW1 | | SW1 | SW2 | SW3 | SW4 | SW5 | SW6 | +// | SW12 | SW11 | SW10 | SW9 | SW8 | SW7 | | SW7 | SW8 | SW9 | SW10 | SW11 | SW12 | +// | SW18 | SW17 | SW16 | SW15 | SW14 | SW13 | | SW13 | SW14 | SW15 | SW16 | SW17 | SW18 | +// | SW24 | SW23 | SW22 | SW21 | SW20 | SW19 | SW25 | | SW25 | SW19 | SW20 | SW21 | SW22 | SW23 | SW24 | +// | SW30 | SW29 | SW28 | SW27 | SW26 | | SW26 | SW27 | SW28 | SW29 | 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(4,5) RC(4,6) 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,7) RC(4,8) RC(4,9) RC(4,10) RC(4,11) + >; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + wakeup-source; + + diode-direction = "col2row"; + row-gpios + = <&pro_micro 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + }; + + left_encoder: encoder_left { + compatible = "alps,ec11"; + a-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + steps = <80>; + status = "disabled"; + }; + + right_encoder: encoder_right { + compatible = "alps,ec11"; + a-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + steps = <80>; + status = "disabled"; + }; + + sensors: sensors { + compatible = "zmk,keymap-sensors"; + sensors = <&left_encoder &right_encoder>; + triggers-per-rotation = <20>; + }; +}; + +&pro_micro_i2c { + status = "okay"; + + oled: ssd1306@3c { + compatible = "solomon,ssd1306fb"; + reg = <0x3c>; + width = <128>; + height = <32>; + segment-offset = <0>; + page-offset = <0>; + display-offset = <0>; + multiplex-ratio = <31>; + segment-remap; + com-invdir; + com-sequential; + inversion-on; + prechargep = <0x22>; + }; +}; diff --git a/boards/shields/sofle/sofle.keymap b/boards/shields/sofle/sofle.keymap new file mode 100644 index 00000000..c9db56ce --- /dev/null +++ b/boards/shields/sofle/sofle.keymap @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include +#include +#include + +#define BASE 0 +#define LOWER 1 +#define RAISE 2 +#define ADJUST 3 + +/ { + + // Activate ADJUST layer by pressing raise and lower + conditional_layers { + compatible = "zmk,conditional-layers"; + adjust_layer { + if-layers = ; + then-layer = ; + }; + }; + + keymap { + compatible = "zmk,keymap"; + + default_layer { + display-name = "default"; +// ------------------------------------------------------------------------------------------------------------ +// | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | +// | ESC | Q | W | E | R | T | | Y | U | I | O | P | BKSPC | +// | TAB | A | S | D | F | G | | H | J | K | L | ; | ' | +// | SHIFT | Z | X | C | V | B | MUTE | | | N | M | , | . | / | SHIFT | +// | GUI | ALT | CTRL | LOWER| ENTER | | SPACE | RAISE| CTRL | ALT | GUI | + bindings = < +&kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &none +&kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSPC +&kp TAB &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 C_MUTE &none &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT + &kp LGUI &kp LALT &kp LCTRL &mo LOWER &kp RET &kp SPACE &mo RAISE &kp RCTRL &kp RALT &kp RGUI + >; + + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>; + }; + + lower_layer { + display-name = "lower"; +// TODO: Some binds are waiting for shifted keycode support. +// ------------------------------------------------------------------------------------------------------------ +// | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | +// | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | F12 | +// | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | | +// | | = | - | + | { | } | | | | [ | ] | ; | : | \ | | +// | | | | | | | | | | | | + bindings = < +&trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 +&kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp F12 +&trans &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp ASTRK &kp LPAR &kp RPAR &kp PIPE +&trans &kp EQUAL &kp MINUS &kp PLUS &kp LBRC &kp RBRC &trans &trans &kp LBKT &kp RBKT &kp SEMI &kp COLON &kp BSLH &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + >; + + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>; + }; + + raise_layer { + display-name = "raise"; +// ------------------------------------------------------------------------------------------------------------ +// | BTCLR | BT1 | BT2 | BT3 | BT4 | BT5 | | | | | | | | +// | | INS | PSCR | GUI | | | | PGUP | | ^ | | | | +// | | ALT | CTRL | SHIFT | | CAPS | | PGDN | <- | v | -> | DEL | BKSPC | +// | | UNDO | CUT | COPY | PASTE | | | | | | | | | | | +// | | | | | | | | | | | | + bindings = < +&bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &trans &trans &trans &trans &trans &trans +&trans &kp INS &kp PSCRN &kp K_CMENU &trans &trans &kp PG_UP &trans &kp UP &trans &kp N0 &trans +&trans &kp LALT &kp LCTRL &kp LSHFT &trans &kp CLCK &kp PG_DN &kp LEFT &kp DOWN &kp RIGHT &kp DEL &kp BSPC +&trans &kp K_UNDO &kp K_CUT &kp K_COPY &kp K_PASTE &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + >; + + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>; + }; + + adjust_layer { +// ---------------------------------------------------------------------------------------------------------------------------- +// | BTCLR | BT1 | BT2 | BT3 | BT4 | BT5 | | | | | | | | +// | EXTPWR | RGB_HUD | RGB_HUI | RGB_SAD | RGB_SAI | RGB_EFF | | | | | | | | +// | | RGB_BRD | RGB_BRI | | | | | | | | | | | +// | | | | | | | RGB_TOG | | | | | | | | | +// | | | | | | | | | | | | + display-name = "adjust"; + bindings = < +&bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &none &none &none &none &none &none +&ext_power EP_TOG &rgb_ug RGB_HUD &rgb_ug RGB_HUI &rgb_ug RGB_SAD &rgb_ug RGB_SAI &rgb_ug RGB_EFF &none &none &none &none &none &none +&none &rgb_ug RGB_BRD &rgb_ug RGB_BRI &none &none &none &none &none &none &none &none &none +&none &none &none &none &none &none &rgb_ug RGB_TOG &none &none &none &none &none &none &none + &none &none &none &none &none &none &none &none &none &none + >; + }; + + }; +}; diff --git a/boards/shields/sofle/sofle.zmk.yml b/boards/shields/sofle/sofle.zmk.yml new file mode 100644 index 00000000..b289c186 --- /dev/null +++ b/boards/shields/sofle/sofle.zmk.yml @@ -0,0 +1,19 @@ +file_format: "1" +id: sofle +name: Sofle +type: shield +url: https://github.com/josefadamcik/SofleKeyboard +requires: [pro_micro] +exposes: [i2c_oled] +features: + - keys + - display + - encoder + - underglow + - studio +siblings: + - sofle_left + - sofle_right + - sofle_left_peripheral + - sofle_dongle_xiao + - sofle_dongle_pro_micro diff --git a/boards/shields/sofle/sofle_dongle_pro_micro.conf b/boards/shields/sofle/sofle_dongle_pro_micro.conf new file mode 100644 index 00000000..2560437b --- /dev/null +++ b/boards/shields/sofle/sofle_dongle_pro_micro.conf @@ -0,0 +1,30 @@ +# MC: +# compatible con todas las versiones de nrf52840 (pro_micro): +# - nice_nano (no probado) +# - nice_nano_v2 (probado) +# - nice_nano_v2 (super mini -> nice_nano_v2 clon) (probado) +# - nrfmicro_11 (no probado) +# - nrfmicro_11_flipped (no probado) +# - nrfmicro_13 (no probado) +# - puchi_ble_v1 (probado) + +### DONGLE MODE +CONFIG_ZMK_SPLIT_BLE_CENTRAL_PERIPHERALS=2 + +### DONGLE OPTIONS +# 3 profiles (n+2) +CONFIG_BT_MAX_CONN=5 +CONFIG_BT_MAX_PAIRED=5 + +### DISPLAY DONGLE OPTIONS +CONFIG_ZMK_DISPLAY=y +CONFIG_BT_BAS=n +CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING=y + +### POWER OPTIONS +# La unidad del intervalo del informe de energía de la batería es segundos +CONFIG_ZMK_BATTERY_REPORT_INTERVAL=60 + +### DEBUG OPTIONS +# CONFIG_ZMK_USB_LOGGING=y +# CONFIG_LOG_PROCESS_THREAD_STARTUP_DELAY_MS=8000 diff --git a/boards/shields/sofle/sofle_dongle_pro_micro.overlay b/boards/shields/sofle/sofle_dongle_pro_micro.overlay new file mode 100644 index 00000000..0a8f4582 --- /dev/null +++ b/boards/shields/sofle/sofle_dongle_pro_micro.overlay @@ -0,0 +1,187 @@ +/* + * Copyright (c) 2020 Pete Johanson + * + * SPDX-License-Identifier: MIT + */ + +#include +#include + +&josefadamcik_sofle_layout { + transform = <&default_transform>; +}; + +/ { + chosen { + zephyr,display = &oled; + zmk,kscan = &mock_kscan; + zmk,physical-layout = &josefadamcik_sofle_layout; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <16>; + rows = <4>; +// | SW6 | SW5 | SW4 | SW3 | SW2 | SW1 | | SW1 | SW2 | SW3 | SW4 | SW5 | SW6 | +// | SW12 | SW11 | SW10 | SW9 | SW8 | SW7 | | SW7 | SW8 | SW9 | SW10 | SW11 | SW12 | +// | SW18 | SW17 | SW16 | SW15 | SW14 | SW13 | | SW13 | SW14 | SW15 | SW16 | SW17 | SW18 | +// | SW24 | SW23 | SW22 | SW21 | SW20 | SW19 | SW25 | | SW25 | SW19 | SW20 | SW21 | SW22 | SW23 | SW24 | +// | SW30 | SW29 | SW28 | SW27 | SW26 | | SW26 | SW27 | SW28 | SW29 | 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(4,5) RC(4,6) 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,7) RC(4,8) RC(4,9) RC(4,10) RC(4,11) + >; + }; + + /* + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + wakeup-source; + + diode-direction = "col2row"; + row-gpios + = <&pro_micro 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + }; + + left_encoder: encoder_left { + compatible = "alps,ec11"; + a-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + steps = <80>; + status = "disabled"; + }; + + right_encoder: encoder_right { + compatible = "alps,ec11"; + a-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + steps = <80>; + status = "disabled"; + }; + + sensors: sensors { + compatible = "zmk,keymap-sensors"; + sensors = <&left_encoder &right_encoder>; + triggers-per-rotation = <20>; + }; + */ + + mock_kscan: kscan_0 { + compatible = "zmk,kscan-mock"; + // wakeup-source; + columns = <0>; + rows = <0>; + events = <0>; + }; + // TODO: per-key RGB node(s)? +}; + +&pro_micro_i2c { + status = "okay"; + + oled: ssd1306@3c { + compatible = "solomon,ssd1306fb"; + reg = <0x3c>; + width = <128>; + height = <64>; + segment-offset = <0>; + page-offset = <0>; + display-offset = <0>; + multiplex-ratio = <63>; + segment-remap; + com-invdir; + inversion-on; + prechargep = <0x22>; + }; +}; + +/* +// 128x64 OLED +&pro_micro_i2c { + status = "okay"; + + oled: ssd1306@3c { + compatible = "solomon,ssd1306fb"; + reg = <0x3c>; + width = <128>; + height = <64>; + segment-offset = <0>; + page-offset = <0>; + display-offset = <0>; + multiplex-ratio = <63>; + segment-remap; + com-invdir; + inversion-on; + prechargep = <0x22>; + }; +}; +// 128x32 OLED +&pro_micro_i2c { + status = "okay"; + + oled: ssd1306@3c { + compatible = "solomon,ssd1306fb"; + reg = <0x3c>; + width = <128>; + height = <32>; + segment-offset = <0>; + page-offset = <0>; + display-offset = <0>; + multiplex-ratio = <31>; + segment-remap; + com-invdir; + com-sequential; + inversion-on; + prechargep = <0x22>; + }; +}; + +// 128x64 OLED model sh1106 + +&pro_micro_i2c { + status = "okay"; + oled: sh1106@3c { + compatible = "sinowealth,sh1106"; + reg = <0x3c>; + width = <129>; + height = <64>; + segment-offset = <1>; + page-offset = <0>; + display-offset = <0>; + multiplex-ratio = <63>; + segment-remap; + com-invdir; + inversion-on; + prechargep = <0x22>; + }; +}; + +// 128x128 OLED model sh1107 +&pro_micro_i2c { + status = "okay"; + oled: sh1106@3c { + compatible = "sinowealth,sh1106"; + reg = <0x3c>; + width = <120>; + height = <128>; + segment-offset = <0>; + page-offset = <0>; + display-offset = <0>; + multiplex-ratio = <119>; + segment-remap; + com-invdir; + inversion-on; + prechargep = <0x22>; + }; +}; + +*/ +// vim: filetype=dts fdm=marker: diff --git a/boards/shields/sofle/sofle_dongle_xiao.conf b/boards/shields/sofle/sofle_dongle_xiao.conf new file mode 100644 index 00000000..1d9fa26f --- /dev/null +++ b/boards/shields/sofle/sofle_dongle_xiao.conf @@ -0,0 +1,24 @@ +# MC: +# compatible con todas las versiones de nrf52840 (xiao): +# - seeeduino_xiao_ble (probado) + +### DONGLE MODE +CONFIG_ZMK_SPLIT_BLE_CENTRAL_PERIPHERALS=2 + +### DONGLE OPTIONS +# 3 profiles (n+2) +CONFIG_BT_MAX_CONN=5 +CONFIG_BT_MAX_PAIRED=5 + +### DISPLAY DONGLE OPTIONS +CONFIG_ZMK_DISPLAY=y +CONFIG_BT_BAS=n +CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING=y + +### POWER OPTIONS +# La unidad del intervalo del informe de energía de la batería es segundos +CONFIG_ZMK_BATTERY_REPORT_INTERVAL=60 + +### DEBUG OPTIONS +# CONFIG_ZMK_USB_LOGGING=y +# CONFIG_LOG_PROCESS_THREAD_STARTUP_DELAY_MS=8000 diff --git a/boards/shields/sofle/sofle_dongle_xiao.overlay b/boards/shields/sofle/sofle_dongle_xiao.overlay new file mode 100644 index 00000000..4d8ecb9c --- /dev/null +++ b/boards/shields/sofle/sofle_dongle_xiao.overlay @@ -0,0 +1,224 @@ +/* + * Copyright (c) 2020 Pete Johanson + * + * SPDX-License-Identifier: MIT + */ + +#include +#include + +&josefadamcik_sofle_layout { + transform = <&default_transform>; +}; + +/ { + chosen { + zephyr,display = &oled; + zmk,kscan = &mock_kscan; + zmk,physical-layout = &josefadamcik_sofle_layout; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <16>; + rows = <4>; +// | SW6 | SW5 | SW4 | SW3 | SW2 | SW1 | | SW1 | SW2 | SW3 | SW4 | SW5 | SW6 | +// | SW12 | SW11 | SW10 | SW9 | SW8 | SW7 | | SW7 | SW8 | SW9 | SW10 | SW11 | SW12 | +// | SW18 | SW17 | SW16 | SW15 | SW14 | SW13 | | SW13 | SW14 | SW15 | SW16 | SW17 | SW18 | +// | SW24 | SW23 | SW22 | SW21 | SW20 | SW19 | SW25 | | SW25 | SW19 | SW20 | SW21 | SW22 | SW23 | SW24 | +// | SW30 | SW29 | SW28 | SW27 | SW26 | | SW26 | SW27 | SW28 | SW29 | 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(4,5) RC(4,6) 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,7) RC(4,8) RC(4,9) RC(4,10) RC(4,11) + >; + }; + + /* + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + wakeup-source; + + diode-direction = "col2row"; + row-gpios + = <&pro_micro 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + }; + + left_encoder: encoder_left { + compatible = "alps,ec11"; + a-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + steps = <80>; + status = "disabled"; + }; + + right_encoder: encoder_right { + compatible = "alps,ec11"; + a-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + steps = <80>; + status = "disabled"; + }; + + sensors: sensors { + compatible = "zmk,keymap-sensors"; + sensors = <&left_encoder &right_encoder>; + triggers-per-rotation = <20>; + }; + */ + + mock_kscan: kscan_0 { + compatible = "zmk,kscan-mock"; + // wakeup-source; + columns = <0>; + rows = <0>; + events = <0>; + }; + // TODO: per-key RGB node(s)? +}; + +&xiao_i2c { + status = "okay"; + + oled: ssd1306@3c { + compatible = "solomon,ssd1306fb"; + reg = <0x3c>; + width = <128>; + height = <64>; + segment-offset = <0>; + page-offset = <0>; + display-offset = <0>; + multiplex-ratio = <63>; + segment-remap; + com-invdir; + inversion-on; + prechargep = <0x22>; + }; +}; + +/* +// 128x64 OLED +&xiao_i2c { + status = "okay"; + + oled: ssd1306@3c { + compatible = "solomon,ssd1306fb"; + reg = <0x3c>; + width = <128>; + height = <64>; + segment-offset = <0>; + page-offset = <0>; + display-offset = <0>; + multiplex-ratio = <63>; + segment-remap; + com-invdir; + inversion-on; + prechargep = <0x22>; + }; +}; +// 128x32 OLED +&xiao_i2c { + status = "okay"; + + oled: ssd1306@3c { + compatible = "solomon,ssd1306fb"; + reg = <0x3c>; + width = <128>; + height = <32>; + segment-offset = <0>; + page-offset = <0>; + display-offset = <0>; + multiplex-ratio = <31>; + segment-remap; + com-invdir; + com-sequential; + inversion-on; + prechargep = <0x22>; + }; +}; + + +// 128x64 OLED model sh1106 + +&xiao_i2c { + status = "okay"; + oled: sh1106@3c { + compatible = "sinowealth,sh1106"; + reg = <0x3c>; + width = <129>; + height = <64>; + segment-offset = <1>; + page-offset = <0>; + display-offset = <0>; + multiplex-ratio = <63>; + segment-remap; + com-invdir; + inversion-on; + prechargep = <0x22>; + }; +}; + +// 128x128 OLED model sh1107 +&xiao_i2c { + status = "okay"; + oled: sh1106@3c { + compatible = "sinowealth,sh1106"; + reg = <0x3c>; + width = <120>; + height = <128>; + segment-offset = <0>; + page-offset = <0>; + display-offset = <0>; + multiplex-ratio = <119>; + segment-remap; + com-invdir; + inversion-on; + prechargep = <0x22>; + }; +}; + +// ################# niceview working fine START ################# +// doc: https://wiki.seeedstudio.com/XIAO-SAMD21-Zephyr-RTOS/ +// @bravekarma nice Discord server +// The &gpioX Y and NRF_PSEL(..., X, Y) uses the PX.Y notation (underlying nRF +// pin numbers), &xiao_d x uses the unified pinout Dx + +&pinctrl { + spi0_default: spi0_default { + group1 { + psels = , + , + ; + }; + }; + spi0_sleep: spi0_sleep { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; +}; + +nice_view_spi: &spi0 { + compatible = "nordic,nrf-spim"; + pinctrl-0 = <&spi0_default>; + pinctrl-1 = <&spi0_sleep>; + pinctrl-names = "default", "sleep"; + cs-gpios = <&xiao_d 6 GPIO_ACTIVE_HIGH>; // Pin D6 as CS +}; + +&xiao_i2c { + status = "disabled"; +}; +// ################# niceview working fine END ################# +*/ +// vim: filetype=dts fdm=marker: diff --git a/boards/shields/sofle/sofle_left.conf b/boards/shields/sofle/sofle_left.conf new file mode 100644 index 00000000..e8137201 --- /dev/null +++ b/boards/shields/sofle/sofle_left.conf @@ -0,0 +1,2 @@ +# Copyright (c) 2020 Ryan Cross +# SPDX-License-Identifier: MIT diff --git a/boards/shields/sofle/sofle_left.overlay b/boards/shields/sofle/sofle_left.overlay new file mode 100644 index 00000000..057e6050 --- /dev/null +++ b/boards/shields/sofle/sofle_left.overlay @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 Ryan Cross + * + * SPDX-License-Identifier: MIT + */ + +#include "sofle.dtsi" + +&kscan0 { + col-gpios + = <&pro_micro 19 GPIO_ACTIVE_HIGH> + , <&pro_micro 18 GPIO_ACTIVE_HIGH> + , <&pro_micro 15 GPIO_ACTIVE_HIGH> + , <&pro_micro 14 GPIO_ACTIVE_HIGH> + , <&pro_micro 16 GPIO_ACTIVE_HIGH> + , <&pro_micro 10 GPIO_ACTIVE_HIGH> + ; +}; + +&left_encoder { + status = "okay"; +}; diff --git a/boards/shields/sofle/sofle_left_peripheral.conf b/boards/shields/sofle/sofle_left_peripheral.conf new file mode 100644 index 00000000..e69de29b diff --git a/boards/shields/sofle/sofle_left_peripheral.overlay b/boards/shields/sofle/sofle_left_peripheral.overlay new file mode 100644 index 00000000..057e6050 --- /dev/null +++ b/boards/shields/sofle/sofle_left_peripheral.overlay @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 Ryan Cross + * + * SPDX-License-Identifier: MIT + */ + +#include "sofle.dtsi" + +&kscan0 { + col-gpios + = <&pro_micro 19 GPIO_ACTIVE_HIGH> + , <&pro_micro 18 GPIO_ACTIVE_HIGH> + , <&pro_micro 15 GPIO_ACTIVE_HIGH> + , <&pro_micro 14 GPIO_ACTIVE_HIGH> + , <&pro_micro 16 GPIO_ACTIVE_HIGH> + , <&pro_micro 10 GPIO_ACTIVE_HIGH> + ; +}; + +&left_encoder { + status = "okay"; +}; diff --git a/boards/shields/sofle/sofle_right.conf b/boards/shields/sofle/sofle_right.conf new file mode 100644 index 00000000..e8137201 --- /dev/null +++ b/boards/shields/sofle/sofle_right.conf @@ -0,0 +1,2 @@ +# Copyright (c) 2020 Ryan Cross +# SPDX-License-Identifier: MIT diff --git a/boards/shields/sofle/sofle_right.overlay b/boards/shields/sofle/sofle_right.overlay new file mode 100644 index 00000000..65e5f330 --- /dev/null +++ b/boards/shields/sofle/sofle_right.overlay @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2020 Ryan Cross + * + * SPDX-License-Identifier: MIT + */ + +#include "sofle.dtsi" + +&default_transform { + col-offset = <6>; +}; + +&kscan0 { + col-gpios + = <&pro_micro 10 GPIO_ACTIVE_HIGH> + , <&pro_micro 16 GPIO_ACTIVE_HIGH> + , <&pro_micro 14 GPIO_ACTIVE_HIGH> + , <&pro_micro 15 GPIO_ACTIVE_HIGH> + , <&pro_micro 18 GPIO_ACTIVE_HIGH> + , <&pro_micro 19 GPIO_ACTIVE_HIGH> + ; +}; + +&right_encoder { + status = "okay"; +}; diff --git a/build.yaml b/build.yaml index 98e2c988..e3045940 100644 --- a/build.yaml +++ b/build.yaml @@ -54,6 +54,7 @@ --- include: + ### CORNE START ### ### nice_view START ### # nice_nano_v2 + nice_view_gem - board: nice_nano_v2 @@ -164,8 +165,42 @@ include: artifact-name: puchi_corne_dongle_view # snippet: zmk-usb-logging ### Pro Micro END ### + ### CORNE END ### - ### settings_reset START ### + ### SOFLEV2 SOFLEV1 SOFLEPLUS START ### + # nice!oled sofle + - board: nice_nano_v2 + shield: sofle_left nice_oled + cmake-args: -DCONFIG_ZMK_KEYBOARD_NAME=\"Sofle_Oled\" -DCONFIG_ZMK_STUDIO=y -DCONFIG_ZMK_SLEEP=y -DCONFIG_ZMK_IDLE_TIMEOUT=60000 + artifact-name: nice_sofle_left_oled + snippet: studio-rpc-usb-uart + - board: nice_nano_v2 + shield: sofle_right nice_oled + cmake-args: -DCONFIG_ZMK_SLEEP=y -DCONFIG_ZMK_IDLE_TIMEOUT=60000 + artifact-name: nice_sofle_right_oled + + # peripheral_left + - board: nice_nano_v2 + shield: sofle_left_peripheral nice_oled + cmake-args: -DCONFIG_ZMK_SLEEP=y -DCONFIG_ZMK_IDLE_TIMEOUT=60000 + artifact-name: nice_sofle_left_peripheral_oled + + # Xiao_Dongle + - board: seeeduino_xiao_ble + shield: sofle_dongle_xiao oled_adapter_seeeduino_xiao_ble_128x64 dongle_display + cmake-args: -DCONFIG_ZMK_KEYBOARD_NAME=\"SofleDongle_X\" -DCONFIG_ZMK_STUDIO=y -DCONFIG_ZMK_IDLE_TIMEOUT=60000 + artifact-name: xiao_sofle_dongle_xiao_oled + snippet: studio-rpc-usb-uart + + # ProMicro_Dongle + - board: nice_nano_v2 + shield: sofle_dongle_pro_micro dongle_display + cmake-args: -DCONFIG_ZMK_KEYBOARD_NAME=\"SofleDongle_P\" -DCONFIG_ZMK_STUDIO=y -DCONFIG_ZMK_SLEEP=n -DCONFIG_ZMK_IDLE_TIMEOUT=60000 + artifact-name: nice_sofle_dongle_oled + snippet: studio-rpc-usb-uart + ### SOFLEV2 SOFLEV1 SOFLEPLUS END ### + + ### SETTINGS_RESET START ### - board: nice_nano_v2 shield: settings_reset artifact-name: nice_settings_reset @@ -175,4 +210,4 @@ include: - board: puchi_ble_v1 shield: settings_reset artifact-name: puchi_settings_reset - ### settings_reset END ### + ### SETTINGS_RESET END ### diff --git a/config/sofle.conf b/config/sofle.conf new file mode 100644 index 00000000..2da30774 --- /dev/null +++ b/config/sofle.conf @@ -0,0 +1,140 @@ +# ======================================== +# FileName: sofle.conf +# Date: 03.01.2025 +# Author: Marcos Chow Castro +# Email: mctechnology170318@gmail.com +# GitHub: https://github.com/mctechnology17 +# Brief: configuration file for ZMK firmware +# Board: nice_nano_v2 and puchi_ble_v1 +# ╔═╦═╦═╗ +# ╔════╗ ║║║║║╔╝ +# ║╔╗╔╗║ ║║║║║╚╗ +# ╚╝║║╚╝ ║╠═╩╩═╝ +# ║╠═╦═╣╚╦═╦╦═╦╗╔═╦═╦╦╗ +# ║║╩╣═╣║║║║║╬║╚╣╬║╬║║║ +# ╚╩═╩═╩╩╩╩═╩═╩═╩═╬╗╠╗║ +# ╚═╩═╝ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT +# ========================================= +# on config_zmk.h file enable/disable the following options, if you want to +# use CONFIG_ZMK_MOUSE=y, CONFIG_ZMK_RGB_UNDERGLOW=y, CONFIG_ZMK_RGB_UNDERGLOW=y +# mouse config, 1 = enable, 0 = disable, default = 1 +# 2 = enable, but with rgb matrix +# #define MC_TECHNOLOGY_MOUSE_ENABLE 1 +# rgb matrix config, 1 = enable, 0 = disable, default = 0 +# #define MC_TECHNOLOGY_RGB_ENABLE 0 +# define macros on for .dtsi file 1 = enable, 0 = disable default = 1 +# #define MC_TECHNOLOGY_MACROS_ENABLE 1 + +### Keyboard name +# CONFIG_ZMK_KEYBOARD_NAME="Nice sofle View" +# CONFIG_ZMK_KEYBOARD_NAME="Puchi sofle View" +# CONFIG_ZMK_KEYBOARD_NAME="Nice sofle Oled" +# CONFIG_ZMK_KEYBOARD_NAME="Puchi sofle Oled" + +### Boost Bluetooth TX power, also make Bluetooth stronger +CONFIG_BT_CTLR_TX_PWR_PLUS_8=y +CONFIG_ZMK_BLE_EXPERIMENTAL_FEATURES=y +# Tune bluetooth profiles for quick select +# CONFIG_BT_MAX_CONN=3 +# Uncomment the following line if you facing issue on win 11 connection +# Enables a combination of settings that are planned to be default in future +# versions of ZMK to improve connection stability. This includes changes to +# timing on BLE pairing initiation, restores use of the updated/new LLCP +# implementation, and disables 2M PHY support. +CONFIG_ZMK_BLE_EXPERIMENTAL_CONN=y + +### POWER OPTIONS +CONFIG_ZMK_SLEEP=y +CONFIG_ZMK_EXT_POWER=y +# 15 min (15*60*1000ms) +# CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000 +# 1 min Número de milisegundos de inactividad antes de entrar en estado inactivo +# CONFIG_ZMK_IDLE_TIMEOUT=60000 +# 30 min (30*60*1000ms) +# CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=1800000 +# CONFIG_ZMK_IDLE_TIMEOUT=120000 +# Disable external power when not connected to USB +# CONFIG_ZMK_EXT_POWER_USB_ONLY=y + +### MOUSE +# https://github.com/zmkfirmware/zmk/blob/main/docs/docs/keymaps/behaviors/mouse-emulation.md +CONFIG_ZMK_MOUSE=y + +### ZMK STUDIO +# MC: 2. zmk-studio test START +# https://github.com/zmkfirmware/zmk/blob/main/docs/docs/config/studio.md +CONFIG_ZMK_STUDIO=y +CONFIG_ZMK_STUDIO_LOCKING=n +# MC: zmk-studio test END + +### RGB UNDERGLOW +# uncomment to enable RGB Underglow or backlight +# CONFIG_ZMK_RGB_UNDERGLOW=y +# CONFIG_WS2812_STRIP=y +# apaga si no se usa el teclado +# CONFIG_ZMK_RGB_UNDERGLOW_AUTO_OFF_IDLE=y +# 0 Solid color 1 Breathe 2 Spectrum 3 Swirl +# CONFIG_ZMK_RGB_UNDERGLOW_EFF_START=3 +# nivel de brillo en porcentaje, el valor por defecto es 10 por ciento +# CONFIG_ZMK_RGB_UNDERGLOW_BRT_STEP=1 +# Turn off RGB underglow when keyboard goes into idle state +# CONFIG_ZMK_RGB_UNDERGLOW_AUTO_OFF_IDLE=y + +# # Hue step in degrees (0-359) used by RGB actions default 10 +# CONFIG_ZMK_RGB_UNDERGLOW_HUE_STEP=30 + +# # Brightness step in percent used by RGB actions default 10 +# CONFIG_ZMK_RGB_UNDERGLOW_SAT_STEP=2 +# CONFIG_ZMK_RGB_UNDERGLOW_HUE_START=240 +# CONFIG_ZMK_RGB_UNDERGLOW_SAT_START=10 +# CONFIG_ZMK_RGB_UNDERGLOW_BRT_START=15 + +# Uncomment the line below to disable external power toggling by the underglow. +# By default toggling the underglow on and off also toggles external power +# on and off. This also causes the display to turn off. +# CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=n + +### OLED DISPLAY +CONFIG_ZMK_DISPLAY=y +CONFIG_ZMK_DISPLAY_STATUS_SCREEN_CUSTOM=y +# esto creo que ya no es necesario +# CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y +# CONFIG_ZMK_DISPLAY_STATUS_SCREEN_BUILT_IN=y + +### WIDGET SETTINGS +# No Widget configurations added since nice!view has its own custom widgets +# activar solo estos dos widgets +# CONFIG_ZMK_WIDGET_WPM_STATUS=n +# CONFIG_ZMK_WIDGET_BATTERY_STATUS_SHOW_PERCENTAGE=y +# CONFIG_ZMK_WIDGET_LAYER_STATUS=y +# CONFIG_ZMK_WIDGET_BATTERY_STATUS=y +# CONFIG_ZMK_WIDGET_OUTPUT_STATUS=y + +### HID para nice!view ePaperDisplay +# Enable eager debouncing +# "Eager Debouncing" +# Trying to lower the input lag. +CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=1 +CONFIG_ZMK_KSCAN_DEBOUNCE_RELEASE_MS=5 + +### Improves compatibility with iPad +# ref: https://zmk.dev/docs/config/system#hid +CONFIG_ZMK_HID_CONSUMER_REPORT_USAGES_BASIC=y + +# RDP compatibility. +# CONFIG_ZMK_HID_SEPARATE_MOD_RELEASE_REPORT=y + +# NKRO +# CONFIG_ZMK_HID_REPORT_TYPE_NKRO=y +# enable F13-F24 +# CONFIG_ZMK_HID_KEYBOARD_NKRO_EXTENDED_REPORT=y + +### DEBUG OPTIONS +# CONFIG_ZMK_USB_LOGGING=y +# CONFIG_LOG_PROCESS_THREAD_STARTUP_DELAY_MS=8000 + +### ENABLE ENCODER +CONFIG_EC11=y +CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y diff --git a/config/sofle.keymap b/config/sofle.keymap new file mode 100644 index 00000000..5a6b2e2c --- /dev/null +++ b/config/sofle.keymap @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include +#include + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { + // ------------------------------------------------------------------------------------------------------------ + // | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | + // | ESC | Q | W | E | R | T | | Y | U | I | O | P | BKSPC | + // | TAB | A | S | D | F | G | | H | J | K | L | ; | ' | + // | SHIFT | Z | X | C | V | B | MUTE | | | N | M | , | . | / | SHIFT | + // | GUI | ALT | CTRL | LOWER| ENTER | | SPACE | RAISE| CTRL | ALT | GUI | + + bindings = < +&kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS +&kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSPC +&kp TAB &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 C_MUTE &kp C_MUTE &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT + &kp LGUI &kp LALT &kp LCTRL &mo 1 &kp RET &kp SPACE &mo 2 &kp RCTRL &kp RALT &kp RGUI + >; + + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>; + }; + + lower_layer { + // TODO: Some binds are waiting for shifted keycode support. + // ------------------------------------------------------------------------------------------------------------ + // | ` | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | + // | RAISE | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | F12 | + // | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | | + // | | = | - | + | { | } | | | | [ | ] | ; | : | \ | | + // | | | | | | | | | | | | + + bindings = < +&kp GRAVE &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 +&mo 2 &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp F12 +&trans &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp KP_MULTIPLY &kp LPAR &kp RPAR &kp PIPE +&trans &kp EQUAL &kp MINUS &kp KP_PLUS &kp LBRC &kp RBRC &trans &trans &kp LBKT &kp RBKT &kp SEMI &kp COLON &kp BSLH &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + >; + + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>; + }; + + raise_layer { + // ------------------------------------------------------------------------------------------------------------ + // |BTCLR| BT1 | BT2 | BT3 | BT4 | BT5 | | | | | | | | + // | | INS | PSCR | GUI | | | | PGUP | | | | | | + // | | ALT | CTRL | SHIFT | | CAPS | | <- | v | ^ | -> | DEL | BKSPC | + // | | UNDO | CUT | COPY | PASTE | | | | | | | | | | | + // | | | | | | | | | | | | + + bindings = < +&bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &trans &trans &trans &trans &trans &trans +&trans &kp INS &kp PSCRN &kp K_CMENU &trans &trans &kp PG_UP &trans &trans &trans &kp N0 &trans +&trans &kp LALT &kp LCTRL &kp LSHFT &trans &kp CLCK &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp DEL &kp BSPC +&trans &kp K_UNDO &kp K_CUT &kp K_COPY &kp K_PASTE &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + >; + + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>; + }; + + layer_3 { + bindings = < +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + >; + }; + + layer_4 { + bindings = < +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + >; + }; + }; +};