ec11 encoders

This commit is contained in:
2025-09-30 23:05:58 +10:00
parent 354fd0d231
commit 1adf0c071e
2 changed files with 31 additions and 6 deletions

View File

@@ -18,6 +18,23 @@
events = <0>;
};
/* Rotary encoders (same logical wiring as halves; mark disabled until mapped to actual pins if needed) */
left_encoder: left_encoder {
compatible = "alps,ec11";
a-gpios = <&gpio0 21 (GPIO_ACTIVE_HIGH)>;
b-gpios = <&gpio0 20 (GPIO_ACTIVE_HIGH)>;
steps = <80>;
status = "okay";
};
right_encoder: right_encoder {
compatible = "alps,ec11";
a-gpios = <&gpio0 20 (GPIO_ACTIVE_HIGH)>;
b-gpios = <&gpio0 21 (GPIO_ACTIVE_HIGH)>;
steps = <80>;
status = "okay";
};
default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <16>;
@@ -30,4 +47,10 @@
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)
>;
};
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder &right_encoder>;
triggers-per-rotation = <20>;
};
};

View File

@@ -1,18 +1,20 @@
# Configuration for Sofle Dongle (Wireless Receiver)
# Dongle doesn't have display or encoders
# Acts as a central node; we want encoder events processed even if dongle has no physical encoders
# (some firmware paths expect sensor count to match halves for behavior consistency)
# Disable display for dongle
# No local display
CONFIG_ZMK_DISPLAY=n
# Disable encoder for dongle
CONFIG_EC11=n
# Enable EC11 driver so encoder sensor behavior compiles & split forwarded events are handled
CONFIG_EC11=y
CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
# Keep other settings
# Power & Sleep
CONFIG_ZMK_SLEEP=y
CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=3600000
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
# Disable WPM widget since no display
# No display widgets
CONFIG_ZMK_WIDGET_WPM_STATUS=n
CONFIG_ZMK_STUDIO=y