From 1c5588d690cfd6e515c8da1e12b435be49668941 Mon Sep 17 00:00:00 2001 From: Joshua Whitley Date: Tue, 29 Mar 2022 00:10:06 -0500 Subject: [PATCH] Add RGB underglow. --- .../boards/nice_nano.overlay | 34 +++++++++++++++++++ .../sofle_rgb_keyhive/sofle_rgb_keyhive.conf | 12 +++++++ 2 files changed, 46 insertions(+) create mode 100644 app/boards/shields/sofle_rgb_keyhive/boards/nice_nano.overlay create mode 100644 app/boards/shields/sofle_rgb_keyhive/sofle_rgb_keyhive.conf diff --git a/app/boards/shields/sofle_rgb_keyhive/boards/nice_nano.overlay b/app/boards/shields/sofle_rgb_keyhive/boards/nice_nano.overlay new file mode 100644 index 00000000..fe6f5670 --- /dev/null +++ b/app/boards/shields/sofle_rgb_keyhive/boards/nice_nano.overlay @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + mosi-pin = <6>; + // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. + sck-pin = <5>; + miso-pin = <7>; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <16>; /* number of LEDs */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/app/boards/shields/sofle_rgb_keyhive/sofle_rgb_keyhive.conf b/app/boards/shields/sofle_rgb_keyhive/sofle_rgb_keyhive.conf new file mode 100644 index 00000000..f6fa868d --- /dev/null +++ b/app/boards/shields/sofle_rgb_keyhive/sofle_rgb_keyhive.conf @@ -0,0 +1,12 @@ +# Copyright (c) 2022, Josh Whitley +# SPDX-License-Identifier: MIT + +# Uncomment the following line to enable the Sofle OLED Display +# CONFIG_ZMK_DISPLAY=y + +# Uncomment the following two lines to enable the underglow LEDs +# CONFIG_ZMK_RGB_UNDERGLOW=y +# CONFIG_WS2812_STRIP=y + +CONFIG_EC11=y +CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y