Skip to content

Commit 20375cf

Browse files
committed
Initial shield
1 parent 9cb5d14 commit 20375cf

15 files changed

+387
-16
lines changed

build.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
---
2020
include:
2121
- board: nice_nano_v2
22-
shield: kyria_rev3_left
22+
shield: charybdis_left
2323
- board: nice_nano_v2
24-
shield: kyria_rev3_right
24+
shield: charybdis_right
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
if SHIELD_CHARYBDIS_RIGHT
2+
3+
config ZMK_KEYBOARD_NAME
4+
default "Charybdis"
5+
6+
config ZMK_SPLIT_BLE_ROLE_CENTRAL
7+
default y
8+
9+
endif
10+
11+
if SHIELD_CHARYBDIS_LEFT || SHIELD_CHARYBDIS_RIGHT
12+
13+
config ZMK_SPLIT
14+
default y
15+
16+
endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
config SHIELD_CHARYBDIS_LEFT
2+
def_bool $(shields_list_contains,charybdis_left)
3+
4+
config SHIELD_CHARYBDIS_RIGHT
5+
def_bool $(shields_list_contains,charybdis_right)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#include <dt-bindings/zmk/matrix_transform.h>
2+
3+
/ {
4+
chosen {
5+
zmk,kscan = &kscan0;
6+
zmk,matrix_transform = &default_transform;
7+
};
8+
9+
vbatt: vbatt {
10+
compatible = "zmk,battery-nrf-vddh";
11+
};
12+
13+
default_transform: keymap_transform_0 {
14+
compatible = "zmk,matrix-transform";
15+
columns = <12>;
16+
rows = <4>;
17+
18+
map = <
19+
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,11) RC(0,10) RC(0,9) RC(0,8) RC(0,7) RC(0,6)
20+
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,11) RC(1,10) RC(1,9) RC(1,8) RC(1,7) RC(1,6)
21+
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,11) RC(2,10) RC(2,9) RC(2,8) RC(2,7) RC(2,6)
22+
RC(3,3) RC(3,4) RC(3,1) RC(3,7) RC(3,9)
23+
>;
24+
};
25+
26+
kscan0: kscan {
27+
compatible = "zmk,kscan-gpio-matrix";
28+
wakeup-source;
29+
diode-direction = "row2col";
30+
row-gpios
31+
= <&pro_micro 18 GPIO_ACTIVE_HIGH>
32+
, <&pro_micro 5 GPIO_ACTIVE_HIGH>
33+
, <&pro_micro 4 GPIO_ACTIVE_HIGH>
34+
, <&pro_micro 9 GPIO_ACTIVE_HIGH>
35+
;
36+
};
37+
};

