diff options
| author | J.Flanagan <jrfhoutx@comcast.net> | 2021-08-29 14:18:56 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-29 12:18:56 -0700 |
| commit | ef7fdee6c803bf92bd6d892326c05ee1f473ad07 (patch) | |
| tree | 15120e33a3c26b5cf4aa49fe8d019a1dac989d68 | |
| parent | f87cd8e8a02bf89d05737a19fd54e8ec6f63f90f (diff) | |
| download | qmk_firmware-ef7fdee6c803bf92bd6d892326c05ee1f473ad07.tar.gz qmk_firmware-ef7fdee6c803bf92bd6d892326c05ee1f473ad07.zip | |
[Keyboard] Add Viktus SP Mini (#14069)
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>
| -rw-r--r-- | keyboards/viktus/sp_mini/config.h | 99 | ||||
| -rw-r--r-- | keyboards/viktus/sp_mini/info.json | 85 | ||||
| -rw-r--r-- | keyboards/viktus/sp_mini/keymaps/default/keymap.c | 128 | ||||
| -rw-r--r-- | keyboards/viktus/sp_mini/keymaps/via/keymap.c | 136 | ||||
| -rw-r--r-- | keyboards/viktus/sp_mini/keymaps/via/rules.mk | 2 | ||||
| -rw-r--r-- | keyboards/viktus/sp_mini/readme.md | 21 | ||||
| -rw-r--r-- | keyboards/viktus/sp_mini/rules.mk | 24 | ||||
| -rw-r--r-- | keyboards/viktus/sp_mini/sp_mini.c | 45 | ||||
| -rw-r--r-- | keyboards/viktus/sp_mini/sp_mini.h | 41 |
9 files changed, 581 insertions, 0 deletions
diff --git a/keyboards/viktus/sp_mini/config.h b/keyboards/viktus/sp_mini/config.h new file mode 100644 index 000000000..06b8c2f51 --- /dev/null +++ b/keyboards/viktus/sp_mini/config.h | |||
| @@ -0,0 +1,99 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
| 3 | Copyright 2015 Jack Humbert | ||
| 4 | |||
| 5 | This program is free software: you can redistribute it and/or modify | ||
| 6 | it under the terms of the GNU General Public License as published by | ||
| 7 | the Free Software Foundation, either version 2 of the License, or | ||
| 8 | (at your option) any later version. | ||
| 9 | |||
| 10 | This program is distributed in the hope that it will be useful, | ||
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | GNU General Public License for more details. | ||
| 14 | |||
| 15 | You should have received a copy of the GNU General Public License | ||
| 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #pragma once | ||
| 20 | |||
| 21 | #include "config_common.h" | ||
| 22 | |||
| 23 | /* USB Device descriptor parameter */ | ||
| 24 | #define VENDOR_ID 0x5644 | ||
| 25 | #define PRODUCT_ID 0x534D | ||
| 26 | #define DEVICE_VER 0x0001 | ||
| 27 | #define MANUFACTURER Viktus_Design | ||
| 28 | #define PRODUCT SP_Mini | ||
| 29 | |||
| 30 | /* key matrix size */ | ||
| 31 | // Rows are doubled-up | ||
| 32 | #define MATRIX_ROWS 10 | ||
| 33 | #define MATRIX_COLS 8 | ||
| 34 | |||
| 35 | |||
| 36 | // wiring of each half | ||
| 37 | #define MATRIX_ROW_PINS { F0, B5, B4, D7, D6 } | ||
| 38 | #define MATRIX_COL_PINS { B6, C6, C7, D4, D2, D3, D5 } // no B7 on left hand | ||
| 39 | #define MATRIX_ROW_PINS_RIGHT { F0, B5, B4, D7, D6 } | ||
| 40 | #define MATRIX_COL_PINS_RIGHT { B6, C6, C7, D4, D2, D3, D5, B7 } | ||
| 41 | |||
| 42 | |||
| 43 | #define DIODE_DIRECTION COL2ROW | ||
| 44 | |||
| 45 | /* Split Defines */ | ||
| 46 | #define SPLIT_USB_DETECT | ||
| 47 | #define MASTER_LEFT | ||
| 48 | #define USE_I2C | ||
| 49 | |||
| 50 | /* define if matrix has ghost */ | ||
| 51 | //#define MATRIX_HAS_GHOST | ||
| 52 | |||
| 53 | /* Set 0 if debouncing isn't needed */ | ||
| 54 | #define DEBOUNCE 5 | ||
| 55 | |||
| 56 | |||
| 57 | /* ws2812 RGB LED */ | ||
| 58 | #define RGB_DI_PIN E6 | ||
| 59 | #define RGBLIGHT_EFFECT_BREATHING | ||
| 60 | #define RGBLIGHT_EFFECT_RAINBOW_MOOD | ||
| 61 | #define RGBLIGHT_EFFECT_RAINBOW_SWIRL | ||
| 62 | #define RGBLIGHT_EFFECT_SNAKE | ||
| 63 | #define RGBLIGHT_EFFECT_KNIGHT | ||
| 64 | #define RGBLIGHT_EFFECT_CHRISTMAS | ||
| 65 | #define RGBLIGHT_EFFECT_STATIC_GRADIENT | ||
| 66 | #define RGBLIGHT_EFFECT_RGB_TEST | ||
| 67 | #define RGBLIGHT_EFFECT_ALTERNATING | ||
| 68 | #define RGBLIGHT_EFFECT_TWINKLE | ||
| 69 | |||
| 70 | //#define RGBLIGHT_SPLIT | ||
| 71 | #define RGBLED_NUM 24 // Number of LEDs | ||
| 72 | #define RGBLED_SPLIT { 12, 12 } | ||
| 73 | |||
| 74 | |||
| 75 | |||
| 76 | #define ENCODERS_PAD_A {F4} | ||
| 77 | #define ENCODERS_PAD_B {F1} | ||
| 78 | //#define ENCODERS_PAD_A_RIGHT {F4} | ||
| 79 | //#define ENCODERS_PAD_B_RIGHT {F1} | ||
| 80 | |||
| 81 | #define ENCODER_RESOLUTIONS { 8, 8 } | ||
| 82 | |||
| 83 | /* | ||
| 84 | * Feature disable options | ||
| 85 | * These options are also useful to firmware size reduction. | ||
| 86 | */ | ||
| 87 | |||
| 88 | /* disable debug print */ | ||
| 89 | // #define NO_DEBUG | ||
| 90 | |||
| 91 | /* disable print */ | ||
| 92 | // #define NO_PRINT | ||
| 93 | |||
| 94 | /* disable action features */ | ||
| 95 | //#define NO_ACTION_LAYER | ||
| 96 | //#define NO_ACTION_TAPPING | ||
| 97 | //#define NO_ACTION_ONESHOT | ||
| 98 | //#define NO_ACTION_MACRO | ||
| 99 | //#define NO_ACTION_FUNCTION | ||
diff --git a/keyboards/viktus/sp_mini/info.json b/keyboards/viktus/sp_mini/info.json new file mode 100644 index 000000000..5b207ce81 --- /dev/null +++ b/keyboards/viktus/sp_mini/info.json | |||
| @@ -0,0 +1,85 @@ | |||
| 1 | { | ||
| 2 | "keyboard_name": "sp_mini", | ||
| 3 | "url": "", | ||
| 4 | "maintainer": "jrfhoutx", | ||
| 5 | "width": 16, | ||
| 6 | "height": 5.5, | ||
| 7 | "layouts": { | ||
| 8 | "LAYOUT_all": { | ||
| 9 | "layout": [ | ||
| 10 | {"x":0, "y":0}, | ||
| 11 | {"x":1.25, "y":0}, | ||
| 12 | {"x":2.25, "y":0}, | ||
| 13 | {"x":3.25, "y":0}, | ||
| 14 | {"x":4.25, "y":0}, | ||
| 15 | {"x":5.25, "y":0}, | ||
| 16 | {"x":6.25, "y":0}, | ||
| 17 | {"x":7.75, "y":0}, | ||
| 18 | {"x":8.75, "y":0}, | ||
| 19 | {"x":9.75, "y":0}, | ||
| 20 | {"x":10.75, "y":0}, | ||
| 21 | {"x":11.75, "y":0}, | ||
| 22 | {"x":12.75, "y":0}, | ||
| 23 | {"x":13.75, "y":0}, | ||
| 24 | {"x":15, "y":0}, | ||
| 25 | |||
| 26 | {"x":0, "y":1.25}, | ||
| 27 | {"label":"Esc", "x":1.25, "y":1.25}, | ||
| 28 | {"label":"Q", "x":2.25, "y":1.25}, | ||
| 29 | {"label":"W", "x":3.25, "y":1.25}, | ||
| 30 | {"label":"E", "x":4.25, "y":1.25}, | ||
| 31 | {"label":"R", "x":5.25, "y":1.25}, | ||
| 32 | {"label":"T", "x":6.25, "y":1.25}, | ||
| 33 | {"label":"Y", "x":7.75, "y":1.25}, | ||
| 34 | {"label":"U", "x":8.75, "y":1.25}, | ||
| 35 | {"label":"I", "x":9.75, "y":1.25}, | ||
| 36 | {"label":"O", "x":10.75, "y":1.25}, | ||
| 37 | {"label":"P", "x":11.75, "y":1.25}, | ||
| 38 | {"label":"Delete", "x":12.75, "y":1.25}, | ||
| 39 | {"label":"Back", "x":13.75, "y":1.25}, | ||
| 40 | {"x":15, "y":1.25}, | ||
| 41 | |||
| 42 | {"x":0, "y":2.25}, | ||
| 43 | {"label":"Tab", "x":1.25, "y":2.25, "w":1.25}, | ||
| 44 | {"label":"A", "x":2.5, "y":2.25}, | ||
| 45 | {"label":"S", "x":3.5, "y":2.25}, | ||
| 46 | {"label":"D", "x":4.5, "y":2.25}, | ||
| 47 | {"label":"F", "x":5.5, "y":2.25}, | ||
| 48 | {"label":"G", "x":6.5, "y":2.25}, | ||
| 49 | {"label":"H", "x":8, "y":2.25}, | ||
| 50 | {"label":"J", "x":9, "y":2.25}, | ||
| 51 | {"label":"K", "x":10, "y":2.25}, | ||
| 52 | {"label":"L", "x":11, "y":2.25}, | ||
| 53 | {"label":"\"", "x":12, "y":2.25}, | ||
| 54 | {"label":"Enter", "x":13, "y":2.25, "w":1.75}, | ||
| 55 | {"x":15, "y":2.25}, | ||
| 56 | |||
| 57 | {"x":0, "y":3.25}, | ||
| 58 | {"label":"Shift", "x":1.25, "y":3.25, "w":1.75}, | ||
| 59 | {"label":"Z", "x":3, "y":3.25}, | ||
| 60 | {"label":"X", "x":4, "y":3.25}, | ||
| 61 | {"label":"C", "x":5, "y":3.25}, | ||
| 62 | {"label":"V", "x":6, "y":3.25}, | ||
| 63 | {"label":"B", "x":7, "y":3.25}, | ||
| 64 | {"label":"N", "x":8.5, "y":3.25}, | ||
| 65 | {"label":"M", "x":9.5, "y":3.25}, | ||
| 66 | {"label":"<", "x":10.5, "y":3.25}, | ||
| 67 | {"label":">", "x":11.5, "y":3.25}, | ||
| 68 | {"label":"Shift", "x":12.5, "y":3.25, "w":1.25}, | ||
| 69 | {"label":"\u2191", "x":14, "y":3.5}, | ||
| 70 | |||
| 71 | {"x":0, "y":4.25}, | ||
| 72 | {"label":"Ctrl", "x":1.25, "y":4.25, "w":1.25}, | ||
| 73 | {"label":"LAlt", "x":2.5, "y":4.25}, | ||
| 74 | {"label":"LGUI", "x":3.5, "y":4.25}, | ||
| 75 | {"label":"Fn1", "x":4.5, "y":4.25, "w":1.25}, | ||
| 76 | {"label":"SPFn1", "x":5.75, "y":4.25, "w":2}, | ||
| 77 | {"label":"BSFn2", "x":8.25, "y":4.25, "w":2.25}, | ||
| 78 | {"label":"Alt", "x":10.5, "y":4.25, "w":1.25}, | ||
| 79 | {"label":"Fn2", "x":11.75, "y":4.25}, | ||
| 80 | {"label":"\u2190", "x":13, "y":4.5}, | ||
| 81 | {"label":"\u2193", "x":14, "y":4.5}, | ||
| 82 | {"label":"\u2192", "x":15, "y":4.5}] | ||
| 83 | } | ||
| 84 | } | ||
| 85 | } | ||
diff --git a/keyboards/viktus/sp_mini/keymaps/default/keymap.c b/keyboards/viktus/sp_mini/keymaps/default/keymap.c new file mode 100644 index 000000000..e01b6083d --- /dev/null +++ b/keyboards/viktus/sp_mini/keymaps/default/keymap.c | |||
| @@ -0,0 +1,128 @@ | |||
| 1 | /* Copyright 2021 jrfhoutx | ||
| 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 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 22 | // entirely and just use numbers. | ||
| 23 | |||
| 24 | |||
| 25 | enum custom_layers { | ||
| 26 | _BASE, | ||
| 27 | _FN1, | ||
| 28 | _FN2, | ||
| 29 | _FN3, | ||
| 30 | }; | ||
| 31 | |||
| 32 | enum custom_keycodes { | ||
| 33 | QWERTY = SAFE_RANGE, | ||
| 34 | }; | ||
| 35 | |||
| 36 | #define KC_FN1 MO(_FN1) | ||
| 37 | #define KC_FN2 MO(_FN2) | ||
| 38 | #define SPFN1 LT(_FN1, KC_SPACE) | ||
| 39 | #define BSFN2 LT(_FN2, KC_BSPC) | ||
| 40 | |||
| 41 | |||
| 42 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 43 | [_BASE] = LAYOUT_all( | ||
| 44 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F24, _______, _______, | ||
| 45 | MO(1), KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_BSPC, _______, | ||
| 46 | MO(2), KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, _______, | ||
| 47 | _______, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_UP, | ||
| 48 | _______, KC_LCTL, KC_LALT, KC_LGUI, KC_FN1, SPFN1, BSFN2, KC_RALT, KC_FN2, KC_LEFT, KC_DOWN, KC_RGHT | ||
| 49 | ), | ||
| 50 | |||
| 51 | [_FN1] = LAYOUT_all( | ||
| 52 | _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 53 | _______, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, _______, | ||
| 54 | _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, KC_VOLU, KC_LBRC, KC_RBRC, KC_4, KC_5, KC_6, KC_SCLN, _______, _______, | ||
| 55 | _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_VOLD, KC_LCBR, KC_RCBR, KC_1, KC_2, KC_3, _______, KC_UP, | ||
| 56 | _______, _______, _______, _______, _______, _______, KC_DEL, KC_0, _______, KC_LEFT, KC_DOWN, KC_RGHT | ||
| 57 | ), | ||
| 58 | |||
| 59 | [_FN2] = LAYOUT_all( | ||
| 60 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 61 | _______, KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_UNDS, KC_PLUS, _______, | ||
| 62 | _______, _______, _______, _______, KC_INS, KC_PGUP, KC_HOME, _______, _______, _______, _______, KC_COLN, _______, _______, | ||
| 63 | _______, _______, _______, _______, KC_DEL, KC_PGDN, KC_END, _______, _______, _______, _______, _______, KC_UP, | ||
| 64 | _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT | ||
| 65 | ), | ||
| 66 | |||
| 67 | [_FN3] = LAYOUT_all( | ||
| 68 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F24, _______, _______, | ||
| 69 | MO(1), KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_BSPC, _______, | ||
| 70 | MO(2), KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, _______, | ||
| 71 | _______, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_UP, | ||
| 72 | _______, KC_LCTL, KC_LALT, KC_LGUI, KC_FN1, SPFN1, BSFN2, KC_RALT, KC_FN2, KC_LEFT, KC_DOWN, KC_RGHT | ||
| 73 | ) | ||
| 74 | |||
| 75 | }; | ||
| 76 | |||
| 77 | void keyboard_pre_init_user(void) { | ||
| 78 | setPinOutput(F5); // initialize F5 for LED | ||
| 79 | setPinOutput(F6); // initialize F6 for LED | ||
| 80 | setPinOutput(F7); // initialize F7 for LED | ||
| 81 | |||
| 82 | } | ||
| 83 | |||
| 84 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
| 85 | writePinLow(F5); | ||
| 86 | writePinLow(F6); | ||
| 87 | writePinLow(F7); | ||
| 88 | switch (get_highest_layer(state)) { | ||
| 89 | case _FN1: | ||
| 90 | writePinHigh(F5); | ||
| 91 | break; | ||
| 92 | case _FN2: | ||
| 93 | writePinHigh(F6); | ||
| 94 | break; | ||
| 95 | case _FN3: // replace 'XXXX' with the layer or function name | ||
| 96 | writePinHigh(F7); | ||
| 97 | break; | ||
| 98 | case KC_F24: | ||
| 99 | writePinHigh(F7); | ||
| 100 | writePinHigh(F5); | ||
| 101 | writePinHigh(F6); | ||
| 102 | break; | ||
| 103 | } | ||
| 104 | return state; | ||
| 105 | } | ||
| 106 | |||
| 107 | |||
| 108 | bool spongebob_mode = false; | ||
| 109 | bool spongebob_case = false; | ||
| 110 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 111 | if (spongebob_mode) { | ||
| 112 | switch(keycode) { | ||
| 113 | case KC_A...KC_Z: | ||
| 114 | if (record->event.pressed) { | ||
| 115 | (spongebob_case ^= 1) == 0 ? tap_code16(S(keycode)) : tap_code(keycode); | ||
| 116 | return false; break; | ||
| 117 | } | ||
| 118 | } | ||
| 119 | } | ||
| 120 | switch(keycode) { | ||
| 121 | case KC_F24: | ||
| 122 | if (record->event.pressed) { | ||
| 123 | spongebob_mode ^= 1; | ||
| 124 | } | ||
| 125 | return false; break; | ||
| 126 | } | ||
| 127 | return true; | ||
| 128 | } | ||
diff --git a/keyboards/viktus/sp_mini/keymaps/via/keymap.c b/keyboards/viktus/sp_mini/keymaps/via/keymap.c new file mode 100644 index 000000000..e1242d5b9 --- /dev/null +++ b/keyboards/viktus/sp_mini/keymaps/via/keymap.c | |||
| @@ -0,0 +1,136 @@ | |||
| 1 | /* Copyright 2021 jrfhoutx | ||
| 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 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 22 | // entirely and just use numbers. | ||
| 23 | |||
| 24 | |||
| 25 | enum custom_layers { | ||
| 26 | _BASE, | ||
| 27 | _FN1, | ||
| 28 | _FN2, | ||
| 29 | _FN3, | ||
| 30 | }; | ||
| 31 | |||
| 32 | enum custom_keycodes { | ||
| 33 | QWERTY = SAFE_RANGE, | ||
| 34 | }; | ||
| 35 | |||
| 36 | #define KC_FN1 MO(_FN1) | ||
| 37 | #define KC_FN2 MO(_FN2) | ||
| 38 | #define SPFN1 LT(_FN1, KC_SPACE) | ||
| 39 | #define BSFN2 LT(_FN2, KC_BSPC) | ||
| 40 | |||
| 41 | |||
| 42 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 43 | [_BASE] = LAYOUT_all( | ||
| 44 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 45 | MO(1), KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_BSPC, _______, | ||
| 46 | MO(2), KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, _______, | ||
| 47 | _______, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_UP, | ||
| 48 | _______, KC_LCTL, KC_LALT, KC_LGUI, KC_FN1, SPFN1, BSFN2, KC_RALT, KC_FN2, KC_LEFT, KC_DOWN, KC_RGHT | ||
| 49 | ), | ||
| 50 | |||
| 51 | [_FN1] = LAYOUT_all( | ||
| 52 | _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 53 | _______, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, _______, | ||
| 54 | _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, KC_VOLU, KC_LBRC, KC_RBRC, KC_4, KC_5, KC_6, KC_SCLN, _______, _______, | ||
| 55 | _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_VOLD, KC_LCBR, KC_RCBR, KC_1, KC_2, KC_3, _______, KC_UP, | ||
| 56 | _______, _______, _______, _______, _______, _______, KC_DEL, KC_0, _______, KC_LEFT, KC_DOWN, KC_RGHT | ||
| 57 | ), | ||
| 58 | |||
| 59 | [_FN2] = LAYOUT_all( | ||
| 60 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 61 | _______, KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_UNDS, KC_PLUS, _______, | ||
| 62 | _______, _______, _______, _______, KC_INS, KC_PGUP, KC_HOME, _______, _______, _______, _______, KC_COLN, _______, _______, | ||
| 63 | _______, _______, _______, _______, KC_DEL, KC_PGDN, KC_END, _______, _______, _______, _______, _______, KC_UP, | ||
| 64 | _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT | ||
| 65 | ), | ||
| 66 | |||
| 67 | [_FN3] = LAYOUT_all( | ||
| 68 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F24, _______, _______, | ||
| 69 | MO(1), KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_BSPC, _______, | ||
| 70 | MO(2), KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, _______, | ||
| 71 | _______, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_UP, | ||
| 72 | _______, KC_LCTL, KC_LALT, KC_LGUI, KC_FN1, SPFN1, BSFN2, KC_RALT, KC_FN2, KC_LEFT, KC_DOWN, KC_RGHT | ||
| 73 | ) | ||
| 74 | |||
| 75 | }; | ||
| 76 | |||
| 77 | void keyboard_pre_init_user(void) { | ||
| 78 | setPinOutput(F5); // initialize F5 for LED | ||
| 79 | setPinOutput(F6); // initialize F6 for LED | ||
| 80 | setPinOutput(F7); // initialize F7 for LED | ||
| 81 | |||
| 82 | } | ||
| 83 | |||
| 84 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
| 85 | switch (get_highest_layer(state)) { | ||
| 86 | case _FN1: | ||
| 87 | writePinHigh(F5); | ||
| 88 | writePinLow(F6); | ||
| 89 | writePinLow(F7); | ||
| 90 | break; | ||
| 91 | case _FN2: | ||
| 92 | writePinHigh(F6); | ||
| 93 | writePinLow(F5); | ||
| 94 | writePinLow(F7); | ||
| 95 | break; | ||
| 96 | case _FN3: // replace 'XXXX' with the layer or function name | ||
| 97 | writePinHigh(F7); | ||
| 98 | writePinLow(F5); | ||
| 99 | writePinLow(F6); | ||
| 100 | break; | ||
| 101 | case KC_F24: | ||
| 102 | writePinHigh(F7); | ||
| 103 | writePinHigh(F5); | ||
| 104 | writePinHigh(F6); | ||
| 105 | break; | ||
| 106 | default: | ||
| 107 | writePinLow(F5); | ||
| 108 | writePinLow(F6); | ||
| 109 | writePinLow(F7); | ||
| 110 | break; | ||
| 111 | } | ||
| 112 | return state; | ||
| 113 | } | ||
| 114 | |||
| 115 | |||
| 116 | bool spongebob_mode = false; | ||
| 117 | bool spongebob_case = false; | ||
| 118 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 119 | if (spongebob_mode) { | ||
| 120 | switch(keycode) { | ||
| 121 | case KC_A...KC_Z: | ||
| 122 | if (record->event.pressed) { | ||
| 123 | (spongebob_case ^= 1) == 0 ? tap_code16(S(keycode)) : tap_code(keycode); | ||
| 124 | return false; break; | ||
| 125 | } | ||
| 126 | } | ||
| 127 | } | ||
| 128 | switch(keycode) { | ||
| 129 | case USER00: | ||
| 130 | if (record->event.pressed) { | ||
| 131 | spongebob_mode ^= 1; | ||
| 132 | } | ||
| 133 | return false; break; | ||
| 134 | } | ||
| 135 | return true; | ||
| 136 | } | ||
diff --git a/keyboards/viktus/sp_mini/keymaps/via/rules.mk b/keyboards/viktus/sp_mini/keymaps/via/rules.mk new file mode 100644 index 000000000..16d33cd89 --- /dev/null +++ b/keyboards/viktus/sp_mini/keymaps/via/rules.mk | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | VIA_ENABLE = yes | ||
| 2 | |||
diff --git a/keyboards/viktus/sp_mini/readme.md b/keyboards/viktus/sp_mini/readme.md new file mode 100644 index 000000000..339977be6 --- /dev/null +++ b/keyboards/viktus/sp_mini/readme.md | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | # sp_mini | ||
| 2 | |||
| 3 |  | ||
| 4 | |||
| 5 | The SP Mini is a 40% version of the SP-111 created in a collaboration of OneCreativeMind and BlindAssassin111 (Viktus owner). All design done by BlindAssassin111. The layout includes an F Row, left macro column, and arrows. Rotary encoders are supported in the top left and right positions. The board also features three through hole LED indicators and RGB underglow. | ||
| 6 | |||
| 7 | The SP Mini has dual ATMEGA32U4 controllers linked with USB Type C. Each PCB half has a single reset button and a standard AVR ISP header. | ||
| 8 | |||
| 9 | * Keyboard Maintainer: [jrfhoutx](https://github.com/jrfhoutx) | ||
| 10 | * Hardware Supported: SP Mini FE (Founder's Edition), SP Mini LC (Low Cal) | ||
| 11 | * Hardware Availability: Viktus Designs, LLC. | ||
| 12 | |||
| 13 | Make example for this keyboard (after setting up your build environment): | ||
| 14 | |||
| 15 | make viktus/sp_mini:default | ||
| 16 | |||
| 17 | Flashing example for this keyboard: | ||
| 18 | |||
| 19 | make viktus/sp_mini:default:flash | ||
| 20 | |||
| 21 | 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/viktus/sp_mini/rules.mk b/keyboards/viktus/sp_mini/rules.mk new file mode 100644 index 000000000..43b0ae8e5 --- /dev/null +++ b/keyboards/viktus/sp_mini/rules.mk | |||
| @@ -0,0 +1,24 @@ | |||
| 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 = lite # 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 = yes # 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 = no # Audio output | ||
| 23 | SPLIT_KEYBOARD = yes | ||
| 24 | ENCODER_ENABLE = yes | ||
diff --git a/keyboards/viktus/sp_mini/sp_mini.c b/keyboards/viktus/sp_mini/sp_mini.c new file mode 100644 index 000000000..c2ccc6db2 --- /dev/null +++ b/keyboards/viktus/sp_mini/sp_mini.c | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | /* Copyright 2021 jrfhoutx | ||
| 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 "sp_mini.h" | ||
| 18 | |||
| 19 | void keyboard_pre_init_kb(void) { | ||
| 20 | // enable built in pullups to avoid timeouts when right hand not connected | ||
| 21 | setPinInputHigh(D0); | ||
| 22 | setPinInputHigh(D1); | ||
| 23 | |||
| 24 | keyboard_pre_init_user(); | ||
| 25 | } | ||
| 26 | |||
| 27 | #ifdef ENCODER_ENABLE | ||
| 28 | bool encoder_update_kb(uint8_t index, bool clockwise) { | ||
| 29 | if (!encoder_update_user(index, clockwise)) { return false; } | ||
| 30 | if (index == 0) { /* First encoder */ | ||
| 31 | if (clockwise) { | ||
| 32 | tap_code(KC_PGDN); | ||
| 33 | } else { | ||
| 34 | tap_code(KC_PGUP); | ||
| 35 | } | ||
| 36 | } else if (index == 1) { /* Second encoder */ | ||
| 37 | if (clockwise) { | ||
| 38 | tap_code(KC_VOLU); | ||
| 39 | } else { | ||
| 40 | tap_code(KC_VOLD); | ||
| 41 | } | ||
| 42 | } | ||
| 43 | return true; | ||
| 44 | } | ||
| 45 | #endif | ||
diff --git a/keyboards/viktus/sp_mini/sp_mini.h b/keyboards/viktus/sp_mini/sp_mini.h new file mode 100644 index 000000000..6474a4f71 --- /dev/null +++ b/keyboards/viktus/sp_mini/sp_mini.h | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | /* Copyright 2021 jrfhoutx | ||
| 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 | #define ___ KC_NO | ||
| 22 | |||
| 23 | #define LAYOUT_all( \ | ||
| 24 | L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, R07, \ | ||
| 25 | L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, R17, \ | ||
| 26 | L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R26, R27, \ | ||
| 27 | L30, L31, L32, L33, L34, L35, L36, R31, R32, R33, R34, R35, R36, \ | ||
| 28 | L40, L41, L42, L43, L44, L45, R42, R43, R44, R45, R46, R47 \ | ||
| 29 | ) \ | ||
| 30 | { \ | ||
| 31 | { L00, L01, L02, L03, L04, L05, L06 }, \ | ||
| 32 | { L10, L11, L12, L13, L14, L15, L16 }, \ | ||
| 33 | { L20, L21, L22, L23, L24, L25, L26 }, \ | ||
| 34 | { L30, L31, L32, L33, L34, L35, L36 }, \ | ||
| 35 | { L40, L41, L42, L43, L44, L45, ___ }, \ | ||
| 36 | { R00, R01, R02, R03, R04, R05, R06, R07}, \ | ||
| 37 | { R10, R11, R12, R13, R14, R15, R16, R17}, \ | ||
| 38 | { R20, R21, R22, R23, R24, ___, R26, R27}, \ | ||
| 39 | { ___, R31, R32, R33, R34, R35, R36, ___}, \ | ||
| 40 | { ___, ___, R42, R43, R44, R45, R46, R47} \ | ||
| 41 | } | ||
