aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/divergetm2/config.h79
-rw-r--r--keyboards/divergetm2/divergetm2.c17
-rw-r--r--keyboards/divergetm2/divergetm2.h74
-rw-r--r--keyboards/divergetm2/keymaps/default/config.h23
-rw-r--r--keyboards/divergetm2/keymaps/default/keymap.c200
-rw-r--r--keyboards/divergetm2/keymaps/default/readme.md5
-rw-r--r--keyboards/divergetm2/keymaps/default/rules.mk0
-rw-r--r--keyboards/divergetm2/keymaps/xtonhasvim/config.h23
-rw-r--r--keyboards/divergetm2/keymaps/xtonhasvim/keymap.c155
-rw-r--r--keyboards/divergetm2/keymaps/xtonhasvim/readme.md9
-rw-r--r--keyboards/divergetm2/keymaps/xtonhasvim/rules.mk3
-rw-r--r--keyboards/divergetm2/readme.md21
-rw-r--r--keyboards/divergetm2/rules.mk75
13 files changed, 684 insertions, 0 deletions
diff --git a/keyboards/divergetm2/config.h b/keyboards/divergetm2/config.h
new file mode 100644
index 000000000..8bc9d2c80
--- /dev/null
+++ b/keyboards/divergetm2/config.h
@@ -0,0 +1,79 @@
1/* Copyright 2018 Christon DeWan (xton)
2 * Copyright 2017 IslandMan93
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#pragma once
19
20#include "config_common.h"
21
22/* USB Device descriptor parameter */
23#define VENDOR_ID 0xFEED
24#define PRODUCT_ID 0x1256
25#define DEVICE_VER 0x0001
26#define MANUFACTURER UniKeyboard
27#define PRODUCT diverge tm2
28#define DESCRIPTION Split 46 key keyboard
29
30/* key matrix size */
31#define MATRIX_ROWS 8
32#define MATRIX_COLS 6
33
34/*
35 * Keyboard Matrix Assignments
36 *
37 * Change this to how you wired your keyboard
38 * COLS: AVR pins used for columns, left to right
39 * ROWS: AVR pins used for rows, top to bottom
40 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
41 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
42 *
43*/
44#define MATRIX_ROW_PINS { D7, E6, B4, B5 }
45#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 }
46#define UNUSED_PINS
47
48/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
49#define DIODE_DIRECTION ROW2COL
50
51
52/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
53#define DEBOUNCING_DELAY 5
54
55/* number of backlight levels */
56
57/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
58#define LOCKING_SUPPORT_ENABLE
59/* Locking resynchronize hack */
60#define LOCKING_RESYNC_ENABLE
61
62/*
63 * Magic Key Options
64 *
65 * Magic keys are hotkey commands that allow control over firmware functions of
66 * the keyboard. They are best used in combination with the HID Listen program,
67 * found here: https://www.pjrc.com/teensy/hid_listen.html
68 *
69 * The options below allow the magic key functionality to be changed. This is
70 * useful if your keyboard/keypad is missing keys and you want magic key support.
71 *
72 */
73
74/* key combination for magic key command */
75#define IS_COMMAND() ( \
76 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
77)
78
79
diff --git a/keyboards/divergetm2/divergetm2.c b/keyboards/divergetm2/divergetm2.c
new file mode 100644
index 000000000..61ea45416
--- /dev/null
+++ b/keyboards/divergetm2/divergetm2.c
@@ -0,0 +1,17 @@
1/* Copyright 2018 Christon DeWan (xton)
2 * Copyright 2017 IslandMan93
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#include "divergetm2.h"
diff --git a/keyboards/divergetm2/divergetm2.h b/keyboards/divergetm2/divergetm2.h
new file mode 100644
index 000000000..50144b1d2
--- /dev/null
+++ b/keyboards/divergetm2/divergetm2.h
@@ -0,0 +1,74 @@
1/* Copyright 2018 Christon DeWan (xton)
2 * Copyright 2017 IslandMan93
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#pragma once
19
20//void promicro_bootloader_jmp(bool program);
21#include "quantum.h"
22
23
24#ifdef USE_I2C
25#include <stddef.h>
26#ifdef __AVR__
27 #include <avr/io.h>
28 #include <avr/interrupt.h>
29#endif
30#endif
31
32//void promicro_bootloader_jmp(bool program);
33
34#ifndef FLIP_HALF
35// Standard Keymap
36// (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left)
37#define LAYOUT( \
38 L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \
39 L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \
40 L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \
41 L30, L31, L32, L33, L34, R31, R32, R33, R34, R35 \
42 ) \
43 { \
44 { L00, L01, L02, L03, L04, L05 }, \
45 { L10, L11, L12, L13, L14, L15 }, \
46 { L20, L21, L22, L23, L24, L25 }, \
47 { L30, L31, L32, L33, L34, KC_NO }, \
48 { R05, R04, R03, R02, R01, R00 }, \
49 { R15, R14, R13, R12, R11, R10 }, \
50 { R25, R24, R23, R22, R21, R20 }, \
51 { R35, R34, R33, R32, R31, KC_NO } \
52 }
53#else
54// Keymap with right side flipped
55// (TRRS jack on both halves are to the right)
56#define LAYOUT( \
57 L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \
58 L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \
59 L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \
60 L30, L31, L32, L33, L34, R31, R32, R33, R34, R35 \
61 ) \
62 { \
63 { L00, L01, L02, L03, L04, L05 }, \
64 { L10, L11, L12, L13, L14, L15 }, \
65 { L20, L21, L22, L23, L24, L25 }, \
66 { L30, L31, L32, L33, L34, KC_NO }, \
67 { R00, R01, R02, R03, R04, R05 }, \
68 { R10, R11, R12, R13, R14, R15 }, \
69 { R20, R21, R22, R23, R24, R25 }, \
70 { KC_NO, R31, R32, R33, R34, R35 } \
71 }
72#endif
73
74#define LAYOUT_ortho_4x12_2x2u LAYOUT
diff --git a/keyboards/divergetm2/keymaps/default/config.h b/keyboards/divergetm2/keymaps/default/config.h
new file mode 100644
index 000000000..ccd00621f
--- /dev/null
+++ b/keyboards/divergetm2/keymaps/default/config.h
@@ -0,0 +1,23 @@
1/* Copyright 2018 Christon DeWan (xton)
2 * Copyright 2017 IslandMan93
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#pragma once
19
20// place overrides here
21#define MASTER_RIGHT
22#define PERMISSIVE_HOLD
23#define TAPPING_TERM 150
diff --git a/keyboards/divergetm2/keymaps/default/keymap.c b/keyboards/divergetm2/keymaps/default/keymap.c
new file mode 100644
index 000000000..068705970
--- /dev/null
+++ b/keyboards/divergetm2/keymaps/default/keymap.c
@@ -0,0 +1,200 @@
1/* Copyright 2018 Christon DeWan (xton)
2 * Copyright 2017 IslandMan93
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include QMK_KEYBOARD_H
19
20extern keymap_config_t keymap_config;
21
22// Each layer gets a name for readability, which is then used in the keymap matrix below.
23// The underscores don't mean anything - you can have a layer called STUFF or any other name.
24// Layer names don't all need to be of the same length, obviously, and you can also skip them
25// entirely and just use numbers.
26#define _QWERTY 0
27#define _COLEMAK 1
28#define _DVORAK 2
29#define _LOWER 3
30#define _RAISE 4
31#define _ADJUST 16
32
33enum custom_keycodes {
34 QWERTY = SAFE_RANGE,
35 COLEMAK,
36 DVORAK
37};
38
39
40
41const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
42
43/* Qwerty
44 * ,-----------------------------------------------------------------------------------.
45 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
46 * |------+------+------+------+------+-------------+------+------+------+------+------|
47 * | Esc | A | S | D | F | G | H | J | K | L | ; | " |
48 * |------+------+------+------+------+------|------+------+------+------+------+------|
49 * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
50 * |------+------+------+------+------+------+------+------+------+------+------+------|
51 * | | Ctrl | Alt | GUI | Lower | Raise | Left | Down | Up |Right |
52 * `-----------------------------------------------------------------------------------'
53 */
54[_QWERTY] = LAYOUT_ortho_4x12_2x2u( \
55 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
56 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
57 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
58 RESET, KC_LCTL, KC_LALT, KC_LGUI, LT(_LOWER, KC_SPC), LT(_RAISE,KC_SPC), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
59),
60
61/* Colemak
62 * ,-----------------------------------------------------------------------------------.
63 * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
64 * |------+------+------+------+------+-------------+------+------+------+------+------|
65 * | Esc | A | R | S | T | D | H | N | E | I | O | " |
66 * |------+------+------+------+------+------|------+------+------+------+------+------|
67 * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
68 * |------+------+------+------+------+------+------+------+------+------+------+------|
69 * | | Ctrl | Alt | GUI | Lower | Raise | Left | Down | Up |Right |
70 * `-----------------------------------------------------------------------------------'
71 */
72[_COLEMAK] = LAYOUT_ortho_4x12_2x2u( \
73 KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \
74 KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
75 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
76 KC_NO, KC_LCTL, KC_LALT, KC_LGUI, LT(_LOWER, KC_SPC), LT(_RAISE,KC_SPC), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
77),
78
79/* Dvorak
80 * ,-----------------------------------------------------------------------------------.
81 * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
82 * |------+------+------+------+------+-------------+------+------+------+------+------|
83 * | Esc | A | O | E | U | I | D | H | T | N | S | / |
84 * |------+------+------+------+------+------|------+------+------+------+------+------|
85 * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
86 * |------+------+------+------+------+------+------+------+------+------+------+------|
87 * | | Ctrl | Alt | GUI | Lower | Raise | Left | Down | Up |Right |
88 * `-----------------------------------------------------------------------------------'
89 */
90[_DVORAK] = LAYOUT_ortho_4x12_2x2u( \
91 KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \
92 KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \
93 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \
94 KC_NO, KC_LCTL, KC_LALT, KC_LGUI, LT(_LOWER, KC_SPC), LT(_RAISE,KC_SPC), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
95),
96
97/* Lower
98 * ,-----------------------------------------------------------------------------------.
99 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
100 * |------+------+------+------+------+-------------+------+------+------+------+------|
101 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | |
102 * |------+------+------+------+------+------|------+------+------+------+------+------|
103 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter |
104 * |------+------+------+------+------+------+------+------+------+------+------+------|
105 * | | | | | | | Next | Vol- | Vol+ | Play |
106 * `-----------------------------------------------------------------------------------'
107 */
108[_LOWER] = LAYOUT_ortho_4x12_2x2u( \
109 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \
110 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
111 BL_STEP, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \
112 _______, _______, _______, _______, _______, MO(_RAISE), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
113),
114
115/* Raise
116 * ,-----------------------------------------------------------------------------------.
117 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
118 * |------+------+------+------+------+-------------+------+------+------+------+------|
119 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
120 * |------+------+------+------+------+------|------+------+------+------+------+------|
121 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter |
122 * |------+------+------+------+------+------+------+------+------+------+------+------|
123 * | | | | | | | Next | Vol- | Vol+ | Play |
124 * `-----------------------------------------------------------------------------------'
125 */
126[_RAISE] = LAYOUT_ortho_4x12_2x2u( \
127 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
128 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
129 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \
130 _______, _______, _______, _______, MO(_LOWER), _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
131),
132
133/* Adjust (Lower + Raise)
134 * ,-----------------------------------------------------------------------------------.
135 * | | Reset| | | | | | | | | | Del |
136 * |------+------+------+------+------+-------------+------+------+------+------+------|
137 * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
138 * |------+------+------+------+------+------|------+------+------+------+------+------|
139 * | | | | | | | | | | | | |
140 * |------+------+------+------+------+------+------+------+------+------+------+------|
141 * | | | | | | | | | | |
142 * `-----------------------------------------------------------------------------------'
143 */
144[_ADJUST] = LAYOUT_ortho_4x12_2x2u( \
145 _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
146 _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
147 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
148 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
149)
150
151
152};
153
154#ifdef AUDIO_ENABLE
155float tone_qwerty[][2] = SONG(QWERTY_SOUND);
156float tone_dvorak[][2] = SONG(DVORAK_SOUND);
157float tone_colemak[][2] = SONG(COLEMAK_SOUND);
158#endif
159
160#define SPACE_WAIT 100
161uint16_t rl_start_time = 0;
162
163
164bool process_record_user(uint16_t keycode, keyrecord_t *record) {
165 if(rl_start_time && record->event.pressed) rl_start_time = 0;
166 switch (keycode) {
167 case QWERTY:
168 if (record->event.pressed) {
169 #ifdef AUDIO_ENABLE
170 PLAY_SONG(tone_qwerty);
171 #endif
172 set_single_persistent_default_layer(1UL<<_QWERTY);
173 }
174 return false;
175 break;
176 case COLEMAK:
177 if (record->event.pressed) {
178 #ifdef AUDIO_ENABLE
179 PLAY_SONG(tone_colemak);
180 #endif
181 set_single_persistent_default_layer(1UL<<_COLEMAK);
182 }
183 return false;
184 break;
185 case DVORAK:
186 if (record->event.pressed) {
187 #ifdef AUDIO_ENABLE
188 PLAY_SONG(tone_dvorak);
189 #endif
190 set_single_persistent_default_layer(1UL<<_DVORAK);
191 }
192 return false;
193 break;
194 }
195 return true;
196}
197
198uint32_t layer_state_set_user(uint32_t state) {
199 return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
200}
diff --git a/keyboards/divergetm2/keymaps/default/readme.md b/keyboards/divergetm2/keymaps/default/readme.md
new file mode 100644
index 000000000..dceb4f8a9
--- /dev/null
+++ b/keyboards/divergetm2/keymaps/default/readme.md
@@ -0,0 +1,5 @@
1# A default-ish keymap for diverge tm2
2
3Actually it's a Planck layout, but I needed something for the default. :-D
4
5The 2u spacebars are space when tapped, raise/lower when held.
diff --git a/keyboards/divergetm2/keymaps/default/rules.mk b/keyboards/divergetm2/keymaps/default/rules.mk
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/keyboards/divergetm2/keymaps/default/rules.mk
diff --git a/keyboards/divergetm2/keymaps/xtonhasvim/config.h b/keyboards/divergetm2/keymaps/xtonhasvim/config.h
new file mode 100644
index 000000000..4ba4a5716
--- /dev/null
+++ b/keyboards/divergetm2/keymaps/xtonhasvim/config.h
@@ -0,0 +1,23 @@
1#pragma once
2
3// help for fast typist+dual function keys?
4#define PERMISSIVE_HOLD
5// Let me type `ls -l` more quickly.
6#define TAPPING_FORCE_HOLD
7
8// where is the cord plugged in?
9#define MASTER_RIGHT
10
11/* speed up mousekeys a bit */
12#define MOUSEKEY_DELAY 50
13#define MOUSEKEY_INTERVAL 20
14#define MOUSEKEY_MAX_SPEED 8
15#define MOUSEKEY_TIME_TO_MAX 30
16#define MOUSEKEY_WHEEL_MAX_SPEED 8
17#define MOUSEKEY_WHEEL_TIME_TO_MAX 40
18
19// because I'm lazy and didn't case out the rgb support
20#define RGBLED_NUM 2
21
22#define BACKLIGHT_PIN B7
23#define BACKLIGHT_LEVELS 3
diff --git a/keyboards/divergetm2/keymaps/xtonhasvim/keymap.c b/keyboards/divergetm2/keymaps/xtonhasvim/keymap.c
new file mode 100644
index 000000000..9d5135baa
--- /dev/null
+++ b/keyboards/divergetm2/keymaps/xtonhasvim/keymap.c
@@ -0,0 +1,155 @@
1 /* Copyright 2018 Christon DeWan
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include QMK_KEYBOARD_H
18#include "xtonhasvim.h"
19
20/************************************
21 * states
22 ************************************/
23
24enum layers {
25 _QWERTY,
26 _LOWER,
27 _RAISE,
28 _ADJUST,
29 _MOVE,
30 _MOUSE,
31 _CMD
32};
33
34extern uint8_t vim_cmd_layer(void) { return _CMD; }
35
36enum keymap_keycodes {
37 RAISE = VIM_SAFE_RANGE,
38 LOWER
39};
40
41/************************************
42 * keymaps!
43 ************************************/
44
45const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
46
47/* Qwerty
48 * ,-----------------------------------------------------------------------------------.
49 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
50 * |------+------+------+------+------+-------------+------+------+------+------+------|
51 * | Ctrl*| A | S | D | F | G | H | J | K | L | ;* | ' |
52 * |------+------+------+------+------+------|------+------+------+------+------+------|
53 * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
54 * |------+------+------+------+------+------+------+------+------+------+------+------|
55 * | chkwm| | Alt | GUI | Lower* | Raise* | SPC | GUI | | Vim |
56 * `-----------------------------------------------------------------------------------'
57 *
58 * - Ctrl acts as Esc when tapped.
59 * - Holding ; switches to movement layer.
60 * - Tapping raise or lower produces space.
61 */
62[_QWERTY] = LAYOUT_ortho_4x12_2x2u( \
63 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
64 LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(_MOVE,KC_SCLN), KC_QUOT, \
65 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT) , \
66 LSFT(KC_LALT), MO(_MOVE), KC_LALT, KC_LGUI, LT(_LOWER, KC_SPC), LT(_RAISE, KC_SPC), KC_RGUI, KC_RALT, MO(_MOVE), VIM_START \
67),
68
69/* Lower
70 * ,-----------------------------------------------------------------------------------.
71 * | ~ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | Bksp |
72 * |------+------+------+------+------+-------------+------+------+------+------+------|
73 * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | | |
74 * |------+------+------+------+------+------|------+------+------+------+------+------|
75 * | | F7 | F8 | F9 | F10 | F11 | F12 | | Next | Vol- | Vol+ | Play |
76 * |------+------+------+------+------+------+------+------+------+------+------+------|
77 * | | Bail | | | | Raise | | | Bail | |
78 * `-----------------------------------------------------------------------------------'
79 */
80[_LOWER] = LAYOUT_ortho_4x12_2x2u( \
81 KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_BSPC, \
82 KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \
83 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, X_____X, X_____X, X_____X, X_____X, FIREY_RETURN, \
84 RESET, TO(_QWERTY), _______, _______, _______, MO(_RAISE), _______, _______, TO(_QWERTY), X_____X \
85),
86
87/* Raise
88 * ,-----------------------------------------------------------------------------------.
89 * | ` | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | Bksp |
90 * |------+------+------+------+------+-------------+------+------+------+------+------|
91 * | Del | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ |
92 * |------+------+------+------+------+------|------+------+------+------+------+------|
93 * | | F7 | F8 | F9 | F10 | F11 | F12 | | Next | Vol- | Vol+ | Play |
94 * |------+------+------+------+------+------+------+------+------+------+------+------|
95 * | | Bail | | | Lower | | | | Bail | |
96 * `-----------------------------------------------------------------------------------'
97 */
98[_RAISE] = LAYOUT_ortho_4x12_2x2u( \
99 KC_GRV, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSPC, \
100 KC_DEL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \
101 _______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, FIREY_RETURN, \
102 X_____X, TO(_QWERTY), _______, _______, MO(_LOWER), _______, _______, _______, TO(_QWERTY), RESET \
103),
104
105
106/* Adjust (Lower + Raise)
107 * ,-------------------------------------------------------------------------------------.
108 * |BL Raise| | | | | | | | | | | |
109 * |--------+------+------+------+------+-------------+------+------+------+------+------|
110 * |BL Lower| | | | | | | | | | | |
111 * |--------+------+------+------+------+------|------+------+------+------+------+------|
112 * |BL STEP | | | | | | | Next | Vol- | Vol+ | Play | |
113 * |--------+------+------+------+------+------+------+------+------+------+------+------|
114 * |Backlite| Mouse| | | | | | | Bail | |
115 * `-------------------------------------------------------------------------------------'
116 */
117[_ADJUST] = LAYOUT_ortho_4x12_2x2u( \
118 BL_INC, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, \
119 BL_DEC, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, \
120 BL_STEP, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, X_____X, \
121 BL_TOGG, TO(_MOUSE), _______, _______, _______, _______, _______, _______, TO(_QWERTY), X_____X \
122),
123
124
125/* movement layer (hold semicolon) */
126[_MOVE] = LAYOUT_ortho_4x12_2x2u( \
127 TO(_QWERTY), X_____X, X_____X, X_____X, X_____X, X_____X, KC_HOME, KC_PGDN, KC_PGUP, KC_END, X_____X, X_____X, \
128 _______, X_____X, LGUI(KC_LBRC), LGUI(LSFT(KC_LBRC)), LGUI(LSFT(KC_RBRC)), LGUI(KC_RBRC), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, X_____X, \
129 _______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, _______, \
130 _______, _______, _______, _______, _______, _______, _______, _______, _______, X_____X \
131),
132
133/* mouse layer
134 */
135[_MOUSE] = LAYOUT_ortho_4x12_2x2u( \
136 TO(_QWERTY), X_____X, X_____X, KC_MS_UP, X_____X, X_____X, KC_MS_WH_LEFT, KC_MS_WH_DOWN, KC_MS_WH_UP, KC_MS_WH_RIGHT, X_____X, X_____X , \
137 _______, X_____X, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, X_____X, X_____X, KC_MS_BTN1, KC_MS_BTN2, KC_MS_BTN3, X_____X, X_____X, \
138 _______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, _______, \
139 _______, TO(_QWERTY), _______, _______, _______, _______, _______, _______, TO(_QWERTY), X_____X \
140),
141
142/* vim command layer.
143 */
144[_CMD] = LAYOUT_ortho_4x12_2x2u( \
145 X_____X, X_____X, VIM_W, VIM_E, X_____X, X_____X, VIM_Y, VIM_U, VIM_I, VIM_O, VIM_P, X_____X, \
146 VIM_ESC, VIM_A, VIM_S, VIM_D, X_____X, VIM_G, VIM_H, VIM_J, VIM_K, VIM_L, X_____X, X_____X, \
147 VIM_SHIFT, X_____X, VIM_X, VIM_C, VIM_V, VIM_B, X_____X, X_____X, VIM_COMMA, VIM_PERIOD, X_____X, VIM_SHIFT, \
148 _______, TO(_QWERTY), _______, _______, X_____X, X_____X, _______, _______, TO(_QWERTY), X_____X \
149)
150
151};
152
153uint32_t layer_state_set_user(uint32_t state) {
154 return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
155}
diff --git a/keyboards/divergetm2/keymaps/xtonhasvim/readme.md b/keyboards/divergetm2/keymaps/xtonhasvim/readme.md
new file mode 100644
index 000000000..9ff4ce1f1
--- /dev/null
+++ b/keyboards/divergetm2/keymaps/xtonhasvim/readme.md
@@ -0,0 +1,9 @@
1# Xton has a tiny keyboard! With Vim!
2
3Based on the standard Planck layout with a few changes:
4
5* Escape moved to dual-function with control.
6* Dedicated movement and mouse layers.
7* Top and middle row swapped in `_RAISE` and `_LOWER` because I never use F-keys.
8* Vim layers! See `users/xtonhasvim`.
9
diff --git a/keyboards/divergetm2/keymaps/xtonhasvim/rules.mk b/keyboards/divergetm2/keymaps/xtonhasvim/rules.mk
new file mode 100644
index 000000000..ede4e02b6
--- /dev/null
+++ b/keyboards/divergetm2/keymaps/xtonhasvim/rules.mk
@@ -0,0 +1,3 @@
1MOUSEKEY_ENABLE = yes
2# BACKLIGHT_ENABLE = yes
3AUDIO_ENABLE = no
diff --git a/keyboards/divergetm2/readme.md b/keyboards/divergetm2/readme.md
new file mode 100644
index 000000000..893b82cb5
--- /dev/null
+++ b/keyboards/divergetm2/readme.md
@@ -0,0 +1,21 @@
1# diverge tm2
2
3A 4x6x2 split ortholinear keyboard with 2u spacebars like the Levinson (similar to Let's Split). Made by [Unikeyboard](https://unikeyboard.io).
4
5Keyboard Maintainer: [IslandMan93](https://github.com/islandman93) and [xton](https://github.com/xton)
6Hardware Supported: Pro Micro
7Hardware Availability: [Diverge TM2](https://unikeyboard.io/product/diverge-tm/)
8
9Make example for this keyboard (after setting up your build environment):
10
11 make divergetm2:default
12
13See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
14
15# Flashing the first time
16
17Disassemble the case so you have access to each Pro Micro. Flash each half with QMK Toolbox by connecting the USB cable and shorting RST and GND. After that, just use the soft reset key on your respective layout to reflash both halves.
18
19# Reflashing Animus
20
21Reflashing the stock firmware is pretty easy. Just follow the same steps in the [original guide](https://imgur.com/a/8UapN). You will have to manually reset the Pro Micro (by shorting the GND and RST) during the upload step. Then reapply your keymap through Arbites.
diff --git a/keyboards/divergetm2/rules.mk b/keyboards/divergetm2/rules.mk
new file mode 100644
index 000000000..2be853a2a
--- /dev/null
+++ b/keyboards/divergetm2/rules.mk
@@ -0,0 +1,75 @@
1
2
3# MCU name
4#MCU = at90usb1286
5MCU = atmega32u4
6
7# Processor frequency.
8# This will define a symbol, F_CPU, in all source code files equal to the
9# processor frequency in Hz. You can then use this symbol in your source code to
10# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
11# automatically to create a 32-bit value in your source code.
12#
13# This will be an integer division of F_USB below, as it is sourced by
14# F_USB after it has run through any CPU prescalers. Note that this value
15# does not *change* the processor frequency - it should merely be updated to
16# reflect the processor speed set externally so that the code can use accurate
17# software delays.
18F_CPU = 16000000
19
20
21#
22# LUFA specific
23#
24# Target architecture (see library "Board Types" documentation).
25ARCH = AVR8
26
27# Input clock frequency.
28# This will define a symbol, F_USB, in all source code files equal to the
29# input clock frequency (before any prescaling is performed) in Hz. This value may
30# differ from F_CPU if prescaling is used on the latter, and is required as the
31# raw input clock is fed directly to the PLL sections of the AVR for high speed
32# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
33# at the end, this will be done automatically to create a 32-bit value in your
34# source code.
35#
36# If no clock division is performed on the input clock inside the AVR (via the
37# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
38F_USB = $(F_CPU)
39
40# Interrupt driven control endpoint task(+60)
41OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
42
43
44# Boot Section Size in *bytes*
45# Teensy halfKay 512
46# Teensy++ halfKay 1024
47# Atmel DFU loader 4096
48# LUFA bootloader 4096
49# USBaspLoader 2048
50# OPT_DEFS += -DBOOTLOADER_SIZE=4096
51
52
53# Build Options
54# change yes to no to disable
55#
56BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
57MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
58EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
59CONSOLE_ENABLE = no # Console for debug(+400)
60COMMAND_ENABLE = yes # Commands for debug and configuration
61NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
62BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
63MIDI_ENABLE = no # MIDI controls
64AUDIO_ENABLE = no # Audio output on port C6
65UNICODE_ENABLE = no # Unicode
66BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
67RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
68
69# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
70SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
71
72SPLIT_KEYBOARD = yes
73
74# must specify this to enable soft-reset
75BOOTLOADER = caterina