config/boards/shields/charybdis-mini-wireless/charybdis_left.conf

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include "charybdis.dtsi"
2+
3+
&kscan0 {
4+
col-gpios
5+
= <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
6+
, <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
7+
, <&pro_micro 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
8+
, <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
9+
, <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
10+
, <&pro_micro 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
11+
;
12+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# https://github.com/inorichi/zmk-pmw3610-driver?tab=readme-ov-file
2+
CONFIG_SPI=y
3+
CONFIG_INPUT=y
4+
CONFIG_ZMK_MOUSE=y
5+
CONFIG_PMW3610=y
6+
7+
# https://zmk.dev/docs/config/power#kconfig-2
8+
CONFIG_ZMK_EXT_POWER=y
9+
10+
# https://github.com/inorichi/zmk-pmw3610-driver/blob/main/Kconfig
11+
CONFIG_PMW3610_SMART_ALGORITHM=y
12+
CONFIG_PMW3610_CPI=1200
13+
CONFIG_PMW3610_CPI_DIVIDOR=4
14+
CONFIG_PMW3610_SNIPE_CPI=800
15+
CONFIG_PMW3610_SNIPE_CPI_DIVIDOR=4
16+
CONFIG_PMW3610_SCROLL_TICK=20
17+
CONFIG_PMW3610_RUN_DOWNSHIFT_TIME_MS=3264
18+
CONFIG_PMW3610_REST1_SAMPLE_TIME_MS=20
19+
CONFIG_PMW3610_POLLING_RATE_125_SW=y
20+
CONFIG_PMW3610_ORIENTATION_90=y
21+
CONFIG_PMW3610_INVERT_X=y
22+
CONFIG_PMW3610_INVERT_SCROLL_Y=n
23+
CONFIG_PMW3610_AUTOMOUSE_TIMEOUT_MS=400
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#include "charybdis.dtsi"
2+
3+
// The matrix transform is 6 columns over because the left half is 6 columns wide.
4+
&default_transform {
5+
col-offset = <6>;
6+
};
7+
8+
&kscan0 {
9+
col-gpios
10+
= <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
11+
, <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
12+
, <&pro_micro 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
13+
, <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
14+
, <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
15+
, <&pro_micro 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
16+
;
17+
};
18+
19+
// https://github.com/inorichi/zmk-pmw3610-driver
20+
&pinctrl {
21+
spi0_default: spi0_default {
22+
group1 {
23+
psels = <NRF_PSEL(SPIM_SCK, 0, 8)>,
24+
<NRF_PSEL(SPIM_MOSI, 0, 17)>,
25+
<NRF_PSEL(SPIM_MISO, 0, 17)>;
26+
};
27+
};
28+
29+
spi0_sleep: spi0_sleep {
30+
group1 {
31+
psels = <NRF_PSEL(SPIM_SCK, 0, 8)>,
32+
<NRF_PSEL(SPIM_MOSI, 0, 17)>,
33+
<NRF_PSEL(SPIM_MISO, 0, 17)>;
34+
low-power-enable;
35+
};
36+
};
37+
};
38+
39+
&spi0 {
40+
status = "okay";
41+
compatible = "nordic,nrf-spim";
42+
pinctrl-0 = <&spi0_default>;
43+
pinctrl-1 = <&spi0_sleep>;
44+
pinctrl-names = "default", "sleep";
45+
cs-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
46+
47+
trackball: trackball@0 {
48+
status = "okay";
49+
compatible = "pixart,pmw3610";
50+
reg = <0>;
51+
spi-max-frequency = <2000000>;
52+
irq-gpios = <&gpio0 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
53+
/* optional features */
54+
// snipe-layers = <1>;
55+
scroll-layers = <2 3>;
56+
automouse-layer = <4>;
57+
};
58+
};
59+
60+
/ {
61+
trackball_listener {
62+
compatible = "zmk,input-listener";
63+
device = <&trackball>;
64+
65+
};
66+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
file_format: "1"
2+
id: charybdis
3+
name: Charybdis
4+
type: shield
5+
url: https://github.com/Bastardkb/Charybdis/
6+
requires: [pro_micro]
7+
features:
8+
- keys
9+
- pointer
10+
- colemak DH
11+
siblings:
12+
- charybdis_left
13+
- charybdis_right

config/charybdis.conf

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
CONFIG_ZMK_SLEEP=y
2+
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
3+
CONFIG_ZMK_MOUSE=y
4+
5+
CONFIG_BT_PERIPHERAL_PREF_MAX_INT=9
6+
CONFIG_BT_PERIPHERAL_PREF_LATENCY=16
7+
CONFIG_BT_BUF_ACL_TX_COUNT=32
8+
CONFIG_BT_L2CAP_TX_BUF_COUNT=32
9+
10+
CONFIG_ZMK_BLE_EXPERIMENTAL_CONN=y
11+
CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING=y
12+
CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_PROXY=y
13+
CONFIG_ZMK_BEHAVIORS_QUEUE_SIZE=512

config/charybdis.json

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"id": "charybdis",
3+
"name": "charybdis",
4+
"layouts": {
5+
"default": {
6+
"layout": [
7+
{ "label": "", "row": 0, "col": 0, "x": 0, "y": 0.360 },
8+
{ "label": "", "row": 0, "col": 1, "x": 1, "y": 0.360 },
9+
{ "label": "", "row": 0, "col": 2, "x": 2, "y": 0.110 },
10+
{ "label": "", "row": 0, "col": 3, "x": 3, "y": -0.015 },
11+
{ "label": "", "row": 0, "col": 4, "x": 4, "y": 0.110 },
12+
{ "label": "", "row": 0, "col": 5, "x": 5, "y": 0.110 },
13+
{ "label": "", "row": 0, "col": 7, "x": 9, "y": 0.110 },
14+
{ "label": "", "row": 0, "col": 8, "x": 10, "y": 0.110 },
15+
{ "label": "", "row": 0, "col": 9, "x": 11, "y": -0.015 },
16+
{ "label": "", "row": 0, "col": 10, "x": 12, "y": 0.110 },
17+
{ "label": "", "row": 0, "col": 11, "x": 13, "y": 0.360 },
18+
{ "label": "", "row": 0, "col": 12, "x": 14, "y": 0.360 },
19+
20+
{ "label": "", "row": 1, "col": 0, "x": 0, "y": 1.360 },
21+
{ "label": "", "row": 1, "col": 1, "x": 1, "y": 1.360 },
22+
{ "label": "", "row": 1, "col": 2, "x": 2, "y": 1.110 },
23+
{ "label": "", "row": 1, "col": 3, "x": 3, "y": 0.985 },
24+
{ "label": "", "row": 1, "col": 4, "x": 4, "y": 1.110 },
25+
{ "label": "", "row": 1, "col": 5, "x": 5, "y": 1.110 },
26+
{ "label": "", "row": 1, "col": 7, "x": 9, "y": 1.110 },
27+
{ "label": "", "row": 1, "col": 8, "x": 10, "y": 1.110 },
28+
{ "label": "", "row": 1, "col": 9, "x": 11, "y": 0.985 },
29+
{ "label": "", "row": 1, "col": 10, "x": 12, "y": 1.110 },
30+
{ "label": "", "row": 1, "col": 11, "x": 13, "y": 1.360 },
31+
{ "label": "", "row": 1, "col": 12, "x": 14, "y": 1.360 },
32+
33+
{ "label": "", "row": 2, "col": 0, "x": 0, "y": 2.360 },
34+
{ "label": "", "row": 2, "col": 1, "x": 1, "y": 2.360 },
35+
{ "label": "", "row": 2, "col": 2, "x": 2, "y": 2.110 },
36+
{ "label": "", "row": 2, "col": 3, "x": 3, "y": 1.985 },
37+
{ "label": "", "row": 2, "col": 4, "x": 4, "y": 2.110 },
38+
{ "label": "", "row": 2, "col": 5, "x": 5, "y": 2.110 },
39+
{ "label": "", "row": 2, "col": 7, "x": 9, "y": 2.110 },
40+
{ "label": "", "row": 2, "col": 8, "x": 10, "y": 2.110 },
41+
{ "label": "", "row": 2, "col": 9, "x": 11, "y": 1.985 },
42+
{ "label": "", "row": 2, "col": 10, "x": 12, "y": 2.110 },
43+
{ "label": "", "row": 2, "col": 11, "x": 13, "y": 2.360 },
44+
{ "label": "", "row": 2, "col": 12, "x": 14, "y": 2.360 },
45+
46+
{ "label": "", "row": 3, "col": 3, "x": 3.48, "y": 3.13, "r": 0 },
47+
{ "label": "", "row": 3, "col": 4, "x": 3.48, "y": 3.13, "r": 15, "rx": 3.98, "ry": 7.88 },
48+
{ "label": "", "row": 3, "col": 5, "x": 3.48, "y": 3.18, "r": 30, "rx": 3.98, "ry": 7.88 },
49+
{ "label": "", "row": 3, "col": 7, "x": 10.52, "y": 3.18, "r": -30, "rx": 11.02, "ry": 7.88 },
50+
{ "label": "", "row": 3, "col": 8, "x": 10.52, "y": 3.13, "r": -15, "rx": 11.02, "ry": 7.88 }
51+
]
52+
}
53+
},
54+
"sensors": []
55+
}

config/charybdis.keymap

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
#include <behaviors/mouse_keys.dtsi>
2+
#include <behaviors.dtsi>
3+
#include <dt-bindings/zmk/bt.h>
4+
#include <dt-bindings/zmk/keys.h>
5+
#include <dt-bindings/zmk/mouse.h>
6+
#include <dt-bindings/zmk/outputs.h>
7+
8+
#define U_TAPPING_TERM 200
9+
10+
/ {
11+
chosen { zmk,matrix_transform = &default_transform; };
12+
};
13+
14+
/ {
15+
combos {
16+
compatible = "zmk,combos";
17+
18+
Delete {
19+
bindings = <&kp DELETE>;
20+
key-positions = <8 9>;
21+
};
22+
23+
CapsWord {
24+
bindings = <&caps_word>;
25+
key-positions = <17 18>;
26+
};
27+
28+
Layer_7 {
29+
bindings = <&mo 7>;
30+
key-positions = <38 39>;
31+
};
32+
};
33+
34+
macros {
35+
VSplit: VSplit {
36+
compatible = "zmk,behavior-macro";
37+
#binding-cells = <0>;
38+
bindings = <&kp LEFT_SHIFT &kp SEMI &kp LS(V) &kp LS(S) &kp LS(P) &kp RET>;
39+
label = "VSPLIT";
40+
};
41+
42+
HSplit: HSplit {
43+
compatible = "zmk,behavior-macro";
44+
#binding-cells = <0>;
45+
bindings = <&kp LEFT_SHIFT &kp SEMI &kp LS(S) &kp LS(P) &kp RET>;
46+
label = "HSPLIT";
47+
};
48+
};
49+
50+
keymap {
51+
compatible = "zmk,keymap";
52+
53+
Base {
54+
bindings = <
55+
&kp C_AC_SEARCH &kp Q &kp W &kp F &kp P &kp B &kp J &kp L &kp U &kp Y &kp APOS &to 5
56+
&kp TAB &mt LEFT_GUI A &mt LEFT_ALT R &mt LCTRL S &mt LEFT_SHIFT T &kp G &kp M &mt LEFT_SHIFT N &mt RCTRL E &mt RIGHT_ALT I &mt RIGHT_GUI O &kp DEL
57+
&caps_word &kp Z &mt LA(LS(LCTRL)) X &mt LC(LA(LS(LEFT_GUI))) C &kp D &kp V &kp K &kp H &mt LA(LS(LCTRL)) COMMA &mt LC(LA(LS(LEFT_GUI))) PERIOD &kp FSLH &to 6
58+
&mkp LCLK &lt 1 BACKSPACE &lt 2 ESCAPE &lt 4 RETURN &lt 3 SPACE
59+
>;
60+
};
61+
62+
Num {
63+
bindings = <
64+
&none &none &none &none &none &none &kp SLASH &mt F7 N7 &mt F8 N8 &mt F9 N9 &mt F10 MINUS &none
65+
&none &none &none &none &kp BACKSPACE &none &kp ASTRK &mt F4 N4 &mt F5 N5 &mt F6 N6 &mt F11 PLUS &none
66+
&none &none &none &none &none &none &kp DOT &mt F1 N1 &mt F2 N2 &mt F3 N3 &mt F12 EQUAL &none
67+
&none &none &none &kp N0 &none
68+
>;
69+
};
70+
71+
Nav {
72+
bindings = <
73+
&none &none &none &none &none &none &none &kp LS(LC(H)) &kp LS(LC(J)) &kp LS(LC(K)) &kp LS(LC(L)) &none
74+
&trans &trans &trans &trans &trans &trans &VSplit &kp LEFT_ARROW &kp DOWN &kp UP &kp RIGHT_ARROW &none
75+
&none &none &none &none &none &none &HSplit &kp HOME &kp PG_DN &kp PG_UP &kp END &none
76+
&none &none &trans &trans &trans
77+
>;
78+
};
79+
80+
Sym {
81+
bindings = <
82+
&none &kp DOLLAR &kp LEFT_BRACE &kp RIGHT_BRACE &kp AMPERSAND &kp BSLH &none &kp COLON &kp TILDE &kp FSLH &kp PIPE &none
83+
&none &kp ASTRK &kp LEFT_PARENTHESIS &kp RIGHT_PARENTHESIS &mt LEFT_SHIFT UNDERSCORE &kp AT_SIGN &kp SEMI &mt RIGHT_SHIFT SPACE &mt LCTRL LESS_THAN &mt LS(LEFT_ALT) GREATER_THAN &mt RIGHT_META EQUAL &none
84+
&none &kp PERCENT &kp LBKT &kp RBKT &kp CARET &kp EXCLAMATION &none &kp GRAVE &kp HASH &kp MINUS &kp PLUS &none
85+
&trans &trans &trans &none &trans
86+
>;
87+
};
88+
89+
Mouse {
90+
bindings = <
91+
&none &none &msc MOVE_DOWN &mmv MOVE_UP &msc MOVE_UP &none &none &kp K_UNDO &kp K_CUT &kp K_COPY &kp K_PASTE &none
92+
&none &mkp MB4 &mmv MOVE_LEFT &mmv MOVE_DOWN &mmv MOVE_RIGHT &mkp MB5 &none &kp RIGHT_SHIFT &kp RCTRL &kp LEFT_ALT &kp RIGHT_META &none
93+
&none &none &msc MOVE_LEFT &none &msc MOVE_RIGHT &none &none &none &none &none &none &none
94+
&mkp MCLK &mkp LCLK &mkp RCLK &none &none
95+
>;
96+
};
97+
98+
Game {
99+
bindings = <
100+
&kp N1 &kp TAB &kp Q &kp W &kp E &kp R &none &none &none &none &none &to 0
101+
&kp N2 &kp LCTRL &kp A &kp S &kp D &kp F &none &none &none &none &none &none
102+
&kp N3 &kp LSHFT &kp Z &kp X &kp C &kp V &none &none &none &none &none &none
103+
&none &kp SPACE &kp LEFT_ALT &none &none
104+
>;
105+
};
106+
107+
Photos {
108+
bindings = <
109+
&trans &kp LA(LC(LS(Z))) &kp LA(LC(LS(E))) &kp LA(LC(LS(A))) &kp LA(LC(LS(S))) &kp LA(LC(LS(B))) &none &none &none &none &none &none
110+
&kp LC(LA(E)) &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp LCTRL &none &none &none &none &none &none
111+
&kp LS(DELETE) &kp LA(LS(A)) &kp LA(KP_N1) &kp LA(KP_N2) &kp LA(KP_N3) &none &none &none &none &none &none &to 0
112+
&none &none &trans &trans &trans
113+
>;
114+
};
115+
116+
Extras {
117+
bindings = <
118+
&kp C_SLEEP &none &none &none &none &kp C_BRIGHTNESS_MAXIMUM &bt BT_CLR &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &kp K_COFFEE
119+
&kp C_POWER &none &none &none &none &kp C_BRIGHTNESS_INC &out OUT_TOG &kp C_PREVIOUS &kp C_STOP &kp C_PLAY_PAUSE &kp C_NEXT &none
120+
&bootloader &none &none &none &none &kp C_BRIGHTNESS_DEC &kp PRINTSCREEN &kp C_VOLUME_DOWN &kp C_VOLUME_UP &kp K_MUTE &none &bootloader
121+
&none &none &none &none &none
122+
>;
123+
};
124+
};
125+
};

0 commit comments

Comments
 (0)