aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/rainkeeb/config.h51
-rw-r--r--keyboards/rainkeeb/info.json54
-rw-r--r--keyboards/rainkeeb/keymaps/default/keymap.c115
-rw-r--r--keyboards/rainkeeb/keymaps/via/keymap.c115
-rw-r--r--keyboards/rainkeeb/keymaps/via/rules.mk1
-rw-r--r--keyboards/rainkeeb/rainkeeb.c16
-rw-r--r--keyboards/rainkeeb/rainkeeb.h34
-rw-r--r--keyboards/rainkeeb/readme.md24
-rw-r--r--keyboards/rainkeeb/rules.mk28
9 files changed, 438 insertions, 0 deletions
diff --git a/keyboards/rainkeeb/config.h b/keyboards/rainkeeb/config.h
new file mode 100644
index 000000000..36c3a5d5b
--- /dev/null
+++ b/keyboards/rainkeeb/config.h
@@ -0,0 +1,51 @@
1/* Copyright 2020 Regan Palmer
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/* USB Device descriptor parameter */
21#define VENDOR_ID 0x726B // rk - "rainkeebs"
22#define PRODUCT_ID 0x726B // rk - "rainkeeb"
23#define DEVICE_VER 0x0001
24#define MANUFACTURER rainkeebs
25#define PRODUCT rainkeeb
26
27/* key matrix size */
28#define MATRIX_ROWS 8
29#define MATRIX_COLS 6
30
31/* key matrix pins */
32#define MATRIX_ROW_PINS { D3, D2, D4, C6, D7, E6, B4, B5 }
33#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 }
34#define UNUSED_PINS
35
36/* COL2ROW or ROW2COL */
37#define DIODE_DIRECTION COL2ROW
38
39/* Set 0 if debouncing isn't needed */
40#define DEBOUNCE 5
41
42/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
43#define LOCKING_SUPPORT_ENABLE
44
45/* Locking resynchronize hack */
46#define LOCKING_RESYNC_ENABLE
47
48/* encoder pads */
49#define ENCODERS_PAD_A { B2 }
50#define ENCODERS_PAD_B { B6 }
51#define ENCODER_RESOLUTION 4
diff --git a/keyboards/rainkeeb/info.json b/keyboards/rainkeeb/info.json
new file mode 100644
index 000000000..bf0a7e2c9
--- /dev/null
+++ b/keyboards/rainkeeb/info.json
@@ -0,0 +1,54 @@
1{
2 "keyboard_name": "rainkeeb",
3 "url": "",
4 "maintainer": "rain",
5 "width": 12,
6 "height": 4,
7 "layouts": {
8 "LAYOUT": {
9 "layout": [
10 {"label":"k00", "x":0, "y":0},
11 {"label":"k01", "x":1, "y":0},
12 {"label":"k02", "x":2, "y":0},
13 {"label":"k03", "x":3, "y":0},
14 {"label":"k04", "x":4, "y":0},
15 {"label":"k05", "x":7, "y":0},
16 {"label":"k06", "x":8, "y":0},
17 {"label":"k07", "x":9, "y":0},
18 {"label":"k08", "x":10, "y":0},
19 {"label":"k09", "x":11, "y":0},
20 {"label":"k10", "x":0, "y":1},
21 {"label":"k11", "x":1, "y":1},
22 {"label":"k12", "x":2, "y":1},
23 {"label":"k13", "x":3, "y":1},
24 {"label":"k14", "x":4, "y":1},
25 {"label":"k15", "x":5.5, "y":1},
26 {"label":"k16", "x":7, "y":1},
27 {"label":"k17", "x":8, "y":1},
28 {"label":"k18", "x":9, "y":1},
29 {"label":"k19", "x":10, "y":1},
30 {"label":"k1a", "x":11, "y":1},
31 {"label":"k20", "x":0, "y":2},
32 {"label":"k21", "x":1, "y":2},
33 {"label":"k22", "x":2, "y":2},
34 {"label":"k23", "x":3, "y":2},
35 {"label":"k24", "x":4, "y":2},
36 {"label":"k25", "x":5.5, "y":2},
37 {"label":"k26", "x":7, "y":2},
38 {"label":"k27", "x":8, "y":2},
39 {"label":"k28", "x":9, "y":2},
40 {"label":"k29", "x":10, "y":2},
41 {"label":"k2a", "x":11, "y":1},
42 {"label":"k30", "x":0, "y":3},
43 {"label":"k31", "x":1, "y":3},
44 {"label":"k32", "x":2, "y":3},
45 {"label":"k33", "x":3, "y":3, "w":2},
46 {"label":"k34", "x":5, "y":3, "w":2},
47 {"label":"k35", "x":7, "y":3, "w":2},
48 {"label":"k36", "x":9, "y":3},
49 {"label":"k37", "x":10, "y":3},
50 {"label":"k38", "x":11, "y":3}
51 ]
52 }
53 }
54}
diff --git a/keyboards/rainkeeb/keymaps/default/keymap.c b/keyboards/rainkeeb/keymaps/default/keymap.c
new file mode 100644
index 000000000..f68ab2ef0
--- /dev/null
+++ b/keyboards/rainkeeb/keymaps/default/keymap.c
@@ -0,0 +1,115 @@
1/* Copyright 2020 Regan Palmer
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
18enum layers {
19 _BASE,
20 _RAISE,
21 _ADJUST,
22 _GAME,
23};
24
25#define RAISE MO(_RAISE)
26#define ADJUST MO(_ADJUST)
27#define GAME TG(_GAME)
28const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
29 [_BASE] = LAYOUT(
30 KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
31 KC_A, KC_S, KC_D, KC_F, KC_G, KC_MPLY, KC_H, KC_J, KC_K, KC_L, KC_ENT,
32 KC_Z, KC_X, KC_C, KC_V, KC_B, KC_PSCR, KC_N, KC_M, KC_COMM, KC_DOT, KC_BSPC,
33 KC_LCTL, KC_LALT, KC_LGUI, KC_LSFT, RAISE, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL),
34
35 [_RAISE] = LAYOUT(
36 KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,
37 KC_ESC, KC_GRV, KC_BSLS, KC_UP, KC_MINS, KC_TRNS, KC_LBRC, KC_RBRC, KC_SCLN, KC_QUOT, KC_TRNS,
38 KC_TAB, KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, ADJUST, KC_EQL, KC_SLSH, KC_TRNS, KC_TRNS, KC_TRNS,
39 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
40
41 [_ADJUST] = LAYOUT(
42 KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10,
43 KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, GAME, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_TRNS,
44 RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_DEL, KC_TRNS, KC_TRNS, KC_TRNS,
45 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
46
47 [_GAME] = LAYOUT(
48 KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
49 KC_A, KC_S, KC_D, KC_F, KC_G, GAME, KC_H, KC_J, KC_K, KC_L, KC_ENT,
50 KC_Z, KC_X, KC_C, KC_V, KC_B, KC_PSCR, KC_N, KC_M, KC_COMM, KC_DOT, KC_BSPC,
51 KC_LCTL, KC_LALT, KC_LGUI, KC_LSFT, KC_NO, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL)
52};
53
54void encoder_update_user(uint8_t index, bool clockwise) {
55 switch (get_highest_layer(layer_state)) {
56 case _BASE:
57 if (clockwise) {
58 tap_code(KC_VOLU);
59 } else {
60 tap_code(KC_VOLD);
61 }
62 break;
63 case _RAISE:
64 if (clockwise) {
65 tap_code(KC_MS_WH_DOWN);
66 } else {
67 tap_code(KC_MS_WH_UP);
68 }
69 break;
70 case _ADJUST:
71 if (clockwise) {
72 tap_code(KC_MS_WH_RIGHT);
73 } else {
74 tap_code(KC_MS_WH_LEFT);
75 }
76 break;
77 case _GAME:
78 if (clockwise) {
79 tap_code(KC_VOLU);
80 } else {
81 tap_code(KC_VOLD);
82 }
83 break;
84 }
85}
86
87char wpm[10];
88
89void oled_task_user(void) {
90 sprintf(wpm, "WPM: %03d", get_current_wpm());
91
92 // Host Keyboard Layer Status
93 oled_write_P(PSTR(" rainkeeb \n"), false);
94 oled_write_P(PSTR(" Layer: "), false);
95
96 switch (get_highest_layer(layer_state)) {
97 case _BASE:
98 oled_write_P(PSTR("Default\n"), false);
99 break;
100 case _RAISE:
101 oled_write_P(PSTR("Raise\n"), false);
102 break;
103 case _ADJUST:
104 oled_write_P(PSTR("Adjust\n"), false);
105 break;
106 case _GAME:
107 oled_write_P(PSTR("Game\n"), false);
108 break;
109 default:
110 // Or use the write_ln shortcut over adding '\n' to the end of your string
111 oled_write_ln_P(PSTR("Undefined"), false);
112 }
113 oled_write_P(PSTR(" "), false);
114 oled_write(wpm, false);
115}
diff --git a/keyboards/rainkeeb/keymaps/via/keymap.c b/keyboards/rainkeeb/keymaps/via/keymap.c
new file mode 100644
index 000000000..f68ab2ef0
--- /dev/null
+++ b/keyboards/rainkeeb/keymaps/via/keymap.c
@@ -0,0 +1,115 @@
1/* Copyright 2020 Regan Palmer
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
18enum layers {
19 _BASE,
20 _RAISE,
21 _ADJUST,
22 _GAME,
23};
24
25#define RAISE MO(_RAISE)
26#define ADJUST MO(_ADJUST)
27#define GAME TG(_GAME)
28const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
29 [_BASE] = LAYOUT(
30 KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
31 KC_A, KC_S, KC_D, KC_F, KC_G, KC_MPLY, KC_H, KC_J, KC_K, KC_L, KC_ENT,
32 KC_Z, KC_X, KC_C, KC_V, KC_B, KC_PSCR, KC_N, KC_M, KC_COMM, KC_DOT, KC_BSPC,
33 KC_LCTL, KC_LALT, KC_LGUI, KC_LSFT, RAISE, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL),
34
35 [_RAISE] = LAYOUT(
36 KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,
37 KC_ESC, KC_GRV, KC_BSLS, KC_UP, KC_MINS, KC_TRNS, KC_LBRC, KC_RBRC, KC_SCLN, KC_QUOT, KC_TRNS,
38 KC_TAB, KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, ADJUST, KC_EQL, KC_SLSH, KC_TRNS, KC_TRNS, KC_TRNS,
39 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
40
41 [_ADJUST] = LAYOUT(
42 KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10,
43 KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, GAME, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_TRNS,
44 RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_DEL, KC_TRNS, KC_TRNS, KC_TRNS,
45 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
46
47 [_GAME] = LAYOUT(
48 KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
49 KC_A, KC_S, KC_D, KC_F, KC_G, GAME, KC_H, KC_J, KC_K, KC_L, KC_ENT,
50 KC_Z, KC_X, KC_C, KC_V, KC_B, KC_PSCR, KC_N, KC_M, KC_COMM, KC_DOT, KC_BSPC,
51 KC_LCTL, KC_LALT, KC_LGUI, KC_LSFT, KC_NO, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL)
52};
53
54void encoder_update_user(uint8_t index, bool clockwise) {
55 switch (get_highest_layer(layer_state)) {
56 case _BASE:
57 if (clockwise) {
58 tap_code(KC_VOLU);
59 } else {
60 tap_code(KC_VOLD);
61 }
62 break;
63 case _RAISE:
64 if (clockwise) {
65 tap_code(KC_MS_WH_DOWN);
66 } else {
67 tap_code(KC_MS_WH_UP);
68 }
69 break;
70 case _ADJUST:
71 if (clockwise) {
72 tap_code(KC_MS_WH_RIGHT);
73 } else {
74 tap_code(KC_MS_WH_LEFT);
75 }
76 break;
77 case _GAME:
78 if (clockwise) {
79 tap_code(KC_VOLU);
80 } else {
81 tap_code(KC_VOLD);
82 }
83 break;
84 }
85}
86
87char wpm[10];
88
89void oled_task_user(void) {
90 sprintf(wpm, "WPM: %03d", get_current_wpm());
91
92 // Host Keyboard Layer Status
93 oled_write_P(PSTR(" rainkeeb \n"), false);
94 oled_write_P(PSTR(" Layer: "), false);
95
96 switch (get_highest_layer(layer_state)) {
97 case _BASE:
98 oled_write_P(PSTR("Default\n"), false);
99 break;
100 case _RAISE:
101 oled_write_P(PSTR("Raise\n"), false);
102 break;
103 case _ADJUST:
104 oled_write_P(PSTR("Adjust\n"), false);
105 break;
106 case _GAME:
107 oled_write_P(PSTR("Game\n"), false);
108 break;
109 default:
110 // Or use the write_ln shortcut over adding '\n' to the end of your string
111 oled_write_ln_P(PSTR("Undefined"), false);
112 }
113 oled_write_P(PSTR(" "), false);
114 oled_write(wpm, false);
115}
diff --git a/keyboards/rainkeeb/keymaps/via/rules.mk b/keyboards/rainkeeb/keymaps/via/rules.mk
new file mode 100644
index 000000000..036bd6d1c
--- /dev/null
+++ b/keyboards/rainkeeb/keymaps/via/rules.mk
@@ -0,0 +1 @@
VIA_ENABLE = yes \ No newline at end of file
diff --git a/keyboards/rainkeeb/rainkeeb.c b/keyboards/rainkeeb/rainkeeb.c
new file mode 100644
index 000000000..b13ecb248
--- /dev/null
+++ b/keyboards/rainkeeb/rainkeeb.c
@@ -0,0 +1,16 @@
1/* Copyright 2020 Regan Palmer
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 "rainkeeb.h" \ No newline at end of file
diff --git a/keyboards/rainkeeb/rainkeeb.h b/keyboards/rainkeeb/rainkeeb.h
new file mode 100644
index 000000000..f0179f087
--- /dev/null
+++ b/keyboards/rainkeeb/rainkeeb.h
@@ -0,0 +1,34 @@
1/* Copyright 2020 Regan Palmer
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 K00, K10, K01, K11, K02, K13, K03, K14, K04, K15, \
22 K20, K30, K21, K31, K22, K32, K23, K33, K24, K34, K25, \
23 K40, K50, K41, K51, K42, K52, K43, K53, K44, K54, K45, \
24 K60, K70, K61, K72, K62, K73, K64, K74, K65 \
25) { \
26 { K00, K01, K02, K03, K04, KC_NO }, \
27 { K10, K11, KC_NO, K13, K14, K15 }, \
28 { K20, K21, K22, K23, K24, K25 }, \
29 { K30, K31, K32, K33, K34, KC_NO }, \
30 { K40, K41, K42, K43, K44, K45 }, \
31 { K50, K51, K52, K53, K54, KC_NO }, \
32 { K60, K61, K62, KC_NO, K64, K65 }, \
33 { K70, KC_NO, K72, K73, K74, KC_NO } \
34}
diff --git a/keyboards/rainkeeb/readme.md b/keyboards/rainkeeb/readme.md
new file mode 100644
index 000000000..f2c759ebe
--- /dev/null
+++ b/keyboards/rainkeeb/readme.md
@@ -0,0 +1,24 @@
1# rainkeeb
2
3![rainkeeb](https://i.imgur.com/GpVBRMw.jpg)
4
5My first custom mech design. 4x10(ish), pro micro based, unibody, split, ortho (any more adjectives?), with OLED and (optional) rotary encoder.
6
7![Default layout](https://i.imgur.com/rCOwsoy.png)
8This is the default layout, at least the base layer. By default the OLED displays "rainkeeb" at the top in case you forget what you're typing on, a layer indicator below that (Default, Raised, Alt), and a WPM counter below that. Encoder toggles Play/Pause on click on the Default and Raised layers, and is supposed to RESET into flash-mode on the Alt layer but that's not working for some reason. Clockwise turn increases volume, scrolls down, and scrolls right on the Default, Raise, and Alt layers respectively. Counterclockwise does the opposite of the clockwise turns, you get the picture.
9
10* Keyboard Maintainer: [rain](https://github.com/rainsff)
11* Hardware Supported: rainkeeb PCB v1
12* Hardware Availability: GB soon
13
14Make example for this keyboard (after setting up your build environment):
15
16 make rainkeeb:default
17
18To put reset into bootloader mode just push the reset button from the left side of the board using a pair of tweezers or similar object.
19
20Install example for this keyboard:
21
22 make rainkeeb:default:flash
23
24See 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/rainkeeb/rules.mk b/keyboards/rainkeeb/rules.mk
new file mode 100644
index 000000000..aa9aab9b7
--- /dev/null
+++ b/keyboards/rainkeeb/rules.mk
@@ -0,0 +1,28 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5BOOTLOADER = caterina
6
7# Build Options
8# comment out to disable the options.
9#
10BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
11MOUSEKEY_ENABLE = yes # Mouse keys
12EXTRAKEY_ENABLE = yes # Audio control and System control
13CONSOLE_ENABLE = no # Console for debug
14COMMAND_ENABLE = no # Commands for debug and configuration
15SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
16NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
17BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
18AUDIO_ENABLE = no
19RGBLIGHT_ENABLE = no
20
21# OLED enable
22OLED_DRIVER_ENABLE = yes
23
24# Encoder enable
25ENCODER_ENABLE = yes
26
27# WPM counter enable
28WPM_ENABLE = yes