Renew repo

This commit is contained in:
HeavyDutySoul 2023-10-06 17:27:41 +03:00
parent ca5c9b4ae6
commit 63d3058465
49 changed files with 997 additions and 613 deletions

View file

@ -0,0 +1,11 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/../tools/uf2/utils/uf2conv.py
-c
-b 0x26000
-f 0xADA52840
-o ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.uf2
${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.bin
)

View file

@ -0,0 +1,8 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
config BOARD_ENABLE_DCDC
bool "Enable DCDC mode"
select SOC_DCDC_NRF52X
default n
depends on BOARD_MDBT50Q

View file

@ -0,0 +1,9 @@
# Maker Diary nrf52840 M.2 board configuration
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
config BOARD_MDBT50Q
bool "mdbt50q"
depends on SOC_NRF52840_QIAA

View file

@ -0,0 +1,31 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
if BOARD_MDBT50Q
config BOARD
default "mdbt50q"
if USB
config USB_NRFX
default y
config USB_DEVICE_STACK
default y
endif # USB
config BT_CTLR
default BT
config ZMK_BLE
default y
config ZMK_USB
default n
config ZMK_SLEEP
default y
endif # BOARD_MDBT50Q

View file

@ -0,0 +1,7 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake)

View file

@ -0,0 +1,91 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
/ {
model = "Raytac mdbt50q module";
compatible = "raytac,mdbt50q";
chosen {
// zephyr,console = &uart0;
// zephyr,shell-uart = &uart0;
// zephyr,uart-mcumgr = &uart0;
// zephyr,bt-mon-uart = &uart0;
// zephyr,bt-c2h-uart = &uart0;
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
};
};
&adc {
status = "okay";
};
&gpiote {
status = "okay";
};
&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};
&uart0 {
compatible = "nordic,nrf-uarte";
current-speed = <115200>;
// status = "okay";
};
&usbd {
compatible = "nordic,nrf-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>;
};
};
};

View file

@ -0,0 +1,15 @@
identifier: mdbt50q
name: Raytac mdbt50q module
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- adc
- usb_device
- ble
- ieee802154
- pwm
- watchdog

View file

@ -0,0 +1,10 @@
file_format: "1"
id: mdbt50q
name: mdbt50q Module
type: board
arch: arm
outputs:
- usb
- ble
url: https://raytac.com
exposes: [raytac_mdbt50q]

View file

@ -0,0 +1,38 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
CONFIG_SOC_SERIES_NRF52X=y
CONFIG_SOC_NRF52840_QIAA=y
CONFIG_BOARD_MDBT50Q=y
# Enable MPU
CONFIG_ARM_MPU=y
# enable GPIO
CONFIG_GPIO=y
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_NVS=y
CONFIG_SETTINGS_NVS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_CLOCK_CONTROL_NRF=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
#CONFIG_SERIAL=y
#CONFIG_CONSOLE=y
#CONFIG_UART_CONSOLE=y
CONFIG_GPIO_AS_PINRESET=y
#CONFIG_BT_DEBUG_LOG=y
#CONFIG_LOG=y
#CONFIG_ZMK_LOG_LEVEL_DBG=y
#CONFIG_NVS_LOG_LEVEL_DBG=y
#CONFIG_USB=n
#CONFIG_HWINFO=y

View file

@ -31,7 +31,7 @@ config PINMUX
default y
choice BOARD_MIKOTO_CHARGER_CURRENT
default BOARD_MIKOTO_CHARGER_CURRENT_100MA
default BOARD_MIKOTO_CHARGER_CURRENT_40MA
endchoice
endif # BOARD_MIKOTO_520

View file

@ -18,7 +18,7 @@
, <3 0 &gpio0 20 0> /* D3 */
, <4 0 &gpio0 22 0> /* D4/A6 */
, <5 0 &gpio0 24 0> /* D5 */
, <6 0 &gpio1 0 0> /* D6/A7 */
, <6 0 &gpio1 8 0> /* D6/A7 */
, <7 0 &gpio1 2 0> /* D7 */
, <8 0 &gpio1 4 0> /* D8/A8 */
, <9 0 &gpio1 6 0> /* D9/A9 */

