119 lines
2.7 KiB
Text
119 lines
2.7 KiB
Text
/*
|
|
* Copyright (c) 2021 The ZMK Contributors
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#include <dt-bindings/led/led.h>
|
|
|
|
/ {
|
|
chosen {
|
|
zephyr,console = &cdc_acm_uart;
|
|
zmk,battery = &vbatt;
|
|
zmk,underglow = &led_strip;
|
|
};
|
|
|
|
vbatt: vbatt {
|
|
compatible = "zmk,battery-voltage-divider";
|
|
label = "BATTERY";
|
|
io-channels = <&adc 7>;
|
|
power-gpios = <&gpio0 14 (GPIO_OPEN_DRAIN | GPIO_ACTIVE_LOW)>;
|
|
output-ohms = <510000>;
|
|
full-ohms = <(1000000 + 510000)>;
|
|
};
|
|
};
|
|
|
|
&adc {
|
|
status = "okay";
|
|
};
|
|
|
|
&usbd {
|
|
cdc_acm_uart: cdc_acm_uart {
|
|
compatible = "zephyr,cdc-acm-uart";
|
|
label = "CDC_ACM_0";
|
|
};
|
|
};
|
|
|
|
|
|
&leds {
|
|
compatible = "gpio-leds";
|
|
blue_led: led_0 {
|
|
gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
|
|
label = "Blue LED";
|
|
};
|
|
};
|
|
&pinctrl {
|
|
spi3_default: spi3_default {
|
|
group1 {
|
|
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
|
|
};
|
|
};
|
|
|
|
spi3_sleep: spi3_sleep {
|
|
group1 {
|
|
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
|
|
low-power-enable;
|
|
};
|
|
};
|
|
};
|
|
&i2c0 {
|
|
compatible = "nordic,nrf-twi";
|
|
pinctrl-0 = <&i2c0_default>;
|
|
pinctrl-1 = <&i2c0_sleep>;
|
|
pinctrl-names = "default", "sleep";
|
|
};
|
|
&uart0 {
|
|
compatible = "nordic,nrf-uarte";
|
|
current-speed = <115200>;
|
|
pinctrl-0 = <&uart0_default>;
|
|
pinctrl-1 = <&uart0_sleep>;
|
|
pinctrl-names = "default", "sleep";
|
|
};
|
|
&spi3 {
|
|
compatible = "nordic,nrf-spim";
|
|
status = "okay";
|
|
|
|
pinctrl-0 = <&spi3_default>;
|
|
pinctrl-1 = <&spi3_sleep>;
|
|
pinctrl-names = "default", "sleep";
|
|
|
|
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 = <7>; /* arbitrary; change at will */
|
|
spi-one-frame = <0x70>;
|
|
spi-zero-frame = <0x40>;
|
|
|
|
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
|
|
};
|
|
};
|
|
&spi2 {
|
|
compatible = "nordic,nrf-spim";
|
|
status = "okay";
|
|
|
|
pinctrl-0 = <&spi2_default>;
|
|
pinctrl-1 = <&spi2_sleep>;
|
|
pinctrl-names = "default", "sleep";
|
|
|
|
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>; /* arbitrary; change at will */
|
|
spi-one-frame = <0x70>;
|
|
spi-zero-frame = <0x40>;
|
|
|
|
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
|
|
};
|
|
};
|