aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMika Kuitunen <mika.kuitunen@hotmail.com>2020-10-23 06:08:56 +0300
committerGitHub <noreply@github.com>2020-10-22 20:08:56 -0700
commite7d8ccdbb2c14af9cf37be680af1d8633729b65a (patch)
tree8a75e70ab60e89f75c6840f66d689956b7786277
parentc45d7e526c9c5315c3fe2e831b01778c51b7a953 (diff)
downloadqmk_firmware-e7d8ccdbb2c14af9cf37be680af1d8633729b65a.tar.gz
qmk_firmware-e7d8ccdbb2c14af9cf37be680af1d8633729b65a.zip
[Keyboard] Add support for Tunks Ergo33 keyboard (#10665)
* [Keyboard] Add support for Tunks Ergo33 * [Keyboard] Ergo33: Code style fixes * [Keyboard] Ergo33: Add GPL license headers * [Keyboard] Ergo33: remove keymap_config declarations * Apply suggestions from code review Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: Ryan <fauxpark@gmail.com>
-rw-r--r--keyboards/tunks/ergo33/config.h68
-rw-r--r--keyboards/tunks/ergo33/ergo33.c17
-rw-r--r--keyboards/tunks/ergo33/ergo33.h57
-rw-r--r--keyboards/tunks/ergo33/info.json18
-rw-r--r--keyboards/tunks/ergo33/keymaps/default/config.h26
-rw-r--r--keyboards/tunks/ergo33/keymaps/default/keymap.c110
-rw-r--r--keyboards/tunks/ergo33/keymaps/default/readme.md11
-rw-r--r--keyboards/tunks/ergo33/keymaps/prpro/config.h28
-rw-r--r--keyboards/tunks/ergo33/keymaps/prpro/keymap.c164
-rw-r--r--keyboards/tunks/ergo33/keymaps/prpro/readme.md5
-rw-r--r--keyboards/tunks/ergo33/keymaps/prpro/rules.mk1
-rw-r--r--keyboards/tunks/ergo33/keymaps/rgb/config.h24
-rw-r--r--keyboards/tunks/ergo33/keymaps/rgb/keymap.c33
-rw-r--r--keyboards/tunks/ergo33/keymaps/rgb/readme.md3
-rw-r--r--keyboards/tunks/ergo33/readme.md20
-rw-r--r--keyboards/tunks/ergo33/rules.mk24
16 files changed, 609 insertions, 0 deletions
diff --git a/keyboards/tunks/ergo33/config.h b/keyboards/tunks/ergo33/config.h
new file mode 100644
index 000000000..96cc5b93b
--- /dev/null
+++ b/keyboards/tunks/ergo33/config.h
@@ -0,0 +1,68 @@
1/* Copyright 2020 Mika Kuitunen
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#pragma once
18
19#include "config_common.h"
20
21/* USB Device descriptor parameter */
22#define VENDOR_ID 0xFEED
23#define PRODUCT_ID 0xA0A1
24#define DEVICE_VER 0x0001
25#define MANUFACTURER kulmajaba
26#define PRODUCT Ergo33
27
28#define MATRIX_ROWS 5
29#define MATRIX_COLS 7
30
31/*
32 * Keyboard Matrix Assignments
33 * COLS: AVR pins used for columns, left to right
34 * ROWS: AVR pins used for rows, top to bottom
35*/
36#define MATRIX_ROW_PINS { F0, F1, B5, B4, D7 }
37#define MATRIX_COL_PINS { F4, F5, F6, F7, C7, C6, B6 }
38
39#define DIODE_DIRECTION COL2ROW
40
41/* Set 0 if debouncing is not needed */
42#define DEBOUNCE 5
43
44/* Underglow + top RGB configuration */
45#define RGB_DI_PIN D4
46
47/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
48//#define LOCKING_SUPPORT_ENABLE
49/* Locking resynchronize hack */
50#define LOCKING_RESYNC_ENABLE
51
52#define ENCODERS_PAD_A { D5 }
53#define ENCODERS_PAD_B { D3 }
54
55/*
56 * Feature disable options
57 * These options are also useful to firmware size reduction.
58 */
59
60/* disable debug print */
61//#define NO_DEBUG
62
63/* disable print */
64//#define NO_PRINT
65
66/* Bootmagic Lite key configuration */
67// #define BOOTMAGIC_LITE_ROW 0
68// #define BOOTMAGIC_LITE_COLUMN 0
diff --git a/keyboards/tunks/ergo33/ergo33.c b/keyboards/tunks/ergo33/ergo33.c
new file mode 100644
index 000000000..942655816
--- /dev/null
+++ b/keyboards/tunks/ergo33/ergo33.c
@@ -0,0 +1,17 @@
1/* Copyright 2020 Mika Kuitunen
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 "ergo33.h"
diff --git a/keyboards/tunks/ergo33/ergo33.h b/keyboards/tunks/ergo33/ergo33.h
new file mode 100644
index 000000000..d3deb9748
--- /dev/null
+++ b/keyboards/tunks/ergo33/ergo33.h
@@ -0,0 +1,57 @@
1/* Copyright 2020 Mika Kuitunen
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#pragma once
18
19#include "quantum.h"
20
21/* The first section contains all of the arguments representing the physical
22 * layout of the board and position of the keys.
23 *
24 * The second converts the arguments into a two-dimensional array which
25 * represents the switch matrix.
26 */
27
28/* Matrix layout
29 * ,---------.
30 * | 00 | 01 |------------------------.
31 * |----|----| 02 | 03 | 04 | 05 | 06 |
32 * | 10 | 11 |----|----|----|----|----|
33 * |----|----| 12 | 13 | 14 | 14 | 16 |
34 * | 20 | 21 |----|----|----|----|----|
35 * |----|----| 22 | 23 | 24 | 25 | 26 |
36 * | 30 | 31 |----|----|----|----|----| ,----.
37 * |----|----| 32 | 33 | 34 | 35 | 36 | | 46 |
38 * | 40 | 41 |---------------------------|----'
39 * `---------' | 43 | 44 | 45 |
40 * `--------------'
41 */
42
43#define LAYOUT( \
44 k00, k01, k02, k03, k04, k05, k06, \
45 k10, k11, k12, k13, k14, k15, k16, \
46 k20, k21, k22, k23, k24, k25, k26, \
47 k30, k31, k32, k33, k34, k35, k36, \
48 k40, k41, k46, \
49 k43, k44, k45 \
50) \
51{ \
52 { k00, k01, k02, k03, k04, k05, k06 }, \
53 { k10, k11, k12, k13, k14, k15, k16 }, \
54 { k20, k21, k22, k23, k24, k25, k26 }, \
55 { k30, k31, k32, k33, k34, k35, k36 }, \
56 { k40, k41, KC_NO, k43, k44, k45, k46 } \
57}
diff --git a/keyboards/tunks/ergo33/info.json b/keyboards/tunks/ergo33/info.json
new file mode 100644
index 000000000..0d4f00b94
--- /dev/null
+++ b/keyboards/tunks/ergo33/info.json
@@ -0,0 +1,18 @@
1{
2 "keyboard_name": "Ergo33",
3 "url": "https://github.com/kulmajaba/tunks-keyboard",
4 "width": 9,
5 "height": 6,
6 "layouts": {
7 "LAYOUT_all": {
8 "layout": [
9 {"x": 0, "y": 0}, {"x": 1, "y": 0}, {"x": 2, "y": 0.4}, {"x": 3, "y": 0.3}, {"x": 4, "y": 0.4}, {"x": 5, "y": 0.5}, {"x": 6, "y": 0.5},
10 {"x": 0, "y": 1}, {"x": 1, "y": 1}, {"x": 2, "y": 1.4}, {"x": 3, "y": 1.3}, {"x": 4, "y": 1.4}, {"x": 5, "y": 1.5}, {"x": 6, "y": 1.5},
11 {"x": 0, "y": 2}, {"x": 1, "y": 2}, {"x": 2, "y": 2.4}, {"x": 3, "y": 2.3}, {"x": 4, "y": 2.4}, {"x": 5, "y": 2.5}, {"x": 6, "y": 2.5},
12 {"x": 0, "y": 3}, {"x": 1, "y": 3}, {"x": 2, "y": 3.4}, {"x": 3, "y": 3.3}, {"x": 4, "y": 3.4}, {"x": 5, "y": 3.5}, {"x": 6, "y": 3.5}, {"x": 8, "y": 3.5},
13 {"x": 0, "y": 4}, {"x": 1, "y": 4},
14 {"x": 4.7, "y": 4.7}, {"x": 5.8, "y": 4.7}, {"x": 6.8, "y": 4.8}
15 ]
16 }
17 }
18} \ No newline at end of file
diff --git a/keyboards/tunks/ergo33/keymaps/default/config.h b/keyboards/tunks/ergo33/keymaps/default/config.h
new file mode 100644
index 000000000..0fd2ef93a
--- /dev/null
+++ b/keyboards/tunks/ergo33/keymaps/default/config.h
@@ -0,0 +1,26 @@
1/* Copyright 2020 Mika Kuitunen
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#pragma once
18
19/* RGB LED count
20 * No external LED PCB: 10
21 * External LED PCB: 14
22 */
23#define RGBLED_NUM 14
24#define RGBLIGHT_ANIMATIONS
25#define RGBLIGHT_LAYERS
26#define RGBLIGHT_SLEEP \ No newline at end of file
diff --git a/keyboards/tunks/ergo33/keymaps/default/keymap.c b/keyboards/tunks/ergo33/keymaps/default/keymap.c
new file mode 100644
index 000000000..e26e556cb
--- /dev/null
+++ b/keyboards/tunks/ergo33/keymaps/default/keymap.c
@@ -0,0 +1,110 @@
1/* Copyright 2020 Mika Kuitunen
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
19/* Each layer gets a name for readability, which is then used in the keymap matrix below.
20 * The underscores don't mean anything - you can have a layer called STUFF or any other name.
21 */
22enum layers {
23 _BASE = 0,
24 _RGB,
25};
26
27const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
28
29 [_BASE] = LAYOUT(
30 KC_ESC, KC_0, KC_1, KC_2, KC_3, KC_4, KC_5,
31 KC_Y, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T,
32 KC_H, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G,
33 KC_N, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, TG(_RGB),
34 KC_LGUI, KC_LCTL, KC_ENT,
35 KC_LALT, KC_SPC, KC_ENT
36 ),
37
38 [_RGB] = LAYOUT(
39 RGB_RMOD, RGB_MOD, RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
40 RGB_HUD, RGB_HUI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
41 RGB_SAD, RGB_SAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
42 RGB_VAD, RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG(_RGB),
43 KC_TRNS, KC_TRNS, KC_TRNS,
44 KC_TRNS, KC_TRNS, KC_TRNS
45 ),
46};
47
48#ifdef ENCODER_ENABLE
49void encoder_update_user(uint8_t index, bool clockwise) {
50 if (index == 0) {
51 if (clockwise) {
52 tap_code(KC_MS_WH_DOWN);
53 } else {
54 tap_code(KC_MS_WH_UP);
55 }
56 }
57}
58#endif
59
60
61#ifdef RGBLIGHT_LAYERS
62#define HUE_PRIMARY 10
63#define HSV_OFF 0, 0, 0
64#define HSV_CAPS HUE_PRIMARY, 255, 64
65#define HSV_LAYER_BASE HUE_PRIMARY, 255, 64
66#define HSV_LAYER_RGB 213, 255, 64
67
68const rgblight_segment_t PROGMEM ug_default_layer[] = RGBLIGHT_LAYER_SEGMENTS(
69 {10, 4, HSV_OFF}
70);
71
72const rgblight_segment_t PROGMEM ug_caps_layer[] = RGBLIGHT_LAYER_SEGMENTS(
73 {11, 1, HSV_CAPS}
74);
75
76const rgblight_segment_t PROGMEM ug_base_layer[] = RGBLIGHT_LAYER_SEGMENTS(
77 {13, 1, HSV_LAYER_BASE}
78);
79
80const rgblight_segment_t PROGMEM ug_rgb_layer[] = RGBLIGHT_LAYER_SEGMENTS(
81 {13, 1, HSV_LAYER_RGB}
82);
83
84/* Define layer order, later layers take precedence */
85const rgblight_segment_t* const PROGMEM ug_layers[] = RGBLIGHT_LAYERS_LIST(
86 ug_default_layer,
87 ug_caps_layer,
88 ug_base_layer,
89 ug_rgb_layer
90);
91
92void keyboard_post_init_user(void) {
93 /* Enable the LED layers and set the initial state */
94 rgblight_layers = ug_layers;
95 rgblight_set_layer_state(0, true);
96 rgblight_set_layer_state(2, true);
97}
98
99layer_state_t layer_state_set_user(layer_state_t state) {
100 /* Both layers will light up if both kb layers are active, latter overrides */
101 rgblight_set_layer_state(2, layer_state_cmp(state, 0));
102 rgblight_set_layer_state(3, layer_state_cmp(state, 1));
103 return state;
104}
105
106bool led_update_user(led_t led_state) {
107 rgblight_set_layer_state(1, led_state.caps_lock);
108 return true;
109}
110#endif
diff --git a/keyboards/tunks/ergo33/keymaps/default/readme.md b/keyboards/tunks/ergo33/keymaps/default/readme.md
new file mode 100644
index 000000000..40c5e0f49
--- /dev/null
+++ b/keyboards/tunks/ergo33/keymaps/default/readme.md
@@ -0,0 +1,11 @@
1# Default Ergo33 Layout
2
3This is the default layout for the Ergo33. It mostly follows the left side of a normal keyboard, except since there is an extra column on the left, `0` is above `TAB` and the left column is:
4```
5ESC
6Y
7H
8N
9GUI (Win)
10```
11The encoder acts as a mouse scrollwheel and encoder press is `Enter`. On the top LEDs the 1st is a layer indicator and the 3rd is a caps lock indicator.
diff --git a/keyboards/tunks/ergo33/keymaps/prpro/config.h b/keyboards/tunks/ergo33/keymaps/prpro/config.h
new file mode 100644
index 000000000..4fc3b2132
--- /dev/null
+++ b/keyboards/tunks/ergo33/keymaps/prpro/config.h
@@ -0,0 +1,28 @@
1/* Copyright 2020 Mika Kuitunen
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#pragma once
18
19/* RGB LED count
20 * No external LED PCB: 10
21 * External LED PCB: 14
22 */
23#define RGBLED_NUM 14
24#define RGBLIGHT_LAYERS
25#define RGBLIGHT_SLEEP
26
27/* Tap dance delay in ms */
28#define TAPPING_TERM 175 \ No newline at end of file
diff --git a/keyboards/tunks/ergo33/keymaps/prpro/keymap.c b/keyboards/tunks/ergo33/keymaps/prpro/keymap.c
new file mode 100644
index 000000000..500e5dba1
--- /dev/null
+++ b/keyboards/tunks/ergo33/keymaps/prpro/keymap.c
@@ -0,0 +1,164 @@
1/* Copyright 2020 Mika Kuitunen
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
19#include "keymap_finnish.h"
20
21enum layers {
22 _BASE = 0,
23 _PRPRO,
24 _PRPRO2,
25};
26
27/* Tap Dance declarations */
28enum {
29 TD_1,
30 TD_2,
31 TD_3,
32 TD_4,
33 TD_5,
34 TD_6,
35 TD_COMMA,
36 TD_HOME,
37 TD_K,
38 TD_DEL,
39 TD_X,
40 TD_C,
41 TD_V,
42 TD_Z
43};
44
45/* Tap Dance definitions */
46qk_tap_dance_action_t tap_dance_actions[] = {
47 [TD_1] = ACTION_TAP_DANCE_DOUBLE(LCTL(KC_1), LCTL(LSFT(KC_1))),
48 [TD_2] = ACTION_TAP_DANCE_DOUBLE(LCTL(KC_2), LCTL(LSFT(KC_2))),
49 [TD_3] = ACTION_TAP_DANCE_DOUBLE(LCTL(KC_3), LCTL(LSFT(KC_3))),
50 [TD_4] = ACTION_TAP_DANCE_DOUBLE(LCTL(KC_4), LCTL(LSFT(KC_4))),
51 [TD_5] = ACTION_TAP_DANCE_DOUBLE(LCTL(KC_5), LCTL(LSFT(KC_5))),
52 [TD_6] = ACTION_TAP_DANCE_DOUBLE(LCTL(KC_6), LCTL(LSFT(KC_6))),
53 [TD_COMMA] = ACTION_TAP_DANCE_DOUBLE(KC_COMMA, KC_DOT),
54 [TD_HOME] = ACTION_TAP_DANCE_DOUBLE(KC_HOME, KC_END),
55 [TD_K] = ACTION_TAP_DANCE_DOUBLE(LCTL(KC_K), LCTL(LSFT(KC_K))),
56 [TD_DEL] = ACTION_TAP_DANCE_DOUBLE(KC_DEL, LSFT(KC_DEL)),
57 [TD_X] = ACTION_TAP_DANCE_DOUBLE(LCTL(KC_X), KC_S),
58 [TD_C] = ACTION_TAP_DANCE_DOUBLE(LCTL(KC_C), KC_M),
59 [TD_V] = ACTION_TAP_DANCE_DOUBLE(LCTL(KC_V), LCTL(KC_L)),
60 [TD_Z] = ACTION_TAP_DANCE_DOUBLE(LCTL(KC_Z), LCTL(LSFT(KC_Z)))
61};
62
63const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
64
65 [_BASE] = LAYOUT(
66 KC_ESC, KC_0, KC_1, KC_2, KC_3, KC_4, KC_5,
67 KC_Y, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T,
68 KC_H, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G,
69 KC_N, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, TG(_PRPRO),
70 KC_LGUI, KC_LCTL, KC_ENT,
71 KC_LALT, KC_SPC, KC_ENT
72 ),
73
74 [_PRPRO] = LAYOUT(
75 KC_ESC, KC_M, KC_V, KC_UP, KC_A, KC_Y, KC_C,
76 KC_1, KC_2, KC_LEFT, KC_DOWN, KC_RIGHT, TD(TD_Z), TD(TD_DEL),
77 FI_SECT, TD(TD_HOME), KC_J, KC_K, KC_L, TD(TD_K), TG(_PRPRO2),
78 KC_S, KC_LSFT, LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), LCTL(KC_S), TG(_PRPRO),
79 LCTL(KC_L), KC_LCTL, KC_ENT,
80 KC_LALT, KC_SPC, KC_ENT
81 ),
82
83 [_PRPRO2] = LAYOUT(
84 KC_TRNS, KC_TRNS, TD(TD_1), TD(TD_2), TD(TD_3), TD(TD_4), TD(TD_5),
85 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
86 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
87 KC_TRNS, KC_TRNS, KC_I, KC_O, TD(TD_COMMA), KC_TRNS, TG(_PRPRO2),
88 KC_TRNS, KC_TRNS, KC_TRNS,
89 KC_TRNS, KC_TRNS, KC_TRNS
90 ),
91};
92
93#ifdef ENCODER_ENABLE
94void encoder_update_user(uint8_t index, bool clockwise) {
95 if (index == 0) {
96 if (clockwise) {
97 tap_code(KC_MS_WH_DOWN);
98 } else {
99 tap_code(KC_MS_WH_UP);
100 }
101 }
102}
103#endif
104
105#ifdef RGBLIGHT_LAYERS
106#define HUE_PRIMARY 10
107#define HSV_PRIMARY HUE_PRIMARY, 255, 255
108#define HSV_OFF 0, 0, 0
109#define HSV_CAPS HUE_PRIMARY, 255, 64
110#define HSV_LAYER_BASE HUE_PRIMARY, 255, 64
111#define HSV_LAYER_PRPRO 213, 255, 64
112#define HSV_LAYER_PRPRO2 184, 255, 64
113
114const rgblight_segment_t PROGMEM ug_default_layer[] = RGBLIGHT_LAYER_SEGMENTS(
115 {0, 14, HSV_PRIMARY},
116 {10, 4, HSV_OFF}
117);
118
119const rgblight_segment_t PROGMEM ug_caps_layer[] = RGBLIGHT_LAYER_SEGMENTS(
120 {11, 1, HSV_CAPS}
121);
122
123const rgblight_segment_t PROGMEM ug_base_layer[] = RGBLIGHT_LAYER_SEGMENTS(
124 {13, 1, HSV_LAYER_BASE}
125);
126
127const rgblight_segment_t PROGMEM ug_prpro_layer[] = RGBLIGHT_LAYER_SEGMENTS(
128 {13, 1, HSV_LAYER_PRPRO}
129);
130
131const rgblight_segment_t PROGMEM ug_prpro2_layer[] = RGBLIGHT_LAYER_SEGMENTS(
132 {13, 1, HSV_LAYER_PRPRO2}
133);
134
135/* Define layer order, later layers take precedence */
136const rgblight_segment_t* const PROGMEM ug_layers[] = RGBLIGHT_LAYERS_LIST(
137 ug_default_layer,
138 ug_caps_layer,
139 ug_base_layer,
140 ug_prpro_layer,
141 ug_prpro2_layer
142);
143
144void keyboard_post_init_user(void) {
145 /* Enable the LED layers */
146 rgblight_layers = ug_layers;
147 rgblight_set_layer_state(0, true);
148 rgblight_set_layer_state(2, true);
149}
150
151layer_state_t layer_state_set_user(layer_state_t state) {
152 rgblight_set_layer_state(0, true);
153 /* Both layers will light up if both kb layers are active */
154 rgblight_set_layer_state(2, layer_state_cmp(state, 0));
155 rgblight_set_layer_state(3, layer_state_cmp(state, 1));
156 rgblight_set_layer_state(4, layer_state_cmp(state, 2));
157 return state;
158}
159
160bool led_update_user(led_t led_state) {
161 rgblight_set_layer_state(1, led_state.caps_lock);
162 return true;
163}
164#endif
diff --git a/keyboards/tunks/ergo33/keymaps/prpro/readme.md b/keyboards/tunks/ergo33/keymaps/prpro/readme.md
new file mode 100644
index 000000000..d9507df73
--- /dev/null
+++ b/keyboards/tunks/ergo33/keymaps/prpro/readme.md
@@ -0,0 +1,5 @@
1# Ergo33 Premiere Pro Layout
2
3Default layout + Premiere pro editing layout for Ergo33.
4
5On this layout, the second and third layers are Adobe Premiere Pro hotkeys. You'll need to use [My custom shortcuts](https://github.com/kulmajaba/tunks-keyboard/blob/master/Ergo33%20prpro.kys) for it to work.
diff --git a/keyboards/tunks/ergo33/keymaps/prpro/rules.mk b/keyboards/tunks/ergo33/keymaps/prpro/rules.mk
new file mode 100644
index 000000000..2176e6dc2
--- /dev/null
+++ b/keyboards/tunks/ergo33/keymaps/prpro/rules.mk
@@ -0,0 +1 @@
TAP_DANCE_ENABLE = yes # Tap dance \ No newline at end of file
diff --git a/keyboards/tunks/ergo33/keymaps/rgb/config.h b/keyboards/tunks/ergo33/keymaps/rgb/config.h
new file mode 100644
index 000000000..dceb82945
--- /dev/null
+++ b/keyboards/tunks/ergo33/keymaps/rgb/config.h
@@ -0,0 +1,24 @@
1/* Copyright 2020 Mika Kuitunen
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#pragma once
18
19/* RGB LED count
20 * No external LED PCB: 10
21 * External LED PCB: 14
22 */
23#define RGBLED_NUM 10
24#define RGBLIGHT_ANIMATIONS \ No newline at end of file
diff --git a/keyboards/tunks/ergo33/keymaps/rgb/keymap.c b/keyboards/tunks/ergo33/keymaps/rgb/keymap.c
new file mode 100644
index 000000000..9ea18d279
--- /dev/null
+++ b/keyboards/tunks/ergo33/keymaps/rgb/keymap.c
@@ -0,0 +1,33 @@
1/* Copyright 2020 Mika Kuitunen
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
19enum layers {
20 _BASE = 0,
21};
22
23const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
24
25 [_BASE] = LAYOUT(
26 RGB_RMOD, RGB_MOD, RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
27 RGB_HUD, RGB_HUI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
28 RGB_SAD, RGB_SAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
29 RGB_VAD, RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
30 KC_TRNS, KC_TRNS, KC_TRNS,
31 KC_TRNS, KC_TRNS, KC_TRNS
32 ),
33};
diff --git a/keyboards/tunks/ergo33/keymaps/rgb/readme.md b/keyboards/tunks/ergo33/keymaps/rgb/readme.md
new file mode 100644
index 000000000..bafc87e5a
--- /dev/null
+++ b/keyboards/tunks/ergo33/keymaps/rgb/readme.md
@@ -0,0 +1,3 @@
1# Ergo33 RGB Layout
2
3Pure RGB lighting layout for product photography.
diff --git a/keyboards/tunks/ergo33/readme.md b/keyboards/tunks/ergo33/readme.md
new file mode 100644
index 000000000..d825ef3af
--- /dev/null
+++ b/keyboards/tunks/ergo33/readme.md
@@ -0,0 +1,20 @@
1# Ergo33
2
3A one-handed 33-key keypad for gaming, macros etc.
4
5* Keyboard Maintainer: [Mika Kuitunen / kulmajaba](https://github.com/kulmajaba)
6* Hardware Supported: Ergo33 PCB, ATmega32U4 MCU, Kailh hot-swap sockets, EC11 rotary encoder
7* Hardware Availability: Open source, schema and layout: [Github](https://github.com/kulmajaba/tunks-keyboard)
8
9![](https://i.imgur.com/G5nAspYl.jpg)
10![](https://i.imgur.com/snLIZrEl.jpg)
11
12Make example for this keyboard (after setting up your build environment):
13
14 make ergo33:default
15
16See 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).
17
18### Bootloader mode
19
20To get the keyboard into bootloader mode, press the switch `SW1` on the backside of the PCB once while the keyboard is connected to USB.
diff --git a/keyboards/tunks/ergo33/rules.mk b/keyboards/tunks/ergo33/rules.mk
new file mode 100644
index 000000000..fcd2cf52b
--- /dev/null
+++ b/keyboards/tunks/ergo33/rules.mk
@@ -0,0 +1,24 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5BOOTLOADER = atmel-dfu
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
11EXTRAKEY_ENABLE = yes # Audio control and System control
12MOUSEKEY_ENABLE = yes # Mouse keys
13COMMAND_ENABLE = no # Commands for debug and configuration
14CONSOLE_ENABLE = no # Console for debug
15# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
16SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
18NKRO_ENABLE = yes # USB Nkey Rollover
19BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
20RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
21BLUETOOTH_ENABLE = no # Enable Bluetooth
22AUDIO_ENABLE = no # Audio output
23
24ENCODER_ENABLE = yes # Rotary encoders