From 48801d85562176cc7c37ab0b405d8de91d5ddbfd Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Sun, 10 Apr 2022 13:25:28 -0400 Subject: configure backlight on reviung41 --- build.yaml | 2 +- config/reviung41.conf | 7 +++++++ config/reviung41.keymap | 37 ++++++++++++++++++++++++++++++++++--- 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/build.yaml b/build.yaml index 869a360..7f0a3cc 100644 --- a/build.yaml +++ b/build.yaml @@ -14,5 +14,5 @@ --- include: - board: planck_rev6 - - board: nice_nano + - board: nice_nano_v2 shield: reviung41 diff --git a/config/reviung41.conf b/config/reviung41.conf index 827b9c6..b516c23 100644 --- a/config/reviung41.conf +++ b/config/reviung41.conf @@ -1,3 +1,10 @@ # Uncomment the following lines to enable RGB underglow CONFIG_ZMK_RGB_UNDERGLOW=y CONFIG_WS2812_STRIP=y + +CONFIG_ZMK_RGB_UNDERGLOW_ON_START=y +CONFIG_ZMK_RGB_UNDERGLOW_EFF_START=0 +CONFIG_ZMK_RGB_UNDERGLOW_SPD_START=1 +CONFIG_ZMK_RGB_UNDERGLOW_BRT_START=10 +CONFIG_ZMK_RGB_UNDERGLOW_SAT_START=10 +CONFIG_ZMK_RGB_UNDERGLOW_HUE_START=0 diff --git a/config/reviung41.keymap b/config/reviung41.keymap index 12f4b8b..5566948 100644 --- a/config/reviung41.keymap +++ b/config/reviung41.keymap @@ -8,6 +8,37 @@ #include #include #include +#include + +&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 = <11>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + color-mapping = ; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; #define QW 0 #define DV 1 @@ -107,9 +138,9 @@ function_layer { bindings = < -&trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &trans -&trans &kp F11 &kp F12 &trans &caps_word &trans &trans &caps_word &trans &trans &trans &trans -&trans &bootloader &trans &trans &to DV &to QW &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &bt BT_CLR +&trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &trans +&trans &kp F11 &kp F12 &trans &to DV &to QW &trans &rgb_ug RGB_TOG &trans &rgb_ug RGB_EFF &rgb_ug RGB_HUI &rgb_ug RGB_SAI &rgb_ug RGB_BRI +&bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &bt BT_CLR &trans &trans &rgb_ug RGB_EFR &rgb_ug RGB_HUD &rgb_ug RGB_SAD &rgb_ug RGB_BRD &trans &trans &trans &trans &trans >; -- cgit v1.2.3