diff options
| author | Victor <lucachi.victor@gmail.com> | 2024-06-16 14:23:45 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-16 14:23:45 +0300 |
| commit | caa38a42a2731c6cc989e10de80f6f7a5f244d8a (patch) | |
| tree | 699fab3816cd299fcc987a5778ef582fa0e41bdc | |
| parent | 0823a3920a2c81e3c53859b422d75bae3ca4c54c (diff) | |
| download | zmk-config-caa38a42a2731c6cc989e10de80f6f7a5f244d8a.tar.gz zmk-config-caa38a42a2731c6cc989e10de80f6f7a5f244d8a.zip | |
initial dongle conf
| -rw-r--r-- | boards/shields/charybdis/Kconfig.defconfig | 16 | ||||
| -rw-r--r-- | boards/shields/charybdis/Kconfig.shield | 8 | ||||
| -rw-r--r-- | boards/shields/charybdis/charybdis.dtsi | 38 | ||||
| -rw-r--r-- | boards/shields/charybdis/charybdis_3610.dtsi | 52 | ||||
| -rw-r--r-- | boards/shields/charybdis/charybdis_dongle.conf | 8 | ||||
| -rw-r--r-- | boards/shields/charybdis/charybdis_dongle.overlay | 26 | ||||
| -rw-r--r-- | boards/shields/charybdis/charybdis_left.conf | 0 | ||||
| -rw-r--r-- | boards/shields/charybdis/charybdis_left.overlay | 28 | ||||
| -rw-r--r-- | boards/shields/charybdis/charybdis_right.conf | 0 | ||||
| -rw-r--r-- | boards/shields/charybdis/charybdis_right.overlay | 50 | ||||
| -rw-r--r-- | build.yaml | 11 | ||||
| -rw-r--r-- | config/charybdis.conf | 15 | ||||
| -rw-r--r-- | config/charybdis.keymap | 161 | ||||
| -rw-r--r-- | config/charybdis_right.conf | 17 | ||||
| -rw-r--r-- | config/west.yml | 13 |
15 files changed, 442 insertions, 1 deletions
diff --git a/boards/shields/charybdis/Kconfig.defconfig b/boards/shields/charybdis/Kconfig.defconfig new file mode 100644 index 0000000..30fcb5d --- /dev/null +++ b/boards/shields/charybdis/Kconfig.defconfig @@ -0,0 +1,16 @@ +if SHIELD_CHARYBDIS_DONGLE + +config ZMK_KEYBOARD_NAME + default "Charybdis" + +config ZMK_SPLIT_ROLE_CENTRAL + default y + +endif + +if SHIELD_CHARYBDIS_DONGLE || SHIELD_CHARYBDIS_LEFT || SHIELD_CHARYBDIS_RIGHT + +config ZMK_SPLIT + default y + +endif diff --git a/boards/shields/charybdis/Kconfig.shield b/boards/shields/charybdis/Kconfig.shield new file mode 100644 index 0000000..88d8453 --- /dev/null +++ b/boards/shields/charybdis/Kconfig.shield @@ -0,0 +1,8 @@ +config SHIELD_CHARYBDIS_DONGLE + def_bool $(shields_list_contains,charybdis_dongle) + +config SHIELD_CHARYBDIS_LEFT + def_bool $(shields_list_contains,charybdis_left) + +config SHIELD_CHARYBDIS_RIGHT + def_bool $(shields_list_contains,charybdis_right) \ No newline at end of file diff --git a/boards/shields/charybdis/charybdis.dtsi b/boards/shields/charybdis/charybdis.dtsi new file mode 100644 index 0000000..e974e08 --- /dev/null +++ b/boards/shields/charybdis/charybdis.dtsi @@ -0,0 +1,38 @@ +#include <dt-bindings/zmk/matrix_transform.h> + +/ { + chosen { + zmk,kscan = &kscan0; + zmk,matrix_transform = &default_transform; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <12>; + rows = <4>; + + map = < + 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) + 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) + 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) + RC(3,3) RC(3,4) RC(3,1) RC(3,7) RC(3,9) + >; + }; + + five_column_transform: keymap_transform_1 { + compatible = "zmk,matrix-transform"; + columns = <10>; + rows = <4>; + + map = < + RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,10) RC(0,9) RC(0,8) RC(0,7) RC(0,6) + RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,10) RC(1,9) RC(1,8) RC(1,7) RC(1,6) + RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,10) RC(2,9) RC(2,8) RC(2,7) RC(2,6) + RC(3,3) RC(3,4) RC(3,1) RC(3,6) RC(3,8) + >; + }; + + kscan0: kscan { + diode-direction = "row2col"; + }; +}; \ No newline at end of file diff --git a/boards/shields/charybdis/charybdis_3610.dtsi b/boards/shields/charybdis/charybdis_3610.dtsi new file mode 100644 index 0000000..2edc255 --- /dev/null +++ b/boards/shields/charybdis/charybdis_3610.dtsi @@ -0,0 +1,52 @@ +#define INPUT_EV_KEY 0x01 /**< Key event */ +#define INPUT_EV_REL 0x02 /**< Relative coordinate event */ +#define INPUT_EV_ABS 0x03 /**< Absolute coordinate event */ +#define INPUT_EV_MSC 0x04 /**< Miscellaneous event */ +#define INPUT_EV_VENDOR_START 0xf0 /**< Vendor specific event start */ +#define INPUT_EV_VENDOR_STOP 0xff /**< Vendor specific event stop */ + +#define INPUT_REL_X 0x00 /**< Relative X coordinate */ +#define INPUT_REL_Y 0x01 /**< Relative Y coordinate */ +#define INPUT_REL_WHEEL 0x08 /**< Relative wheel coordinate */ +#define INPUT_REL_HWHEEL 0x06 /**< Relative horizontal wheel coordinate */ +#define INPUT_REL_MISC 0x09 /**< Relative misc coordinate */ + +&pinctrl { + spi0_default: spi0_default { + group1 { + psels = <NRF_PSEL(SPIM_SCK, 0, 8)>, + <NRF_PSEL(SPIM_MOSI, 0, 17)>, + <NRF_PSEL(SPIM_MISO, 0, 17)>; + }; + }; + + spi0_sleep: spi0_sleep { + group1 { + psels = <NRF_PSEL(SPIM_SCK, 0, 8)>, + <NRF_PSEL(SPIM_MOSI, 0, 17)>, + <NRF_PSEL(SPIM_MISO, 0, 17)>; + low-power-enable; + }; + }; +}; + +&spi0 { + status = "disabled"; + compatible = "nordic,nrf-spim"; + pinctrl-0 = <&spi0_default>; + pinctrl-1 = <&spi0_sleep>; + pinctrl-names = "default", "sleep"; + cs-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>; + + trackball: trackball@0 { + status = "disabled"; + compatible = "pixart,pmw3610"; + reg = <0>; + spi-max-frequency = <2000000>; + irq-gpios = <&gpio0 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + cpi = <3200>; + evt-type = <INPUT_EV_REL>; + x-input-code = <INPUT_REL_X>; + y-input-code = <INPUT_REL_Y>; + }; +}; \ No newline at end of file diff --git a/boards/shields/charybdis/charybdis_dongle.conf b/boards/shields/charybdis/charybdis_dongle.conf new file mode 100644 index 0000000..609e8a6 --- /dev/null +++ b/boards/shields/charybdis/charybdis_dongle.conf @@ -0,0 +1,8 @@ +CONFIG_ZMK_SPLIT_BLE_CENTRAL_PERIPHERALS=2 + +#CONFIG_SPI=y +#CONFIG_INPUT=y +#CONFIG_PINCTRL=y +#CONFIG_ZMK_MOUSE=y + +CONFIG_ZMK_SLEEP=n \ No newline at end of file diff --git a/boards/shields/charybdis/charybdis_dongle.overlay b/boards/shields/charybdis/charybdis_dongle.overlay new file mode 100644 index 0000000..27f7f2c --- /dev/null +++ b/boards/shields/charybdis/charybdis_dongle.overlay @@ -0,0 +1,26 @@ +#include "charybdis.dtsi" + +/ { + chosen { + zmk,kscan = &mock_kscan; + }; + + mock_kscan: kscan_1 { + compatible = "zmk,kscan-mock"; + columns = <0>; + rows = <0>; + events = <0>; + }; +}; + +/ { + vtrackball: virtual_input_trackball { + compatible = "zmk,virtual-input"; + }; + + input_relay_config_trackball { + compatible = "zmk,split-peripheral-input-relay"; + device = <&vtrackball>; + relay-channel = <102>; + }; +}; \ No newline at end of file diff --git a/boards/shields/charybdis/charybdis_left.conf b/boards/shields/charybdis/charybdis_left.conf new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/boards/shields/charybdis/charybdis_left.conf diff --git a/boards/shields/charybdis/charybdis_left.overlay b/boards/shields/charybdis/charybdis_left.overlay new file mode 100644 index 0000000..5e2887a --- /dev/null +++ b/boards/shields/charybdis/charybdis_left.overlay @@ -0,0 +1,28 @@ +#include "charybdis.dtsi" +#include "charybdis_3610.dtsi" + +&kscan0 { + compatible = "zmk,kscan-gpio-matrix"; + + col-gpios + = <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + + row-gpios + = <&pro_micro 18 GPIO_ACTIVE_HIGH> + , <&pro_micro 5 GPIO_ACTIVE_HIGH> + , <&pro_micro 4 GPIO_ACTIVE_HIGH> + , <&pro_micro 9 GPIO_ACTIVE_HIGH> + ; +}; + +/ { + vtrackball: virtual_input_trackball { + compatible = "zmk,virtual-input"; + }; +}; \ No newline at end of file diff --git a/boards/shields/charybdis/charybdis_right.conf b/boards/shields/charybdis/charybdis_right.conf new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/boards/shields/charybdis/charybdis_right.conf diff --git a/boards/shields/charybdis/charybdis_right.overlay b/boards/shields/charybdis/charybdis_right.overlay new file mode 100644 index 0000000..5c41819 --- /dev/null +++ b/boards/shields/charybdis/charybdis_right.overlay @@ -0,0 +1,50 @@ +#include "charybdis.dtsi" +#include "charybdis_3610.dtsi" + +&default_transform { + col-offset = <6>; +}; + +&five_column_transform { + col-offset = <5>; +}; + +&kscan0 { + compatible = "zmk,kscan-gpio-matrix"; + + col-gpios + = <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + + row-gpios + = <&pro_micro 18 GPIO_ACTIVE_HIGH> + , <&pro_micro 5 GPIO_ACTIVE_HIGH> + , <&pro_micro 4 GPIO_ACTIVE_HIGH> + , <&pro_micro 9 GPIO_ACTIVE_HIGH> + ; +}; + +&spi0 { + status = "okay"; +}; + +&trackball { + status = "okay"; +}; + +/ { + vtrackball: virtual_input_trackball { + compatible = "zmk,virtual-input"; + }; + + input_relay_config_trackball { + compatible = "zmk,split-peripheral-input-relay"; + device = <&trackball>; + relay-channel = <102>; + }; +}; \ No newline at end of file diff --git a/build.yaml b/build.yaml index f8e9c6c..f64c746 100644 --- a/build.yaml +++ b/build.yaml @@ -17,3 +17,14 @@ # artifact-name: corne_left_with_logging # --- +include: + - board: seeeduino_xiao_ble + shield: charybdis_dongle + - board: nice_nano_v2 + shield: charybdis_left + - board: nice_nano_v2 + shield: charybdis_right +# - board: seeeduino_xiao_ble +# shield: settings_reset +# - board: nice_nano_v2 +# shield: settings_reset \ No newline at end of file diff --git a/config/charybdis.conf b/config/charybdis.conf new file mode 100644 index 0000000..75e8eda --- /dev/null +++ b/config/charybdis.conf @@ -0,0 +1,15 @@ +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 + +CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=1 +CONFIG_ZMK_KSCAN_DEBOUNCE_RELEASE_MS=5 + +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 \ No newline at end of file diff --git a/config/charybdis.keymap b/config/charybdis.keymap new file mode 100644 index 0000000..2b097cb --- /dev/null +++ b/config/charybdis.keymap @@ -0,0 +1,161 @@ +#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/mouse.h> +#include <dt-bindings/zmk/outputs.h> + +#define Base 0 +#define Media 1 +#define Nav 2 +#define Mouse 3 +#define Sym 4 +#define Num 5 +#define Fun 6 +#define Button 7 + +/ { + trackball_listener { + compatible = "zmk,input-behavior-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>; + }; + + 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>; + }; + + 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>; + }; + + ib_wheel_scaler: ib_wheel_scaler { + compatible = "zmk,input-behavior-scaler"; + #binding-cells = <2>; + evt-type = <INPUT_EV_REL>; + input-code = <INPUT_REL_WHEEL>; + }; + + behaviors { + hm: homerow_mods { + compatible = "zmk,behavior-hold-tap"; + #binding-cells = <2>; + flavor = "tap-preferred"; + tapping-term-ms = <240>; + quick-tap-ms = <150>; + bindings = + <&kp>, + <&kp>; + }; + + lt: layer_tap { + compatible = "zmk,behavior-hold-tap"; + #binding-cells = <2>; + flavor = "balanced"; + tapping-term-ms = <240>; + quick-tap-ms = <150>; + bindings = + <&mo>, + <&kp>; + }; + }; + + chosen { + zmk,matrix_transform = &five_column_transform; + }; + + keymap { + compatible = "zmk,keymap"; + + Base { + bindings = < + &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P + &hm LGUI A &hm LALT S &hm LCTRL D &hm LSHIFT F &kp G &kp H &hm RSHFT J &hm RCTRL K &hm RALT L &hm RGUI SEMICOLON + &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT < 7 SLASH + < 1 ESCAPE < 2 TAB < 3 SPACE < 4 BACKSPACE < 5 ENTER + >; + }; + + Media { + bindings = < + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &kp LGUI &kp LALT &kp LCTRL &kp LSHIFT &trans &trans &kp C_PREVIOUS &kp C_VOLUME_DOWN &kp C_VOLUME_UP &kp C_NEXT + &kp C_PREV &kp C_VOL_DN &kp C_VOL_UP &kp C_NEXT &trans &trans &trans &trans &trans &trans + &trans &trans &trans &kp C_STOP &kp C_PLAY_PAUSE + >; + }; + + Nav { + bindings = < + &kp LC(Z) &kp LC(X) &kp LC(C) &kp LC(V) &kp LC(A) &trans &trans &trans &trans &trans + &kp LEFT_GUI &kp LALT &kp LCTRL &kp LSHIFT &kp SQT &kp CAPS &kp LEFT &kp DOWN &kp UP &kp RIGHT + &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp DELETE &kp INSERT &kp HOME &kp PAGE_DOWN &kp PAGE_UP &kp END + &trans &trans &trans &kp DELETE &kp ENTER + >; + }; + + Mouse { + bindings = < + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &mkp LCLK &mkp MCLK &mkp RCLK &trans &trans &mkp LCLK &mkp MCLK &mkp RCLK &trans + &trans &trans &trans &trans &trans + >; + }; + + Sym { + bindings = < + &kp LEFT_BRACE &kp AMPERSAND &kp ASTERISK &kp LEFT_PARENTHESIS &kp RIGHT_BRACE &trans &trans &trans &trans &trans + &kp COLON &kp DOLLAR &kp PERCENT &kp CARET &kp PLUS &trans &kp RSHIFT &kp RCTRL &kp RALT &kp RGUI + &kp TILDE &kp EXCL &kp AT &kp HASH &kp PIPE &trans &trans &trans &trans &trans + &kp LEFT_PARENTHESIS &kp RIGHT_PARENTHESIS &kp UNDERSCORE &trans &trans + >; + }; + + Num { + bindings = < + &kp LEFT_BRACKET &kp NUMBER_7 &kp NUMBER_8 &kp NUMBER_9 &kp RIGHT_BRACKET &trans &trans &trans &trans &trans + &kp SEMICOLON &kp NUMBER_4 &kp NUMBER_5 &kp NUMBER_6 &kp EQUAL &trans &kp RSHIFT &kp RCTRL &kp RALT &kp RGUI + &kp GRAVE &kp NUMBER_1 &kp NUMBER_2 &kp NUMBER_3 &kp BACKSLASH &trans &trans &trans &trans &trans + &kp SQT &kp NUMBER_0 &kp MINUS &trans &trans + >; + }; + + Fun { + bindings = < + &kp F12 &kp F7 &kp F8 &kp F9 &kp PRINTSCREEN &trans &trans &trans &trans &trans + &kp F11 &kp F4 &kp F5 &kp F6 &kp SCROLLLOCK &trans &kp RSHIFT &kp RCTRL &kp RALT &kp RGUI + &kp F10 &kp F1 &kp F2 &kp F3 &kp PAUSE_BREAK &trans &trans &trans &trans &trans + &kp C_MENU &kp TAB &kp SPACE &trans &trans + >; + }; + + Button { + bindings = < + &bt BT_CLR &bootloader &trans &trans &bt BT_SEL 0 &out OUT_TOG &out OUT_USB &out OUT_BLE &bootloader &trans + &kp LGUI &kp LALT &kp LCTRL &kp LSHIFT &bt BT_SEL 1 &trans &kp RSHIFT &kp RCTRL &kp RALT &kp RGUI + &ext_power EP_TOG &ext_power EP_ON &ext_power EP_OFF &trans &bt BT_SEL 2 &trans &mkp LCLK &mkp MCLK &mkp RCLK &trans + &mkp LCLK &mkp MCLK &mkp RCLK &mkp MB4 &mkp MB5 + >; + }; + }; +}; \ No newline at end of file diff --git a/config/charybdis_right.conf b/config/charybdis_right.conf new file mode 100644 index 0000000..940bf9f --- /dev/null +++ b/config/charybdis_right.conf @@ -0,0 +1,17 @@ +#CONFIG_SPI=y +#CONFIG_INPUT=y +#CONFIG_PMW3610=y +#CONFIG_ZMK_MOUSE=y +#CONFIG_ZMK_EXT_POWER=y + +CONFIG_PMW3610_SWAP_XY=y +CONFIG_PMW3610_INVERT_X=y +CONFIG_PMW3610_INVERT_Y=y +#CONFIG_PMW3610_REPORT_INTERVAL_MIN=12 + +#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 + +#CONFIG_SPI_LOG_LEVEL_DBG=y \ No newline at end of file diff --git a/config/west.yml b/config/west.yml index b886cbe..94f76b4 100644 --- a/config/west.yml +++ b/config/west.yml @@ -2,12 +2,23 @@ manifest: remotes: - name: zmkfirmware url-base: https://github.com/zmkfirmware + - name: badjeff + url-base: https://github.com/badjeff # Additional modules containing boards/shields/custom code can be listed here as well # See https://docs.zephyrproject.org/3.2.0/develop/west/manifest.html#projects projects: - name: zmk remote: zmkfirmware - revision: main + revision: feat/pointers-move-scroll import: app/west.yml + - name: zmk-pmw3610-driver + remote: badjeff + revision: main + - name: zmk-split-peripheral-input-relay + remote: badjeff + revision: main + - name: zmk-input-behavior-listener + remote: badjeff + revision: main self: path: config |