feat(boards): Add BDN9 rev2 RGB support

This commit is contained in:
Peter Johanson 2022-04-08 01:59:19 +00:00 committed by Pete Johanson
parent 32c8737a22
commit 22c487f276
3 changed files with 32 additions and 14 deletions

View file

@ -1,6 +1,6 @@
# keeb.io BDN9 board configuration # keeb.io BDN9 board configuration
# Copyright (c) 2020 Pete Johanson # Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
if BOARD_BDN9 if BOARD_BDN9
@ -14,4 +14,8 @@ config ZMK_KEYBOARD_NAME
config ZMK_USB config ZMK_USB
default y default y
config ZMK_RGB_UNDERGLOW
select SPI
select WS2812_STRIP
endif # BOARD_BDN9 endif # BOARD_BDN9

View file

@ -0,0 +1,5 @@
# Copyright (c) 2022 The ZMK Contributors
# SPDX-License-Identifier: MIT
# Uncomment the line below to enable RGB.
# CONFIG_ZMK_RGB_UNDERGLOW=y

View file

@ -18,9 +18,7 @@
zephyr,flash = &flash0; zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart; zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan; zmk,kscan = &kscan;
/* TODO: Enable once the GPIO bitbanging driver supports STM32
zmk,underglow = &led_strip; zmk,underglow = &led_strip;
*/
}; };
kscan: kscan { kscan: kscan {
@ -40,17 +38,6 @@
; ;
}; };
/*
led_strip: ws2812 {
compatible = "worldsemi,ws2812-gpio";
label = "WS2812";
in-gpios = <&gpiob 15 0>;
chain-length = <9>;
};
*/
left_encoder: encoder_left { left_encoder: encoder_left {
compatible = "alps,ec11"; compatible = "alps,ec11";
label = "LEFT_ENCODER"; label = "LEFT_ENCODER";
@ -83,6 +70,28 @@
}; };
}; };
&spi2 {
status = "okay";
pinctrl-0 = <&spi2_sck_pb13 &spi2_miso_pb14 &spi2_mosi_pb15>;
pinctrl-names = "default";
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 = <9>;
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
&clk_hsi { &clk_hsi {
status = "okay"; status = "okay";
}; };