Skip to content

Commit

Permalink
add base bt config
Browse files Browse the repository at this point in the history
  • Loading branch information
mkonji008 committed Oct 27, 2024
1 parent 8c8d226 commit 3b9b722
Show file tree
Hide file tree
Showing 17 changed files with 491 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
on: [push, pull_request, workflow_dispatch]

jobs:
build:
uses: petejohanson/zmk/.github/workflows/build-user-config.yml@core/zephyr-3.5-update
19 changes: 19 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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, e.g:
#
# board: [ "nice_nano_v2" ]
# shield: [ "corne_left", "corne_right" ]
# include:
# - board: bdn9_rev2
# - board: nice_nano_v2
# shield: reviung41
#
---
include:
- board: nice_nano_v2
shield: charybdis_left
- board: nice_nano_v2
shield: charybdis_right
16 changes: 16 additions & 0 deletions config/boards/shields/charybdis/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
if SHIELD_CHARYBDIS_RIGHT

config ZMK_KEYBOARD_NAME
default "Charybdis"

config ZMK_SPLIT_BLE_ROLE_CENTRAL
default y

endif

if SHIELD_CHARYBDIS_LEFT || SHIELD_CHARYBDIS_RIGHT

config ZMK_SPLIT
default y

endif
5 changes: 5 additions & 0 deletions config/boards/shields/charybdis/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
config SHIELD_CHARYBDIS_LEFT
def_bool $(shields_list_contains,charybdis_left)

config SHIELD_CHARYBDIS_RIGHT
def_bool $(shields_list_contains,charybdis_right)
Empty file.
37 changes: 37 additions & 0 deletions config/boards/shields/charybdis/charybdis.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#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 = <10>;
rows = <4>;

map = <
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9)
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9)
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9)
RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7)

>;
};

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";

diode-direction = "col2row";
row-gpios= <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>

;
};

};
11 changes: 11 additions & 0 deletions config/boards/shields/charybdis/charybdis.zmk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
file_format: "1"
id: charybdis
name: Charybdis
type: shield
url: https://github.com/Bastardkb/Charybdis/
requires: [pro_micro]
features:
- keys
siblings:
- charybdis_left
- charybdis_right
Empty file.
18 changes: 18 additions & 0 deletions config/boards/shields/charybdis/charybdis_left.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright (c) 2020 ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include "charybdis.dtsi"

&kscan0 {
diode-direction = "col2row";
col-gpios
= <&pro_micro 20 (GPIO_ACTIVE_HIGH)> // COL1
, <&pro_micro 10 (GPIO_ACTIVE_HIGH)> // COL2
, <&pro_micro 6 (GPIO_ACTIVE_HIGH)> // COL3
, <&pro_micro 7 (GPIO_ACTIVE_HIGH)> // COL4
, <&pro_micro 8 (GPIO_ACTIVE_HIGH)> // COL5
;
};
Empty file.
68 changes: 68 additions & 0 deletions config/boards/shields/charybdis/charybdis_right.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Copyright (c) 2020 ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include "charybdis.dtsi"

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

&kscan0 {
diode-direction = "col2row";
col-gpios
= <&pro_micro 20 (GPIO_ACTIVE_HIGH)> // COL1
, <&pro_micro 10 (GPIO_ACTIVE_HIGH)> // COL2
, <&pro_micro 6 (GPIO_ACTIVE_HIGH)> // COL3
, <&pro_micro 7 (GPIO_ACTIVE_HIGH)> // COL4
, <&pro_micro 8 (GPIO_ACTIVE_HIGH)> // COL5
;
};

&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 = "okay";
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 = "okay";
compatible = "pixart,pmw3610";
reg = <0>;
spi-max-frequency = <2000000>;
irq-gpios = <&gpio0 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
scroll-layers = <1>;
// snipe-layers = <>;
// automouse-layer = <5>;
};
};

/ {
trackball_listener {
compatible = "zmk,input-listener";
device = <&trackball>;
};
};
6 changes: 6 additions & 0 deletions config/charybdis.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y

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
176 changes: 176 additions & 0 deletions config/charybdis.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
#include <behaviors/mouse_keys.dtsi>
#include <behaviors.dtsi>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/mouse.h>
#include <dt-bindings/zmk/outputs.h>

