diff options
author | Kjetil Orbekk <kj@orbekk.com> | 2022-04-10 13:25:28 -0400 |
---|---|---|
committer | Kjetil Orbekk <kj@orbekk.com> | 2022-04-10 13:25:28 -0400 |
commit | 48801d85562176cc7c37ab0b405d8de91d5ddbfd (patch) | |
tree | 96b8ec5dcd6389c5c3208a64c865df6480d7799e | |
parent | 540690d0d0820668128a196bd8b079939e37e699 (diff) |
configure backlight on reviung41
-rw-r--r-- | build.yaml | 2 | ||||
-rw-r--r-- | config/reviung41.conf | 7 | ||||
-rw-r--r-- | config/reviung41.keymap | 37 |
3 files changed, 42 insertions, 4 deletions
@@ -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 <dt-bindings/zmk/keys.h> #include <dt-bindings/zmk/bt.h> #include <dt-bindings/zmk/rgb.h> +#include <dt-bindings/led/led.h> + +&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 = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>; + }; +}; + +/ { + 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 >; |