diff options
author | CrossR <r.cross@lancaster.ac.uk> | 2020-08-16 12:44:18 +0100 |
---|---|---|
committer | CrossR <r.cross@lancaster.ac.uk> | 2020-08-16 12:44:18 +0100 |
commit | 892394d9e6b795f3f7c60e5e4d433760b5fc64ed (patch) | |
tree | 766558da1d5f4c6ece9e8de6de19204432c35b02 /app/boards/shields/sofle | |
parent | e593e971ecf5c442b3c558676a9248b71b2aae4d (diff) |
Update to include missing encoder config.
Diffstat (limited to 'app/boards/shields/sofle')
-rw-r--r-- | app/boards/shields/sofle/Kconfig.defconfig | 2 | ||||
-rw-r--r-- | app/boards/shields/sofle/sofle.conf | 4 | ||||
-rw-r--r-- | app/boards/shields/sofle/sofle.dtsi | 25 |
3 files changed, 28 insertions, 3 deletions
diff --git a/app/boards/shields/sofle/Kconfig.defconfig b/app/boards/shields/sofle/Kconfig.defconfig index 4437868..2ccf147 100644 --- a/app/boards/shields/sofle/Kconfig.defconfig +++ b/app/boards/shields/sofle/Kconfig.defconfig @@ -3,14 +3,12 @@ if SHIELD_SOFLE_LEFT config ZMK_KEYBOARD_NAME default "Sofle Left" - endif if SHIELD_SOFLE_RIGHT config ZMK_KEYBOARD_NAME default "Sofle Right" - endif if SHIELD_SOFLE_LEFT || SHIELD_SOFLE_RIGHT diff --git a/app/boards/shields/sofle/sofle.conf b/app/boards/shields/sofle/sofle.conf index 60c20dc..2194add 100644 --- a/app/boards/shields/sofle/sofle.conf +++ b/app/boards/shields/sofle/sofle.conf @@ -1,2 +1,6 @@ # 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 diff --git a/app/boards/shields/sofle/sofle.dtsi b/app/boards/shields/sofle/sofle.dtsi index dfa001c..cfd7a95 100644 --- a/app/boards/shields/sofle/sofle.dtsi +++ b/app/boards/shields/sofle/sofle.dtsi @@ -42,7 +42,30 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) , <&pro_micro_d 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> , <&pro_micro_d 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> ; - + }; + + // TODO: Check these pins! + left_encoder: encoder_left { + compatible = "alps,ec11"; + label = "LEFT_ENCODER"; + a-gpios = <&pro_micro_d 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&pro_micro_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + resolution = <4>; + status = "disabled"; + }; + + right_encoder: encoder_right { + compatible = "alps,ec11"; + label = "RIGHT_ENCODER"; + a-gpios = <&pro_micro_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&pro_micro_d 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + resolution = <4>; + status = "disabled"; + }; + + sensors { + compatible = "zmk,keymap-sensors"; + sensors = <&left_encoder &right_encoder>; }; }; |