feat: xiao dongle rgb, corne rgb fix: multiple xiao+promicro encoder def ref: CHANGELOG.txt for more...

This commit is contained in:
Chow Castro, Marcos 2025-02-27 21:09:55 +01:00
parent 51779bb90f
commit 3e89c0de61
17 changed files with 242 additions and 48 deletions

View file

@ -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:

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {