Skip to content

Commit

Permalink
updated config, studio compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlucachi authored Sep 27, 2024
1 parent f656c3e commit ea6c3b2
Show file tree
Hide file tree
Showing 13 changed files with 245 additions and 74 deletions.
Empty file.
125 changes: 124 additions & 1 deletion boards/shields/charybdis/charybdis.dtsi
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#include <dt-bindings/zmk/matrix_transform.h>
#include <physical_layouts.dtsi>

/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
zmk,physical-layout = &charybdis_6col_layout;
};

default_transform: keymap_transform_0 {
Expand Down Expand Up @@ -35,4 +36,126 @@
kscan0: kscan {
diode-direction = "row2col";
};

charybdis_6col_layout: charybdis_6col_layout {
compatible = "zmk,physical-layout";
display-name = "6-column";

transform = <&default_transform>;

keys // w h x y rot rx ry
= <&key_physical_attrs 100 100 0 57 0 0 0>
, <&key_physical_attrs 100 100 100 57 0 0 0>
, <&key_physical_attrs 100 100 200 12 0 0 0>
, <&key_physical_attrs 100 100 300 0 0 0 0>
, <&key_physical_attrs 100 100 400 12 0 0 0>
, <&key_physical_attrs 100 100 500 12 0 0 0>
, <&key_physical_attrs 100 100 900 12 0 0 0>
, <&key_physical_attrs 100 100 1000 12 0 0 0>
, <&key_physical_attrs 100 100 1100 0 0 0 0>
, <&key_physical_attrs 100 100 1200 12 0 0 0>
, <&key_physical_attrs 100 100 1300 57 0 0 0>
, <&key_physical_attrs 100 100 1400 57 0 0 0>
, <&key_physical_attrs 100 100 0 157 0 0 0>
, <&key_physical_attrs 100 100 100 157 0 0 0>
, <&key_physical_attrs 100 100 200 112 0 0 0>
, <&key_physical_attrs 100 100 300 100 0 0 0>
, <&key_physical_attrs 100 100 400 112 0 0 0>
, <&key_physical_attrs 100 100 500 112 0 0 0>
, <&key_physical_attrs 100 100 900 112 0 0 0>
, <&key_physical_attrs 100 100 1000 112 0 0 0>
, <&key_physical_attrs 100 100 1100 100 0 0 0>
, <&key_physical_attrs 100 100 1200 112 0 0 0>
, <&key_physical_attrs 100 100 1300 157 0 0 0>
, <&key_physical_attrs 100 100 1400 157 0 0 0>
, <&key_physical_attrs 100 100 0 257 0 0 0>
, <&key_physical_attrs 100 100 100 257 0 0 0>
, <&key_physical_attrs 100 100 200 212 0 0 0>
, <&key_physical_attrs 100 100 300 200 0 0 0>
, <&key_physical_attrs 100 100 400 212 0 0 0>
, <&key_physical_attrs 100 100 500 212 0 0 0>
, <&key_physical_attrs 100 100 900 212 0 0 0>
, <&key_physical_attrs 100 100 1000 212 0 0 0>
, <&key_physical_attrs 100 100 1100 200 0 0 0>
, <&key_physical_attrs 100 100 1200 212 0 0 0>
, <&key_physical_attrs 100 100 1300 257 0 0 0>
, <&key_physical_attrs 100 100 1400 257 0 0 0>
, <&key_physical_attrs 100 100 348 312 0 0 0>
, <&key_physical_attrs 100 100 348 312 1500 398 789>
, <&key_physical_attrs 100 100 348 312 3000 398 789>
, <&key_physical_attrs 100 100 1052 312 (-3000) 1102 789>
, <&key_physical_attrs 100 100 1052 312 (-1500) 1102 789>
;
};

charybdis_5col_layout: charybdis_5col_layout{
compatible = "zmk,physical-layout";
display-name = "5-column";

transform = <&five_column_transform>;

keys // w h x y rot rx ry
= <&key_physical_attrs 100 100 0 57 0 0 0>
, <&key_physical_attrs 100 100 100 12 0 0 0>
, <&key_physical_attrs 100 100 200 0 0 0 0>
, <&key_physical_attrs 100 100 300 12 0 0 0>
, <&key_physical_attrs 100 100 400 12 0 0 0>
, <&key_physical_attrs 100 100 800 12 0 0 0>
, <&key_physical_attrs 100 100 900 12 0 0 0>
, <&key_physical_attrs 100 100 1000 0 0 0 0>
, <&key_physical_attrs 100 100 1100 12 0 0 0>
, <&key_physical_attrs 100 100 1200 57 0 0 0>
, <&key_physical_attrs 100 100 0 157 0 0 0>
, <&key_physical_attrs 100 100 100 112 0 0 0>
, <&key_physical_attrs 100 100 200 100 0 0 0>
, <&key_physical_attrs 100 100 300 112 0 0 0>
, <&key_physical_attrs 100 100 400 112 0 0 0>
, <&key_physical_attrs 100 100 800 112 0 0 0>
, <&key_physical_attrs 100 100 900 112 0 0 0>
, <&key_physical_attrs 100 100 1000 100 0 0 0>
, <&key_physical_attrs 100 100 1100 112 0 0 0>
, <&key_physical_attrs 100 100 1200 157 0 0 0>
, <&key_physical_attrs 100 100 0 257 0 0 0>
, <&key_physical_attrs 100 100 100 212 0 0 0>
, <&key_physical_attrs 100 100 200 200 0 0 0>
, <&key_physical_attrs 100 100 300 212 0 0 0>
, <&key_physical_attrs 100 100 400 212 0 0 0>
, <&key_physical_attrs 100 100 800 212 0 0 0>
, <&key_physical_attrs 100 100 900 212 0 0 0>
, <&key_physical_attrs 100 100 1000 200 0 0 0>
, <&key_physical_attrs 100 100 1100 212 0 0 0>
, <&key_physical_attrs 100 100 1200 257 0 0 0>
, <&key_physical_attrs 100 100 248 312 0 0 0>
, <&key_physical_attrs 100 100 248 312 1500 298 789>
, <&key_physical_attrs 100 100 248 312 3000 298 789>
, <&key_physical_attrs 100 100 952 312 (-3000) 1002 789>
, <&key_physical_attrs 100 100 952 312 (-1500) 1002 789>
;
};

charybdis_position_map {
compatible = "zmk,physical-layout-position-map";

complete;

twelve {
physical-layout = <&charybdis_6col_layout>;
positions
= < 0 1 2 3 4 5 6 7 8 9 10 11 >
, <12 13 14 15 16 17 18 19 20 21 22 23 >
, <24 25 26 27 28 29 30 31 32 33 34 35 >
, < 36 37 38 39 40 >
;
};

ten {
physical-layout = <&charybdis_5col_layout>;
positions
= <35 0 1 2 3 4 5 6 7 8 9 36>
, <37 10 11 12 13 14 15 16 17 18 19 38>
, <39 20 21 22 23 24 25 26 27 28 29 40>
, < 30 31 32 33 34 >
;
};
};
};
51 changes: 51 additions & 0 deletions boards/shields/charybdis/charybdis.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/mouse.h>

/ {
trackball_listener {
compatible = "zmk,input-listener";
device = <&vtrackball>;
};

keymap {
compatible = "zmk,keymap";

Base {
bindings = <
&kp LGUI &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp RGUI
&kp RCTRL &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp RCTRL
&kp LSHIFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &lt 7 SLASH &kp RSHIFT
&kp BSPC &kp SPACE &mo 1 &mo 2 &kp RET
>;
};

Lower {
bindings = <
&none &none &kp C_NEXT &kp C_PP &kp C_PREV &none &kp LBKT &kp N7 &kp N8 &kp N9 &kp RBKT &none
&none &kp LGUI &kp LALT &kp LCTRL &kp LSHIFT &none &kp KP_PLUS &kp N4 &kp N5 &kp N6 &kp KP_MINUS &none
&none &none &none &none &none &bootloader &kp KP_MULTIPLY &kp N1 &kp N2 &kp N3 &kp KP_SLASH &none
&none &none &trans &none &trans
>;
};

Raise {
bindings = <
&none &none &none &none &none &none &none &kp C_VOL_UP &kp C_MUTE &kp C_VOL_DN &none &none
&none &kp LEFT &kp UP &kp DOWN &kp RIGHT &none &none &kp RSHIFT &kp RCTRL &kp RALT &kp RGUI &none
&none &kp HOME &kp PG_UP &kp PG_DN &kp END &none &none &none &none &none &none &none
&trans &trans &none &trans &none
>;
};

Pointer {
bindings = <
&bootloader &none &none &none &none &none &none &none &none &none &none &bootloader
&none &kp LGUI &kp LALT &kp LCTRL &kp LSHIFT &none &none &kp RSHIFT &kp RCTRL &kp RALT &kp RGUI &none
&none &none &none &none &none &none &none &none &none &none &none &none
&mkp MB2 &mkp MB1 &mkp MB3 &mkp MB3 &mkp MB1
>;
};
};
};
2 changes: 2 additions & 0 deletions boards/shields/charybdis/charybdis_dongle.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
CONFIG_ZMK_SPLIT_BLE_CENTRAL_PERIPHERALS=2
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y

CONFIG_INPUT=y
CONFIG_ZMK_MOUSE=y
CONFIG_ZMK_MOUSE_SMOOTH_SCROLLING=y

CONFIG_ZMK_SLEEP=n
1 change: 1 addition & 0 deletions boards/shields/charybdis/charybdis_left.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_INPUT=y
14 changes: 14 additions & 0 deletions boards/shields/charybdis/charybdis_right.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CONFIG_SPI=y
CONFIG_INPUT=y
CONFIG_PMW3610=y
CONFIG_ZMK_MOUSE=y
CONFIG_ZMK_EXT_POWER=y

CONFIG_PMW3610_INVERT_X=y

