Skip to content

Commit

Permalink
add dongle
Browse files Browse the repository at this point in the history
  • Loading branch information
ironhee committed Oct 15, 2024
1 parent 2f13bfb commit 644303e
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 24 deletions.
2 changes: 2 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ include:
shield: totem_left
- board: seeeduino_xiao_ble
shield: totem_right
- board: seeeduino_xiao_ble
shield: totem_dongle
- board: seeeduino_xiao_ble
shield: settings_reset
13 changes: 10 additions & 3 deletions config/boards/shields/totem/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
# Copyright (c) 2022 The ZMK Contributors
# SPDX-License-Identifier: MIT

if SHIELD_TOTEM_LEFT
if SHIELD_TOTEM_DONGLE

config ZMK_KEYBOARD_NAME
default "TOTEM"

config ZMK_SPLIT_ROLE_CENTRAL
default y

config ZMK_USB
default y

endif

if SHIELD_TOTEM_LEFT || SHIELD_TOTEM_RIGHT

if SHIELD_TOTEM_LEFT || SHIELD_TOTEM_RIGHT || SHIELD_TOTEM_DONGLE

config ZMK_SPLIT
default y

endif
config ZMK_BLE
default y

endif
5 changes: 4 additions & 1 deletion config/boards/shields/totem/Kconfig.shield
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ config SHIELD_TOTEM_LEFT
def_bool $(shields_list_contains,totem_left)

config SHIELD_TOTEM_RIGHT
def_bool $(shields_list_contains,totem_right)
def_bool $(shields_list_contains,totem_right)

config SHIELD_TOTEM_DONGLE
def_bool $(shields_list_contains,totem_dongle)
3 changes: 2 additions & 1 deletion config/boards/shields/totem/totem.zmk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ features:
- keys
siblings:
- totem_left
- totem_right
- totem_right
- totem_dongle
4 changes: 4 additions & 0 deletions config/boards/shields/totem/totem_dongle.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CONFIG_ZMK_SPLIT_BLE_CENTRAL_PERIPHERALS=2
CONFIG_ZMK_SLEEP=n
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
CONFIG_ZMK_EXT_POWER=y
17 changes: 17 additions & 0 deletions config/boards/shields/totem/totem_dongle.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include "totem.dtsi"

&kscan0 {
col-gpios
= <&xiao_d 4 GPIO_ACTIVE_HIGH>
, <&xiao_d 5 GPIO_ACTIVE_HIGH>
, <&xiao_d 10 GPIO_ACTIVE_HIGH>
, <&xiao_d 9 GPIO_ACTIVE_HIGH>
, <&xiao_d 8 GPIO_ACTIVE_HIGH>
;
};
2 changes: 1 addition & 1 deletion config/hold_tap.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#define HT_IDLE require-prior-idle-ms = <120>;
#define HT_LEFT hold-trigger-key-positions = <KEYS_RIGHT KEYS_ETC>;
#define HT_RIGHT hold-trigger-key-positions = <KEYS_LEFT KEYS_ETC>;
#define HT_MT bindings = <&kp>, <&kp>; hold-trigger-on-release; hold-while-undecided;
#define HT_MT bindings = <&kp>, <&kp>; hold-trigger-on-release;
#define HT_LT bindings = <&mo>, <&kp>;

ZMK_HOLD_TAP(lmt, HT HT_LEFT HT_MT HT_BLCD HT_IDLE)
Expand Down
49 changes: 31 additions & 18 deletions config/layers.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,28 @@
/* Alias */
/*=====================*/
#define __________ &trans
#define EMOJI &kp LC(LG(SPACE))
#define SCR_CAP &kp LS(LC(LG(N4)))
#define SCR_REC &kp LS(LG(N5))
#define SCR_PRV &kp LC(LEFT)
#define SCR_NXT &kp LC(RIGHT)
#define SCR_TAB &kp LC(UP)

#define SYMB_RET &tlt SYMB RET
#define NAVI_SPC &tlt NAVI SPACE
#define SYMB_BSPC &tlt SYMB BSPC
#define KP_LA0 &kp LC(LEFT)
#define KP_LH2 &kp LC(RIGHT)
#define KP_LH1 &tlt NAVI SPACE
#define KP_LH0 &tlt SYMB RET

#define KP_RH0 &tlt SYMB BSPC
#define KP_RH1 &sk LSHFT
#define KP_RH2 &kp C_PP
#define KP_RA0 &rmt FUNC APOS

#define A_LEFT &kp LA(LEFT)
#define A_RIGHT &kp LA(RIGHT)
#define A_UP &kp LA(UP)
#define A_DOWN &kp LA(DOWN)

#define BT_1 &bt BT_SEL 1
#define BT_2 &bt BT_SEL 2
#define BT_3 &bt BT_SEL 3
#define BT_4 &bt BT_SEL 4
#define BT_X &bt BT_CLR

