Skip to content

Commit a98759f

Browse files
committed
更新 crosses 配置,添加物理布局和键位映射,优化 ZMK Studio 设置
1 parent b5e8f21 commit a98759f

6 files changed

Lines changed: 127 additions & 39 deletions

File tree

build.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ include:
1717
shield: crosses_left
1818
- board: nice_nano
1919
shield: crosses_right
20+
snippet: studio-rpc-usb-uart
21+
cmake-args: -DCONFIG_ZMK_STUDIO=y
2022
- board: nice_nano
2123
shield: settings_reset

config/boards/shields/crosses/crosses.dtsi

Lines changed: 78 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,84 @@
11
#include <dt-bindings/zmk/matrix_transform.h>
2-
#include <dt-bindings/led/led.h>
2+
#include "physical_layouts.dtsi"
33

44
/ {
5+
crosses_layout: crosses_layout {
6+
compatible = "zmk,physical-layout";
7+
display-name = "crosses";
8+
9+
kscan = <&kscan0>;
10+
transform = <&matrix_transform0>;
11+
12+
keys // w h x y rot rx ry
13+
= <&key_physical_attrs 100 100 300 0 0 0 0>
14+
, <&key_physical_attrs 100 100 925 0 0 0 0>
15+
, <&key_physical_attrs 100 100 400 25 0 0 0>
16+
, <&key_physical_attrs 100 100 500 25 0 0 0>
17+
, <&key_physical_attrs 100 100 725 25 0 0 0>
18+
, <&key_physical_attrs 100 100 825 25 0 0 0>
19+
, <&key_physical_attrs 100 100 200 50 0 0 0>
20+
, <&key_physical_attrs 100 100 1025 50 0 0 0>
21+
, <&key_physical_attrs 100 100 0 100 0 0 0>
22+
, <&key_physical_attrs 100 100 100 100 0 0 0>
23+
, <&key_physical_attrs 100 100 300 100 0 0 0>
24+
, <&key_physical_attrs 100 100 925 100 0 0 0>
25+
, <&key_physical_attrs 100 100 1125 100 0 0 0>
26+
, <&key_physical_attrs 100 100 1225 100 0 0 0>
27+
, <&key_physical_attrs 100 100 400 125 0 0 0>
28+
, <&key_physical_attrs 100 100 500 125 0 0 0>
29+
, <&key_physical_attrs 100 100 725 125 0 0 0>
30+
, <&key_physical_attrs 100 100 825 125 0 0 0>
31+
, <&key_physical_attrs 100 100 200 150 0 0 0>
32+
, <&key_physical_attrs 100 100 1025 150 0 0 0>
33+
, <&key_physical_attrs 100 100 0 200 0 0 0>
34+
, <&key_physical_attrs 100 100 100 200 0 0 0>
35+
, <&key_physical_attrs 100 100 300 200 0 0 0>
36+
, <&key_physical_attrs 100 100 925 200 0 0 0>
37+
, <&key_physical_attrs 100 100 1125 200 0 0 0>
38+
, <&key_physical_attrs 100 100 1225 200 0 0 0>
39+
, <&key_physical_attrs 100 100 400 225 0 0 0>
40+
, <&key_physical_attrs 100 100 500 225 0 0 0>
41+
, <&key_physical_attrs 100 100 725 225 0 0 0>
42+
, <&key_physical_attrs 100 100 825 225 0 0 0>
43+
, <&key_physical_attrs 100 100 200 250 0 0 0>
44+
, <&key_physical_attrs 100 100 1025 250 0 0 0>
45+
, <&key_physical_attrs 100 100 0 300 0 0 0>
46+
, <&key_physical_attrs 100 100 100 300 0 0 0>
47+
, <&key_physical_attrs 100 100 300 300 0 0 0>
48+
, <&key_physical_attrs 100 100 925 300 0 0 0>
49+
, <&key_physical_attrs 100 100 1125 300 0 0 0>
50+
, <&key_physical_attrs 100 100 1225 300 0 0 0>
51+
, <&key_physical_attrs 100 100 400 325 0 0 0>
52+
, <&key_physical_attrs 100 100 500 325 0 0 0>
53+
, <&key_physical_attrs 100 100 725 325 0 0 0>
54+
, <&key_physical_attrs 100 100 825 325 0 0 0>
55+
, <&key_physical_attrs 100 100 200 350 0 0 0>
56+
, <&key_physical_attrs 100 100 1025 350 0 0 0>
57+
, <&key_physical_attrs 100 100 0 400 0 0 0>
58+
, <&key_physical_attrs 100 100 100 400 0 0 0>
59+
, <&key_physical_attrs 100 100 1125 400 0 0 0>
60+
, <&key_physical_attrs 100 100 1225 400 0 0 0>
61+
, <&key_physical_attrs 100 100 325 475 0 0 0>
62+
, <&key_physical_attrs 100 100 425 475 0 0 0>
63+
, <&key_physical_attrs 100 100 525 475 0 0 0>
64+
, <&key_physical_attrs 100 100 700 475 0 0 0>
65+
, <&key_physical_attrs 100 100 800 475 0 0 0>
66+
, <&key_physical_attrs 100 100 900 475 0 0 0>
67+
;
68+
};
69+
70+
571
chosen {
672
zmk,kscan = &kscan0;
7-
zmk,matrix_transform = &default_transform;
8-
73+
zmk,physical-layout = &crosses_layout;
974
};
1075

1176
default_transform: keymap_transform_0 {
1277
compatible = "zmk,matrix-transform";
1378
columns = <12>;
14-
rows = <5>;
79+
rows = <4>;
1580

16-
map = <
81+
map = <
1782
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)
1883
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)
1984
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)
@@ -33,9 +98,16 @@
3398
, <&gpio0 29 GPIO_ACTIVE_HIGH>
3499
, <&gpio0 31 GPIO_ACTIVE_HIGH>
35100
, <&gpio0 11 GPIO_ACTIVE_HIGH>
36-
37101
;
38102
};
39103

