feat(shields): Add RGB support to 2% Milk

Co-Authored-By: treezoob <98245530+treezoob@users.noreply.github.com>
This commit is contained in:
Kurtis Lew 2022-06-22 15:07:05 -07:00 committed by Nick Winans
parent da209c453e
commit ef3eb339ed
6 changed files with 163 additions and 0 deletions

View file

@ -0,0 +1,31 @@
#include <dt-bindings/led/led.h>
&spi1 {
compatible = "nordic,nrf-spim";
status = "okay";
mosi-pin = <9>;
// 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 = <2>;
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;
};
};

View file

@ -0,0 +1,31 @@
#include <dt-bindings/led/led.h>
&spi1 {
compatible = "nordic,nrf-spim";
status = "okay";
mosi-pin = <9>;
// 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 = <2>;
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;
};
};

View file

@ -0,0 +1,32 @@
#include <dt-bindings/led/led.h>
&spi1 {
compatible = "nordic,nrf-spim";
status = "okay";
mosi-pin = <43>;
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.
sck-pin = <12>; // 0.12 is not broken out on the nRFMicro
miso-pin = <22>; // 0.22 is not broken out on the nRFMicro
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 = <2>;
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;
};
};

View file

@ -0,0 +1,31 @@
#include <dt-bindings/led/led.h>
&spi1 {
compatible = "nordic,nrf-spim";
status = "okay";
mosi-pin = <38>;
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.
sck-pin = <12>; // 0.12 is not broken out on the nRFMicro
miso-pin = <22>; // 0.22 is not broken out on the nRFMicro
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 = <2>;
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;
};
};

View file

@ -0,0 +1,31 @@
#include <dt-bindings/led/led.h>
&spi1 {
compatible = "nordic,nrf-spim";
status = "okay";
mosi-pin = <43>;
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.
sck-pin = <12>; // 0.12 is not broken out on the nRFMicro
miso-pin = <22>; // 0.22 is not broken out on the nRFMicro
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 = <2>;
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;
};
};

View file

@ -1,2 +1,9 @@
# Copyright (c) 2022 The ZMK Contributors # Copyright (c) 2022 The ZMK Contributors
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
# Uncomment the following lines to enable RGB Underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y
# Uncomment the following line to turn on logging, and set ZMK logging to debug output
# CONFIG_ZMK_USB_LOGGING=y