From 3e89c0de61588ec5dd30c51aed0110dd09653deb Mon Sep 17 00:00:00 2001 From: "Chow Castro, Marcos" Date: Thu, 27 Feb 2025 21:09:55 +0100 Subject: [PATCH] feat: xiao dongle rgb, corne rgb fix: multiple xiao+promicro encoder def ref: CHANGELOG.txt for more... --- CHANGELOG.txt | 17 ++++- boards/seeeduino_xiao_ble.overlay | 52 ++++++++++++++ .../lily58/lily58_dongle_pro_micro.overlay | 14 +++- .../shields/lily58/lily58_dongle_xiao.overlay | 14 +++- .../sofle/sofle_dongle_pro_micro.overlay | 3 +- .../shields/sofle/sofle_dongle_xiao.overlay | 72 +++++++++---------- ...itkb_aurora_sofle_dongle_pro_micro.overlay | 25 ++++++- .../splitkb_aurora_sofle_dongle_xiao.overlay | 34 ++++++++- build.yaml | 13 ++++ config/corne.keymap | 16 +++++ snippets/common-config/common-config.conf | 0 snippets/common-config/snippet.yml | 3 + snippets/dongle-config/dongle-config.conf | 0 snippets/dongle-config/snippet.yml | 3 + snippets/rgb-config/rgb-config.conf | 20 ++++++ snippets/rgb-config/snippet.yml | 3 + zephyr/module.yml | 1 + 17 files changed, 242 insertions(+), 48 deletions(-) create mode 100644 boards/seeeduino_xiao_ble.overlay create mode 100644 snippets/common-config/common-config.conf create mode 100644 snippets/common-config/snippet.yml create mode 100644 snippets/dongle-config/dongle-config.conf create mode 100644 snippets/dongle-config/snippet.yml create mode 100644 snippets/rgb-config/rgb-config.conf create mode 100644 snippets/rgb-config/snippet.yml diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ed25a18..564ec12 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,19 @@ Changelog file for Structures extra. https://github.com/mctechnology17/zmk-config/blob/main/CHANGELOG.txt +# FEATURES 0.0.2-beta4 (Feb 27, 2025) +======================================= ++ NEW FEATURES +- [x] build.yaml updated +- [x] Add build for rgb + oled display +- [x] seeeduino_xiao_ble.overlay rgb added +- [x] Add build for rgb + oled display + dongle +- [x] corne.overlay rgb led definition, layer reserved added +- [x] snippet: rgb-config common-config dongle-config for multiple settings +- [x] Add right- left_encoder definition sofle_dongle_pro_micro.overlay sofle_dongle_xiao.overlay +- [x] Add right- left_encoder definition splitkb_aurora_sofle_dongle_pro_micro.overlay splitkb_aurora_sofle_dongle_xiao.overlay +- [x] Add left_encoder definition lily58_dongle_pro_micro.overlay lily58_dongle_xiao.overlay + # FEATURES 0.0.2-beta3 (Jan 06, 2025) ======================================= + NEW FEATURES @@ -52,6 +65,4 @@ https://github.com/mctechnology17/zmk-config/blob/main/CHANGELOG.txt - [ ] Add set up the workspace https://github.com/urob/zmk-config?tab=readme-ov-file#set-up-the-workspace - [ ] Add a wiki to the repository - [ ] Add a video tutorial to the repository -- [ ] Add EXTRA_CONF_FILE for each device -- [ ] Add build for rgb + oled display -- [ ] Add build for rgb + oled display + dongle +- [ ] README.md updated + fotos as reference diff --git a/boards/seeeduino_xiao_ble.overlay b/boards/seeeduino_xiao_ble.overlay new file mode 100644 index 0000000..66f7ec6 --- /dev/null +++ b/boards/seeeduino_xiao_ble.overlay @@ -0,0 +1,52 @@ +/* +ref: For future reference, this pinout shows both pin numberings https://files.seeedstudio.com/wiki/XIAO-BLE/pinout2.png +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 +*/ +#include + +&pinctrl { + spi0_default: spi0_default { + group1 { + psels = ; + }; + }; + + spi0_sleep: spi0_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi3 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi0_default>; + pinctrl-1 = <&spi0_sleep>; + pinctrl-names = "default", "sleep"; + + 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 = <27>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = ; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; +// vim: filetype=dts fdm=marker: diff --git a/boards/shields/lily58/lily58_dongle_pro_micro.overlay b/boards/shields/lily58/lily58_dongle_pro_micro.overlay index 2564d87..852bb9a 100644 --- a/boards/shields/lily58/lily58_dongle_pro_micro.overlay +++ b/boards/shields/lily58/lily58_dongle_pro_micro.overlay @@ -40,7 +40,19 @@ 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) rows = <0>; events = <0>; }; - // TODO: per-key RGB node(s)? + + 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>; + }; + + sensors: sensors { + compatible = "zmk,keymap-sensors"; + sensors = <&left_encoder>; + triggers-per-rotation = <20>; + }; }; &kata0510_lily58_layout { diff --git a/boards/shields/lily58/lily58_dongle_xiao.overlay b/boards/shields/lily58/lily58_dongle_xiao.overlay index f0fda75..a2a633d 100644 --- a/boards/shields/lily58/lily58_dongle_xiao.overlay +++ b/boards/shields/lily58/lily58_dongle_xiao.overlay @@ -40,7 +40,19 @@ 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) rows = <0>; events = <0>; }; - // TODO: per-key RGB node(s)? + + left_encoder: encoder_left { + compatible = "alps,ec11"; + a-gpios = <&xiao_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&xiao_d 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + steps = <80>; + }; + + sensors { + compatible = "zmk,keymap-sensors"; + sensors = <&left_encoder>; + triggers-per-rotation = <20>; + }; }; &kata0510_lily58_layout { diff --git a/boards/shields/sofle/sofle_dongle_pro_micro.overlay b/boards/shields/sofle/sofle_dongle_pro_micro.overlay index 0a8f458..c6ad44e 100644 --- a/boards/shields/sofle/sofle_dongle_pro_micro.overlay +++ b/boards/shields/sofle/sofle_dongle_pro_micro.overlay @@ -50,6 +50,7 @@ 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) , <&pro_micro 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> ; }; + */ left_encoder: encoder_left { compatible = "alps,ec11"; @@ -72,7 +73,6 @@ 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) sensors = <&left_encoder &right_encoder>; triggers-per-rotation = <20>; }; - */ mock_kscan: kscan_0 { compatible = "zmk,kscan-mock"; @@ -81,7 +81,6 @@ 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) rows = <0>; events = <0>; }; - // TODO: per-key RGB node(s)? }; &pro_micro_i2c { diff --git a/boards/shields/sofle/sofle_dongle_xiao.overlay b/boards/shields/sofle/sofle_dongle_xiao.overlay index 4d8ecb9..5890a5c 100644 --- a/boards/shields/sofle/sofle_dongle_xiao.overlay +++ b/boards/shields/sofle/sofle_dongle_xiao.overlay @@ -36,44 +36,6 @@ 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) >; }; - /* - 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; @@ -81,7 +43,39 @@ 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) rows = <0>; events = <0>; }; - // TODO: per-key RGB node(s)? + + /* + row-gpios + = <&xiao_d 0 GPIO_ACTIVE_HIGH> + , <&xiao_d 1 GPIO_ACTIVE_HIGH> + , <&xiao_d 2 GPIO_ACTIVE_HIGH> + , <&xiao_d 3 GPIO_ACTIVE_HIGH> + ; + }; + */ + + left_encoder: encoder_left { + compatible = "alps,ec11"; + a-gpios = <&xiao_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&xiao_d 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + steps = <80>; + status = "disabled"; + }; + + right_encoder: encoder_right { + compatible = "alps,ec11"; + a-gpios = <&xiao_d 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&xiao_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + steps = <80>; + status = "disabled"; + + }; + + sensors { + compatible = "zmk,keymap-sensors"; + sensors = <&left_encoder &right_encoder>; + triggers-per-rotation = <20>; + }; }; &xiao_i2c { diff --git a/boards/shields/splitkb_aurora_sofle/splitkb_aurora_sofle_dongle_pro_micro.overlay b/boards/shields/splitkb_aurora_sofle/splitkb_aurora_sofle_dongle_pro_micro.overlay index 3445c38..7cda86d 100644 --- a/boards/shields/splitkb_aurora_sofle/splitkb_aurora_sofle_dongle_pro_micro.overlay +++ b/boards/shields/splitkb_aurora_sofle/splitkb_aurora_sofle_dongle_pro_micro.overlay @@ -43,7 +43,30 @@ 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) rows = <0>; events = <0>; }; - // TODO: per-key RGB node(s)? + + left_encoder: left_encoder { + compatible = "alps,ec11"; + steps = <144>; + status = "disabled"; + + a-gpios = <&pro_micro 16 GPIO_PULL_UP>; + b-gpios = <&pro_micro 10 GPIO_PULL_UP>; + }; + + right_encoder: right_encoder { + compatible = "alps,ec11"; + steps = <144>; + status = "disabled"; + + a-gpios = <&pro_micro 16 GPIO_PULL_UP>; + b-gpios = <&pro_micro 10 GPIO_PULL_UP>; + }; + + sensors: sensors { + compatible = "zmk,keymap-sensors"; + sensors = <&left_encoder &right_encoder>; + triggers-per-rotation = <36>; + }; }; &pro_micro_i2c { diff --git a/boards/shields/splitkb_aurora_sofle/splitkb_aurora_sofle_dongle_xiao.overlay b/boards/shields/splitkb_aurora_sofle/splitkb_aurora_sofle_dongle_xiao.overlay index 57458db..bfbee97 100644 --- a/boards/shields/splitkb_aurora_sofle/splitkb_aurora_sofle_dongle_xiao.overlay +++ b/boards/shields/splitkb_aurora_sofle/splitkb_aurora_sofle_dongle_xiao.overlay @@ -43,7 +43,39 @@ 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) rows = <0>; events = <0>; }; - // TODO: per-key RGB node(s)? + + /* + row-gpios + = <&xiao_d 0 GPIO_ACTIVE_HIGH> + , <&xiao_d 1 GPIO_ACTIVE_HIGH> + , <&xiao_d 2 GPIO_ACTIVE_HIGH> + , <&xiao_d 3 GPIO_ACTIVE_HIGH> + ; + }; + */ + + left_encoder: encoder_left { + compatible = "alps,ec11"; + a-gpios = <&xiao_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&xiao_d 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + steps = <80>; + status = "disabled"; + }; + + right_encoder: encoder_right { + compatible = "alps,ec11"; + a-gpios = <&xiao_d 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&xiao_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + steps = <80>; + status = "disabled"; + + }; + + sensors { + compatible = "zmk,keymap-sensors"; + sensors = <&left_encoder &right_encoder>; + triggers-per-rotation = <20>; + }; }; &xiao_i2c { diff --git a/build.yaml b/build.yaml index b0c0419..802815c 100644 --- a/build.yaml +++ b/build.yaml @@ -165,6 +165,19 @@ include: artifact-name: puchi_corne_dongle_view # snippet: zmk-usb-logging ### Pro Micro END ### + + ### ProMicro_Dongle START ### + # NICE x PUCHI and nice_oled + rgb + - board: nice_nano_v2 + shield: corne_left nice_oled + cmake-args: -DCONFIG_ZMK_KEYBOARD_NAME=\"Corne_Oled_RGB\" + artifact-name: nice_corne_left_oled_rgb + snippet: rgb-config studio-rpc-usb-uart + - board: puchi_ble_v1 + shield: corne_right nice_oled + snippet: rgb-config + artifact-name: puchi_corne_right_oled_rgb + ### Pro Micro END ### ### CORNE END ### ### SOFLEV2 SOFLEV1 SOFLEPLUS START ### diff --git a/config/corne.keymap b/config/corne.keymap index 62ea39b..ce22aee 100644 --- a/config/corne.keymap +++ b/config/corne.keymap @@ -9,6 +9,10 @@ #include #include +&led_strip { + chain-length = <27>; +}; + / { keymap { compatible = "zmk,keymap"; @@ -60,5 +64,17 @@ &kp LGUI &studio_unlock &kp SPACE &kp RET &studio_unlock &kp RALT >; }; + extra_1 { + status = "reserved"; + }; + + extra_2 { + status = "reserved"; + }; + + extra_3 { + status = "reserved"; + }; + }; }; }; diff --git a/snippets/common-config/common-config.conf b/snippets/common-config/common-config.conf new file mode 100644 index 0000000..e69de29 diff --git a/snippets/common-config/snippet.yml b/snippets/common-config/snippet.yml new file mode 100644 index 0000000..f0b1af3 --- /dev/null +++ b/snippets/common-config/snippet.yml @@ -0,0 +1,3 @@ +name: common-config +append: + EXTRA_CONF_FILE: common-config.conf diff --git a/snippets/dongle-config/dongle-config.conf b/snippets/dongle-config/dongle-config.conf new file mode 100644 index 0000000..e69de29 diff --git a/snippets/dongle-config/snippet.yml b/snippets/dongle-config/snippet.yml new file mode 100644 index 0000000..6f3f4b6 --- /dev/null +++ b/snippets/dongle-config/snippet.yml @@ -0,0 +1,3 @@ +name: dongle-config +append: + EXTRA_CONF_FILE: dongle-config.conf diff --git a/snippets/rgb-config/rgb-config.conf b/snippets/rgb-config/rgb-config.conf new file mode 100644 index 0000000..d6674bd --- /dev/null +++ b/snippets/rgb-config/rgb-config.conf @@ -0,0 +1,20 @@ +### RGB UNDERGLOW +CONFIG_ZMK_RGB_UNDERGLOW=y +CONFIG_WS2812_STRIP=y +# 0 Solid color 1 Breathe 2 Spectrum 3 Swirl +CONFIG_ZMK_RGB_UNDERGLOW_EFF_START=3 +# brightness level in percentage, the default value is 10 percent +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 +# 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 diff --git a/snippets/rgb-config/snippet.yml b/snippets/rgb-config/snippet.yml new file mode 100644 index 0000000..c0552da --- /dev/null +++ b/snippets/rgb-config/snippet.yml @@ -0,0 +1,3 @@ +name: rgb-config +append: + EXTRA_CONF_FILE: rgb-config.conf diff --git a/zephyr/module.yml b/zephyr/module.yml index 1cc2b35..d9f1966 100644 --- a/zephyr/module.yml +++ b/zephyr/module.yml @@ -1,3 +1,4 @@ build: settings: board_root: . + snippet_root: .