CONFIG_PMW3610_REST1_SAMPLE_TIME_MS=100
CONFIG_PMW3610_REST2_SAMPLE_TIME_MS=200
CONFIG_PMW3610_REST3_SAMPLE_TIME_MS=300
CONFIG_PMW3610_RUN_DOWNSHIFT_TIME_MS=500
CONFIG_PMW3610_REST1_DOWNSHIFT_TIME_MS=3000
CONFIG_PMW3610_REST2_DOWNSHIFT_TIME_MS=30000
4 changes: 4 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@
include:
- board: seeeduino_xiao_ble
shield: charybdis_dongle
snippet: studio-rpc-usb-uart
cmake-args: -DCONFIG_ZMK_STUDIO=y
- board: nice_nano_v2
shield: charybdis_dongle
snippet: studio-rpc-usb-uart
cmake-args: -DCONFIG_ZMK_STUDIO=y
- board: nice_nano_v2
shield: charybdis_left
- board: nice_nano_v2
Expand Down
14 changes: 1 addition & 13 deletions config/charybdis.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,4 @@ CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
CONFIG_ZMK_BLE_EXPERIMENTAL_CONN=y

CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING=y
CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_PROXY=y

#eager debouce
#CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=1
#CONFIG_ZMK_KSCAN_DEBOUNCE_RELEASE_MS=5

#logging
#CONFIG_ZMK_USB_LOGGING=y
#CONFIG_LOG_MODE_IMMEDIATE=n
#CONFIG_LOG_TIMESTAMP_64BIT=y
#CONFIG_LOG_PROCESS_THREAD_STARTUP_DELAY_MS=5000
#CONFIG_ZMK_LOG_LEVEL_DBG=y
#CONFIG_KSCAN_LOG_LEVEL_INF=y
CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_PROXY=y
73 changes: 43 additions & 30 deletions config/charybdis.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <dt-bindings/zmk/mouse.h>
#include <dt-bindings/zmk/outputs.h>

#include <dt-bindings/zmk/input_transform.h>

#define Base 0
#define Media 1
#define Nav 2
Expand All @@ -16,43 +18,54 @@

/ {
trackball_listener {
compatible = "zmk,input-behavior-listener";
compatible = "zmk,input-listener";
device = <&vtrackball>;
layers = <0>;
evt-type = <INPUT_EV_REL>;
x-input-code = <INPUT_REL_X>;
y-input-code = <INPUT_REL_Y>;
scale-multiplier = <1>;
scale-divisor = <6>;

snipe {
layers = <MSE>;
input-processors = <&xy_scaler 1 3>;
};

scroll {
layers = <NAV>;
input-processors = <&xy_invert (INPUT_TRANSFORM_Y_INVERT)>, <&xy_scaler 1 3>, <&x_scaler 0 1>, <&mouse_to_wheel_mapper>;
};
};

trackball_snipe_listener {
compatible = "zmk,input-behavior-listener";
device = <&vtrackball>;
layers = <7>;
evt-type = <INPUT_EV_REL>;
x-input-code = <INPUT_REL_X>;
y-input-code = <INPUT_REL_Y>;
scale-multiplier = <1>;
scale-divisor = <16>;
xy_scaler: xy_scaler {
compatible = "zmk,input-processor-scaler";
#input-processor-cells = <2>;
type = <INPUT_EV_REL>;
codes = <INPUT_REL_X>, <INPUT_REL_Y>;
};

trackball_scroll_listener {
compatible = "zmk,input-behavior-listener";
device = <&vtrackball>;
layers = <2>;
evt-type = <INPUT_EV_REL>;
x-input-code = <INPUT_REL_MISC>;
y-input-code = <INPUT_REL_WHEEL>;
y-invert;
bindings = <&ib_wheel_scaler 1 8>;
x_scaler: x_scaler {
compatible = "zmk,input-processor-scaler";
#input-processor-cells = <2>;
type = <INPUT_EV_REL>;
codes = <INPUT_REL_X>;
};

y_scaler: y_scaler {
compatible = "zmk,input-processor-scaler";
#input-processor-cells = <2>;
type = <INPUT_EV_REL>;
codes = <INPUT_REL_Y>;
};

xy_invert: xy_invert {
compatible = "zmk,input-processor-transform";
#input-processor-cells = <1>;
type = <INPUT_EV_REL>;
x-codes = <INPUT_REL_X>, <INPUT_REL_WHEEL>;
y-codes = <INPUT_REL_Y>, <INPUT_REL_HWHEEL>;
};

ib_wheel_scaler: ib_wheel_scaler {
compatible = "zmk,input-behavior-scaler";
#binding-cells = <2>;
evt-type = <INPUT_EV_REL>;
input-code = <INPUT_REL_WHEEL>;
mouse_to_wheel_mapper: mouse_to_wheel_mapper {
compatible = "zmk,input-processor-code-mapper";
#input-processor-cells = <0>;
type = <INPUT_EV_REL>;
map = <INPUT_REL_X INPUT_REL_MISC>, <INPUT_REL_Y INPUT_REL_WHEEL>;
};

behaviors {
Expand Down
1 change: 0 additions & 1 deletion config/charybdis_left.conf

This file was deleted.

24 changes: 0 additions & 24 deletions config/charybdis_right.conf

This file was deleted.

Loading

0 comments on commit ea6c3b2

Please sign in to comment.