40104
};
41105

106+
107+
&crosses_layout{
108+
109+
transform = <&default_transform>;
110+
111+
kscan = <&kscan0>;
112+
113+
};
Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
1-
CONFIG_SPI=y
1+
CONFIG_SPI=y
2+
CONFIG_INPUT=y
3+
CONFIG_ZMK_MOUSE=y
4+
CONFIG_ZMK_EXT_POWER=y
25

3-
CONFIG_SPI=y
4-
CONFIG_INPUT=y
5-
CONFIG_ZMK_MOUSE=y
6+
CONFIG_PMW3610=y
7+
CONFIG_PMW3610_CPI=1600
8+
CONFIG_PMW3610_CPI_DIVIDOR=4
9+
CONFIG_PMW3610_ORIENTATION_90=y
10+
CONFIG_PMW3610_INVERT_X=y
611

7-
CONFIG_ZMK_EXT_POWER=y
12+
CONFIG_PMW3610_SNIPE_CPI=400
13+
CONFIG_PMW3610_SNIPE_CPI_DIVIDOR=4
814

9-
CONFIG_PMW3610=y
10-
CONFIG_PMW3610_CPI=1200
11-
CONFIG_PMW3610_CPI_DIVIDOR=4
12-
CONFIG_PMW3610_ORIENTATION_270=y
13-
CONFIG_PMW3610_SNIPE_CPI=200
14-
CONFIG_PMW3610_SNIPE_CPI_DIVIDOR=1
15-
CONFIG_PMW3610_SCROLL_TICK=70
16-
CONFIG_PMW3610_INVERT_X=y
17-
18-
CONFIG_PMW3610_POLLING_RATE_125_SW=y
15+
CONFIG_PMW3610_SCROLL_TICK=24
16+
CONFIG_PMW3610_POLLING_RATE_125_SW=y
1917
CONFIG_PMW3610_SMART_ALGORITHM=y
2018

21-
# CONFIG_PMW3610_AUTOMOUSE_TIMEOUT_MS=250
19+
# CONFIG_PMW3610_AUTOMOUSE_TIMEOUT_MS=250
20+
21+
CONFIG_PMW3610_RUN_DOWNSHIFT_TIME_MS=2000
22+
CONFIG_PMW3610_REST1_SAMPLE_TIME_MS=20
23+
CONFIG_PMW3610_REST1_DOWNSHIFT_TIME_MS=5000
24+
CONFIG_PMW3610_REST2_SAMPLE_TIME_MS=50
25+
CONFIG_PMW3610_REST2_DOWNSHIFT_TIME_MS=30000
26+
CONFIG_PMW3610_REST3_SAMPLE_TIME_MS=100
2227

28+
CONFIG_ZMK_STUDIO=y
29+
CONFIG_ZMK_STUDIO_LOCKING=y
30+
CONFIG_ZMK_STUDIO_LOCK_ON_DISCONNECT=n

config/boards/shields/crosses/crosses_right.overlay

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
irq-gpios = <&gpio0 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
6060
scroll-layers = <1>;
6161
//snipe-layers = <2>;
62-
// automouse-layer = <3>;
62+
// automouse-layer = <3>;
6363
};
6464
};
6565

config/crosses.conf

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
# CONFIG_BT_LL_SW_LLCP_LEGACY=y
1+
CONFIG_BT_PERIPHERAL_PREF_MAX_INT=9
2+
CONFIG_BT_PERIPHERAL_PREF_LATENCY=2
23

3-
# CONFIG_BT_PERIPHERAL_PREF_MAX_INT=9
4-
# CONFIG_BT_PERIPHERAL_PREF_LATENCY=16
5-
# CONFIG_BT_BUF_ACL_TX_COUNT=32
6-
# CONFIG_BT_L2CAP_TX_BUF_COUNT=32
4+
CONFIG_BT_BUF_ACL_TX_COUNT=24
5+
CONFIG_BT_BUF_EVT_RX_COUNT=10
6+
CONFIG_BT_L2CAP_TX_BUF_COUNT=32
77

88
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
9-
CONFIG_ZMK_BATTERY_REPORT_INTERVAL=60
109

10+
CONFIG_ZMK_BLE_EXPERIMENTAL_CONN=y
1111

12+
CONFIG_ZMK_BEHAVIORS_QUEUE_SIZE=512
1213

13-
CONFIG_ZMK_KEYBOARD_NAME="Crosses"
14+
CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING=y
15+
CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_PROXY=y
16+
CONFIG_ZMK_EXT_POWER=y
1417

18+
# CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=15
19+
# CONFIG_ZMK_KSCAN_DEBOUNCE_RELEASE_MS=15
20+
21+
CONFIG_ZMK_KEYBOARD_NAME="Crosses 46"

config/crosses.keymap

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include <dt-bindings/zmk/bt.h>
33
#include <dt-bindings/zmk/keys.h>
44
#include <dt-bindings/zmk/pointing.h>
5-
#include <dt-bindings/zmk/rgb.h>
65

76
&lt {
87
tapping-term-ms = <200>;
@@ -14,7 +13,7 @@
1413
keymap {
1514
compatible = "zmk,keymap";
1615

17-
layer_0 {
16+
Base {
1817
bindings = <
1918
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp BSPC
2019
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH
@@ -24,7 +23,7 @@
2423
>;
2524
};
2625

27-
layer_1 {
26+
Lower {
2827
bindings = <
2928
&kp LS(N1) &kp LS(N2) &kp LS(N3) &kp LS(N4) &kp LS(N5) &kp LS(N6) &kp LS(N7) &kp LS(N8) &kp LS(N9) &kp LS(N0) &kp LS(MINUS) &kp LS(EQUAL)
3029
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH
@@ -34,7 +33,7 @@
3433
>;
3534
};
3635

37-
layer_2 {
36+
Raise {
3837
bindings = <
3938
&kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12
4039
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH
@@ -44,12 +43,12 @@
4443
>;
4544
};
4645

47-
layer_3 {
46+
Mouse {
4847
bindings = <
49-
&none &none &none &none &none &none &none &none &none &none &none &none
50-
&none &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 3 &none &bt BT_CLR &bt BT_CLR &none &bt BT_SEL 2 &bt BT_SEL 1 &bt BT_SEL 0 &none
51-
&none &none &none &none &none &none &none &none &none &none &none &none
52-
&none &none &none &none &none &none &none &none &none &none &none &none
48+
&none &none &none &none &none &none &none &none &none &none &none &none
49+
&none &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 3 &none &bt BT_CLR &bt BT_CLR &none &bt BT_SEL 2 &bt BT_SEL 1 &bt BT_SEL 0 &none
50+
&none &none &none &none &none &none &none &none &none &none &none &none
51+
&none &none &none &none &none &none &studio_unlock &none &none &none &none &none
5352
&mkp MCLK &mkp LCLK &mkp RCLK &mkp RCLK &mkp LCLK &mkp MCLK
5453
>;
5554
};

0 commit comments

Comments
 (0)