zmk/app/boards/arm/glove80_v0/glove80_v0_rh.dts
2022-12-24 13:00:14 +09:00

120 lines
2.7 KiB
Text

/*
* Copyright (c) 2021 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include <dt-bindings/led/led.h>
#include "glove80_v0.dtsi"
/ {
model = "glove80_v0_rh";
compatible = "glove80_v0_rh";
chosen {
zmk,underglow = &led_strip;
zmk,backlight = &power_led_backlight;
zmk,battery = &vbatt;
};
leds {
compatible = "gpio-leds";
red_led: led_0 {
gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
label = "Red LED";
};
};
power_led_backlight: pwmleds {
compatible = "pwm-leds";
label = "Backlight LEDs";
pwm_led_0 {
pwms = <&pwm0 20>;
label = "Power Led Backlight";
};
};
ext-power {
compatible = "zmk,ext-power-generic";
label = "EXT_POWER";
control-gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>; /**[SC] WS2812_CE */
init-delay-ms = <10>;
};
vbatt: vbatt-divider {
compatible = "zmk,battery-voltage-divider";
label = "BATTERY";
io-channels = <&adc 5>;
output-ohms = <820000>; /** Double check that this is right */
full-ohms = <(1500000 + 820000)>;
};
vbatt-vddh {
compatible = "zmk,battery-nrf-vddh";
label = "BATTERY-VDDH";
};
};
&spi1 {
compatible = "nordic,nrf-spim";
/* Cannot be used together with i2c0. */
status = "okay";
mosi-pin = <13>;
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.
sck-pin = <24>; // NC
miso-pin = <25>; // NC
led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";
label = "WS2812C-2020";
/* SPI */
reg = <0>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <2000000>;
/* WS2812 */
chain-length = <40>;
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
&pwm0 {
status = "okay";
ch0-pin = <20>; /* 32 * 0 + 20 */
};
// [SC] Not sure if this section is necessary
&uart0 {
compatible = "nordic,nrf-uarte";
tx-pin = <6>;
rx-pin = <8>;
};
&default_transform {
col-offset = <7>;
};
&kscan0 {
row-gpios
= <&gpio0 26 GPIO_ACTIVE_HIGH> // RH ROW1
, <&gpio0 5 GPIO_ACTIVE_HIGH> // RH ROW2
, <&gpio0 7 GPIO_ACTIVE_HIGH> // RH ROW3
, <&gpio1 8 GPIO_ACTIVE_HIGH> // RH ROW4
, <&gpio0 11 GPIO_ACTIVE_HIGH> // RH ROW5
, <&gpio0 12 GPIO_ACTIVE_HIGH> // RH ROW6
;
col-gpios
= <&gpio0 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // RH Thumb
, <&gpio1 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // RH COL1
, <&gpio1 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // RH COL2
, <&gpio1 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // RH COL3
, <&gpio1 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // RH COL4
, <&gpio1 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // RH COL5
, <&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // RH COL6
;
};