From 3e57e2c5e620fd70b2579d08f7bc52775e1f5e88 Mon Sep 17 00:00:00 2001 From: Ramon Imbao Date: Sun, 12 Nov 2023 13:25:13 +0800 Subject: [PATCH] Enable RGB --- config/boards/arm/mona_w/mona_w.dts | 27 +++++++++++++++++++++++ config/boards/arm/mona_w/mona_w_defconfig | 5 +++++ 2 files changed, 32 insertions(+) diff --git a/config/boards/arm/mona_w/mona_w.dts b/config/boards/arm/mona_w/mona_w.dts index 62f47fb..282ebf3 100644 --- a/config/boards/arm/mona_w/mona_w.dts +++ b/config/boards/arm/mona_w/mona_w.dts @@ -19,6 +19,7 @@ zmk,kscan = &kscan0; zmk,matrix_transform = &default_transform; zmk,battery = &vbatt; + zmk,underglow = &led_strip; }; kscan0: kscan { @@ -92,6 +93,32 @@ status = "okay"; }; +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + mosi-pin = <5>; + // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. + sck-pin = <6>; + miso-pin = <8>; + + 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>; + color-mapping = ; + }; +}; + &flash0 { /* * For more information, see: diff --git a/config/boards/arm/mona_w/mona_w_defconfig b/config/boards/arm/mona_w/mona_w_defconfig index 99d4fac..13c7b48 100644 --- a/config/boards/arm/mona_w/mona_w_defconfig +++ b/config/boards/arm/mona_w/mona_w_defconfig @@ -19,4 +19,9 @@ CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y +# Enable Underglow +CONFIG_ZMK_RGB_UNDERGLOW=y +CONFIG_WS2812_STRIP=y +CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=y + CONFIG_BUILD_OUTPUT_UF2=y \ No newline at end of file