#define HM_TAPPING_TERM 300
#define HM_TAPPING_TERM_FAST 200
#define HM_PRIOR_IDLE 150

#define COMBO_TERM_FAST 35
#define COMBO_TERM_SLOW 40
#define COMBO_PRIOR_IDLE 100
/ {
behaviors {
lt: layer_tap {
compatible = "zmk,behavior-hold-tap";
#binding-cells = <2>;
flavor = "balanced";
tapping-term-ms = <240>;
quick-tap-ms = <150>;
bindings = <&mo>, <&kp>;
};

bhm: balanced_homerow_mods {
compatible = "zmk,behavior-hold-tap";
#binding-cells = <2>;
tapping-term-ms = <HM_TAPPING_TERM>;
quick-tap-ms = <175>;
require-prior-idle-ms = <HM_PRIOR_IDLE>;
flavor = "balanced";
bindings = <&kp>, <&kp>;
};
};

combos {
compatible = "zmk,combos";

escape {
bindings = <&kp ESCAPE>;
key-positions = <8 9>;
require-prior-idle-ms = <COMBO_PRIOR_IDLE>;
};

tab {
bindings = <&kp TAB>;
key-positions = <0 1>;
require-prior-idle-ms = <COMBO_PRIOR_IDLE>;
};

delete {
bindings = <&kp DELETE>;
key-positions = <29 28>;
require-prior-idle-ms = <COMBO_PRIOR_IDLE>;
};

bt+boot_right {
bindings = <&mo 4>;
key-positions = <5 6 7 8>;
};

bt+boot_left {
bindings = <&mo 4>;
key-positions = <1 2 3 4>;
};
};

keymap {
compatible = "zmk,keymap";

Base {
label = "Base";
bindings = <
&kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P
&bhm LCTRL A &bhm LALT S &bhm LGUI D &bhm LSHIFT F &kp G &kp H &bhm RIGHT_SHIFT J &bhm LEFT_GUI K &bhm LEFT_ALT L &bhm LCTRL SLASH
&kp Z &kp X &kp C &kp V &lt 1 B &lt 7 N &lt 6 M &kp COMMA &kp DOT &mkp MCLK
&mkp LCLK &lt 1 SPACE &mkp RCLK &lt 3 RET &lt 2 BACKSPACE
>;
};

Lower {
label = "Lower";
bindings = <
&kp F1 &kp F2 &kp F3 &kp F4 &none &kp N0 &kp N1 &kp N2 &kp N3 &kp MINUS
&kp F5 &kp F6 &kp F7 &kp F8 &none &kp SLASH &kp N4 &kp N5 &kp NUMBER_6 &kp PLUS
&kp F9 &kp F10 &kp F11 &kp F12 &none &kp ASTERISK &kp N7 &kp N8 &kp N9 &kp EQUAL
&kp LEFT &kp RIGHT &kp DELETE &kp DEL &trans
>;
};

Raise {
label = "Raise";
bindings = <
&kp DOLLAR &kp PERCENT &kp CARET &kp LBRC &kp RBRC &kp EQUAL &kp PLUS &kp GRAVE &kp SINGLE_QUOTE &kp SEMICOLON
&kp AMPS &kp EXCL &kp QMARK &kp LBKT &kp RBKT &kp UNDER &kp MINUS &trans &kp DOUBLE_QUOTES &kp COLON
&kp AT &kp LESS_THAN &kp GREATER_THAN &kp LPAR &kp RPAR &kp HASH &kp ASTERISK &kp TILDE &kp PIPE &kp BACKSLASH
&trans &trans &kp SPACE &trans &trans
>;
};

nav-and-fn {
label = "nav-and-fn";
bindings = <
&kp LS(TAB) &kp TAB &kp INSERT &kp HOME &kp PAGE_UP &none &kp LA(LEFT) &kp LA(DOWN) &kp LA(UP) &kp LA(RIGHT)
&none &none &none &kp END &kp PAGE_DOWN &none &kp LEFT &kp DOWN &kp UP &kp RIGHT
&to 8 &none &none &none &kp PRINTSCREEN &kp DELETE &kp LC(LEFT) &kp LC(DOWN) &kp LC(UP) &kp LC(RIGHT)
&trans &trans &kp SPACE &trans &trans
>;
};

bt+boot {
label = "bt+boot";
bindings = <
&bt BT_NXT &bt BT_PRV &none &none &none &none &none &none &none &none
&bt BT_CLR &none &none &none &none &none &none &none &none &none
&out OUT_TOG &none &none &none &bootloader &bootloader &none &none &none &none
&none &none &none &none &none
>;
};

Mouse {
bindings = <
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&mkp MCLK &trans &trans &trans &trans &trans &trans &trans &trans &mkp LCLK
&mkp LCLK &trans &mkp RCLK &trans &trans
>;
};

macro-1 {
bindings = <
&kp LG(N1) &kp LG(N2) &kp LG(N3) &none &none &none &none &none &none &none
&kp LG(N4) &kp LG(N5) &kp LG(N6) &none &none &none &none &none &none &none
&kp LG(N7) &kp LG(N8) &kp LG(N9) &kp LG(N0) &none &none &none &none &none &none
&none &none &none &none &none
>;
};

macro-2 {
bindings = <
&kp LG(LS(N1)) &kp LG(LS(N2)) &kp LS(LG(N3)) &none &none &none &none &none &none &none
&kp LG(LS(N4)) &kp LG(LS(N5)) &kp LG(LS(N6)) &none &none &none &none &none &none &none
&kp LG(LS(N7)) &kp LG(LS(N8)) &kp LG(LS(N9)) &kp LS(LG(N0)) &none &none &none &none &none &none
&none &none &none &none &none
>;
};

game {
bindings = <
&kp TAB &kp Q &kp W &kp E &kp R &kp F1 &kp F2 &kp F3 &kp F4 &kp F5
&kp LCTRL &kp A &kp S &kp D &kp F &kp COMMA &kp PERIOD &none &none &none
&kp LSHIFT &kp Z &kp X &kp C &kp V &mkp LCLK &mkp MCLK &mkp RCLK &none &to 0
&mo 10 &mo 9 &kp SPACE &mo 2 &kp LEFT_CONTROL
>;
};

game+ {
bindings = <
&kp T &kp Y &kp U &kp I &kp O &trans &trans &trans &trans &trans
&kp G &kp H &kp J &kp K &kp L &trans &trans &trans &trans &trans
&kp B &kp N &kp M &kp P &kp TILDE &trans &trans &trans &trans &trans
&trans &trans &kp SPACE &mo 2 &kp LEFT_CONTROL
>;
};

game++ {
bindings = <
&kp ESC &kp HOME &kp UP &kp END &kp PAGE_UP &trans &trans &trans &trans &trans
&kp DEL &kp LEFT &kp DOWN &kp RIGHT &kp PAGE_DOWN &trans &trans &trans &trans &trans
&kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &trans &trans &trans &trans &trans
&trans &trans &kp SPACE &mo 2 &kp LEFT_CONTROL
>;
};
};
};
19 changes: 19 additions & 0 deletions config/charybdis_right.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
CONFIG_SPI=y
CONFIG_INPUT=y
CONFIG_ZMK_MOUSE=y

CONFIG_ZMK_EXT_POWER=y

CONFIG_PMW3610=y
CONFIG_PMW3610_CPI=2400
CONFIG_PMW3610_CPI_DIVIDOR=4
CONFIG_PMW3610_ORIENTATION_90=y
CONFIG_PMW3610_SNIPE_CPI=800
CONFIG_PMW3610_SNIPE_CPI_DIVIDOR=4
CONFIG_PMW3610_SCROLL_TICK=32
CONFIG_PMW3610_INVERT_X=y
CONFIG_PMW3610_AUTOMOUSE_TIMEOUT_MS=750

CONFIG_PMW3610_POLLING_RATE_125_SW=y

CONFIG_PMW3610_SMART_ALGORITHM=y
Loading

0 comments on commit 3b9b722

Please sign in to comment.