Skip to content

Commit

Permalink
dongle
Browse files Browse the repository at this point in the history
  • Loading branch information
DusanLesan committed Aug 9, 2024
1 parent 54e30d4 commit 0460472
Show file tree
Hide file tree
Showing 18 changed files with 289 additions and 92 deletions.
Empty file removed boards/shields/.gitkeep
Empty file.
26 changes: 6 additions & 20 deletions build.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
# This file generates the GitHub Actions matrix.
# For simple board + shield combinations, add them to the top level board and
# shield arrays, for more control, add individual board + shield combinations
# to the `include` property. You can also use the `cmake-args` property to
# pass flags to the build command and `artifact-name` to assign a name to
# distinguish build outputs from each other:
#
# board: [ "nice_nano_v2" ]
# shield: [ "corne_left", "corne_right" ]
# include:
# - board: bdn9_rev2
# - board: nice_nano_v2
# shield: reviung41
# - board: nice_nano_v2
# shield: corne_left
# cmake-args: -DCONFIG_ZMK_USB_LOGGING=y
# artifact-name: corne_left_with_logging
#
---
include:
- board: nice_nano_v2
shield: kyria_rev3_left
shield: kb_left
- board: nice_nano_v2
shield: kyria_rev3_right
shield: kb_right
- board: nice_nano_v2
shield: kb_dongle
- board: nice_nano_v2
shield: settings_reset
22 changes: 22 additions & 0 deletions config/boards/shields/kb/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
if SHIELD_KB_DONGLE

config ZMK_KEYBOARD_NAME
default "Kyria"

config ZMK_SPLIT_BLE_ROLE_CENTRAL
default y

config ZMK_USB
default y

endif

if SHIELD_KB_LEFT || SHIELD_KB_RIGHT || SHIELD_KB_DONGLE

config ZMK_SPLIT
default y

config ZMK_BLE
default y

endif
8 changes: 8 additions & 0 deletions config/boards/shields/kb/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
config SHIELD_KB_LEFT
def_bool $(shields_list_contains,kb_left)

config SHIELD_KB_RIGHT
def_bool $(shields_list_contains,kb_right)

config SHIELD_KB_DONGLE
def_bool $(shields_list_contains,kb_dongle)
8 changes: 8 additions & 0 deletions config/boards/shields/kb/kb.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CONFIG_ZMK_SLEEP=y
CONFIG_PM_DEVICE=y
CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000
CONFIG_ZMK_EXT_POWER=y

CONFIG_ZMK_KEYBOARD_NAME="Kyria"

CONFIG_BT_CTLR_TX_PWR_PLUS_8=n
33 changes: 33 additions & 0 deletions config/boards/shields/kb/kb.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include "kb_common.dtsi"

/ {
chosen {
zmk,matrix-transform = &default_transform;
};

default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <14>;
rows = <4>;
// | MX6 | MX5 | MX4 | MX3 | MX2 | MX1 | | MX1 | MX2 | MX3 | MX4 | MX5 | MX6 |
// | MX12 | MX11 | MX10 | MX9 | MX8 | MX7 | | MX7 | MX8 | MX9 | MX10 | MX11 | MX12 |
// | MX20 | MX19 | MX18 | MX17 | MX16 | MX15 | MX14 | MX13 | | MX13 | MX14 | MX15 | MX16 | MX17 | MX18 | MX19 | MX20 |
// | MX25 | MX24 | MX23 | MX22 | MX21 | | MX21 | MX22 | MX23 | MX24 | MX25 |
map = <
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,8) RC(0,9) RC(0,10) RC(0,11) RC(0,12) RC(0,13)
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,8) RC(1,9) RC(1,10) RC(1,11) RC(1,12) RC(1,13)
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(3,3) RC(2,6) RC(2,7) RC(3,10) RC(2,8) RC(2,9) RC(2,10) RC(2,11) RC(2,12) RC(2,13)
RC(3,2) RC(3,4) RC(3,5) RC(3,1) RC(3,6) RC(3,7) RC(3,12) RC(3,8) RC(3,9) RC(3,11)
>;
};
};

&left_encoder {
a-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
};

