Skip to content

Commit

Permalink
zephyr 3.5 config for the charybdis
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlucachi authored Dec 29, 2023
1 parent c17b270 commit 0f59dfa
Show file tree
Hide file tree
Showing 16 changed files with 189 additions and 89 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ on: [push, pull_request, workflow_dispatch]

jobs:
build:
uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main
uses: petejohanson/zmk/.github/workflows/build-user-config.yml@core/zephyr-3.5-update
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)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG_BT_LL_SW_LLCP_LEGACY=y
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y

CONFIG_BT_PERIPHERAL_PREF_MAX_INT=9
CONFIG_BT_PERIPHERAL_PREF_LATENCY=16
Expand Down
47 changes: 47 additions & 0 deletions config/boards/shields/charybdis/charybdis.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#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 {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";

diode-direction = "row2col";
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>
;
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHIFT
&kp LCTRL &kp SPACE &mo 1 &mo 2 &kp RET
>;

trackball-bindings = <&tmv_coarse>;
};

Lower {
Expand 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 {
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)>
;
};
18 changes: 18 additions & 0 deletions config/boards/shields/charybdis/charybdis_right.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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_POLLING_RATE_125_SW=y

CONFIG_PMW3610_SMART_ALGORITHM=y
64 changes: 64 additions & 0 deletions config/boards/shields/charybdis/charybdis_right.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright (c) 2020 ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include "charybdis.dtsi"

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

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

&kscan0 {
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)>
;
};

&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 = <5>;
};
};
File renamed without changes.
7 changes: 0 additions & 7 deletions config/charybdis_right.conf

This file was deleted.

7 changes: 0 additions & 7 deletions config/corne.conf

This file was deleted.

68 changes: 0 additions & 68 deletions config/corne.keymap

This file was deleted.

11 changes: 8 additions & 3 deletions config/west.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
manifest:
remotes:
- name: zmkfirmware
url-base: https://github.com/victorlucachi
url-base: https://github.com/petejohanson
- name: inorichi
url-base: https://github.com/inorichi
projects:
- name: zmk
remote: zmkfirmware
revision: pmw3610-aml
revision: feat/pointers-move-scroll
import: app/west.yml
- name: zmk-pmw3610-driver
remote: inorichi
revision: main
self:
path: config
path: config

0 comments on commit 0f59dfa

Please sign in to comment.