Skip to content

Commit

Permalink
first attempt to integrate NiceView on Left Half
Browse files Browse the repository at this point in the history
  • Loading branch information
sidx64 committed Jan 26, 2024
1 parent 5c7aa8b commit b4a511d
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 11 deletions.
27 changes: 27 additions & 0 deletions config/boards/shields/corny/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
53 changes: 47 additions & 6 deletions config/boards/shields/corny/corny.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <NRF_PSEL(SPIM_SCK, 0, 5)>,
<NRF_PSEL(SPIM_MOSI, 0, 4)>,
<NRF_PSEL(SPIM_MISO, 0, 8)>;
};
};
spi0_sleep: spi0_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 5)>,
<NRF_PSEL(SPIM_MOSI, 0, 4)>,
<NRF_PSEL(SPIM_MISO, 0, 8)>;
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 {
Expand All @@ -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 = &sharp;
};
};

&usbd {
status = "okay";
};
9 changes: 7 additions & 2 deletions config/boards/shields/corny/corny_left.conf
Original file line number Diff line number Diff line change
@@ -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
8 changes: 5 additions & 3 deletions config/boards/shields/corny/corny_left.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
;
};

&left_encoder {
status = "okay";
};
/*
* &left_encoder {
* status = "okay";
* };
*/

0 comments on commit b4a511d

Please sign in to comment.