View file

@ -1,39 +0,0 @@
/*
* Copyright (c) 2022 The ZMK Contributors
* SPDX-License-Identifier: MIT
*/
&pinctrl {
uart0_default: uart0_default {
group1 {
psels = <NRF_PSEL(UART_RX, 0, 4)>;
bias-pull-up;
};
group2 {
psels = <NRF_PSEL(UART_TX, 0, 8)>;
};
};
uart0_sleep: uart0_sleep {
group1 {
psels = <NRF_PSEL(UART_RX, 0, 4)>,
<NRF_PSEL(UART_TX, 0, 8)>;
low-power-enable;
};
};
i2c0_default: i2c0_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 17)>,
<NRF_PSEL(TWIM_SCL, 0, 20)>;
};
};
i2c0_sleep: i2c0_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 17)>,
<NRF_PSEL(TWIM_SCL, 0, 20)>;
low-power-enable;
};
};
};

View file

@ -7,7 +7,6 @@
/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include "arduino_pro_micro_pins.dtsi"
#include "mikoto_520-pinctrl.dtsi"
/ {
model = "mikoto";
@ -63,17 +62,14 @@
&i2c0 {
compatible = "nordic,nrf-twi";
pinctrl-0 = <&i2c0_default>;
pinctrl-1 = <&i2c0_sleep>;
pinctrl-names = "default", "sleep";
sda-pin = <17>;
scl-pin = <20>;
};
&uart0 {
compatible = "nordic,nrf-uarte";
current-speed = <115200>;
pinctrl-0 = <&uart0_default>;
pinctrl-1 = <&uart0_sleep>;
pinctrl-names = "default", "sleep";
tx-pin = <8>;
rx-pin = <4>;
};
&usbd {
@ -96,12 +92,12 @@
#size-cells = <1>;
sd_partition: partition@0 {
label = "softdevice";
reg = <0x00000000 0x00026000>;
label = "mbr";
reg = <0x00000000 0x00001000>;
};
code_partition: partition@26000 {
code_partition: partition@1000 {
label = "code_partition";
reg = <0x00026000 0x000c6000>;
reg = <0x00001000 0x000d3000>;
};
/*

View file

@ -7,8 +7,6 @@ CONFIG_BOARD_MIKOTO_520=y
# Enable MPU
CONFIG_ARM_MPU=y
CONFIG_PINCTRL=y
# enable GPIO
CONFIG_GPIO=y

View file

@ -4,19 +4,19 @@
* SPDX-License-Identifier: MIT
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/init.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/sys/sys_io.h>
#include <zephyr/devicetree.h>
#include <kernel.h>
#include <device.h>
#include <init.h>
#include <drivers/gpio.h>
#include <sys/sys_io.h>
#include <devicetree.h>
static int pinmux_mikoto_init(const struct device *port) {
ARG_UNUSED(port);
#if CONFIG_BOARD_MIKOTO_520
const struct device *p0 = DEVICE_DT_GET(DT_NODELABEL(gpio0));
const struct device *p1 = DEVICE_DT_GET(DT_NODELABEL(gpio1));
const struct device *p0 = device_get_binding("GPIO_0");
const struct device *p1 = device_get_binding("GPIO_1");
#if CONFIG_BOARD_MIKOTO_CHARGER_CURRENT_40MA
gpio_pin_configure(p0, 26, GPIO_INPUT | GPIO_PULL_DOWN);
gpio_pin_configure(p1, 15, GPIO_INPUT);

View file

@ -28,17 +28,17 @@ endif # ZMK_DISPLAY
if LVGL
config LV_Z_VDB_SIZE
config LVGL_VDB_SIZE
default 64
config LV_Z_DPI
config LVGL_DPI
default 148
config LV_Z_BITS_PER_PIXEL
config LVGL_BITS_PER_PIXEL
default 1
choice LV_COLOR_DEPTH
default LV_COLOR_DEPTH_1
choice LVGL_COLOR_DEPTH
default LVGL_COLOR_DEPTH_1
endchoice
endif # LVGL

View file

@ -1,38 +1,24 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&spi3 {
&spi1 {
compatible = "nordic,nrf-spim";
/* Cannot be used together with i2c0. */
status = "okay";
pinctrl-0 = <&spi3_default>;
pinctrl-1 = <&spi3_sleep>;
pinctrl-names = "default", "sleep";
mosi-pin = <6>;
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.
sck-pin = <5>;
miso-pin = <7>;
led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";
label = "WS2812";
label = "SK6812mini";
/* SPI */
reg = <0>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>; /* arbitrary; change at will */
chain-length = <6>; /* There are per-key RGB, but the first 6 are underglow */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;

View file

@ -1,47 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View file

@ -10,10 +10,6 @@
col-offset = <6>;
};
&five_column_transform {
col-offset = <6>;
};
&kscan0 {
col-gpios
= <&pro_micro 14 GPIO_ACTIVE_HIGH>

View file

@ -29,17 +29,17 @@ endif # ZMK_DISPLAY
if LVGL
config LV_Z_VDB_SIZE
config LVGL_VDB_SIZE
default 64
config LV_Z_DPI
config LVGL_DPI
default 148
config LV_Z_BITS_PER_PIXEL
config LVGL_BITS_PER_PIXEL
default 1
choice LV_COLOR_DEPTH
default LV_COLOR_DEPTH_1
choice LVGL_COLOR_DEPTH
default LVGL_COLOR_DEPTH_1
endchoice
endif # LVGL

View file

@ -1,27 +1,18 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&spi3 {
&spi1 {
compatible = "nordic,nrf-spim";
status = "okay";
pinctrl-0 = <&spi3_default>;
pinctrl-1 = <&spi3_sleep>;
pinctrl-names = "default", "sleep";
mosi-pin = <6>;
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.
sck-pin = <5>;
miso-pin = <7>;
led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";
@ -32,10 +23,9 @@
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>; /* arbitrary; change at will */
chain-length = <5>; /* 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>;
};
};

View file

@ -1,47 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View file

@ -1,6 +1,9 @@
# Uncomment to enable encoder
# CONFIG_EC11=y
# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
CONFIG_ZMK_SLEEP=y
CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=1800000
CONFIG_ZMK_BATTERY_REPORT_INTERVAL=900
# Uncomment the following line to enable the Lily58 OLED Display
# CONFIG_ZMK_DISPLAY=y
CONFIG_ZMK_USB_INIT_PRIORITY=10
CONFIG_ZMK_BLE_INIT_PRIORITY=90
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y

View file

@ -8,7 +8,6 @@
/ {
chosen {
zephyr,display = &oled;
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};
@ -45,37 +44,4 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,5) RC(4,6) RC(3,6) RC(3,7)
;
};
left_encoder: encoder_left {
compatible = "alps,ec11";
label = "LEFT_ENCODER";
a-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
};
sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder>;
};
};
&pro_micro_i2c {
status = "okay";
oled: ssd1306@3c {
compatible = "solomon,ssd1306fb";
reg = <0x3c>;
label = "DISPLAY";
width = <128>;
height = <32>;
segment-offset = <0>;
page-offset = <0>;
display-offset = <0>;
multiplex-ratio = <31>;
segment-remap;
com-invdir;
com-sequential;
prechargep = <0x22>;
};
};

View file

@ -0,0 +1,56 @@
#define DFT 0
#define LWR 1
#define RSE 2
#define ADJ 3
#define Z_BOOT &bootloader
#define Z_BT_0 &bt BT_SEL 0
#define Z_BT_1 &bt BT_SEL 1
#define Z_BT_2 &bt BT_SEL 2
#define Z_BT_3 &bt BT_SEL 3
#define Z_BT_4 &bt BT_SEL 4
#define Z_BT_C &bt BT_CLR
#define Z_VUP &kp C_VOL_UP
#define Z_VDN &kp C_VOL_DN
#define Z_MUT &kp C_MUTE
#define CPW &caps_word
#define OUT_T &out OUT_TOG
#define OUT_U &out OUT_USB
#define OUT_B &out OUT_BLE
#define EP_T &ext_power EP_TOG
#define EP_ON &ext_power EP_ON
#define EP_OF &ext_power EP_OFF
#define ESCT &mt TILD ESC
#define FN1 &mt F1 N1
#define FN2 &mt F2 N2
#define FN3 &mt F3 N3
#define FN4 &mt F4 N4
#define FN5 &mt F5 N5
#define FN6 &mt F6 N6
#define FN7 &mt F7 N7
#define FN8 &mt F8 N8
#define FN9 &mt F9 N9
#define FN10 &mt F10 N0
#define FN11 &mt F11 MINUS
#define ______ &trans
#define XXXXXX &none
// Combo macro
#define COMBO(name, keypress, keypos) \
combo_##name { \
layers = <0 2>; \
timeout-ms = <50>; \
bindings = <keypress>; \
key-positions = <keypos>; \
};
// Macro macro
#define MACRO(name, keys) \
name: name##_macro { \
label = #name; \
compatible = "zmk,behavior-macro";\
#binding-cells = <0>; \
tap-ms = <1>; \
wait-ms = <1>; \
bindings = <keys>; \
};

View file

@ -7,64 +7,109 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/ext_power.h>
#include <dt-bindings/zmk/outputs.h>
#include "lily58.h"
&kscan0 {
debounce-press-ms = <3>;
debounce-release-ms = <3>;
debounce-scan-period-ms = <10>;
};
&mt {
flavor = "tap-preferred";
tapping-term-ms = <400>;
quick-tap-ms = <200>;
};
&caps_word {
continue-list = <UNDER MINUS BSPC>;
};
/ {
keymap {
compatible = "zmk,keymap";
default_layer {
// ------------------------------------------------------------------------------------------------------------
// | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ` |
// | TAB | Q | W | E | R | T | | Y | U | I | O | P | - |
// | CTRL | A | S | D | F | G | | H | J | K | L | ; | ' |
// | SHIFT | Z | X | C | V | B | "[" | | "]" | N | M | , | . | / | SHIFT |
// | ALT | GUI | LOWER| SPACE | | ENTER | RAISE| BSPC | GUI |
bindings = <
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp GRAVE
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp MINUS
&kp LCTRL &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp LBKT &kp RBKT &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT
&kp LALT &kp LGUI &mo 1 &kp SPACE &kp RET &mo 2 &kp BSPC &kp RGUI
>;
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
// ┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
ESCT FN1 FN2 FN3 FN4 FN5 FN6 FN7 FN8 FN9 FN10 FN11
// ├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT
// ├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
&kp LCTRL &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp LPAR &kp RPAR &kp N &kp M &kp COMMA &kp DOT &kp SLASH &kp RSHFT
// └────────┴────────┴─────┬──┴─────┬──┴─────┬──┴─────┬──┴────────┤ ├────────┴──┬─────┴──┬─────┴──┬─────┴──┬─────┴────────┴────────┘
&mo ADJ &kp LGUI &mo RSE &kp SPACE &kp ENTER &mo LWR &kp RALT &kp BKSP
// └────────┴────────┴────────┴───────────┘ └───────────┴────────┴────────┴────────┘
>;
};
lower_layer {
// ------------------------------------------------------------------------------------------------------------
// | BTCLR | BT1 | BT2 | BT3 | BT4 | BT5 | | | | | | | |
// | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |
// | ` | ! | @ | # | $ | % | | ^ | & | * | ( | ) | ~ |
// | | | | | | | | | | | _ | + | { | } | "|" |
// | | | | | | | | | |
bindings = <
&bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &trans &trans &trans &trans &trans &trans
&kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12
&kp GRAVE &kp EXCL &kp AT &kp HASH &kp DOLLAR &kp PRCNT &kp CARET &kp AMPS &kp KP_MULTIPLY &kp LPAR &kp RPAR &kp TILDE
&trans &ext_power EP_ON &ext_power EP_OFF &ext_power EP_TOG &trans &trans &trans &trans &trans &kp MINUS &kp KP_PLUS &kp LBRC &kp RBRC &kp PIPE
&trans &trans &trans &trans &trans &trans &trans &trans
>;
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
// ┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
&kp GRAVE &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp STAR &kp LPRN &kp RPRN &kp UNDER
// ├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
______ &kp AT &kp HASH &kp DLLR &kp CARET &kp STAR ______ ______ ______ ______ ______ ______
// ├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
CPW &kp QMARK XXXXXX &kp LBKT &kp RBKT &kp COLN ______ ______ ______ ______ ______ ______
// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
______ &kp UNDER &kp DQT &kp LPRN &kp RPRN &kp PIPE ______ ______ ______ ______ ______ ______ ______ ______
// └────────┴────────┴─────┬──┴─────┬──┴─────┬──┴─────┬──┴────────┤ ├────────┴──┬─────┴──┬─────┴──┬─────┴──┬─────┴────────┴────────┘
______ ______ ______ ______ ______ ______ ______ ______
// └────────┴────────┴────────┴───────────┘ └───────────┴────────┴────────┴────────┘
>;
};
raise_layer {
// ------------------------------------------------------------------------------------------------------------
// | | | | | | | | | | | | | |
// | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | |
// | F1 | F2 | F3 | F4 | F5 | F6 | | | <- | v | ^ | -> | |
// | F7 | F8 | F9 | F10 | F11 | F12 | | | | + | - | = | [ | ] | \ |
// | | | | | | | | | |
bindings = <
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &trans
&kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &trans &kp LEFT &kp DOWN &kp UP &kp RIGHT &trans
&kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &trans &trans &kp KP_PLUS &kp MINUS &kp EQUAL &kp LBKT &kp RBKT &kp BSLH
&trans &trans &trans &trans &trans &trans &trans &trans
>;
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
// ┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
______ XXXXXX XXXXXX XXXXXX XXXXXX XXXXXX &kp PSCRN XXXXXX XXXXXX XXXXXX XXXXXX &kp EQL
// ├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
______ ______ ______ ______ ______ ______ &kp INS &kp N7 &kp N8 &kp N9 XXXXXX &kp RBKT
// ├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
______ ______ ______ ______ ______ ______ &kp DEL &kp N4 &kp N5 &kp N6 &kp LT &kp GT
// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
______ ______ ______ ______ ______ ______ ______ ______ &kp N0 &kp N1 &kp N2 &kp N3 &kp DOT ______
// └────────┴────────┴─────┬──┴─────┬──┴─────┬──┴─────┬──┴────────┤ ├────────┴──┬─────┴──┬─────┴──┬─────┴──┬─────┴────────┴────────┘
______ ______ ______ ______ ______ ______ ______ ______
// └────────┴────────┴────────┴───────────┘ └───────────┴────────┴────────┴────────┘
>;
};
adjust_layer {
bindings = <
// ┌──[0]───┬──[1]───┬──[2]───┬──[3]───┬──[4]───┬──[5]───┐ ┌──[6]───┬──[7]───┬──[8]───┬──[9]───┬──[10]──┬──[11]──┐
______ Z_BT_0 Z_BT_1 Z_BT_2 Z_BT_3 Z_BT_4 Z_VUP XXXXXX XXXXXX XXXXXX XXXXXX XXXXXX
// ├──[12]──┼──[13]──┼──[14]──┼──[15]──┼──[16]──┼──[17]──┤ ├──[18]──┼──[19]──┼──[20]──┼──[21]──┼──[22]──┼──[23]──┤
______ ______ ______ ______ OUT_T Z_BT_C Z_VDN &kp HOME &kp UP &kp END &kp PGUP &kp BSLH
// ├──[24]──┼──[25]──┼──[26]──┼──[27]──┼──[28]──┼──[29]──┤ ├──[30]──┼──[31]──┼──[32]──┼──[33]──┼──[34]──┼──[35]──┤
______ ______ ______ ______ ______ ______ Z_MUT &kp LEFT &kp DOWN &kp RIGHT &kp PGDN ______
// ├──[36]──┼──[37]──┼──[38]──┼──[39]──┼──[40]──┼──[41]──┼──[52]──┐ ┌──[53]──┼──[42]──┼──[43]──┼──[44]──┼──[45]──┼──[46]──┼──[47]──┤
______ ______ ______ ______ &suspend Z_BOOT &vim_s &vim_q Z_BOOT &suspend ______ ______ ______ ______
// └────────┴────────┴─────┬──┴[48]─┬──┴[49]─┬──┴[50]─┬──┴──[51]──┤ ├──[54]──┴──┬─[55]┴──┬─[56]┴──┬─[57]┴──┬─────┴────────┴────────┘
______ ______ ______ ______ ______ ______ ______ ______
// └────────┴────────┴────────┴───────────┘ └───────────┴────────┴────────┴────────┘
>;
};
};
combos {
compatible = "zmk,combos";
// layer toggle
COMBO(nlock, &tog RSE, 28 31)
COMBO(caps, &kp CAPS, 25 34)
// vim shortcuts
};
macros {
MACRO(vim_q, &kp COLON &kp Q &kp EXCL)
MACRO(vim_s, &kp COLON &kp W &kp Q)
MACRO(dir_up, &kp DOT &kp DOT &kp FSLH)
};
};

View file

@ -1,3 +1,9 @@
# Uncomment to enable encoder
# CONFIG_EC11=y
# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
CONFIG_ZMK_SLEEP=y
CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=1800000
CONFIG_ZMK_BATTERY_REPORT_INTERVAL=900
CONFIG_ZMK_USB_INIT_PRIORITY=10
CONFIG_ZMK_BLE_INIT_PRIORITY=90
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y

View file

@ -16,7 +16,3 @@
, <&pro_micro 10 GPIO_ACTIVE_HIGH>
;
};
&left_encoder {
status = "okay";
};

View file

@ -1 +1,13 @@
CONFIG_ZMK_SLEEP=y
CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=1800000
CONFIG_ZMK_BATTERY_REPORT_INTERVAL=1800
CONFIG_ZMK_USB_INIT_PRIORITY=10
CONFIG_ZMK_BLE_INIT_PRIORITY=90
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
CONFIG_BT_PERIPHERAL_PREF_MAX_INT=9
CONFIG_BT_PERIPHERAL_PREF_LATENCY=16
CONFIG_BT_BUF_ACL_TX_COUNT=32
CONFIG_BT_L2CAP_TX_BUF_COUNT=32

View file

@ -0,0 +1,16 @@
if SHIELD_ORTHRUS_LEFT
config ZMK_KEYBOARD_NAME
default "Orthrus"
config ZMK_SPLIT_BLE_ROLE_CENTRAL
default y
endif
if SHIELD_ORTHRUS_LEFT || SHIELD_ORTHRUS_RIGHT
config ZMK_SPLIT
default y
endif

View file

@ -0,0 +1,8 @@
# Copyright (c) 2020 Pete Johanson
# SPDX-License-Identifier: MIT
config SHIELD_ORTHRUS_LEFT
def_bool $(shields_list_contains,orthrus_left)
config SHIELD_ORTHRUS_RIGHT
def_bool $(shields_list_contains,orthrus_right)

View file

View file

@ -0,0 +1,30 @@
/*
* Copyright (c) 2020 Pete Johanson
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix_transform.h>
/ {
chosen {
zmk,matrix_transform = &default_transform;
};
default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <56>;
rows = <1>;
// | SW1 | SW2 | SW3 | SW4 | SW5 | SW6 | | SW6 | SW5 | SW4 | SW3 | SW2 | SW1 |
// | SW7 | SW8 | SW9 | SW10 | SW11 | SW12 | | SW12 | SW11 | SW10 | SW9 | SW8 | SW7 |
// | SW13 | SW14 | SW15 | SW16 | SW17 | SW18 | | SW18 | SW17 | SW16 | SW15 | SW14 | SW13 |
// | SW19 | SW20 | SW21 | | SW21 | SW20 | SW19 |
map = <
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,28) RC(0,29) RC(0,30) RC(0,31) RC(0,32) RC(0,33)
RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11) RC(0,34) RC(0,35) RC(0,36) RC(0,37) RC(0,38) RC(0,39)
RC(0,12) RC(0,13) RC(0,14) RC(0,15) RC(0,16) RC(0,17) RC(0,40) RC(0,41) RC(0,42) RC(0,43) RC(0,44) RC(0,45)
RC(0,18) RC(0,19) RC(0,20) RC(0,21) RC(0,22) RC(0,23) RC(0,46) RC(0,47) RC(0,48) RC(0,49) RC(0,50) RC(0,51)
RC(0,24) RC(0,25) RC(0,26) RC(0,27) RC(0,52) RC(0,53) RC(0,54) RC(0,55)
>;
};
};

View file

@ -0,0 +1,66 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
&mt {
flavor = "tap-preferred";
tapping-term-ms = <400>;
quick-tap-ms = <200>;
};
#define DFT 0
#define LWR 1
#define RSE 2
#define ADJ 3
/ {
keymap {
compatible = "zmk,keymap";
default_layer {
bindings = <
&mt F12 ESC &mt F1 N1 &mt F2 N2 &mt F3 N3 &mt F4 N4 &mt F5 N5 &mt F6 N6 &mt F7 N7 &mt F8 N8 &mt F9 N9 &mt F10 N0 &mt F11 MINUS
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBRC
&kp LGUI &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp SLASH &kp RSHFT
&mo ADJ &kp LCTRL &mo RSE &kp SPACE &kp ENTER &mo LWR &kp RALT &kp BKSP
>;
};
lower_layer {
bindings = <
&kp GRAVE &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp STAR &kp LPRN &kp RPRN &kp UNDER
&kp TILD &kp AT &kp HASH &kp DLLR &kp CARET &kp STAR &trans &trans &trans &trans &trans &trans
&kp CAPS &kp QMARK &none &kp LBKT &kp RBKT &kp COLN &trans &trans &trans &trans &trans &trans
&trans &kp UNDER &kp DQT &kp LPRN &kp RPRN &kp PIPE &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans
>;
};
raise_layer {
bindings = <
&trans &none &none &none &none &none &kp PSCRN &none &none &none &none &kp EQL
&trans &trans &trans &trans &trans &trans &kp INS &kp N7 &kp N8 &kp N9 &trans &kp RBRC
&trans &trans &trans &trans &trans &trans &kp DEL &kp N4 &kp N5 &kp N6 &kp LT &kp GT
&trans &trans &trans &trans &trans &trans &kp N0 &kp N1 &kp N2 &kp N3 &kp DOT &trans
&trans &trans &trans &trans &trans &trans &trans &lt ADJ BKSP
>;
};
adjust_layer {
bindings = <
&trans &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &trans &trans &trans &trans &trans &trans
&trans &bt BT_PRV &bt BT_NXT &bt BT_CLR &trans &trans &trans &kp HOME &kp PGDN &kp PGUP &kp END &kp BSLH
&trans &trans &trans &trans &trans &trans &trans &kp LEFT &kp DOWN &kp UP &kp RIGHT &trans
&trans &trans &trans &trans &reset &bootloader &bootloader &reset &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans
>;
};
};
};

View file

@ -0,0 +1,11 @@
file_format: "1"
id: orthrus
name: Orthrus
type: shield
url: https://github.com/
requires: [mdbt50q]
features:
- keys
siblings:
- orthrus_left
- orthrus_right

View file

@ -0,0 +1,52 @@
/*
* Copyright (c) 2020 Pete Johanson
*
* SPDX-License-Identifier: MIT
*/
#include "orthrus.dtsi"
/ {
chosen {
zmk,kscan = &kscan0;
};
kscan0: kscan {
compatible = "zmk,kscan-gpio-direct";
label = "KSCAN";
input-gpios
= <&gpio1 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 23 #0 28
, <&gpio0 30 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 29 #1 29
, <&gpio0 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 0 #2 30
, <&gpio1 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 5 #3 31
, <&gpio0 11 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 9 #4 32
, <&gpio0 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 13 #5 33
, <&gpio1 11 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 22 #6 34
, <&gpio0 31 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 28 #7 35
, <&gpio0 27 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 30 #8 36
, <&gpio0 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 4 #9 37
, <&gpio1 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 8 #10 38
, <&gpio0 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 14 #11 39
, <&gpio1 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 21 #12 40
, <&gpio0 29 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 25 #13 41
, <&gpio1 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 11 #14 42
, <&gpio0 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 3 #15 43
, <&gpio0 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 7 #16 44
, <&gpio0 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 15 #17 45
, <&gpio1 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 20 #18 46
, <&gpio1 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 24 #19 47
, <&gpio1 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 12 #20 48
, <&gpio0 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 2 #21 49
, <&gpio0 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 6 #22 50
, <&gpio0 17 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 16 #23 51
, <&gpio0 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 1 #24 52
, <&gpio0 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 10 #25 53
, <&gpio0 24 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 17 #26 54
, <&gpio1 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 18 #27 55
;
};
};
//&uart0 {
// tx-pin = <27>;
//};

View file

@ -0,0 +1,56 @@
/*
* Copyright (c) 2020 Pete Johanson
*
* SPDX-License-Identifier: MIT
*/
#include "orthrus.dtsi"
/ {
chosen {
zmk,kscan = &kscan0;
};
kscan0: kscan {
compatible = "zmk,kscan-gpio-direct";
label = "KSCAN";
input-gpios
= <&gpio0 30 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 29 #0 28
, <&gpio0 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 0 #1 29
, <&gpio0 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 4 #2 30
, <&gpio0 11 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 9 #3 29
, <&gpio0 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 13 #4 30
, <&gpio0 24 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 17 #5 31
, <&gpio0 31 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 28 #6 32
, <&gpio0 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 1 #7 33
, <&gpio1 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 5 #8 34
, <&gpio0 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 10 #9 35
, <&gpio0 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 14 #10 36
, <&gpio1 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 18 #11 37
, <&gpio0 29 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 25 #12 38
, <&gpio0 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 2 #13 39
, <&gpio0 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 6 #14 40
, <&gpio1 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 11 #15 41
, <&gpio0 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 15 #16 42
, <&gpio1 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 19 #17 43
, <&gpio1 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 24 #18 44
, <&gpio0 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 3 #19 45
, <&gpio0 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 7 #20 46
, <&gpio1 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 12 #21 47
, <&gpio0 17 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 16 #22 48
, <&gpio1 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 20 #24 49
, <&gpio1 11 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 22 #25 50
, <&gpio1 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 23 #26 51
, <&gpio0 27 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 30 #27 52
, <&gpio1 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> // 8 #28 53
;
};
};
&default_transform {
col-offset = <28>;
};
//&uart0 {
// tx-pin = <27>;
//};

View file

@ -8,9 +8,9 @@
/ {
behaviors {
sys_reset: behavior_reset {
reset: behavior_reset {
compatible = "zmk,behavior-reset";
label = "SYSRESET";
label = "RESET";
#binding-cells = <0>;
};
@ -20,5 +20,11 @@
type = <RST_UF2>;
#binding-cells = <0>;
};
suspend: behavior_reset_suspend {
compatible = "zmk,behavior-reset";
label = "SUSPEND";
type = <RST_SUSPEND>;
#binding-cells = <0>;
};
};
};

View file

@ -11,3 +11,5 @@
// https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/d6b28e66053eea467166f44875e3c7ec741cb471/src/main.c#L107
#define RST_UF2 0x57
#define RST_OTA 0xA8
#define RST_SUSPEND 0xFE