&right_encoder {
a-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
};
112 changes: 53 additions & 59 deletions config/kyria_rev3.keymap → config/boards/shields/kb/kb.keymap
Original file line number Diff line number Diff line change
@@ -1,94 +1,88 @@
/*
* Copyright (c) 2023 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include <behaviors.dtsi>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/keys.h>

&lt {
tapping-term-ms = <300>;
flavor = "hold-preferred";
tapping-term-ms = <300>;
flavor = "hold-preferred";
};

/ {
behaviors {
shift_sym: shift_sym {
compatible = "zmk,behavior-mod-morph";
label = "SHIFT_SYM";
bindings = <&lt 1 ENTER>, <&to 1>;
behaviors {
shift_sym: shift_sym {
compatible = "zmk,behavior-mod-morph";
label = "SHIFT_SYM";
bindings = <&lt 1 ENTER>, <&to 1>;

#binding-cells = <0>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
#binding-cells = <0>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};

shift_nav: shift_nav {
compatible = "zmk,behavior-mod-morph";
label = "SHIFT_NAV";
bindings = <&lt 2 SPACE>, <&to 2>;
shift_nav: shift_nav {
compatible = "zmk,behavior-mod-morph";
label = "SHIFT_NAV";
bindings = <&lt 2 SPACE>, <&to 2>;

#binding-cells = <0>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
#binding-cells = <0>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};

bc_del: bc_del {
compatible = "zmk,behavior-mod-morph";
label = "BC_DEL";
bindings = <&kp BACKSPACE>, <&kp DELETE>;
bc_del: bc_del {
compatible = "zmk,behavior-mod-morph";
label = "BC_DEL";
bindings = <&kp BACKSPACE>, <&kp DELETE>;

#binding-cells = <0>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
};
#binding-cells = <0>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
};

keymap {
compatible = "zmk,keymap";
keymap {
compatible = "zmk,keymap";

alpha {
bindings = <
alpha {
bindings = <
&kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &bc_del
&kp TAB &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 K_FORWARD &kp LSHFT &mo 3 &kp K_BACK &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp BACKSLASH
&kp LCTRL &kp LALT &kp LGUI &mt LCTRL SPACE &shift_nav &shift_sym &mt RIGHT_SHIFT ENTER &kp RIGHT_GUI &kp RIGHT_ALT &kp K_MENU
>;
};
&kp LCTRL &kp LALT &kp LGUI &mt LCTRL SPACE &shift_nav &shift_sym &mt RIGHT_SHIFT ENTER &kp RIGHT_GUI &kp RIGHT_ALT &kp K_MENU
>;
};

sym {
bindings = <
sym {
bindings = <
&kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp EQUAL
&kp BSPC &kp EXCL &kp AT_SIGN &kp HASH &kp DOLLAR &kp PERCENT &kp CARET &kp AMPERSAND &kp ASTERISK &kp LEFT_PARENTHESIS &kp RIGHT_PARENTHESIS &kp PLUS
&kp PIPE &kp BACKSLASH &kp COLON &kp SEMICOLON &kp MINUS &kp LEFT_BRACKET &kp LEFT_BRACE &trans &trans &kp RIGHT_BRACE &kp RIGHT_BRACKET &kp UNDERSCORE &kp COMMA &kp PERIOD &kp SLASH &kp QUESTION
&trans &trans &trans &trans &trans &to 0 &trans &trans &trans &trans
>;
};
&trans &trans &trans &trans &trans &to 0 &trans &trans &trans &trans
>;
};

nav {
bindings = <
nav {
bindings = <
&trans &trans &trans &trans &trans &trans &kp PG_UP &kp HOME &kp UP_ARROW &kp END &kp C_VOLUME_UP &kp DELETE
&kp C_PLAY_PAUSE &kp K_PLAY_PAUSE &trans &trans &trans &trans &kp PAGE_DOWN &kp LEFT &kp DOWN &kp RIGHT &kp C_VOL_DN &kp INSERT
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &kp C_PLAY &kp C_STOP &kp C_PREVIOUS &kp C_NEXT &kp C_MUTE &kp PRINTSCREEN
&trans &trans &trans &trans &to 0 &trans &trans &trans &trans &trans
>;
};
&trans &trans &trans &trans &to 0 &trans &trans &trans &trans &trans
>;
};

funct {
bindings = <
funct {
bindings = <
&trans &kp F9 &kp F10 &kp F11 &kp F12 &trans &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &bt BT_CLR
&trans &kp F5 &kp F6 &kp F7 &kp F8 &trans &trans &trans &trans &trans &trans &trans
&trans &kp F1 &kp F2 &kp F3 &kp F4 &trans &trans &trans &trans &tog 4 &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
>;
};
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
>;
};

game {
bindings = <
game {
bindings = <
&trans &trans &kp Q &kp W &kp E &kp R &trans &trans &trans &trans &trans &trans
&trans &trans &kp A &kp S &kp D &kp F &trans &trans &trans &trans &trans &trans
&tog 0 &trans &kp Z &kp X &kp C &kp V &kp G &kp I &trans &trans &trans &trans &trans &trans &trans &tog 0
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
>;
};
};
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
>;
};
};
};
13 changes: 13 additions & 0 deletions config/boards/shields/kb/kb.zmk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
file_format: "1"
id: kyria_rev3
name: Kyria Rev3
type: shield
url: https://splitkb.com/products/kyria-pcb-kit
requires: [pro_micro]
exposes: [i2c_oled]
features:
- keys
siblings:
- kb_left
- kb_right
- kb_dongle
53 changes: 53 additions & 0 deletions config/boards/shields/kb/kb_common.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#include <dt-bindings/zmk/matrix_transform.h>

/ {
chosen {
zephyr,display = &oled;
zmk,kscan = &kscan0;
zmk,matrix-transform = &default_transform;
};

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";
};

left_encoder: encoder_left {
compatible = "alps,ec11";
steps = <80>;
status = "disabled";
};

right_encoder: encoder_right {
compatible = "alps,ec11";
steps = <80>;
status = "disabled";
};

sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder &right_encoder>;
triggers-per-rotation = <20>;
};

// TODO: RGB node(s)
};

&pro_micro_i2c {
status = "okay";

oled: ssd1306@3c {
compatible = "solomon,ssd1306fb";
reg = <0x3c>;
width = <128>;
height = <64>;
segment-offset = <0>;
page-offset = <0>;
display-offset = <0>;
multiplex-ratio = <63>;
prechargep = <0x22>;
inversion-on;
};
};
6 changes: 6 additions & 0 deletions config/boards/shields/kb/kb_dongle.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CONFIG_ZMK_SPLIT_BLE_CENTRAL_PERIPHERALS=2
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y

CONFIG_ZMK_SLEEP=n
CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000
CONFIG_ZMK_EXT_POWER=y
27 changes: 27 additions & 0 deletions config/boards/shields/kb/kb_dongle.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include "kb.dtsi"

&default_transform {
col-offset = <7>;
};

&kscan0 {
row-gpios
= <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
col-gpios
= <&pro_micro 16 GPIO_ACTIVE_HIGH>
, <&pro_micro 4 GPIO_ACTIVE_HIGH>
, <&pro_micro 5 GPIO_ACTIVE_HIGH>
, <&pro_micro 6 GPIO_ACTIVE_HIGH>
, <&pro_micro 7 GPIO_ACTIVE_HIGH>
, <&pro_micro 8 GPIO_ACTIVE_HIGH>
, <&pro_micro 10 GPIO_ACTIVE_HIGH>
;
};

&right_encoder {
status = "okay";
};
4 changes: 4 additions & 0 deletions config/boards/shields/kb/kb_left.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CONFIG_ZMK_SLEEP=y
CONFIG_PM_DEVICE=y
CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000
CONFIG_ZMK_EXT_POWER=y
23 changes: 23 additions & 0 deletions config/boards/shields/kb/kb_left.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "kb.dtsi"

&kscan0 {
row-gpios
= <&pro_micro 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
col-gpios
= <&pro_micro 10 GPIO_ACTIVE_HIGH>
, <&pro_micro 16 GPIO_ACTIVE_HIGH>
, <&pro_micro 14 GPIO_ACTIVE_HIGH>
, <&pro_micro 15 GPIO_ACTIVE_HIGH>
, <&pro_micro 18 GPIO_ACTIVE_HIGH>
, <&pro_micro 19 GPIO_ACTIVE_HIGH>
, <&pro_micro 8 GPIO_ACTIVE_HIGH>
;
};

&left_encoder {
status = "okay";
};
4 changes: 4 additions & 0 deletions config/boards/shields/kb/kb_right.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CONFIG_ZMK_SLEEP=y
CONFIG_PM_DEVICE=y
CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000
CONFIG_ZMK_EXT_POWER=y
Loading

0 comments on commit 0460472

Please sign in to comment.