Skip to content

Commit

Permalink
Enable RGB
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonimbao committed Nov 12, 2023
1 parent b204052 commit 3e57e2c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
27 changes: 27 additions & 0 deletions config/boards/arm/mona_w/mona_w.dts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
zmk,battery = &vbatt;
zmk,underglow = &led_strip;
};

kscan0: kscan {
Expand Down Expand Up @@ -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 = <LED_COLOR_ID_GREEN
LED_COLOR_ID_RED
LED_COLOR_ID_BLUE>;
};
};

&flash0 {
/*
* For more information, see:
Expand Down
5 changes: 5 additions & 0 deletions config/boards/arm/mona_w/mona_w_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3e57e2c

Please sign in to comment.