diff --git a/config/boards/shields/corny/Kconfig.defconfig b/config/boards/shields/corny/Kconfig.defconfig index f2ae9bb..f5da484 100644 --- a/config/boards/shields/corny/Kconfig.defconfig +++ b/config/boards/shields/corny/Kconfig.defconfig @@ -13,4 +13,31 @@ if SHIELD_CORNY_LEFT || SHIELD_CORNY_RIGHT config ZMK_SPLIT default y +config ZMK_DISPLAY + select LV_FONT_MONTSERRAT_26 + +if ZMK_DISPLAY + +config SPI + default y + +config LS0XX + default y + +config LV_Z_BITS_PER_PIXEL + default 1 + +choice LV_COLOR_DEPTH + default LV_COLOR_DEPTH_1 + +endchoice + +config LV_DPI_DEF + default 30 + +config LV_Z_VDB_SIZE + default 16 + +endif # ZMK_DISPLAY + endif diff --git a/config/boards/shields/corny/corny.dtsi b/config/boards/shields/corny/corny.dtsi index 737b6e0..665729d 100644 --- a/config/boards/shields/corny/corny.dtsi +++ b/config/boards/shields/corny/corny.dtsi @@ -34,12 +34,43 @@ RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(3,5) RC(3,6) RC(2,6) RC(2,7) ; }; - left_encoder: encoder_left { - 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"; + &pinctrl { + spi0_default: spi0_default { + group1 { + psels = , + , + ; + }; + }; + spi0_sleep: spi0_sleep { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; + }; + + display_spi: &spi0 { + compatible = "nordic,nrf-spim"; + pinctrl-0 = <&spi0_default>; + pinctrl-1 = <&spi0_sleep>; + pinctrl-names = "default", "sleep"; + cs-gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>; + }; + + &display_spi { + status = "okay"; + sharp: ls0xx@0 { + compatible = "sharp,ls0xx"; + label = "DISPLAY"; + spi-max-frequency = <2000000>; + reg = <0>; + width = <160>; + height = <68>; + //disp-en-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; //testing setting this to 6 from 23 + }; }; right_encoder: encoder_right { @@ -56,3 +87,13 @@ RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(3,5) RC(3,6) RC(2,6) RC(2,7) triggers-per-rotation = <20>; }; }; + +/ { + chosen { + zephyr,display = ♯ + }; +}; + +&usbd { + status = "okay"; +}; \ No newline at end of file diff --git a/config/boards/shields/corny/corny_left.conf b/config/boards/shields/corny/corny_left.conf index 11c5f31..173f662 100644 --- a/config/boards/shields/corny/corny_left.conf +++ b/config/boards/shields/corny/corny_left.conf @@ -1,4 +1,9 @@ CONFIG_NFCT_PINS_AS_GPIOS=y -CONFIG_EC11=y -CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y +# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y CONFIG_ZMK_SLEEP=y + +# Nice!View +CONFIG_ZMK_DISPLAY=y +CONFIG_ZMK_DISPLAY_BLANK_ON_IDLE=n +CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_26=y +CONFIG_LV_FONT_DEFAULT_MONTSERRAT_26=y \ No newline at end of file diff --git a/config/boards/shields/corny/corny_left.overlay b/config/boards/shields/corny/corny_left.overlay index 6ec0d12..547eacb 100644 --- a/config/boards/shields/corny/corny_left.overlay +++ b/config/boards/shields/corny/corny_left.overlay @@ -11,6 +11,8 @@ ; }; -&left_encoder { - status = "okay"; -}; +/* + * &left_encoder { + * status = "okay"; + * }; + */