Skip to content

Commit

Permalink
slicemk: boards: enable RGB for 202205 and 202207 (to squash 2024-01-15)
Browse files Browse the repository at this point in the history
  • Loading branch information
xudongzheng committed Jan 15, 2024
1 parent 67e15ef commit 810de25
Show file tree
Hide file tree
Showing 8 changed files with 122 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/dts-v1/;
#include <nordic/nrf52833_qiaa.dtsi>

#include <dt-bindings/led/led.h>

/ {
model = "SliceMK ErgoDox 202205 Green";

Expand All @@ -11,6 +13,7 @@
zephyr,console = &cdc_acm_uart;

zmk,battery = &vbatt;
zmk,underglow = &led_strip;
};

leds {
Expand Down Expand Up @@ -72,3 +75,20 @@
};
};
};

&spi0 {
compatible = "nordic,nrf-spim";
status = "okay";
pinctrl-0 = <&spi0_default>;
pinctrl-names = "default";

led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";
reg = <0>;
spi-max-frequency = <4000000>;
chain-length = <4>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
#include "slicemk_ergodox_202205_green_common.dts"

/ {
EXT_POWER {
compatible = "zmk,ext-power-generic";
control-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
init-delay-ms = <50>;
};

ergodox_a: ergodox_a {
compatible = "ergodox-a";
#gpio-cells = <2>;
Expand All @@ -24,3 +30,15 @@
;
};
};

&pinctrl {
// Define an arbitrary unused pin for SCK as it's required for SPI. Define
// MOSI pin for LED data.
spi0_default: spi0_default {
group1 {
psels =
<NRF_PSEL(SPIM_SCK, 0, 4)>,
<NRF_PSEL(SPIM_MOSI, 0, 23)>;
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,10 @@ CONFIG_BT_CTLR_PHY_CODED=y

# Use internal RC for 32.768kHz.
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y

# Enable WS2812B underglow.
CONFIG_WS2812_STRIP=y
CONFIG_ZMK_RGB_UNDERGLOW=y
CONFIG_ZMK_RGB_UNDERGLOW_ON_START=n
CONFIG_ZMK_RGB_UNDERGLOW_HUE_START=300
CONFIG_ZMK_RGB_UNDERGLOW_BRT_START=50
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
#include "slicemk_ergodox_202205_green_common.dts"

/ {
EXT_POWER {
compatible = "zmk,ext-power-generic";
control-gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
init-delay-ms = <50>;
};

ergodox_a: ergodox_a {
compatible = "ergodox-a";
#gpio-cells = <2>;
Expand All @@ -24,3 +30,15 @@
;
};
};

&pinctrl {
// Define an arbitrary unused pin for SCK as it's required for SPI. Define
// MOSI pin for LED data.
spi0_default: spi0_default {
group1 {
psels =
<NRF_PSEL(SPIM_SCK, 0, 19)>,
<NRF_PSEL(SPIM_MOSI, 0, 20)>;
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,10 @@ CONFIG_BT_CTLR_PHY_CODED=y

# Use internal RC for 32.768kHz.
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y

# Enable WS2812B underglow.
CONFIG_WS2812_STRIP=y
CONFIG_ZMK_RGB_UNDERGLOW=y
CONFIG_ZMK_RGB_UNDERGLOW_ON_START=n
CONFIG_ZMK_RGB_UNDERGLOW_HUE_START=300
CONFIG_ZMK_RGB_UNDERGLOW_BRT_START=50
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/dts-v1/;
#include <nordic/nrf52833_qiaa.dtsi>

#include <dt-bindings/led/led.h>

/ {
model = "SliceMK ErgoDox 202207 Green";

Expand All @@ -11,12 +13,19 @@
zephyr,console = &cdc_acm_uart;

zmk,battery = &vbatt;
zmk,underglow = &led_strip;
};

// Use VDDHDIV5 for battery voltage.
vbatt: vbatt {
compatible = "zmk,battery-nrf-vddh";
};

EXT_POWER {
compatible = "zmk,ext-power-generic";
control-gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
init-delay-ms = <50>;
};
};

&adc {
Expand Down Expand Up @@ -57,3 +66,32 @@
};
};
};

&pinctrl {
// Define an arbitrary unused pin for SCK as it's required for SPI. Define
// MOSI pin for LED data.
spi0_default: spi0_default {
group1 {
psels =
<NRF_PSEL(SPIM_SCK, 0, 23)>,
<NRF_PSEL(SPIM_MOSI, 0, 20)>;
};
};
};

&spi0 {
compatible = "nordic,nrf-spim";
status = "okay";
pinctrl-0 = <&spi0_default>;
pinctrl-names = "default";

led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";
reg = <0>;
spi-max-frequency = <4000000>;
chain-length = <4>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,10 @@ CONFIG_BT_CTLR_TX_PWR_PLUS_8=y

# Include support for Coded PHY.
CONFIG_BT_CTLR_PHY_CODED=y

# Enable WS2812B underglow. TODO TODO TODO need pinctrl on 3.2, not 3.5
CONFIG_WS2812_STRIP=y
CONFIG_ZMK_RGB_UNDERGLOW=y
CONFIG_ZMK_RGB_UNDERGLOW_ON_START=n
CONFIG_ZMK_RGB_UNDERGLOW_HUE_START=300
CONFIG_ZMK_RGB_UNDERGLOW_BRT_START=50
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,10 @@ CONFIG_BT_CTLR_TX_PWR_PLUS_8=y

# Include support for Coded PHY.
CONFIG_BT_CTLR_PHY_CODED=y

# Enable WS2812B underglow.
CONFIG_WS2812_STRIP=y
CONFIG_ZMK_RGB_UNDERGLOW=y
CONFIG_ZMK_RGB_UNDERGLOW_ON_START=n
CONFIG_ZMK_RGB_UNDERGLOW_HUE_START=300
CONFIG_ZMK_RGB_UNDERGLOW_BRT_START=50

0 comments on commit 810de25

Please sign in to comment.