92 lines
2.2 KiB
Devicetree
92 lines
2.2 KiB
Devicetree
/*
|
|
*
|
|
* Copyright (c) 2021 Darryl deHaan
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
#include "sofle.dtsi"
|
|
|
|
/{
|
|
chosen {
|
|
zmk,battery = &vbatt;
|
|
zmk,backlight = &backlight;
|
|
};
|
|
|
|
kscan0: kscan {
|
|
compatible = "zmk,kscan-gpio-matrix";
|
|
wakeup-source;
|
|
diode-direction = "col2row";
|
|
row-gpios
|
|
= <&gpio0 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
|
, <&gpio0 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
|
, <&gpio0 12 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
|
, <&gpio0 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
|
, <&gpio1 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
|
;
|
|
|
|
col-gpios
|
|
= <&gpio0 22 GPIO_ACTIVE_HIGH>
|
|
, <&gpio0 29 GPIO_ACTIVE_HIGH>
|
|
, <&gpio0 3 GPIO_ACTIVE_HIGH>
|
|
, <&gpio0 28 GPIO_ACTIVE_HIGH>
|
|
, <&gpio0 30 GPIO_ACTIVE_HIGH>
|
|
, <&gpio0 21 GPIO_ACTIVE_HIGH>
|
|
, <&gpio0 23 GPIO_ACTIVE_HIGH>
|
|
;
|
|
};
|
|
|
|
ext-power {
|
|
compatible = "zmk,ext-power-generic";
|
|
label = "EXT_POWER";
|
|
control-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
|
|
init-delay-ms = <50>;
|
|
};
|
|
|
|
vbatt: vbatt {
|
|
compatible = "zmk,battery-nrf-vddh";
|
|
// init-delay-ms = <50>;
|
|
};
|
|
|
|
};
|
|
&default_transform {
|
|
col-offset = <7>;
|
|
};
|
|
|
|
&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";
|
|
|
|
/* SPI */
|
|
reg = <0>; /* ignored, but necessary for SPI bindings */
|
|
spi-max-frequency = <4000000>;
|
|
|
|
/* WS2812 */
|
|
chain-length = <7>; /* 6 keys have underglow at the moment */
|
|
spi-one-frame = <0x70>;
|
|
spi-zero-frame = <0x40>;
|
|
|
|
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
|
|
};
|
|
};
|
|
&pinctrl {
|
|
// Other pinctrl definitions for other hardware
|
|
pwm0_default: pwm0_default {
|
|
group1 {
|
|
psels = <NRF_PSEL(PWM_OUT0, 1, 5)>;
|
|
};
|
|
};
|
|
pwm0_sleep: pwm0_sleep {
|
|
group1 {
|
|
psels = <NRF_PSEL(PWM_OUT0, 1, 5)>;
|
|
low-power-enable;
|
|
};
|
|
};
|
|
};
|