/* * Copyright (c) 2021 The ZMK Contributors * * SPDX-License-Identifier: MIT */ /dts-v1/; #include #include #include "glove80_v0.dtsi" / { model = "glove80_v0_lh"; compatible = "glove80_v0_lh"; chosen { zmk,underglow = &led_strip; zmk,backlight = &power_led_backlight; zmk,battery = &vbatt; zmk,underglow-indicators = &underglow_indicators; }; leds { compatible = "gpio-leds"; red_led: led_0 { gpios = <&gpio1 10 GPIO_ACTIVE_HIGH >; label = "Red LED"; }; }; power_led_backlight: pwmleds { compatible = "pwm-leds"; label = "Backlight LEDs"; pwm_led_0 { pwms = <&pwm0 42>; label = "Power Led Backlight"; }; }; ext-power { compatible = "zmk,ext-power-generic"; label = "EXT_POWER"; control-gpios = <&gpio0 30 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"; }; /* MoErgo 40 LEDs 34 28 22 16 10 35 29 23 17 11 6 36 30 24 18 12 7 37 31 25 19 13 8 38 32 26 20 14 9 39 33 27 21 15 0 1 2 3 4 5 */ underglow_indicators: underglow-indicators { compatible = "zmk,underglow-indicators"; layer-state = <35 29 23 17 11 6>; bat-lhs = <36 30 24 18 12 7>; bat-rhs = <37 31 25 19 13 8>; capslock = <22>; numlock = <16>; scrolllock = <10>; ble-state = <3 4 0 1>; usb-state = <5>; output-fallback = <15>; }; }; &spi1 { compatible = "nordic,nrf-spim"; /* Cannot be used together with i2c0. */ status = "okay"; mosi-pin = <27>; // 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>; /* 18 keys have underglow at the moment */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; color-mapping = ; }; }; &pwm0 { status = "okay"; ch0-pin = <42>; /* 32 * 1 + 10 */ }; // [SC] Not sure if this section is necessary &uart0 { compatible = "nordic,nrf-uarte"; tx-pin = <6>; rx-pin = <8>; }; &kscan0 { row-gpios = <&gpio0 26 GPIO_ACTIVE_HIGH> // LH ROW1 , <&gpio0 5 GPIO_ACTIVE_HIGH> // LH ROW2 , <&gpio0 7 GPIO_ACTIVE_HIGH> // LH ROW3 , <&gpio1 8 GPIO_ACTIVE_HIGH> // LH ROW4 , <&gpio0 11 GPIO_ACTIVE_HIGH> // LH ROW5 , <&gpio0 12 GPIO_ACTIVE_HIGH> // LH ROW6 ; col-gpios = <&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // LH COL6 , <&gpio1 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // LH COL5 , <&gpio1 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // LH COL4 , <&gpio1 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // LH COL3 , <&gpio1 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // LH COL2 , <&gpio1 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // LH COL1 , <&gpio0 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // LH Thumb ; };