Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Maokaman1 authored Jan 6, 2024
0 parents commit f38157a
Show file tree
Hide file tree
Showing 16 changed files with 355 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
62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# ZMK Firmware for Ergonaut One keyboard

This is a repository for a ZMK Firmware for Ergonaut One keyboard.

## Default keymap

Visual representation of the default keymap in keyboard-layout-editor: [KLE](http://www.keyboard-layout-editor.com/#/gists/13d0f7ae7a8b5835efcd23d61f50336a)

This layout is heavily inspired from [Watchman 42-key layout](https://github.com/aroum/Watchman-layouts)

## FAQ

- [FAQ](#faq)
- [How to change the keymap?](#how-to-change-the-keymap)
- [How to flash the keyboard?](#how-to-flash-the-keyboard)
- [How to pair halves?](#how-to-pair-halves)
- [Problems](#problems)
- [I'm getting File Transfer Error after copying firmware to the keyboard](#im-getting-file-transfer-error-after-copying-firmware-to-the-keyboard)

### How to change the keymap?

1. Fork or use this repository as a template https://github.com/ergonautkb/one-zmk-config.
2. Enable Github Actions for your repository.

You have two options on how to configure your desired keymap:

#### Option 1. Keymap Editor

1. Open [Keymap Editor](https://nickcoutsos.github.io/keymap-editor/).
2. Connect it to your Github account and give an access to your repository to Keymap Editor's app.
3. Make changes to your keymap and press `Save` - it will trigger software build. Wait for it to complete.
4. Grab the `firmware.zip` archive.

#### Option 2. Manual

1. Make changes to the [ergonaut_one.keymap](config/boards/shields/ergonaut_one/ergonaut_one.keymap) file using your favorite text editor.
2. Commit changes to your repository.
3. Go to `Actions` tab in your Github repository, locate the latest build and wait for it to complete.
4. Grab the `firmware.zip` archive

### How to flash the keyboard?

1. Obtain `firmware.zip`
2. Unzip `firmware.zip` - you should have `ergonaut_one_left-seeeduino_xiao_ble-zmk.uf2` and `ergonaut_one_right-seeeduino_xiao_ble-zmk.uf2` files
3. Turn off the power for selected halve (move slider to position `OFF`)
4. Connect selected halve to the PC via USB-C cable
5. Press `RESET` button **twice** to enter DFU mode - you should see new USB device in your file manager
6. Copy the corresponding firmware to the root directory of the new USB device
7. Disconnect selected halve from the PC
8. Repeat steps 3-7 for the other halve

### How to pair halves?

1. Turn off the power for both halves (move slider to position `OFF`)
2. Turn on the power for both halves (move slider to position `ON`)
3. Press `RESET` button **once** on both halves **simultaneously**

### Problems

#### I'm getting File Transfer Error after copying firmware to the keyboard

It's OK. Proof: https://zmk.dev/docs/troubleshooting#file-transfer-error
7 changes: 7 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include:
- board: seeeduino_xiao_ble
shield: ergonaut_one_left
- board: seeeduino_xiao_ble
shield: ergonaut_one_right
- board: seeeduino_xiao_ble
shield: settings_reset
19 changes: 19 additions & 0 deletions config/boards/shields/ergonaut_one/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT

if SHIELD_ERGONAUT_ONE_LEFT

config ZMK_KEYBOARD_NAME
default "Ergonaut One"

config ZMK_SPLIT_ROLE_CENTRAL
default y

endif

if SHIELD_ERGONAUT_ONE_LEFT || SHIELD_ERGONAUT_ONE_RIGHT

config ZMK_SPLIT
default y

endif
8 changes: 8 additions & 0 deletions config/boards/shields/ergonaut_one/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT

config SHIELD_ERGONAUT_ONE_LEFT
def_bool $(shields_list_contains,ergonaut_one_left)

config SHIELD_ERGONAUT_ONE_RIGHT
def_bool $(shields_list_contains,ergonaut_one_right)
51 changes: 51 additions & 0 deletions config/boards/shields/ergonaut_one/ergonaut_one.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

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

/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
/* /delete-property/ zephyr,console; */
/* /delete-property/ zephyr,shell-uart; */
};

default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <12>;
rows = <4>;

// | SW1 | SW2 | SW3 | SW4 | SW5 | SW6 | | SW6 | SW5 | SW4 | SW3 | SW2 | SW1 |
// | SW7 | SW8 | SW9 | SW10 | SW11 | SW12 | | SW12 | SW11 | SW10 | SW9 | SW8 | SW7 |
// | SW13 | SW14 | SW15 | SW16 | SW17 | SW18 | | SW18 | SW17 | SW16 | SW15 | SW14 | SW13 |
// | | | | SW20 | SW21 | SW22 | | SW22 | SW21 | SW20 | | | |

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,5) RC(3,11) RC(3,10) RC(3,9)
>;
};

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

diode-direction = "col2row";
row-gpios
= <&xiao_d 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&xiao_d 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&xiao_d 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&xiao_d 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
};

&xiao_spi { status = "disabled"; };
&xiao_i2c { status = "disabled"; };
&xiao_serial { status = "disabled"; };
65 changes: 65 additions & 0 deletions config/boards/shields/ergonaut_one/ergonaut_one.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>

#define DEF 0
#define LWR 1
#define RSE 2
#define ADJ 3

&lt {
quick-tap-ms = <200>;
};

&mt {
quick-tap-ms = <200>;
};

/ {
conditional_layers {
compatible = "zmk,conditional-layers";

tri-layer {
if-layers = <1 2>;
then-layer = <3>;
};
};

keymap {
compatible = "zmk,keymap";

default_layer {
bindings = <
&mt LGUI RBKT &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT
&mt LCTRL GRAVE &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &mt RCTRL SQT
&mt LALT MINUS &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &mt RALT BSLH
&lt RSE TAB &mt LSHFT SPACE &lt LWR RET &lt LWR ESC &mt RSHFT BSPC &lt RSE DEL
>;
};
lower_layer {
bindings = <
&mt LGUI F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12
&mt LCTRL PLUS &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp STAR &kp LPAR &kp RPAR &mt RCTRL MINUS
&mt LALT EQUAL &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp RALT
&trans &trans &trans &trans &trans &trans
>;
};

raise_layer {
bindings = <
&mt LGUI KP_NUM &kp KP_SLASH &kp KP_N7 &kp KP_N8 &kp KP_N9 &kp KP_MINUS &kp C_VOL_UP &kp HOME &kp PSCRN &kp PG_UP &kp SLCK &kp CLCK
&mt LCTRL EQUAL &kp KP_MULTIPLY &kp KP_N4 &kp KP_N5 &kp KP_N6 &kp KP_PLUS &kp C_MUTE &kp LEFT &kp UP &kp RIGHT &kp INS &mt RCTRL K_APP
&kp LALT &kp KP_N0 &kp KP_N1 &kp KP_N2 &kp KP_N3 &kp KP_DOT &kp C_VOL_DN &kp END &kp DOWN &kp PG_DN &kp PAUSE_BREAK &kp RALT
&trans &trans &trans &trans &trans &trans
>;
};
adjust_layer {
bindings = <
&bootloader &none &none &none &none &none &none &none &none &none &none &bootloader
&bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &bt BT_SEL 4 &bt BT_SEL 3 &bt BT_SEL 2 &bt BT_SEL 1 &bt BT_SEL 0 &bt BT_CLR
&sys_reset &none &none &none &none &none &none &none &none &none &none &sys_reset
&trans &none &trans &none &trans &trans
>;
};
};
};
11 changes: 11 additions & 0 deletions config/boards/shields/ergonaut_one/ergonaut_one.zmk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
file_format: '1'
id: ergonaut_one
name: Ergonaut One
type: shield
url: https://github.com/ergonautkb/one
requires: [seeeduino_xiao_ble]
features:
- keys
siblings:
- ergonaut_one_left
- ergonaut_one_right
2 changes: 2 additions & 0 deletions config/boards/shields/ergonaut_one/ergonaut_one_left.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
18 changes: 18 additions & 0 deletions config/boards/shields/ergonaut_one/ergonaut_one_left.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include "ergonaut_one.dtsi"

&kscan0 {
col-gpios
= <&xiao_d 0 GPIO_ACTIVE_HIGH>
, <&xiao_d 1 GPIO_ACTIVE_HIGH>
, <&xiao_d 2 GPIO_ACTIVE_HIGH>
, <&xiao_d 3 GPIO_ACTIVE_HIGH>
, <&xiao_d 4 GPIO_ACTIVE_HIGH>
, <&xiao_d 5 GPIO_ACTIVE_HIGH>
;
};
2 changes: 2 additions & 0 deletions config/boards/shields/ergonaut_one/ergonaut_one_right.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
22 changes: 22 additions & 0 deletions config/boards/shields/ergonaut_one/ergonaut_one_right.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include "ergonaut_one.dtsi"

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

&kscan0 {
col-gpios
= <&xiao_d 0 GPIO_ACTIVE_HIGH>
, <&xiao_d 1 GPIO_ACTIVE_HIGH>
, <&xiao_d 2 GPIO_ACTIVE_HIGH>
, <&xiao_d 3 GPIO_ACTIVE_HIGH>
, <&xiao_d 4 GPIO_ACTIVE_HIGH>
, <&xiao_d 5 GPIO_ACTIVE_HIGH>
;
};
15 changes: 15 additions & 0 deletions config/ergonaut_one.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT

CONFIG_BT_MAX_CONN=5
CONFIG_BT_MAX_PAIRED=5

CONFIG_ZMK_IDLE_TIMEOUT=30000
CONFIG_ZMK_SLEEP=y
CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000
CONFIG_ZMK_BATTERY_REPORT_INTERVAL=1800

CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y

CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
56 changes: 56 additions & 0 deletions config/ergonaut_one.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"id": "ergonaut_one",
"name": "Ergonaut One",
"layouts": {
"LAYOUT": {
"layout": [
{ "row": 0, "col": 0, "x": 0, "y": 0.375 },
{ "row": 0, "col": 1, "x": 1, "y": 0.375 },
{ "row": 0, "col": 2, "x": 2, "y": 0.125 },
{ "row": 0, "col": 3, "x": 3, "y": 0.000 },
{ "row": 0, "col": 4, "x": 4, "y": 0.125 },
{ "row": 0, "col": 5, "x": 5, "y": 0.250 },
{ "row": 0, "col": 6, "x": 9, "y": 0.250 },
{ "row": 0, "col": 7, "x": 10, "y": 0.125 },
{ "row": 0, "col": 8, "x": 11, "y": 0.000 },
{ "row": 0, "col": 9, "x": 12, "y": 0.125 },
{ "row": 0, "col": 10, "x": 13, "y": 0.375 },
{ "row": 0, "col": 11, "x": 14, "y": 0.375 },

{ "row": 1, "col": 0, "x": 0, "y": 1.375 },
{ "row": 1, "col": 1, "x": 1, "y": 1.375 },
{ "row": 1, "col": 2, "x": 2, "y": 1.125 },
{ "row": 1, "col": 3, "x": 3, "y": 1.000 },
{ "row": 1, "col": 4, "x": 4, "y": 1.125 },
{ "row": 1, "col": 5, "x": 5, "y": 1.250 },
{ "row": 1, "col": 6, "x": 9, "y": 1.250 },
{ "row": 1, "col": 7, "x": 10, "y": 1.125 },
{ "row": 1, "col": 8, "x": 11, "y": 1.000 },
{ "row": 1, "col": 9, "x": 12, "y": 1.125 },
{ "row": 1, "col": 10, "x": 13, "y": 1.375 },
{ "row": 1, "col": 11, "x": 14, "y": 1.375 },

{ "row": 2, "col": 0, "x": 0, "y": 2.375 },
{ "row": 2, "col": 1, "x": 1, "y": 2.375 },
{ "row": 2, "col": 2, "x": 2, "y": 2.125 },
{ "row": 2, "col": 3, "x": 3, "y": 2.000 },
{ "row": 2, "col": 4, "x": 4, "y": 2.125 },
{ "row": 2, "col": 5, "x": 5, "y": 2.250 },
{ "row": 2, "col": 6, "x": 9, "y": 2.250 },
{ "row": 2, "col": 7, "x": 10, "y": 2.125 },
{ "row": 2, "col": 8, "x": 11, "y": 2.000 },
{ "row": 2, "col": 9, "x": 12, "y": 2.125 },
{ "row": 2, "col": 10, "x": 13, "y": 2.375 },
{ "row": 2, "col": 11, "x": 14, "y": 2.375 },

{ "row": 3, "col": 3, "x": 3.5, "y": 3.250 },
{ "row": 3, "col": 4, "x": 3.5, "y": 3.250, "r": 15, "rx": 4, "ry": 8.05 },
{ "row": 3, "col": 5, "x": 3.5, "y": 3.250, "r": 30, "rx": 4, "ry": 8.05 },
{ "row": 3, "col": 6, "x": 10.5, "y": 3.250, "r": -30, "rx": 11, "ry": 8.05 },
{ "row": 3, "col": 7, "x": 10.5, "y": 3.250, "r": -15, "rx": 11, "ry": 8.05 },
{ "row": 3, "col": 8, "x": 10.5, "y": 3.250 }
]
}
},
"sensors": []
}
1 change: 1 addition & 0 deletions config/ergonaut_one.keymap
11 changes: 11 additions & 0 deletions config/west.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
manifest:
remotes:
- name: zmkfirmware
url-base: https://github.com/zmkfirmware
projects:
- name: zmk
remote: zmkfirmware
revision: main
import: app/west.yml
self:
path: config

0 comments on commit f38157a

Please sign in to comment.