diff options
-rw-r--r-- | keyboards/splitkb/zima/config.h | 93 | ||||
-rw-r--r-- | keyboards/splitkb/zima/info.json | 25 | ||||
-rw-r--r-- | keyboards/splitkb/zima/keymaps/default/keymap.c | 37 | ||||
-rw-r--r-- | keyboards/splitkb/zima/keymaps/default/readme.md | 7 | ||||
-rw-r--r-- | keyboards/splitkb/zima/readme.md | 17 | ||||
-rw-r--r-- | keyboards/splitkb/zima/rules.mk | 28 | ||||
-rw-r--r-- | keyboards/splitkb/zima/zima.c | 112 | ||||
-rw-r--r-- | keyboards/splitkb/zima/zima.h | 29 |
8 files changed, 348 insertions, 0 deletions
diff --git a/keyboards/splitkb/zima/config.h b/keyboards/splitkb/zima/config.h new file mode 100644 index 000000000..b39ef7308 --- /dev/null +++ b/keyboards/splitkb/zima/config.h | |||
@@ -0,0 +1,93 @@ | |||
1 | /* | ||
2 | Copyright 2019 Thomas Baart | ||
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 0xF75B | ||
25 | #define DEVICE_VER 0x0001 | ||
26 | #define MANUFACTURER splitkb | ||
27 | #define PRODUCT Zima | ||
28 | |||
29 | /* key matrix size */ | ||
30 | #define MATRIX_ROWS 4 | ||
31 | #define MATRIX_COLS 3 | ||
32 | |||
33 | /* | ||
34 | * Keyboard Matrix Assignments | ||
35 | */ | ||
36 | #define DIRECT_PINS { \ | ||
37 | { C6, D6, D5 }, \ | ||
38 | { C7, F7, D4 }, \ | ||
39 | { E6, F5, F6 }, \ | ||
40 | { F0, F1, F4 } \ | ||
41 | } | ||
42 | |||
43 | #define UNUSED_PINS | ||
44 | |||
45 | #define ENCODERS_PAD_A { B4 } | ||
46 | #define ENCODERS_PAD_B { D7 } | ||
47 | |||
48 | // #define QMK_ESC_OUTPUT B7 | ||
49 | // #define QMK_ESC_INPUT C6 | ||
50 | // #define QMK_SPEAKER B6 | ||
51 | |||
52 | #define B6_AUDIO | ||
53 | #define AUDIO_CLICKY | ||
54 | #define NO_MUSIC_MODE | ||
55 | |||
56 | #define RGB_DI_PIN B5 | ||
57 | #define RGBLED_NUM 5 | ||
58 | #define RGBLIGHT_HUE_STEP 8 | ||
59 | #define RGBLIGHT_SAT_STEP 8 | ||
60 | #define RGBLIGHT_VAL_STEP 8 | ||
61 | #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ | ||
62 | #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ | ||
63 | #define RGBLIGHT_EFFECT_BREATHING | ||
64 | #define RGBLIGHT_EFFECT_RAINBOW_MOOD | ||
65 | #define RGBLIGHT_EFFECT_RAINBOW_SWIRL | ||
66 | #define RGBLIGHT_EFFECT_STATIC_GRADIENT | ||
67 | #define RGBLIGHT_EFFECT_TWINKLE | ||
68 | |||
69 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
70 | #define DEBOUNCE 5 | ||
71 | |||
72 | /* define if matrix has ghost (lacks anti-ghosting diodes) */ | ||
73 | //#define MATRIX_HAS_GHOST | ||
74 | |||
75 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
76 | // #define LOCKING_SUPPORT_ENABLE | ||
77 | /* Locking resynchronize hack */ | ||
78 | // #define LOCKING_RESYNC_ENABLE | ||
79 | |||
80 | #define FB_ERM_LRA 0 | ||
81 | #define FB_BRAKEFACTOR 3 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */ | ||
82 | #define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ | ||
83 | |||
84 | /* Please refer to your datasheet for the optimal setting for your specific motor. */ | ||
85 | #define RATED_VOLTAGE 3 | ||
86 | #define V_PEAK 5 | ||
87 | |||
88 | #define DRV_GREETING alert_750ms | ||
89 | #define DRV_MODE_DEFAULT buzz | ||
90 | // EC11K encoders have a different resolution than other EC11 encoders. | ||
91 | // When using the default resolution of 4, if you notice your encoder skipping | ||
92 | // every other tick, lower the resolution to 2. | ||
93 | #define ENCODER_RESOLUTION 2 | ||
diff --git a/keyboards/splitkb/zima/info.json b/keyboards/splitkb/zima/info.json new file mode 100644 index 000000000..de1a909c3 --- /dev/null +++ b/keyboards/splitkb/zima/info.json | |||
@@ -0,0 +1,25 @@ | |||
1 | { | ||
2 | "keyboard_name": "Zima", | ||
3 | "url": "splitkb.com", | ||
4 | "maintainer": "splitkb.com, drashna", | ||
5 | "width": 3, | ||
6 | "height": 4, | ||
7 | "layouts": { | ||
8 | "LAYOUT_ortho_4x3": { | ||
9 | "layout": [ | ||
10 | {"label":"K00 (B0,B4)", "x":0, "y":1}, | ||
11 | {"label":"K01 (B0,B5)", "x":1, "y":1}, | ||
12 | {"label":"K02 (B0,B6)", "x":2, "y":1}, | ||
13 | {"label":"K10 (B1,B4)", "x":0, "y":2}, | ||
14 | {"label":"K11 (B1,B5)", "x":1, "y":2}, | ||
15 | {"label":"K12 (B1,B6)", "x":2, "y":2}, | ||
16 | {"label":"K20 (B2,B4)", "x":0, "y":3}, | ||
17 | {"label":"K21 (B2,B5)", "x":1, "y":3}, | ||
18 | {"label":"K22 (B2,B6)", "x":2, "y":3}, | ||
19 | {"label":"K30 (B3,B4)", "x":0, "y":4}, | ||
20 | {"label":"K31 (B3,B5)", "x":1, "y":4}, | ||
21 | {"label":"K32 (B3,B6)", "x":2, "y":4} | ||
22 | ] | ||
23 | } | ||
24 | } | ||
25 | } | ||
diff --git a/keyboards/splitkb/zima/keymaps/default/keymap.c b/keyboards/splitkb/zima/keymaps/default/keymap.c new file mode 100644 index 000000000..33483c293 --- /dev/null +++ b/keyboards/splitkb/zima/keymaps/default/keymap.c | |||
@@ -0,0 +1,37 @@ | |||
1 | /* Copyright 2019 Thomas Baart | ||
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 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
19 | [0] = LAYOUT_ortho_4x3( /* Base */ | ||
20 | KC_MUTE, TG(1), TG(2), | ||
21 | KC_P7, KC_P8, KC_P9, | ||
22 | KC_P4, KC_P5, KC_P6, | ||
23 | KC_P1, KC_P2, KC_P3 | ||
24 | ), | ||
25 | [1] = LAYOUT_ortho_4x3( /* Layer 1 */ | ||
26 | RESET, _______, XXXXXXX, | ||
27 | AU_ON, AU_OFF, XXXXXXX, | ||
28 | CK_TOGG, XXXXXXX, CK_UP, | ||
29 | CK_RST, XXXXXXX, CK_DOWN | ||
30 | ), | ||
31 | [2] = LAYOUT_ortho_4x3( /* Layer 2*/ | ||
32 | RGB_TOG, RGB_MOD, _______, | ||
33 | RGB_HUI, RGB_SAI, RGB_VAI, | ||
34 | RGB_HUD, RGB_SAD, RGB_VAD, | ||
35 | HPT_TOG, HPT_FBK, HPT_CONT | ||
36 | ) | ||
37 | }; | ||
diff --git a/keyboards/splitkb/zima/keymaps/default/readme.md b/keyboards/splitkb/zima/keymaps/default/readme.md new file mode 100644 index 000000000..0f78f4bf1 --- /dev/null +++ b/keyboards/splitkb/zima/keymaps/default/readme.md | |||
@@ -0,0 +1,7 @@ | |||
1 | # The default keymap for zima | ||
2 | |||
3 | This includes support for the OLED and Encoder. However, the actual code is found in the `zima.c` file. This can be replaced by adding your own `oled_task_user(void)` and `encoder_update_user` functinons. These will replace what is in the keyboard, and allow you to customize these features. | ||
4 | |||
5 | The reason that this is done this way, is so that this functionality will work on the [QMK Configurator](https://config.qmk.fm/#/splitkb/zima/LAYOUT_ortho_4x3) | ||
6 | |||
7 | For reference, the code used for the oled and encoder defaults is in [zima.c](https://github.com/qmk/qmk_firmware/tree/master/keyboards/splitkb/zima/zima.c). | ||
diff --git a/keyboards/splitkb/zima/readme.md b/keyboards/splitkb/zima/readme.md new file mode 100644 index 000000000..d97450030 --- /dev/null +++ b/keyboards/splitkb/zima/readme.md | |||
@@ -0,0 +1,17 @@ | |||
1 | # Zima | ||
2 | |||
3 |  | ||
4 | |||
5 | A feature-packed twelve key macropad the size of a creditcard. | ||
6 | |||
7 | * Keyboard Maintainer: [Thomas Baart](https://github.com/splitkb) | ||
8 | * Hardware Supported: Onboard ATmega32u4 with speaker, encoder, RGB underglow, OLED and haptic support, with a Type C connector | ||
9 | * Hardware Availability: [splitkb.com](https://splitkb.com/collections/keyboard-kits/products/zima) | ||
10 | |||
11 | Make example for this keyboard (after setting up your build environment): | ||
12 | |||
13 | make splitkb/zima:default | ||
14 | |||
15 | Keyboard can be put into bootloader mode by pressing the button to the right of the USB port on the underside of the PCB. | ||
16 | |||
17 | See 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/splitkb/zima/rules.mk b/keyboards/splitkb/zima/rules.mk new file mode 100644 index 000000000..71c9dc6e8 --- /dev/null +++ b/keyboards/splitkb/zima/rules.mk | |||
@@ -0,0 +1,28 @@ | |||
1 | # MCU name | ||
2 | MCU = atmega32u4 | ||
3 | |||
4 | # Bootloader selection | ||
5 | BOOTLOADER = atmel-dfu | ||
6 | |||
7 | # Build Options | ||
8 | # change yes to no to disable | ||
9 | # | ||
10 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration | ||
11 | MOUSEKEY_ENABLE = no # Mouse keys | ||
12 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
13 | CONSOLE_ENABLE = no # Console for debug | ||
14 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
15 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
16 | SLEEP_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 | ||
18 | NKRO_ENABLE = no # USB Nkey Rollover | ||
19 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
20 | RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow | ||
21 | BLUETOOTH_ENABLE = no # Enable Bluetooth | ||
22 | AUDIO_ENABLE = yes # Audio output | ||
23 | |||
24 | ENCODER_ENABLE = yes # ENables the use of one or more encoders | ||
25 | OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays | ||
26 | HAPTIC_ENABLE += DRV2605L # Supported but not included by defaut | ||
27 | |||
28 | LTO_ENABLE = yes | ||
diff --git a/keyboards/splitkb/zima/zima.c b/keyboards/splitkb/zima/zima.c new file mode 100644 index 000000000..3989ebeb2 --- /dev/null +++ b/keyboards/splitkb/zima/zima.c | |||
@@ -0,0 +1,112 @@ | |||
1 | /* Copyright 2019 Thomas Baart | ||
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 "zima.h" | ||
17 | #include <stdio.h> | ||
18 | |||
19 | #ifdef HAPTIC_ENABLE | ||
20 | # include "haptic.h" | ||
21 | extern haptic_config_t haptic_config; | ||
22 | #endif | ||
23 | |||
24 | #ifdef OLED_DRIVER_ENABLE | ||
25 | static bool is_asleep = false; | ||
26 | static uint32_t oled_timer; | ||
27 | |||
28 | void suspend_power_down_kb(void) { | ||
29 | is_asleep = true; | ||
30 | suspend_power_down_user(); | ||
31 | } | ||
32 | |||
33 | void suspend_wakeup_init_kb(void) { | ||
34 | is_asleep = false; | ||
35 | suspend_wakeup_init_user(); | ||
36 | } | ||
37 | |||
38 | __attribute__((weak)) oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; } | ||
39 | |||
40 | __attribute__((weak)) void oled_task_user(void) { | ||
41 | if (is_asleep) { | ||
42 | oled_off(); | ||
43 | return; | ||
44 | } | ||
45 | |||
46 | if (timer_elapsed32(oled_timer) < 30000) { | ||
47 | oled_on(); | ||
48 | oled_scroll_off(); | ||
49 | oled_write_P(PSTR("SplitKB's Zima"), false); | ||
50 | char layer[2] = {0}; | ||
51 | snprintf(layer, sizeof(layer), "%d", get_highest_layer(layer_state)); | ||
52 | oled_write_P(PSTR(" L:"), false); | ||
53 | oled_write_ln(layer, false); | ||
54 | oled_write_ln_P(PSTR("--------------"), false); | ||
55 | if (rgblight_is_enabled()) { | ||
56 | oled_write_P(PSTR("HSV: "), false); | ||
57 | char rgbs[14]; | ||
58 | snprintf(rgbs, sizeof(rgbs), "%3d, %3d, %3d", rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val()); | ||
59 | oled_write_ln(rgbs, false); | ||
60 | } else { | ||
61 | oled_write_ln_P(PSTR("RGB LIGHT DISABLED"), false); | ||
62 | } | ||
63 | # ifdef AUDIO_ENABLE | ||
64 | oled_write_P(PSTR("Audio:"), false); | ||
65 | is_audio_on() ? oled_write_P(PSTR(" on"), false) : oled_write_P(PSTR("off"), false); | ||
66 | # ifdef AUDIO_CLICKY | ||
67 | oled_write_P(PSTR(" Clicky:"), false); | ||
68 | (is_clicky_on() && is_audio_on()) ? oled_write_P(PSTR(" on"), false) : oled_write_P(PSTR("off"), false); | ||
69 | # endif | ||
70 | # endif | ||
71 | } else { | ||
72 | if (timer_elapsed32(oled_timer) < 120000) { | ||
73 | oled_on(); | ||
74 | // clang-format off | ||
75 | static const char PROGMEM qmk_logo[] = { | ||
76 | 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, | ||
77 | 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, | ||
78 | 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; | ||
79 | // clang-format on | ||
80 | oled_write_ln_P(qmk_logo, false); | ||
81 | oled_scroll_right(); | ||
82 | } else { | ||
83 | oled_off(); | ||
84 | } | ||
85 | } | ||
86 | } | ||
87 | |||
88 | bool process_record_kb(uint16_t keycode, keyrecord_t* record) { | ||
89 | oled_timer = timer_read32(); | ||
90 | |||
91 | return process_record_user(keycode, record); | ||
92 | } | ||
93 | #endif | ||
94 | |||
95 | #ifdef ENCODER_ENABLE | ||
96 | __attribute__((weak)) void encoder_update_user(uint8_t index, bool clockwise) { | ||
97 | if (clockwise) { | ||
98 | tap_code16(KC_VOLU); | ||
99 | } else { | ||
100 | tap_code16(KC_VOLD); | ||
101 | } | ||
102 | # ifdef OLED_DRIVER_ENABLE | ||
103 | oled_timer = timer_read32(); | ||
104 | # endif | ||
105 | # if defined(AUDIO_ENABLE) && defined(AUDIO_CLICKY) | ||
106 | if (is_audio_on() && is_clicky_on()) clicky_play(); | ||
107 | # endif | ||
108 | # ifdef HAPTIC_ENABLE | ||
109 | if (haptic_config.enable) haptic_play(); | ||
110 | # endif | ||
111 | } | ||
112 | #endif | ||
diff --git a/keyboards/splitkb/zima/zima.h b/keyboards/splitkb/zima/zima.h new file mode 100644 index 000000000..dc492ef10 --- /dev/null +++ b/keyboards/splitkb/zima/zima.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* Copyright 2019 Thomas Baart | ||
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_ortho_4x3( \ | ||
21 | k00, k01, k02, \ | ||
22 | k03, k04, k05, \ | ||
23 | k06, k07, k08, \ | ||
24 | k09, k10, k11 \ | ||
25 | ) { \ | ||
26 | {k00, k01, k02}, \ | ||
27 | {k03, k04, k05}, \ | ||
28 | {k06, k07, k08}, \ | ||
29 | {k09, k10, k11} } | ||