78 lines
1.8 KiB
Text
78 lines
1.8 KiB
Text
/*
|
|
* Copyright (c) 2021 Richard Titmuss
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#include "tornblue.dtsi"
|
|
|
|
&default_transform {
|
|
col-offset = <6>;
|
|
};
|
|
|
|
&kscan0 {
|
|
row-gpios
|
|
= <&gpio1 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
|
, <&gpio1 13 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
|
, <&gpio1 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
|
, <&gpio1 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
|
;
|
|
|
|
col-gpios
|
|
= <&gpio0 7 GPIO_ACTIVE_HIGH>
|
|
, <&gpio1 9 GPIO_ACTIVE_HIGH>
|
|
, <&gpio0 12 GPIO_ACTIVE_HIGH>
|
|
, <&gpio0 23 GPIO_ACTIVE_HIGH>
|
|
, <&gpio0 21 GPIO_ACTIVE_HIGH>
|
|
, <&gpio0 19 GPIO_ACTIVE_HIGH>
|
|
;
|
|
};
|
|
|
|
/ {
|
|
leds {
|
|
compatible = "gpio-leds";
|
|
led1: led1 {
|
|
gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
|
|
label = "LED 4"; /* D42 */
|
|
};
|
|
led2: led2 {
|
|
gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
|
|
label = "LED 5"; /* D43 */
|
|
};
|
|
led3: led3 {
|
|
gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
|
|
label = "LED 6"; /* D44 */
|
|
};
|
|
};
|
|
|
|
ext-power {
|
|
compatible = "zmk,ext-power-generic";
|
|
label = "EXT_POWER";
|
|
control-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
|
|
};
|
|
};
|
|
|
|
&spi0 {
|
|
compatible = "nordic,nrf-spim";
|
|
// Cannot be used together with i2c0
|
|
status = "okay";
|
|
mosi-pin = <22>;
|
|
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.
|
|
sck-pin = <27>;
|
|
miso-pin = <8>;
|
|
|
|
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 = <6>; /* LED strip length */
|
|
spi-one-frame = <0x70>;
|
|
spi-zero-frame = <0x40>;
|
|
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
|
|
};
|
|
};
|