|
| 1 | +/* |
| 2 | +* |
| 3 | +* Copyright (c) 2023 The ZMK Contributors |
| 4 | +* SPDX-License-Identifier: MIT |
| 5 | +* |
| 6 | +*/ |
| 7 | + |
| 8 | +/dts-v1/; |
| 9 | +#include <nordic/nrf52840_qiaa.dtsi> |
| 10 | + |
| 11 | +#include <dt-bindings/led/led.h> |
| 12 | +#include <dt-bindings/zmk/matrix_transform.h> |
| 13 | + |
| 14 | +#include "adv360pro-pinctrl.dtsi" |
| 15 | + |
| 16 | +/ { |
| 17 | + model = "Adv360 Pro"; |
| 18 | + compatible = "kinesis,adv360pro"; |
| 19 | + |
| 20 | + chosen { |
| 21 | + zephyr,code-partition = &code_partition; |
| 22 | + zephyr,sram = &sram0; |
| 23 | + zephyr,flash = &flash0; |
| 24 | + zephyr,console = &cdc_acm_uart; |
| 25 | + zmk,kscan = &kscan0; |
| 26 | + zmk,backlight = &backlight; |
| 27 | + zmk,battery = &vbatt; |
| 28 | + zmk,matrix_transform = &default_transform; |
| 29 | + zmk,underglow = &led_strip; |
| 30 | + }; |
| 31 | + |
| 32 | + default_transform: keymap_transform_0 { |
| 33 | + compatible = "zmk,matrix-transform"; |
| 34 | + columns = <20>; |
| 35 | + rows = <5>; |
| 36 | + |
| 37 | + |
| 38 | + map = < |
| 39 | + RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(4,6) RC(4,13) RC(4,14) RC(4,15) RC(4,16) RC(4,17) RC(4,18) RC(4,19) |
| 40 | + RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,13) RC(3,14) RC(3,15) RC(3,16) RC(3,17) RC(3,18) RC(3,19) |
| 41 | + RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,8) RC(2,9) RC(2,10) RC(2,11) RC(2,13) RC(2,14) RC(2,15) RC(2,16) RC(2,17) RC(2,18) RC(2,19) |
| 42 | + RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,9) RC(1,10) RC(1,14) RC(1,15) RC(1,16) RC(1,17) RC(1,18) RC(1,19) |
| 43 | + RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11) RC(0,12) RC(0,15) RC(0,16) RC(0,17) RC(0,18) RC(0,19) |
| 44 | + |
| 45 | + >; |
| 46 | + }; |
| 47 | + ext-power { |
| 48 | + compatible = "zmk,ext-power-generic"; |
| 49 | + label = "EXT_POWER"; |
| 50 | + control-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; |
| 51 | + }; |
| 52 | + |
| 53 | + vbatt: vbatt { |
| 54 | + compatible = "zmk,battery-voltage-divider"; |
| 55 | + io-channels = <&adc 2>; |
| 56 | + output-ohms = <100000>; |
| 57 | + full-ohms = <(100000 + 100000)>; |
| 58 | + }; |
| 59 | + |
| 60 | + backlight: pwmleds { |
| 61 | + compatible = "pwm-leds"; |
| 62 | + pwm_led_0 { |
| 63 | + pwms = <&pwm0 0 10000 PWM_POLARITY_NORMAL>; |
| 64 | + }; |
| 65 | + }; |
| 66 | + |
| 67 | +}; |
| 68 | + |
| 69 | +&pwm0 { |
| 70 | + status = "okay"; |
| 71 | + pinctrl-0 = <&pwm0_default>; |
| 72 | + pinctrl-1 = <&pwm0_sleep>; |
| 73 | + pinctrl-names = "default", "sleep"; |
| 74 | +}; |
| 75 | + |
| 76 | +&adc { |
| 77 | + status = "okay"; |
| 78 | +}; |
| 79 | + |
| 80 | +&gpiote { |
| 81 | + status = "okay"; |
| 82 | +}; |
| 83 | + |
| 84 | +&gpio0 { |
| 85 | + status = "okay"; |
| 86 | +}; |
| 87 | + |
| 88 | +&gpio1 { |
| 89 | + status = "okay"; |
| 90 | +}; |
| 91 | + |
| 92 | +&usbd { |
| 93 | + status = "okay"; |
| 94 | + cdc_acm_uart: cdc_acm_uart { |
| 95 | + compatible = "zephyr,cdc-acm-uart"; |
| 96 | + }; |
| 97 | +}; |
| 98 | + |
| 99 | +&flash0 { |
| 100 | + /* |
| 101 | + * For more information, see: |
| 102 | + * http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html |
| 103 | + */ |
| 104 | + partitions { |
| 105 | + compatible = "fixed-partitions"; |
| 106 | + #address-cells = <1>; |
| 107 | + #size-cells = <1>; |
| 108 | + |
| 109 | + sd_partition: partition@0 { |
| 110 | + label = "softdevice"; |
| 111 | + reg = <0x00000000 0x00026000>; |
| 112 | + }; |
| 113 | + code_partition: partition@26000 { |
| 114 | + label = "code_partition"; |
| 115 | + reg = <0x00026000 0x000c6000>; |
| 116 | + }; |
| 117 | + |
| 118 | + /* |
| 119 | + * The flash starting at 0x000ec000 and ending at |
| 120 | + * 0x000f3fff is reserved for use by the application. |
| 121 | + */ |
| 122 | + |
| 123 | + /* |
| 124 | + * Storage partition will be used by FCB/LittleFS/NVS |
| 125 | + * if enabled. |
| 126 | + */ |
| 127 | + storage_partition: partition@ec000 { |
| 128 | + label = "storage"; |
| 129 | + reg = <0x000ec000 0x00008000>; |
| 130 | + }; |
| 131 | + |
| 132 | + boot_partition: partition@f4000 { |
| 133 | + label = "adafruit_boot"; |
| 134 | + reg = <0x000f4000 0x0000c000>; |
| 135 | + }; |
| 136 | + }; |
| 137 | +}; |
| 138 | + |
| 139 | +&spi3 { |
| 140 | + compatible = "nordic,nrf-spim"; |
| 141 | + status = "okay"; |
| 142 | + pinctrl-0 = <&spi3_default>; |
| 143 | + pinctrl-1 = <&spi3_sleep>; |
| 144 | + pinctrl-names = "default", "sleep"; |
| 145 | + |
| 146 | + led_strip: ws2812@0 { |
| 147 | + compatible = "worldsemi,ws2812-spi"; |
| 148 | + label = "WS2812"; |
| 149 | + |
| 150 | + /* SPI */ |
| 151 | + reg = <0>; |
| 152 | + spi-max-frequency = <4000000>; |
| 153 | + |
| 154 | + /* WS2812 */ |
| 155 | + chain-length = <3>; /* number of LEDs */ |
| 156 | + spi-one-frame = <0x70>; |
| 157 | + spi-zero-frame = <0x40>; |
| 158 | + |
| 159 | + color-mapping = <LED_COLOR_ID_GREEN |
| 160 | + LED_COLOR_ID_RED |
| 161 | + LED_COLOR_ID_BLUE>; |
| 162 | + }; |
| 163 | +}; |
0 commit comments