/*=====================*/
/* Layer */
/*=====================*/
Expand All @@ -29,7 +36,7 @@ ZMK_LAYER(base_layer, /*
*/&kp Z &kp X &kp C &kp V &kp B &kp N &kp M &M_COMMA &M_DOT &M_FSLH /*
╰────────────┴────────────┴────────────┴────────────┴────────────╯╰────────────┴────────────┴────────────┴────────────┴────────────╯
╭────────────╮ ╭────────────┬────────────┬────────────╮╭────────────┬────────────┬────────────╮ ╭────────────╮
*/SCR_PRV &none SCR_NXT SYMB_RET NAVI_SPC &sk LSHFT SYMB_BSPC &kp C_PP &none &kp APOS /*
*/KP_LA0 &none KP_LH2 KP_LH1 KP_LH0 KP_RH0 KP_RH1 KP_RH2 &none KP_RA0 /*
╰────────────╯ ╰────────────┴────────────┴────────────╯╰────────────┴────────────┴────────────╯ ╰────────────╯
*/)

Expand Down Expand Up @@ -59,6 +66,19 @@ ZMK_LAYER(symb_layer, /*
╰────────────╯ ╰────────────┴────────────┴────────────╯╰────────────┴────────────┴────────────╯ ╰────────────╯
*/)

ZMK_LAYER(func_layer, /*
╭────────────┬────────────┬────────────┬────────────┬────────────╮╭────────────┬────────────┬────────────┬────────────┬────────────╮
*/__________ __________ __________ __________ __________ __________ __________ __________ __________ __________ /*
├────────────┼────────────┼────────────┼────────────┼────────────┤├────────────┼────────────┼────────────┼────────────┼────────────┤
*/BT_1 BT_2 BT_3 BT_4 BT_X __________ __________ __________ __________ __________ /*
├────────────┼────────────┼────────────┼────────────┼────────────┤├────────────┼────────────┼────────────┼────────────┼────────────┤
*/__________ __________ __________ __________ __________ __________ __________ __________ __________ __________ /*
╰────────────┴────────────┴────────────┴────────────┴────────────╯╰────────────┴────────────┴────────────┴────────────┴────────────╯
╭────────────╮ ╭────────────┬────────────┬────────────╮╭────────────┬────────────┬────────────╮ ╭────────────╮
*/__________ __________ __________ __________ __________ __________ __________ __________ __________ __________/*
╰────────────╯ ╰────────────┴────────────┴────────────╯╰────────────┴────────────┴────────────╯ ╰────────────╯
*/)

/*=====================*/
/* Combo */
/*=====================*/
Expand Down Expand Up @@ -104,11 +124,4 @@ ZMK_COMBO(r_lt , &kp LT , RB1 RB2, BASE NAVI SYMB, COMBO_TERM_FAST, CO
ZMK_COMBO(r_gt , &kp GT , RB2 RB3, BASE NAVI SYMB, COMBO_TERM_FAST, COMBO_IDLE_FAST)

ZMK_COMBO(r_lang , &kp LC(SPACE), LH0 RH0, BASE NAVI SYMB, COMBO_TERM_SLOW, COMBO_IDLE_SLOW)
ZMK_COMBO(r_scr_tab, SCR_TAB , LA0 LH2, BASE NAVI SYMB, COMBO_TERM_SLOW, COMBO_IDLE_SLOW)

ZMK_COMBO(ble_sel_1, &bt BT_SEL 1 , LT4 LB4, BASE NAVI SYMB, COMBO_TERM_SLOW, COMBO_IDLE_SLOW)
ZMK_COMBO(ble_sel_2, &bt BT_SEL 2 , LT3 LB3, BASE NAVI SYMB, COMBO_TERM_SLOW, COMBO_IDLE_SLOW)
ZMK_COMBO(ble_sel_3, &bt BT_SEL 3 , LT2 LB2, BASE NAVI SYMB, COMBO_TERM_SLOW, COMBO_IDLE_SLOW)
ZMK_COMBO(ble_sel_4, &bt BT_SEL 4 , LT1 LB1, BASE NAVI SYMB, COMBO_TERM_SLOW, COMBO_IDLE_SLOW)
ZMK_COMBO(ble_clear, &bt BT_CLR , LT0 LB0, BASE NAVI SYMB, COMBO_TERM_SLOW, COMBO_IDLE_SLOW)

ZMK_COMBO(r_scr_tab, &kp LC(UP) , LA0 LH2, BASE NAVI SYMB, COMBO_TERM_SLOW, COMBO_IDLE_SLOW)
1 change: 1 addition & 0 deletions config/totem.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define BASE 0
#define NAVI 1
#define SYMB 2
#define FUNC 3

#include "./hold_tap.dtsi"
#include "./mod_morph.dtsi"
Expand Down

0 comments on commit 644303e

Please sign in to comment.