zmk/app/boards/arm/ckp/ckp.dtsi
ReFil db08e041c6
feat(boards): Polarity works CKP Series
Adds support for the CKP family of boards
BT60V2 ANSIHotswap, ISO Hotswap, ANSI Lowpro and soldered
BT65 ANSI Hotswap, ISO Hotswap and soldered
BT75 ANSI Hotswap and soldered

The BT65 and BT75 are stylised as btXX_v1 in order to maintain compatibility with customers existing zmk-config setups in the same way the BT60 V1 was handled when merged into main.

CKP boards have identical pinmapping between hotswap and soldered so there's only one set of defconfig, dts, keymap, yaml and yml files per size
2023-04-25 13:37:33 -04:00

218 lines
5.3 KiB
Plaintext

/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include <dt-bindings/led/led.h>
#include <dt-bindings/zmk/matrix_transform.h>
#include "ckp-pinctrl.dtsi"
/ {
model = "CKP";
compatible = "polarityworks,ckp";
chosen {
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zmk,kscan = &kscan0;
zmk,underglow = &led_strip;
zmk,backlight = &backlight;
zmk,battery = &vbatt;
};
sensors {
compatible = "zmk,keymap-sensors";
sensors = <&encoder_1>;
};
kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";
col-gpios
= <&gpio1 11 GPIO_ACTIVE_HIGH>
, <&gpio1 10 GPIO_ACTIVE_HIGH>
, <&gpio1 13 GPIO_ACTIVE_HIGH>
, <&gpio1 15 GPIO_ACTIVE_HIGH>
, <&gpio0 3 GPIO_ACTIVE_HIGH>
, <&gpio0 2 GPIO_ACTIVE_HIGH>
, <&gpio0 28 GPIO_ACTIVE_HIGH>
, <&gpio0 29 GPIO_ACTIVE_HIGH>
, <&gpio0 30 GPIO_ACTIVE_HIGH>
, <&gpio0 31 GPIO_ACTIVE_HIGH>
, <&gpio0 5 GPIO_ACTIVE_HIGH>
, <&gpio0 7 GPIO_ACTIVE_HIGH>
, <&gpio1 9 GPIO_ACTIVE_HIGH>
, <&gpio0 12 GPIO_ACTIVE_HIGH>
, <&gpio0 23 GPIO_ACTIVE_HIGH>
, <&gpio1 6 GPIO_ACTIVE_HIGH>
;
row-gpios
= <&gpio0 22 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio1 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio1 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio1 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio1 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
ext-power {
compatible = "zmk,ext-power-generic";
label = "EXT_POWER";
control-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
};
encoder_1: encoder_1 {
compatible = "alps,ec11";
label = "ENCODER_ONE";
a-gpios = <&gpio0 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&gpio0 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
status = "okay";
};
encoder_2: encoder_2 {
compatible = "alps,ec11";
label = "ENCODER_TWO";
a-gpios = <&gpio0 26 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&gpio0 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
status = "okay";
};
encoder_3: encoder_3 {
compatible = "alps,ec11";
label = "encoder_3";
a-gpios = <&gpio0 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&gpio0 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
status = "okay";
};
backlight: pwmleds {
compatible = "pwm-leds";
label = "Backlight LEDs";
pwm_led_0 {
pwms = <&pwm0 0 10000 PWM_POLARITY_NORMAL>;
};
};
leds {
compatible = "gpio-leds";
blue_led: led_0 {
gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
label = "Blue LED";
};
};
vbatt: vbatt {
compatible = "zmk,battery-voltage-divider";
label = "VBATT";
io-channels = <&adc 2>;
output-ohms = <100000>;
full-ohms = <(100000 + 100000)>;
};
};
&adc {
status = "okay";
};
&pwm0 {
status = "okay";
pinctrl-0 = <&pwm0_default>;
pinctrl-1 = <&pwm0_sleep>;
pinctrl-names = "default", "sleep";
};
&gpiote {
status = "okay";
};
&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};
&usbd {
status = "okay";
};
&flash0 {
/*
* For more information, see:
* http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html
*/
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
sd_partition: partition@0 {
label = "softdevice";
reg = <0x00000000 0x00026000>;
};
code_partition: partition@26000 {
label = "code_partition";
reg = <0x00026000 0x000c6000>;
};
/*
* The flash starting at 0x000ec000 and ending at
* 0x000f3fff is reserved for use by the application.
*/
/*
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@ec000 {
label = "storage";
reg = <0x000ec000 0x00008000>;
};
boot_partition: partition@f4000 {
label = "adafruit_boot";
reg = <0x000f4000 0x0000c000>;
};
};
};
&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";
label = "WS2812";
/* SPI */
reg = <0>;
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <12>; /* number of LEDs */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN
LED_COLOR_ID_RED
LED_COLOR_ID_BLUE>;
};
};