aboutsummaryrefslogtreecommitdiff
path: root/keyboards/tkw
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/tkw')
-rw-r--r--keyboards/tkw/grandiceps/config.h68
-rw-r--r--keyboards/tkw/grandiceps/grandiceps.c16
-rw-r--r--keyboards/tkw/grandiceps/grandiceps.h38
-rw-r--r--keyboards/tkw/grandiceps/halconf.h31
-rw-r--r--keyboards/tkw/grandiceps/info.json19
-rw-r--r--keyboards/tkw/grandiceps/keymaps/default/keymap.c466
-rw-r--r--keyboards/tkw/grandiceps/keymaps/default/readme.md13
-rw-r--r--keyboards/tkw/grandiceps/mcuconf.h34
-rw-r--r--keyboards/tkw/grandiceps/readme.md19
-rw-r--r--keyboards/tkw/grandiceps/rules.mk30
10 files changed, 734 insertions, 0 deletions
diff --git a/keyboards/tkw/grandiceps/config.h b/keyboards/tkw/grandiceps/config.h
new file mode 100644
index 000000000..44ea8d699
--- /dev/null
+++ b/keyboards/tkw/grandiceps/config.h
@@ -0,0 +1,68 @@
1/* Copyright 2020 Thys de Wet
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#pragma once
17
18#include "config_common.h"
19
20
21/* USB Device descriptor parameter */
22#define VENDOR_ID 0xFEED
23#define PRODUCT_ID 0x7812
24#define DEVICE_VER 0x0001
25#define MANUFACTURER TKW
26#define PRODUCT Grandiceps Split
27
28/* key matrix size */
29#define MATRIX_ROWS 10
30#define MATRIX_COLS 6
31
32
33
34#define MATRIX_COL_PINS { B0, A7, A3, A5, A4, A2 }
35#define MATRIX_ROW_PINS { B12, A6, B13, B9, B8 }
36#define MATRIX_COL_PINS_RIGHT { B0, A7, A3, A5, A4, A2 }
37#define MATRIX_ROW_PINS_RIGHT { B12, A6, B13, B9, B8 }
38
39#define DIODE_DIRECTION COL2ROW
40
41#define SOFT_SERIAL_PIN A15
42#define SELECT_SOFT_SERIAL_SPEED 1
43
44#define MATRIX_IO_DELAY 5
45#define TAP_CODE_DELAY 10
46
47#define ENCODERS_PAD_A { B14 }
48#define ENCODERS_PAD_B { B15 }
49
50#define RGB_DI_PIN B1
51#define RGBLED_NUM 16
52#define RGBLED_SPLIT { 8,8 }
53#define RGBLIGHT_LIMIT_VAL 120
54#define RGBLIGHT_ANIMATIONS
55
56#define WS2812_PWM_DRIVER PWMD3
57#define WS2812_PWM_CHANNEL 4
58#define WS2812_PWM_PAL_MODE 2
59#define WS2812_DMA_STREAM STM32_DMA1_STREAM2
60#define WS2812_DMA_CHANNEL 5
61
62/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
63#define DEBOUNCE 5
64
65
66/* disable these deprecated features by default */
67#define NO_ACTION_MACRO
68#define NO_ACTION_FUNCTION
diff --git a/keyboards/tkw/grandiceps/grandiceps.c b/keyboards/tkw/grandiceps/grandiceps.c
new file mode 100644
index 000000000..bfb67dfc2
--- /dev/null
+++ b/keyboards/tkw/grandiceps/grandiceps.c
@@ -0,0 +1,16 @@
1/* Copyright 2020 Thys de Wet
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#include "grandiceps.h"
diff --git a/keyboards/tkw/grandiceps/grandiceps.h b/keyboards/tkw/grandiceps/grandiceps.h
new file mode 100644
index 000000000..ecb92fd39
--- /dev/null
+++ b/keyboards/tkw/grandiceps/grandiceps.h
@@ -0,0 +1,38 @@
1/* Copyright 2020 Thys de Wet
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#pragma once
17
18#include "quantum.h"
19
20#define LAYOUT( \
21 L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \
22 L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \
23 L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \
24 L30, L31, L32, L33, L34, L35, L45, R40, R30, R31, R32, R33, R34, R35, \
25 L40, L41, L42, L43, L44, R41, R42, R43, R44, R45 \
26 ) \
27 { \
28 { L00, L01, L02, L03, L04, L05 }, \
29 { L10, L11, L12, L13, L14, L15 }, \
30 { L20, L21, L22, L23, L24, L25 }, \
31 { L30, L31, L32, L33, L34, L35 }, \
32 { L40, L41, L42, L43, L44, L45 }, \
33 { R05, R04, R03, R02, R01, R00 }, \
34 { R15, R14, R13, R12, R11, R10 }, \
35 { R25, R24, R23, R22, R21, R20 }, \
36 { R35, R34, R33, R32, R31, R30 }, \
37 { R45, R44, R43, R42, R41, R40 } \
38 }
diff --git a/keyboards/tkw/grandiceps/halconf.h b/keyboards/tkw/grandiceps/halconf.h
new file mode 100644
index 000000000..481e7f75a
--- /dev/null
+++ b/keyboards/tkw/grandiceps/halconf.h
@@ -0,0 +1,31 @@
1/* Copyright 2020 QMK
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/*
18 * This file was auto-generated by:
19 * `qmk chibios-confupdate -i keyboards/tkw/grandiceps/halconf.h -r platforms/chibios/BLACKPILL_STM32_F411/configs/halconf.h`
20 */
21
22#pragma once
23
24#define HAL_USE_I2C TRUE
25
26#define HAL_USE_PWM TRUE
27
28#define HAL_USE_SERIAL TRUE
29
30#include_next <halconf.h>
31
diff --git a/keyboards/tkw/grandiceps/info.json b/keyboards/tkw/grandiceps/info.json
new file mode 100644
index 000000000..4f63ae1eb
--- /dev/null
+++ b/keyboards/tkw/grandiceps/info.json
@@ -0,0 +1,19 @@
1{
2 "keyboard_name": "grandiceps",
3 "url": "https://github.com/vattern/grandiceps",
4 "maintainer": "vattern",
5 "manufacturer": "tkw",
6 "width": 16.5,
7 "height": 5.25,
8 "layouts": {
9 "LAYOUT": {
10 "layout": [
11 {"x":0, "y":0.5}, {"x":1, "y":0.375}, {"x":2, "y":0.125}, {"x":3, "y":0}, {"x":4, "y":0.125}, {"x":5, "y":0.25}, {"x":10.5, "y":0.25}, {"x":11.5, "y":0.125}, {"x":12.5, "y":0}, {"x":13.5, "y":0.125}, {"x":14.5, "y":0.375}, {"x":15.5, "y":0.5},
12 {"x":0, "y":1.5}, {"x":1, "y":1.375}, {"x":2, "y":1.125}, {"x":3, "y":1}, {"x":4, "y":1.125}, {"x":5, "y":1.25}, {"x":10.5, "y":1.25}, {"x":11.5, "y":1.125}, {"x":12.5, "y":1}, {"x":13.5, "y":1.125}, {"x":14.5, "y":1.375}, {"x":15.5, "y":1.5},
13 {"x":0, "y":2.5}, {"x":1, "y":2.375}, {"x":2, "y":2.125}, {"x":3, "y":2}, {"x":4, "y":2.125}, {"x":5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.125}, {"x":12.5, "y":2}, {"x":13.5, "y":2.125}, {"x":14.5, "y":2.375}, {"x":15.5, "y":2.5},
14 {"x":0, "y":3.5}, {"x":1, "y":3.375}, {"x":2, "y":3.125}, {"x":3, "y":3}, {"x":4, "y":3.125}, {"x":5, "y":3.25}, {"x":6, "y":2.75}, {"x":9.5, "y":2.75}, {"x":10.5, "y":3.25}, {"x":11.5, "y":3.125}, {"x":12.5, "y":3}, {"x":13.5, "y":3.125}, {"x":14.5, "y":3.375}, {"x":15.5, "y":3.5},
15 {"x":1, "y":4.375}, {"x":2, "y":4.125}, {"x":3, "y":4.15}, {"x":4.5, "y":4.25}, {"x":6, "y":4.25, "h":1.5}, {"x":9.5, "y":4.25, "h":1.5}, {"x":11, "y":4.25}, {"x":12.5, "y":4.15}, {"x":13.5, "y":4.125}, {"x":14.5, "y":4.375}
16 ]
17 }
18 }
19}
diff --git a/keyboards/tkw/grandiceps/keymaps/default/keymap.c b/keyboards/tkw/grandiceps/keymaps/default/keymap.c
new file mode 100644
index 000000000..b4cf6ed02
--- /dev/null
+++ b/keyboards/tkw/grandiceps/keymaps/default/keymap.c
@@ -0,0 +1,466 @@
1/* Copyright 2020 Thys de Wet
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#include QMK_KEYBOARD_H
17
18//This keymap is HEAVILY inspired by sofle
19
20enum grandiceps_layers {
21 _QWERTY,
22 _COLEMAK,
23 _LOWER,
24 _RAISE,
25 _ADJUST,
26};
27
28enum custom_keycodes {
29 KC_QWERTY = SAFE_RANGE,
30 KC_COLEMAK,
31 KC_LOWER,
32 KC_RAISE,
33 KC_ADJUST,
34 KC_PRVWD,
35 KC_NXTWD,
36 KC_LSTRT,
37 KC_LEND,
38 KC_DLINE
39};
40
41
42
43const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
44/*
45 * QWERTY
46 * ,-----------------------------------------. ,-----------------------------------------.
47 * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - |
48 * |------+------+------+------+------+------| |------+------+------+------+------+------|
49 * | DEL | Q | W | E | R | T | | Y | U | I | O | P | Bspc |
50 * |------+------+------+------+------+------| |------+------+------+------+------+------|
51 * | Tab | A | S | D | F | G |-------. ,-------| H | J | K | L | ; | ' |
52 * |------+------+------+------+------+------| | | |------+------+------+------+------+------|
53 * |LShift| Z | X | C | V | B |-------| |-------| N | M | , | . | / |RShift|
54 * `-----------------------------------------/ / \ \-----------------------------------------'
55 * | LGUI | LAlt | LCTR |LOWER | /Space / \Enter \ |RAISE | RCTR | RAlt | RGUI |
56 * | | | | |/ / \ \ | | | | |
57 * `----------------------------------' '------''---------------------------'
58 */
59
60[_QWERTY] = LAYOUT(
61 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
62 KC_DEL, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
63 KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
64 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, XXXXXXX,KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
65 KC_LGUI,KC_LALT,KC_LCTRL, KC_LOWER, KC_SPC, KC_ENT, KC_RAISE, KC_RCTRL, KC_RALT, KC_RGUI
66),
67/*
68 * COLEMAK
69 * ,-----------------------------------------. ,-----------------------------------------.
70 * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ` |
71 * |------+------+------+------+------+------| |------+------+------+------+------+------|
72 * | ESC | Q | W | F | P | G | | J | L | U | Y | ; | Bspc |
73 * |------+------+------+------+------+------| |------+------+------+------+------+------|
74 * | TAB | A | R | S | T | D |-------. ,-------| H | N | E | I | O | ' |
75 * |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------|
76 * |LShift| Z | X | C | V | B |-------| |-------| K | M | , | . | / |RShift|
77 * `-----------------------------------------/ / \ \-----------------------------------------'
78 * | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | RGUI |
79 * | | | | |/ / \ \ | | | | |
80 * `----------------------------------' '------''---------------------------'
81 */
82
83[_COLEMAK] = LAYOUT(
84 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV,
85 KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
86 KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
87 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, XXXXXXX,KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
88 KC_LGUI,KC_LALT,KC_LCTRL,KC_LOWER, KC_ENT, KC_SPC, KC_RAISE, KC_RCTRL, KC_RALT, KC_RGUI
89),
90/* LOWER
91 * ,-----------------------------------------. ,-----------------------------------------.
92 * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 |
93 * |------+------+------+------+------+------| |------+------+------+------+------+------|
94 * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | F12 |
95 * |------+------+------+------+------+------| |------+------+------+------+------+------|
96 * | Tab | ! | @ | # | $ | % |-------. ,-------| ^ | & | * | ( | ) | | |
97 * |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------|
98 * | Shift| = | - | + | { | } |-------| |-------| [ | ] | ; | : | \ | Shift|
99 * `-----------------------------------------/ / \ \-----------------------------------------'
100 * | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | RGUI |
101 * | | | | |/ / \ \ | | | | |
102 * `----------------------------------' '------''---------------------------'
103 */
104[_LOWER] = LAYOUT(
105 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
106 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_F12,
107 _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE,
108 _______, KC_EQL, KC_MINS, KC_PLUS, KC_LCBR, KC_RCBR, _______, _______, KC_LBRC, KC_RBRC, KC_SCLN, KC_COLN, KC_BSLS, _______,
109 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
110),
111/* RAISE
112 * ,----------------------------------------. ,-----------------------------------------.
113 * | | | | | | | | | | | | | |
114 * |------+------+------+------+------+------| |------+------+------+------+------+------|
115 * | Esc | Ins | Pscr | Menu | | | | | PWrd | Up | NWrd | DLine| Bspc |
116 * |------+------+------+------+------+------| |------+------+------+------+------+------|
117 * | Tab | LAt | LCtl |LShift| | Caps |-------. ,-------| | Left | Down | Rigth| Del | Bspc |
118 * |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------|
119 * |Shift | Undo | Cut | Copy | Paste| |-------| |-------| | LStr | | LEnd | | Shift|
120 * `-----------------------------------------/ / \ \-----------------------------------------'
121 * | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | RGUI |
122 * | | | | |/ / \ \ | | | | |
123 * `----------------------------------' '------''---------------------------'
124 */
125[_RAISE] = LAYOUT(
126 _______, _______ , _______ , _______ , _______ , _______, _______, _______ , _______, _______ , _______ ,_______,
127 _______, KC_INS, KC_PSCR, KC_APP, XXXXXXX, XXXXXXX, KC_PGUP, KC_PRVWD, KC_UP, KC_NXTWD, KC_DLINE, KC_BSPC,
128 _______, KC_LALT, KC_LCTL, KC_LSFT, XXXXXXX, KC_CAPS, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_BSPC,
129 _______, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, XXXXXXX, _______, _______, XXXXXXX, KC_LSTRT, XXXXXXX, KC_LEND, XXXXXXX, _______,
130 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
131),
132/* ADJUST
133 * ,-----------------------------------------. ,-----------------------------------------.
134 * | | | | | | | | | | | | | |
135 * |------+------+------+------+------+------| |------+------+------+------+------+------|
136 * | RESET| |QWERTY|COLEMAK| | | | | | | | | |
137 * |------+------+------+------+------+------| |------+------+------+------+------+------|
138 * | | |MACWIN| | | |-------. ,-------| | VOLDO| MUTE | VOLUP| | |
139 * |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------|
140 * | | | | | | |-------| |-------| | PREV | PLAY | NEXT | | |
141 * `-----------------------------------------/ / \ \-----------------------------------------'
142 * | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | RGUI |
143 * | | | | |/ / \ \ | | | | |
144 * `----------------------------------' '------''---------------------------'
145 */
146 [_ADJUST] = LAYOUT(
147 XXXXXXX , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_VAI, RGB_SAI, RGB_HUI, XXXXXXX, RGB_TOG,
148 RESET , XXXXXXX, KC_QWERTY,KC_COLEMAK,CG_TOGG, XXXXXXX, RGB_RMOD, RGB_VAD, RGB_SAD, RGB_HUD, XXXXXXX, XXXXXXX,
149 XXXXXXX , XXXXXXX, CG_TOGG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, XXXXXXX, XXXXXXX,
150 XXXXXXX , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX,
151 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
152 )
153};
154
155bool process_record_user(uint16_t keycode, keyrecord_t *record) {
156
157
158 switch (keycode) {
159 case KC_QWERTY:
160 if (record->event.pressed) {
161 set_single_persistent_default_layer(_QWERTY);
162 }
163 return false;
164 case KC_COLEMAK:
165 if (record->event.pressed) {
166 set_single_persistent_default_layer(_COLEMAK);
167 }
168 return false;
169 case KC_LOWER:
170 if (record->event.pressed) {
171 layer_on(_LOWER);
172 update_tri_layer(_LOWER, _RAISE, _ADJUST);
173 } else {
174 layer_off(_LOWER);
175 update_tri_layer(_LOWER, _RAISE, _ADJUST);
176 }
177 return false;
178 case KC_RAISE:
179 if (record->event.pressed) {
180 layer_on(_RAISE);
181 update_tri_layer(_LOWER, _RAISE, _ADJUST);
182 } else {
183 layer_off(_RAISE);
184 update_tri_layer(_LOWER, _RAISE, _ADJUST);
185 }
186 return false;
187 case KC_ADJUST:
188 if (record->event.pressed) {
189 layer_on(_ADJUST);
190 } else {
191 layer_off(_ADJUST);
192 }
193 return false;
194 case KC_PRVWD:
195 if (record->event.pressed) {
196 if (keymap_config.swap_lctl_lgui) {
197 register_mods(mod_config(MOD_LALT));
198 register_code(KC_LEFT);
199 } else {
200 register_mods(mod_config(MOD_LCTL));
201 register_code(KC_LEFT);
202 }
203 } else {
204 if (keymap_config.swap_lctl_lgui) {
205 unregister_mods(mod_config(MOD_LALT));
206 unregister_code(KC_LEFT);
207 } else {
208 unregister_mods(mod_config(MOD_LCTL));
209 unregister_code(KC_LEFT);
210 }
211 }
212 break;
213 case KC_NXTWD:
214 if (record->event.pressed) {
215 if (keymap_config.swap_lctl_lgui) {
216 register_mods(mod_config(MOD_LALT));
217 register_code(KC_RIGHT);
218 } else {
219 register_mods(mod_config(MOD_LCTL));
220 register_code(KC_RIGHT);
221 }
222 } else {
223 if (keymap_config.swap_lctl_lgui) {
224 unregister_mods(mod_config(MOD_LALT));
225 unregister_code(KC_RIGHT);
226 } else {
227 unregister_mods(mod_config(MOD_LCTL));
228 unregister_code(KC_RIGHT);
229 }
230 }
231 break;
232 case KC_LSTRT:
233 if (record->event.pressed) {
234 if (keymap_config.swap_lctl_lgui) {
235 //CMD-arrow on Mac, but we have CTL and GUI swapped
236 register_mods(mod_config(MOD_LCTL));
237 register_code(KC_LEFT);
238 } else {
239 register_code(KC_HOME);
240 }
241 } else {
242 if (keymap_config.swap_lctl_lgui) {
243 unregister_mods(mod_config(MOD_LCTL));
244 unregister_code(KC_LEFT);
245 } else {
246 unregister_code(KC_HOME);
247 }
248 }
249 break;
250 case KC_LEND:
251 if (record->event.pressed) {
252 if (keymap_config.swap_lctl_lgui) {
253 //CMD-arrow on Mac, but we have CTL and GUI swapped
254 register_mods(mod_config(MOD_LCTL));
255 register_code(KC_RIGHT);
256 } else {
257 register_code(KC_END);
258 }
259 } else {
260 if (keymap_config.swap_lctl_lgui) {
261 unregister_mods(mod_config(MOD_LCTL));
262 unregister_code(KC_RIGHT);
263 } else {
264 unregister_code(KC_END);
265 }
266 }
267 break;
268 case KC_DLINE:
269 if (record->event.pressed) {
270 register_mods(mod_config(MOD_LCTL));
271 register_code(KC_BSPC);
272 } else {
273 unregister_mods(mod_config(MOD_LCTL));
274 unregister_code(KC_BSPC);
275 }
276 break;
277 case KC_COPY:
278 if (record->event.pressed) {
279 register_mods(mod_config(MOD_LCTL));
280 register_code(KC_C);
281 } else {
282 unregister_mods(mod_config(MOD_LCTL));
283 unregister_code(KC_C);
284 }
285 return false;
286 case KC_PASTE:
287 if (record->event.pressed) {
288 register_mods(mod_config(MOD_LCTL));
289 register_code(KC_V);
290 } else {
291 unregister_mods(mod_config(MOD_LCTL));
292 unregister_code(KC_V);
293 }
294 return false;
295 case KC_CUT:
296 if (record->event.pressed) {
297 register_mods(mod_config(MOD_LCTL));
298 register_code(KC_X);
299 } else {
300 unregister_mods(mod_config(MOD_LCTL));
301 unregister_code(KC_X);
302 }
303 return false;
304 break;
305 case KC_UNDO:
306 if (record->event.pressed) {
307 register_mods(mod_config(MOD_LCTL));
308 register_code(KC_Z);
309 } else {
310 unregister_mods(mod_config(MOD_LCTL));
311 unregister_code(KC_Z);
312 }
313 return false;
314 }
315 return true;
316}
317
318#ifdef OLED_DRIVER_ENABLE
319static void render_logo(void) {
320 static const char PROGMEM my_logo[] = {
321 // 'protea', 128x32px
322 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
323 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
324 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
325 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
326 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x38, 0x1c, 0x0c, 0x06, 0x82, 0x80, 0xc0, 0xc0,
327 0x40, 0x00, 0x80, 0x90, 0xd0, 0xd8, 0xc8, 0xc8, 0x44, 0x44, 0x00, 0x88, 0xb8, 0xb8, 0xd8, 0xd8,
328 0xc0, 0xc0, 0x80, 0x20, 0x60, 0x60, 0x50, 0xd0, 0xb0, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
329 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
330 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
331 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
332 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x30, 0x30,
333 0x30, 0x30, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
334 0x20, 0x20, 0x20, 0x20, 0x20, 0x08, 0x07, 0x01, 0x90, 0x90, 0x90, 0x99, 0x99, 0x90, 0x84, 0x22,
335 0x6b, 0xe9, 0xf5, 0xf5, 0xf5, 0xe5, 0xc5, 0x10, 0x1e, 0x1e, 0x4e, 0x60, 0xf1, 0xf9, 0xf9, 0xf9,
336 0xf8, 0x78, 0x7a, 0x7b, 0x33, 0x37, 0xc6, 0xee, 0xcc, 0x19, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00,
337 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
338 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
339 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
340 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
341 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
342 0x00, 0x01, 0x02, 0x0c, 0x30, 0xc0, 0x80, 0x00, 0x06, 0x0c, 0x18, 0x31, 0x71, 0x61, 0x69, 0x40,
343 0x42, 0x86, 0x0d, 0x1d, 0x19, 0x39, 0x31, 0x76, 0x67, 0x6f, 0x4f, 0x0f, 0x0e, 0xce, 0xc0, 0xc0,
344 0xd2, 0xd6, 0xd7, 0xb7, 0x37, 0x3b, 0xda, 0xc0, 0xcb, 0x08, 0x11, 0x10, 0x00, 0x00, 0x00, 0x00,
345 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
346 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
347 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
348 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
349 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
350 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, 0x06, 0x0e, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00,
351 0x0e, 0x1c, 0x38, 0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x06, 0x04, 0x05, 0x01,
352 0x01, 0x01, 0x01, 0x05, 0x04, 0x06, 0x06, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
353 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
354 };
355
356 oled_write_raw_P(my_logo, sizeof(my_logo));
357}
358
359static void print_status_narrow(void) {
360 // Print current mode
361 oled_write_P(PSTR("\n\n"), false);
362 oled_write_ln_P(PSTR("MODE"), false);
363 oled_write_ln_P(PSTR("\n"), false);
364 if (keymap_config.swap_lctl_lgui) {
365 oled_write_ln_P(PSTR("MAC\n"), false);
366 } else {
367 oled_write_ln_P(PSTR("WIN\n"), false);
368 }
369
370 switch (get_highest_layer(default_layer_state)) {
371 case _QWERTY:
372 oled_write_ln_P(PSTR("Qwrt"), false);
373 break;
374 case _COLEMAK:
375 oled_write_ln_P(PSTR("Clmk"), false);
376 break;
377 default:
378 oled_write_P(PSTR("Undef"), false);
379 }
380 oled_write_P(PSTR("\n\n"), false);
381 // Print current layer
382 oled_write_ln_P(PSTR("LAYER"), false);
383 switch (get_highest_layer(layer_state)) {
384 case _COLEMAK:
385 case _QWERTY:
386 oled_write_P(PSTR("Base\n"), false);
387 break;
388 case _RAISE:
389 oled_write_P(PSTR("Raise"), false);
390 break;
391 case _LOWER:
392 oled_write_P(PSTR("Lower"), false);
393 break;
394 case _ADJUST:
395 oled_write_P(PSTR("Adj\n"), false);
396 break;
397 default:
398 oled_write_ln_P(PSTR("Undef"), false);
399 }
400 oled_write_P(PSTR("\n\n"), false);
401 led_t led_usb_state = host_keyboard_led_state();
402 oled_write_ln_P(PSTR("CPSLK"), led_usb_state.caps_lock);
403 oled_write_P(PSTR("\n\n"), false);
404}
405
406void oled_task_user(void) {
407 if (is_keyboard_master()) {
408 print_status_narrow();
409 } else {
410 render_logo();
411 }
412}
413
414oled_rotation_t oled_init_user(oled_rotation_t rotation) {
415 if (is_keyboard_master()) {
416 return OLED_ROTATION_270;
417 } else {
418 return rotation;
419 }
420}
421#endif
422
423#ifdef ENCODER_ENABLE
424void encoder_update_user(uint8_t index, bool clockwise){
425
426 if (index == 0) {
427 switch (get_highest_layer(layer_state)) {
428 case _QWERTY:
429 // Move whole words. Hold shift to select while moving.
430 if (clockwise) {
431 tap_code(KC_VOLU);
432 } else {
433 tap_code(KC_VOLD);
434 }
435 break;
436 default:
437 // History scrubbing. For Adobe products, hold shift while moving
438 // backward to go forward instead.
439 if (clockwise) {
440 tap_code16(C(KC_Z));
441 } else {
442 tap_code16(C(KC_Y));
443 }
444 break;
445 }
446 } else if (index == 1) {
447 switch (get_highest_layer(layer_state)) {
448 case _QWERTY:
449 // Scrolling with PageUp and PgDn.
450 if (clockwise) {
451 tap_code16(KC_PGDN);
452 } else {
453 tap_code16(KC_PGUP);
454 }
455 break;
456 default:
457 if (clockwise) {
458 tap_code16(A(KC_TAB));
459 } else {
460 tap_code16(A(S(KC_TAB)));
461 }
462 break;
463 }
464 }
465}
466#endif
diff --git a/keyboards/tkw/grandiceps/keymaps/default/readme.md b/keyboards/tkw/grandiceps/keymaps/default/readme.md
new file mode 100644
index 000000000..b7ea011a9
--- /dev/null
+++ b/keyboards/tkw/grandiceps/keymaps/default/readme.md
@@ -0,0 +1,13 @@
1![grandiceps default keymap](https://raw.githubusercontent.com/vattern/grandiceps/master/images/layer0.png)
2![grandiceps adjust layer](https://raw.githubusercontent.com/vattern/grandiceps/master/images/layer4.png)
3
4
5# Default keymap for grandiceps Keyboard
6
7Features:
8
9- Symmetric modifiers (CMD/Super, Alt/Opt, Ctrl, Shift)
10- Various modes, can be switched (using Adjust layer)
11- Modes for Qwerty and Colemak support
12- Modes for Mac vs Linux/Win support -> different order of modifiers and different action shortcuts on the "UPPER" layer .
13- The OLED on master half shows selected mode and caps lock state and is rotated.
diff --git a/keyboards/tkw/grandiceps/mcuconf.h b/keyboards/tkw/grandiceps/mcuconf.h
new file mode 100644
index 000000000..bf59ea62a
--- /dev/null
+++ b/keyboards/tkw/grandiceps/mcuconf.h
@@ -0,0 +1,34 @@
1/* Copyright 2020 QMK
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/*
18 * This file was auto-generated by:
19 * `qmk chibios-confupdate -i keyboards/tkw/grandiceps/mcuconf.h -r platforms/chibios/BLACKPILL_STM32_F411/configs/mcuconf.h`
20 */
21
22#pragma once
23
24#include_next <mcuconf.h>
25
26#undef STM32_I2C_USE_I2C1
27#define STM32_I2C_USE_I2C1 TRUE
28
29#undef STM32_PWM_USE_TIM3
30#define STM32_PWM_USE_TIM3 TRUE
31
32#undef STM32_SERIAL_USE_USART1
33#define STM32_SERIAL_USE_USART1 TRUE
34
diff --git a/keyboards/tkw/grandiceps/readme.md b/keyboards/tkw/grandiceps/readme.md
new file mode 100644
index 000000000..894f1c8d7
--- /dev/null
+++ b/keyboards/tkw/grandiceps/readme.md
@@ -0,0 +1,19 @@
1# grandiceps
2
3![grandiceps](https://i.imgur.com/FMtsboVl.jpg)
4
5ARM split keyboard with RGB underglow and encoders.
6
7* Keyboard Maintainer: [vattern](https://github.com/vattern)
8* Hardware Supported: f411 blackpill
9* Hardware Availability: [grandiceps](https://github.com/vattern/grandiceps)
10
11Make example for this keyboard (after setting up your build environment):
12
13 make tkw/grandiceps:default
14
15Flashing example for this keyboard:
16
17 make tkw/grandiceps:default:flash
18
19See 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).
diff --git a/keyboards/tkw/grandiceps/rules.mk b/keyboards/tkw/grandiceps/rules.mk
new file mode 100644
index 000000000..432bf8647
--- /dev/null
+++ b/keyboards/tkw/grandiceps/rules.mk
@@ -0,0 +1,30 @@
1# MCU name
2MCU = STM32F411
3
4# Build Options
5# change yes to no to disable
6#
7BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
8MOUSEKEY_ENABLE = yes # Mouse keys
9EXTRAKEY_ENABLE = yes # Audio control and System control
10CONSOLE_ENABLE = no # Console for debug
11COMMAND_ENABLE = no # Commands for debug and configuration
12# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
13SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
14# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
15NKRO_ENABLE = yes # USB Nkey Rollover
16BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
17RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
18ENCODER_ENABLE = yes # Enable rotary encoder support
19BLUETOOTH_ENABLE = no # Enable Bluetooth
20AUDIO_ENABLE = no # Audio output
21KEYBOARD_SHARED_EP = yes # Free up some extra endpoints - needed if console+mouse+extra
22
23SPLIT_KEYBOARD = yes
24SERIAL_DRIVER = usart
25OLED_DRIVER_ENABLE = yes
26WS2812_DRIVER = pwm
27OPT_DEFS += -DSTM32_DMA_REQUIRED=TRUE
28
29# Address of the bootloader in system memory
30STM32_BOOTLOADER_ADDRESS = 0x1FFF0000