From 6e037d55a404be34924149b96738499ce11cd30b Mon Sep 17 00:00:00 2001 From: Marco Massarelli <60667061+ceoloide@users.noreply.github.com> Date: Mon, 8 Jan 2024 01:46:52 +0000 Subject: [PATCH] Add display SPI setup --- .../shields/corney_island/Kconfig.defconfig | 44 ++++++++++++++++--- .../shields/corney_island/corney_island.dtsi | 32 ++++++++++++++ 2 files changed, 69 insertions(+), 7 deletions(-) diff --git a/boards/shields/corney_island/Kconfig.defconfig b/boards/shields/corney_island/Kconfig.defconfig index a19ea11..32865cf 100644 --- a/boards/shields/corney_island/Kconfig.defconfig +++ b/boards/shields/corney_island/Kconfig.defconfig @@ -1,16 +1,46 @@ if SHIELD_CORNEY_ISLAND_LEFT -config ZMK_KEYBOARD_NAME - default "Corney Island" + config ZMK_KEYBOARD_NAME + default "Corney Island" -config ZMK_SPLIT_ROLE_CENTRAL - default y + config ZMK_SPLIT_ROLE_CENTRAL + default y -endif +endif # SHIELD_CORNEY_ISLAND_LEFT if SHIELD_CORNEY_ISLAND_LEFT || SHIELD_CORNEY_ISLAND_RIGHT -config ZMK_SPLIT - default y + config ZMK_SPLIT + default y + + if ZMK_DISPLAY + + config I2C + default y + + config SSD1306 + default y + + config SSD1306_REVERSE_MODE + default y + + endif # ZMK_DISPLAY + + if LVGL + + config LV_Z_VDB_SIZE + default 64 + + config LV_Z_DPI + default 148 + + config LV_Z_BITS_PER_PIXEL + default 1 + + choice LV_COLOR_DEPTH + default LV_COLOR_DEPTH_1 + endchoice + + endif # LVGL endif \ No newline at end of file diff --git a/boards/shields/corney_island/corney_island.dtsi b/boards/shields/corney_island/corney_island.dtsi index d12d79d..d6341cc 100644 --- a/boards/shields/corney_island/corney_island.dtsi +++ b/boards/shields/corney_island/corney_island.dtsi @@ -34,3 +34,35 @@ RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) ; }; }; + +// sck= SCL +// mosi= SDA +&pinctrl { + spi0_default: spi0_default { + group1 { + psels = , + , + ; + }; + }; + spi0_sleep: spi0_sleep { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; +}; + +nice_view_spi: &spi0 { + compatible = "nordic,nrf-spim"; + pinctrl-0 = <&spi0_default>; + pinctrl-1 = <&spi0_sleep>; + pinctrl-names = "default", "sleep"; + cs-gpios = <&pro_micro 4 GPIO_ACTIVE_HIGH>; //HAND +}; + +&pro_micro_i2c { + status = "disabled"; +}; \ No newline at end of file