Skip to content

Commit

Permalink
feat: xiao dongle rgb, corne rgb fix: multiple xiao+promicro encoder …
Browse files Browse the repository at this point in the history
…def ref: CHANGELOG.txt for more...
  • Loading branch information
mctechnology17 committed Feb 27, 2025
1 parent 51779bb commit 3e89c0d
Show file tree
Hide file tree
Showing 17 changed files with 238 additions and 44 deletions.
17 changes: 14 additions & 3 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
52 changes: 52 additions & 0 deletions boards/seeeduino_xiao_ble.overlay
Original file line number Diff line number Diff line change
@@ -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 <dt-bindings/led/led.h>

&pinctrl {
spi0_default: spi0_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 29)>;
};
};

spi0_sleep: spi0_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 29)>;
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 = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};

/ {
chosen {
zmk,underglow = &led_strip;
};
};
// vim: filetype=dts fdm=marker:
14 changes: 13 additions & 1 deletion boards/shields/lily58/lily58_dongle_pro_micro.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
14 changes: 13 additions & 1 deletion boards/shields/lily58/lily58_dongle_xiao.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions boards/shields/sofle/sofle_dongle_pro_micro.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
Expand All @@ -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 {
Expand Down
64 changes: 29 additions & 35 deletions boards/shields/sofle/sofle_dongle_xiao.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -36,52 +36,46 @@ 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)
>;
};

mock_kscan: kscan_0 {
compatible = "zmk,kscan-mock";
// wakeup-source;
columns = <0>;
rows = <0>;
events = <0>;
};

/*
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)>
;
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 = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
steps = <80>;
status = "disabled";
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 = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
steps = <80>;
status = "disabled";
};
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: 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>;
sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder &right_encoder>;
triggers-per-rotation = <20>;
};
// TODO: per-key RGB node(s)?
};

&xiao_i2c {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
13 changes: 13 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ###
Expand Down
16 changes: 16 additions & 0 deletions config/corne.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/mouse.h>

&led_strip {
chain-length = <27>;
};

/ {
keymap {
compatible = "zmk,keymap";
Expand Down Expand Up @@ -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";
};
};
};
};
Empty file.
3 changes: 3 additions & 0 deletions snippets/common-config/snippet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: common-config
append:
EXTRA_CONF_FILE: common-config.conf
Empty file.
3 changes: 3 additions & 0 deletions snippets/dongle-config/snippet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: dongle-config
append:
EXTRA_CONF_FILE: dongle-config.conf
20 changes: 20 additions & 0 deletions snippets/rgb-config/rgb-config.conf
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions snippets/rgb-config/snippet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: rgb-config
append:
EXTRA_CONF_FILE: rgb-config.conf
1 change: 1 addition & 0 deletions zephyr/module.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build:
settings:
board_root: .
snippet_root: .

0 comments on commit 3e89c0d

Please sign in to comment.