Skip to content

Commit

Permalink
update with charybdis dongle config
Browse files Browse the repository at this point in the history
  • Loading branch information
mkonji008 committed Oct 27, 2024
0 parents commit 9a6929d
Show file tree
Hide file tree
Showing 21 changed files with 572 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: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
todo

-sort out wiring differences in zmk between handwire and bastardkb
-adjust keymap
Empty file added boards/shields/.gitkeep
Empty file.
16 changes: 16 additions & 0 deletions boards/shields/charybdis/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions boards/shields/charybdis/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -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)
36 changes: 36 additions & 0 deletions boards/shields/charybdis/charybdis.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#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)>

;
};
};
52 changes: 52 additions & 0 deletions boards/shields/charybdis/charybdis_3610.dtsi
Original file line number Diff line number Diff line change
@@ -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 = <2400>;
evt-type = <INPUT_EV_REL>;
x-input-code = <INPUT_REL_X>;
y-input-code = <INPUT_REL_Y>;
};
};
13 changes: 13 additions & 0 deletions boards/shields/charybdis/charybdis_dongle.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CONFIG_ZMK_SPLIT_BLE_CENTRAL_PERIPHERALS=2

CONFIG_INPUT=y
CONFIG_ZMK_MOUSE=y

CONFIG_ZMK_SLEEP=n

#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
24 changes: 24 additions & 0 deletions boards/shields/charybdis/charybdis_dongle.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#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
;
};

/ {
vtrackball: virtual_input_trackball {
compatible = "zmk,virtual-input";
};

input_relay_config_trackball {
compatible = "zmk,split-peripheral-input-relay";
device = <&vtrackball>;
relay-channel = <102>;
};
};
Empty file.
19 changes: 19 additions & 0 deletions boards/shields/charybdis/charybdis_left.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "charybdis.dtsi"
#include "charybdis_3610.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
;
};

/ {
vtrackball: virtual_input_trackball {
compatible = "zmk,virtual-input";
};
};
Empty file.
37 changes: 37 additions & 0 deletions boards/shields/charybdis/charybdis_right.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include "charybdis.dtsi"
#include "charybdis_3610.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
;
};

&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>;
};
};
28 changes: 28 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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. You can also use the `cmake-args` property to
# pass flags to the build command and `artifact-name` to assign a name to
# distinguish build outputs from each other:
#
# board: [ "nice_nano_v2" ]
# shield: [ "corne_left", "corne_right" ]
# include:
# - board: bdn9_rev2
# - board: nice_nano_v2
# shield: reviung41
# - board: nice_nano_v2
# shield: corne_left
# cmake-args: -DCONFIG_ZMK_USB_LOGGING=y
# artifact-name: corne_left_with_logging
#
---
include:
- board: nice_nano_v2
shield: charybdis_dongle
- board: nice_nano_v2
shield: charybdis_left
- board: nice_nano_v2
shield: charybdis_right
- board: nice_nano_v2
shield: settings_reset
5 changes: 5 additions & 0 deletions config/charybdis.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
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
Loading

0 comments on commit 9a6929d

Please sign in to comment.