diff options
| author | HorrorTroll <sonicvipduc@gmail.com> | 2022-01-22 13:16:16 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-21 22:16:16 -0800 |
| commit | 25cffa26171be0615ca2a5da8920985f7bc5cbe1 (patch) | |
| tree | 67981384b40a249abf4291404071661b0d2b287f | |
| parent | 24eac9d3cec3a2848a595fd580c125602e82fb4e (diff) | |
| download | qmk_firmware-25cffa26171be0615ca2a5da8920985f7bc5cbe1.tar.gz qmk_firmware-25cffa26171be0615ca2a5da8920985f7bc5cbe1.zip | |
[Keyboard] Add M63 RGB keyboard (#15887)
13 files changed, 738 insertions, 5 deletions
diff --git a/keyboards/horrortroll/chinese_pcb/m63_rgb/config.h b/keyboards/horrortroll/chinese_pcb/m63_rgb/config.h new file mode 100644 index 000000000..298397125 --- /dev/null +++ b/keyboards/horrortroll/chinese_pcb/m63_rgb/config.h | |||
| @@ -0,0 +1,107 @@ | |||
| 1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
| 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 0x7516 | ||
| 23 | #define PRODUCT_ID 0x6002 | ||
| 24 | #define DEVICE_VER 0x0001 | ||
| 25 | #define MANUFACTURER HorrorTroll | ||
| 26 | #define PRODUCT M63 RGB | ||
| 27 | |||
| 28 | /* key matrix size */ | ||
| 29 | #define MATRIX_ROWS 5 | ||
| 30 | #define MATRIX_COLS 14 | ||
| 31 | |||
| 32 | /* key matrix pins */ | ||
| 33 | #define MATRIX_ROW_PINS { B3, B4, A0, A2, A3 } | ||
| 34 | #define MATRIX_COL_PINS { B0, B1, B2, B10, A7, A6, A5, A4, B5, B6, A1, B7, B8, B9 } | ||
| 35 | |||
| 36 | #define BOOTMAGIC_LITE_ROW 3 | ||
| 37 | #define BOOTMAGIC_LITE_COLUMN 5 | ||
| 38 | |||
| 39 | /* COL2ROW or ROW2COL */ | ||
| 40 | #define DIODE_DIRECTION COL2ROW | ||
| 41 | |||
| 42 | /* Set 0 if debouncing isn't needed */ | ||
| 43 | #define DEBOUNCE 5 | ||
| 44 | |||
| 45 | /* Forcing to use NKRO instead 6KRO */ | ||
| 46 | #define FORCE_NKRO | ||
| 47 | |||
| 48 | /* Change USB Polling Rate to 1000hz and a larger keys per scan for elite gaming */ | ||
| 49 | #define USB_POLLING_INTERVAL_MS 1 | ||
| 50 | #define QMK_KEYS_PER_SCAN 12 | ||
| 51 | |||
| 52 | #ifdef RGB_MATRIX_ENABLE | ||
| 53 | #define DRIVER_LED_TOTAL 75 | ||
| 54 | #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 | ||
| 55 | #define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS | ||
| 56 | #define RGB_MATRIX_KEYPRESSES | ||
| 57 | #define RGB_MATRIX_FRAMEBUFFER_EFFECTS | ||
| 58 | |||
| 59 | /* RGB Matrix config */ | ||
| 60 | #define RGB_DI_PIN B15 | ||
| 61 | |||
| 62 | /* RGB Matrix effect */ | ||
| 63 | #define ENABLE_RGB_MATRIX_ALPHAS_MODS | ||
| 64 | #define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN | ||
| 65 | #define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT | ||
| 66 | #define ENABLE_RGB_MATRIX_BREATHING | ||
| 67 | #define ENABLE_RGB_MATRIX_BAND_SAT | ||
| 68 | #define ENABLE_RGB_MATRIX_BAND_VAL | ||
| 69 | #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT | ||
| 70 | #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL | ||
| 71 | #define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT | ||
| 72 | #define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL | ||
| 73 | #define ENABLE_RGB_MATRIX_CYCLE_ALL | ||
| 74 | #define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT | ||
| 75 | #define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN | ||
| 76 | #define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON | ||
| 77 | #define ENABLE_RGB_MATRIX_CYCLE_OUT_IN | ||
| 78 | #define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL | ||
| 79 | #define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL | ||
| 80 | #define ENABLE_RGB_MATRIX_CYCLE_SPIRAL | ||
| 81 | #define ENABLE_RGB_MATRIX_DUAL_BEACON | ||
| 82 | #define ENABLE_RGB_MATRIX_RAINBOW_BEACON | ||
| 83 | #define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS | ||
| 84 | #define ENABLE_RGB_MATRIX_RAINDROPS | ||
| 85 | #define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS | ||
| 86 | #define ENABLE_RGB_MATRIX_HUE_BREATHING | ||
| 87 | #define ENABLE_RGB_MATRIX_HUE_PENDULUM | ||
| 88 | #define ENABLE_RGB_MATRIX_HUE_WAVE | ||
| 89 | #define ENABLE_RGB_MATRIX_PIXEL_RAIN | ||
| 90 | #define ENABLE_RGB_MATRIX_PIXEL_FRACTAL | ||
| 91 | // enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined | ||
| 92 | #define ENABLE_RGB_MATRIX_TYPING_HEATMAP | ||
| 93 | #define ENABLE_RGB_MATRIX_DIGITAL_RAIN | ||
| 94 | // enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined | ||
| 95 | #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE | ||
| 96 | #define ENABLE_RGB_MATRIX_SOLID_REACTIVE | ||
| 97 | #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE | ||
| 98 | #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE | ||
| 99 | #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS | ||
| 100 | #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS | ||
| 101 | #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS | ||
| 102 | #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS | ||
| 103 | #define ENABLE_RGB_MATRIX_SPLASH | ||
| 104 | #define ENABLE_RGB_MATRIX_MULTISPLASH | ||
| 105 | #define ENABLE_RGB_MATRIX_SOLID_SPLASH | ||
| 106 | #define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH | ||
| 107 | #endif | ||
diff --git a/keyboards/horrortroll/chinese_pcb/m63_rgb/info.json b/keyboards/horrortroll/chinese_pcb/m63_rgb/info.json new file mode 100644 index 000000000..651e58a10 --- /dev/null +++ b/keyboards/horrortroll/chinese_pcb/m63_rgb/info.json | |||
| @@ -0,0 +1,78 @@ | |||
| 1 | { | ||
| 2 | "keyboard_name": "M63 RGB", | ||
| 3 | "url": "", | ||
| 4 | "maintainer": "HorrorTroll", | ||
| 5 | "layouts": { | ||
| 6 | "LAYOUT_60_ansi_arrow": { | ||
| 7 | "layout": [ | ||
| 8 | {"label":"Esc", "x":0, "y":0}, | ||
| 9 | {"label":"1!", "x":1, "y":0}, | ||
| 10 | {"label":"2@", "x":2, "y":0}, | ||
| 11 | {"label":"3#", "x":3, "y":0}, | ||
| 12 | {"label":"4$", "x":4, "y":0}, | ||
| 13 | {"label":"5%", "x":5, "y":0}, | ||
| 14 | {"label":"6^", "x":6, "y":0}, | ||
| 15 | {"label":"7&", "x":7, "y":0}, | ||
| 16 | {"label":"8*", "x":8, "y":0}, | ||
| 17 | {"label":"9(", "x":9, "y":0}, | ||
| 18 | {"label":"0)", "x":10, "y":0}, | ||
| 19 | {"label":"-_", "x":11, "y":0}, | ||
| 20 | {"label":"=+", "x":12, "y":0}, | ||
| 21 | {"label":"Backspace", "x":13, "y":0, "w":2}, | ||
| 22 | |||
| 23 | {"label":"Tab", "x":0, "y":1, "w":1.5}, | ||
| 24 | {"label":"Q", "x":1.5, "y":1}, | ||
| 25 | {"label":"W", "x":2.5, "y":1}, | ||
| 26 | {"label":"E", "x":3.5, "y":1}, | ||
| 27 | {"label":"R", "x":4.5, "y":1}, | ||
| 28 | {"label":"T", "x":5.5, "y":1}, | ||
| 29 | {"label":"Y", "x":6.5, "y":1}, | ||
| 30 | {"label":"U", "x":7.5, "y":1}, | ||
| 31 | {"label":"I", "x":8.5, "y":1}, | ||
| 32 | {"label":"O", "x":9.5, "y":1}, | ||
| 33 | {"label":"P", "x":10.5, "y":1}, | ||
| 34 | {"label":"[{", "x":11.5, "y":1}, | ||
| 35 | {"label":"]}", "x":12.5, "y":1}, | ||
| 36 | {"label":"\\|", "x":13.5, "y":1, "w":1.5}, | ||
| 37 | |||
| 38 | {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, | ||
| 39 | {"label":"A", "x":1.75, "y":2}, | ||
| 40 | {"label":"S", "x":2.75, "y":2}, | ||
| 41 | {"label":"D", "x":3.75, "y":2}, | ||
| 42 | {"label":"F", "x":4.75, "y":2}, | ||
| 43 | {"label":"G", "x":5.75, "y":2}, | ||
| 44 | {"label":"H", "x":6.75, "y":2}, | ||
| 45 | {"label":"J", "x":7.75, "y":2}, | ||
| 46 | {"label":"K", "x":8.75, "y":2}, | ||
| 47 | {"label":"L", "x":9.75, "y":2}, | ||
| 48 | {"label":";:", "x":10.75, "y":2}, | ||
| 49 | {"label":"'\"", "x":11.75, "y":2}, | ||
| 50 | {"label":"Enter", "x":12.75, "y":2, "w":2.25}, | ||
| 51 | |||
| 52 | {"label":"Shift", "x":0, "y":3, "w":2.25}, | ||
| 53 | {"label":"Z", "x":2.25, "y":3}, | ||
| 54 | {"label":"X", "x":3.25, "y":3}, | ||
| 55 | {"label":"C", "x":4.25, "y":3}, | ||
| 56 | {"label":"V", "x":5.25, "y":3}, | ||
| 57 | {"label":"B", "x":6.25, "y":3}, | ||
| 58 | {"label":"N", "x":7.25, "y":3}, | ||
| 59 | {"label":"M", "x":8.25, "y":3}, | ||
| 60 | {"label":",<", "x":9.25, "y":3}, | ||
| 61 | {"label":".>", "x":10.25, "y":3}, | ||
| 62 | {"label":"Shift", "x":11.25, "y":3, "w":1.75}, | ||
| 63 | {"label":"\u2191", "x":13, "y":3}, | ||
| 64 | {"label":"/?", "x":14, "y":3}, | ||
| 65 | |||
| 66 | {"label":"Ctrl", "x":0, "y":4, "w":1.25}, | ||
| 67 | {"label":"Win", "x":1.25, "y":4, "w":1.25}, | ||
| 68 | {"label":"Alt", "x":2.5, "y":4, "w":1.25}, | ||
| 69 | {"label":"Space", "x":3.75, "y":4, "w":6.25}, | ||
| 70 | {"label":"Alt", "x":10, "y":4}, | ||
| 71 | {"label":"Fn", "x":11, "y":4}, | ||
| 72 | {"label":"\u2190", "x":12, "y":4}, | ||
| 73 | {"label":"\u2193", "x":13, "y":4}, | ||
| 74 | {"label":"\u2192", "x":14, "y":4} | ||
| 75 | ] | ||
| 76 | } | ||
| 77 | } | ||
| 78 | } | ||
diff --git a/keyboards/horrortroll/chinese_pcb/m63_rgb/keymaps/default/keymap.c b/keyboards/horrortroll/chinese_pcb/m63_rgb/keymaps/default/keymap.c new file mode 100644 index 000000000..8f421c22f --- /dev/null +++ b/keyboards/horrortroll/chinese_pcb/m63_rgb/keymaps/default/keymap.c | |||
| @@ -0,0 +1,187 @@ | |||
| 1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
| 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 <string.h> | ||
| 18 | #include <math.h> | ||
| 19 | |||
| 20 | #include <lib/lib8tion/lib8tion.h> | ||
| 21 | |||
| 22 | #include QMK_KEYBOARD_H | ||
| 23 | |||
| 24 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
| 25 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
| 26 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 27 | // entirely and just use numbers. | ||
| 28 | |||
| 29 | enum layer_names { | ||
| 30 | _BASE = 0, | ||
| 31 | _FN = 1 | ||
| 32 | }; | ||
| 33 | |||
| 34 | enum user_rgb_mode { | ||
| 35 | RGB_MODE_ALL, | ||
| 36 | RGB_MODE_KEYLIGHT, | ||
| 37 | RGB_MODE_UNDERGLOW, | ||
| 38 | RGB_MODE_NONE, | ||
| 39 | }; | ||
| 40 | |||
| 41 | typedef union { | ||
| 42 | uint32_t raw; | ||
| 43 | struct { | ||
| 44 | uint8_t rgb_mode :8; | ||
| 45 | }; | ||
| 46 | } user_config_t; | ||
| 47 | |||
| 48 | user_config_t user_config; | ||
| 49 | |||
| 50 | // enum layer_keycodes { }; | ||
| 51 | |||
| 52 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 53 | |||
| 54 | /* | ||
| 55 | ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ | ||
| 56 | │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Bakspc│ | ||
| 57 | ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ | ||
| 58 | │ Tab │ q │ w │ e │ r │ t │ y │ u │ i │ o │ p │ [ │ ] │ \ │ | ||
| 59 | ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ | ||
| 60 | │ Caps │ a │ s │ d │ f │ g │ h │ j │ k │ l │ ; │ ' │ Enter │ | ||
| 61 | ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┬───┤ | ||
| 62 | │ LShift │ z │ x │ c │ v │ b │ n │ m │ , │ . │ RSft │ ↑ │ / │ | ||
| 63 | ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬───┼───┼───┤ | ||
| 64 | │LCrl│GUI │LAlt│ Space │RAt│Fn │ ← │ ↓ │ → │ | ||
| 65 | └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ | ||
| 66 | ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ | ||
| 67 | │ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ | ||
| 68 | ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ | ||
| 69 | │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ { │ } │ | │ | ||
| 70 | ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ | ||
| 71 | │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ : │ " │ │ | ||
| 72 | ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┬───┤ | ||
| 73 | │ LShift │ Z │ X │ C │ V │ B │ N │ M │ < │ > │ RSft │ │ ? │ | ||
| 74 | ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬───┼───┼───┤ | ||
| 75 | │ │ │ │ │ │ │ │ │ │ | ||
| 76 | └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ | ||
| 77 | */ | ||
| 78 | /* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 */ | ||
| 79 | [_BASE] = LAYOUT_60_ansi_arrow( | ||
| 80 | KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, | ||
| 81 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, | ||
| 82 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, | ||
| 83 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH), KC_UP, KC_SLSH, | ||
| 84 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN), KC_LEFT, KC_DOWN, KC_RIGHT | ||
| 85 | ), | ||
| 86 | |||
| 87 | /* | ||
| 88 | ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ | ||
| 89 | │ ` │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ Delete│ | ||
| 90 | ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ | ||
| 91 | │Reset│ │ │ │ │ │ │ │Ins│ │PSc│ │Hui│ Mod │ | ||
| 92 | ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ | ||
| 93 | │ │ │ │ │ │ │ │ │ │Tog│ │ │ │ | ||
| 94 | ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┬───┤ | ||
| 95 | │ │ │ │Cal│ │ │ │Mut│VoD│VoU│ │Vai│ │ | ||
| 96 | ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬───┼───┼───┤ | ||
| 97 | │ │ │ │ │ │ │Spd│Vad│Spi│ | ||
| 98 | └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ | ||
| 99 | */ | ||
| 100 | /* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 */ | ||
| 101 | [_FN] = LAYOUT_60_ansi_arrow( | ||
| 102 | KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, | ||
| 103 | RESET, _______, _______, _______, _______, _______, _______, _______, KC_INS, _______, KC_PSCR, _______, RGB_HUI, RGB_MOD, | ||
| 104 | _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, _______, _______, _______, | ||
| 105 | _______, _______, _______, KC_CALC, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, RGB_VAI, _______, | ||
| 106 | _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_VAD, RGB_SPI | ||
| 107 | ), | ||
| 108 | }; | ||
| 109 | |||
| 110 | void keyboard_post_init_user(void) { | ||
| 111 | user_config.raw = eeconfig_read_user(); | ||
| 112 | switch (user_config.rgb_mode) { | ||
| 113 | case RGB_MODE_ALL: | ||
| 114 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
| 115 | rgb_matrix_enable_noeeprom(); | ||
| 116 | break; | ||
| 117 | case RGB_MODE_KEYLIGHT: | ||
| 118 | rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR); | ||
| 119 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 120 | break; | ||
| 121 | case RGB_MODE_UNDERGLOW: | ||
| 122 | rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); | ||
| 123 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 124 | break; | ||
| 125 | case RGB_MODE_NONE: | ||
| 126 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
| 127 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 128 | break; | ||
| 129 | } | ||
| 130 | } | ||
| 131 | |||
| 132 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 133 | switch (keycode) { | ||
| 134 | case RGB_TOG: | ||
| 135 | if (record->event.pressed) { | ||
| 136 | switch (rgb_matrix_get_flags()) { | ||
| 137 | case LED_FLAG_ALL: { | ||
| 138 | rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR); | ||
| 139 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 140 | user_config.rgb_mode = RGB_MODE_KEYLIGHT; | ||
| 141 | } | ||
| 142 | break; | ||
| 143 | case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): { | ||
| 144 | rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); | ||
| 145 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 146 | user_config.rgb_mode = RGB_MODE_UNDERGLOW; | ||
| 147 | } | ||
| 148 | break; | ||
| 149 | case (LED_FLAG_UNDERGLOW): { | ||
| 150 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
| 151 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 152 | user_config.rgb_mode = RGB_MODE_NONE; | ||
| 153 | } | ||
| 154 | break; | ||
| 155 | default: { | ||
| 156 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
| 157 | rgb_matrix_enable_noeeprom(); | ||
| 158 | user_config.rgb_mode = RGB_MODE_ALL; | ||
| 159 | } | ||
| 160 | break; | ||
| 161 | } | ||
| 162 | eeconfig_update_user(user_config.raw); | ||
| 163 | } | ||
| 164 | return false; | ||
| 165 | } | ||
| 166 | |||
| 167 | return true; | ||
| 168 | } | ||
| 169 | |||
| 170 | void rgb_matrix_indicators_user(void) { | ||
| 171 | HSV hsv = rgb_matrix_config.hsv; | ||
| 172 | uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1)); | ||
| 173 | hsv.h = time; | ||
| 174 | RGB rgb = hsv_to_rgb(hsv); | ||
| 175 | |||
| 176 | if ((rgb_matrix_get_flags() & LED_FLAG_KEYLIGHT)) { | ||
| 177 | if (host_keyboard_led_state().caps_lock) { | ||
| 178 | rgb_matrix_set_color(28, rgb.r, rgb.g, rgb.b); | ||
| 179 | } | ||
| 180 | } else { | ||
| 181 | if (host_keyboard_led_state().caps_lock) { | ||
| 182 | rgb_matrix_set_color(28, rgb.r, rgb.g, rgb.b); | ||
| 183 | } else { | ||
| 184 | rgb_matrix_set_color(28, 0, 0, 0); | ||
| 185 | } | ||
| 186 | } | ||
| 187 | } | ||
diff --git a/keyboards/horrortroll/chinese_pcb/m63_rgb/keymaps/default/readme.md b/keyboards/horrortroll/chinese_pcb/m63_rgb/keymaps/default/readme.md new file mode 100644 index 000000000..01ff3523b --- /dev/null +++ b/keyboards/horrortroll/chinese_pcb/m63_rgb/keymaps/default/readme.md | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | # Default Layout | ||
| 2 | |||
| 3 | Keymap is default 63 qwerty, 60% arrow layout | ||
diff --git a/keyboards/horrortroll/chinese_pcb/m63_rgb/keymaps/via/config.h b/keyboards/horrortroll/chinese_pcb/m63_rgb/keymaps/via/config.h new file mode 100644 index 000000000..fe6aa8c1f --- /dev/null +++ b/keyboards/horrortroll/chinese_pcb/m63_rgb/keymaps/via/config.h | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
| 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 | #define DYNAMIC_KEYMAP_LAYER_COUNT 2 | ||
| 20 | |||
| 21 | #ifdef RGB_MATRIX_ENABLE | ||
| 22 | #define VIA_QMK_RGBLIGHT_ENABLE | ||
| 23 | #endif | ||
diff --git a/keyboards/horrortroll/chinese_pcb/m63_rgb/keymaps/via/keymap.c b/keyboards/horrortroll/chinese_pcb/m63_rgb/keymaps/via/keymap.c new file mode 100644 index 000000000..8f421c22f --- /dev/null +++ b/keyboards/horrortroll/chinese_pcb/m63_rgb/keymaps/via/keymap.c | |||
| @@ -0,0 +1,187 @@ | |||
| 1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
| 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 <string.h> | ||
| 18 | #include <math.h> | ||
| 19 | |||
| 20 | #include <lib/lib8tion/lib8tion.h> | ||
| 21 | |||
| 22 | #include QMK_KEYBOARD_H | ||
| 23 | |||
| 24 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
| 25 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
| 26 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 27 | // entirely and just use numbers. | ||
| 28 | |||
| 29 | enum layer_names { | ||
| 30 | _BASE = 0, | ||
| 31 | _FN = 1 | ||
| 32 | }; | ||
| 33 | |||
| 34 | enum user_rgb_mode { | ||
| 35 | RGB_MODE_ALL, | ||
| 36 | RGB_MODE_KEYLIGHT, | ||
| 37 | RGB_MODE_UNDERGLOW, | ||
| 38 | RGB_MODE_NONE, | ||
| 39 | }; | ||
| 40 | |||
| 41 | typedef union { | ||
| 42 | uint32_t raw; | ||
| 43 | struct { | ||
| 44 | uint8_t rgb_mode :8; | ||
| 45 | }; | ||
| 46 | } user_config_t; | ||
| 47 | |||
| 48 | user_config_t user_config; | ||
| 49 | |||
| 50 | // enum layer_keycodes { }; | ||
| 51 | |||
| 52 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 53 | |||
| 54 | /* | ||
| 55 | ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ | ||
| 56 | │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Bakspc│ | ||
| 57 | ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ | ||
| 58 | │ Tab │ q │ w │ e │ r │ t │ y │ u │ i │ o │ p │ [ │ ] │ \ │ | ||
| 59 | ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ | ||
| 60 | │ Caps │ a │ s │ d │ f │ g │ h │ j │ k │ l │ ; │ ' │ Enter │ | ||
| 61 | ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┬───┤ | ||
| 62 | │ LShift │ z │ x │ c │ v │ b │ n │ m │ , │ . │ RSft │ ↑ │ / │ | ||
| 63 | ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬───┼───┼───┤ | ||
| 64 | │LCrl│GUI │LAlt│ Space │RAt│Fn │ ← │ ↓ │ → │ | ||
| 65 | └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ | ||
| 66 | ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ | ||
| 67 | │ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ | ||
| 68 | ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ | ||
| 69 | │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ { │ } │ | │ | ||
| 70 | ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ | ||
| 71 | │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ : │ " │ │ | ||
| 72 | ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┬───┤ | ||
| 73 | │ LShift │ Z │ X │ C │ V │ B │ N │ M │ < │ > │ RSft │ │ ? │ | ||
| 74 | ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬───┼───┼───┤ | ||
| 75 | │ │ │ │ │ │ │ │ │ │ | ||
| 76 | └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ | ||
| 77 | */ | ||
| 78 | /* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 */ | ||
| 79 | [_BASE] = LAYOUT_60_ansi_arrow( | ||
| 80 | KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, | ||
| 81 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, | ||
| 82 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, | ||
| 83 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH), KC_UP, KC_SLSH, | ||
| 84 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN), KC_LEFT, KC_DOWN, KC_RIGHT | ||
| 85 | ), | ||
| 86 | |||
| 87 | /* | ||
| 88 | ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ | ||
| 89 | │ ` │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ Delete│ | ||
| 90 | ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ | ||
| 91 | │Reset│ │ │ │ │ │ │ │Ins│ │PSc│ │Hui│ Mod │ | ||
| 92 | ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ | ||
| 93 | │ │ │ │ │ │ │ │ │ │Tog│ │ │ │ | ||
| 94 | ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┬───┤ | ||
| 95 | │ │ │ │Cal│ │ │ │Mut│VoD│VoU│ │Vai│ │ | ||
| 96 | ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬───┼───┼───┤ | ||
| 97 | │ │ │ │ │ │ │Spd│Vad│Spi│ | ||
| 98 | └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ | ||
| 99 | */ | ||
| 100 | /* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 */ | ||
| 101 | [_FN] = LAYOUT_60_ansi_arrow( | ||
| 102 | KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, | ||
| 103 | RESET, _______, _______, _______, _______, _______, _______, _______, KC_INS, _______, KC_PSCR, _______, RGB_HUI, RGB_MOD, | ||
| 104 | _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, _______, _______, _______, | ||
| 105 | _______, _______, _______, KC_CALC, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, RGB_VAI, _______, | ||
| 106 | _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_VAD, RGB_SPI | ||
| 107 | ), | ||
| 108 | }; | ||
| 109 | |||
| 110 | void keyboard_post_init_user(void) { | ||
| 111 | user_config.raw = eeconfig_read_user(); | ||
| 112 | switch (user_config.rgb_mode) { | ||
| 113 | case RGB_MODE_ALL: | ||
| 114 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
| 115 | rgb_matrix_enable_noeeprom(); | ||
| 116 | break; | ||
| 117 | case RGB_MODE_KEYLIGHT: | ||
| 118 | rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR); | ||
| 119 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 120 | break; | ||
| 121 | case RGB_MODE_UNDERGLOW: | ||
| 122 | rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); | ||
| 123 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 124 | break; | ||
| 125 | case RGB_MODE_NONE: | ||
| 126 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
| 127 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 128 | break; | ||
| 129 | } | ||
| 130 | } | ||
| 131 | |||
| 132 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 133 | switch (keycode) { | ||
| 134 | case RGB_TOG: | ||
| 135 | if (record->event.pressed) { | ||
| 136 | switch (rgb_matrix_get_flags()) { | ||
| 137 | case LED_FLAG_ALL: { | ||
| 138 | rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR); | ||
| 139 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 140 | user_config.rgb_mode = RGB_MODE_KEYLIGHT; | ||
| 141 | } | ||
| 142 | break; | ||
| 143 | case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): { | ||
| 144 | rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); | ||
| 145 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 146 | user_config.rgb_mode = RGB_MODE_UNDERGLOW; | ||
| 147 | } | ||
| 148 | break; | ||
| 149 | case (LED_FLAG_UNDERGLOW): { | ||
| 150 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
| 151 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 152 | user_config.rgb_mode = RGB_MODE_NONE; | ||
| 153 | } | ||
| 154 | break; | ||
| 155 | default: { | ||
| 156 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
| 157 | rgb_matrix_enable_noeeprom(); | ||
| 158 | user_config.rgb_mode = RGB_MODE_ALL; | ||
| 159 | } | ||
| 160 | break; | ||
| 161 | } | ||
| 162 | eeconfig_update_user(user_config.raw); | ||
| 163 | } | ||
| 164 | return false; | ||
| 165 | } | ||
| 166 | |||
| 167 | return true; | ||
| 168 | } | ||
| 169 | |||
| 170 | void rgb_matrix_indicators_user(void) { | ||
| 171 | HSV hsv = rgb_matrix_config.hsv; | ||
| 172 | uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1)); | ||
| 173 | hsv.h = time; | ||
| 174 | RGB rgb = hsv_to_rgb(hsv); | ||
| 175 | |||
| 176 | if ((rgb_matrix_get_flags() & LED_FLAG_KEYLIGHT)) { | ||
| 177 | if (host_keyboard_led_state().caps_lock) { | ||
| 178 | rgb_matrix_set_color(28, rgb.r, rgb.g, rgb.b); | ||
| 179 | } | ||
| 180 | } else { | ||
| 181 | if (host_keyboard_led_state().caps_lock) { | ||
| 182 | rgb_matrix_set_color(28, rgb.r, rgb.g, rgb.b); | ||
| 183 | } else { | ||
| 184 | rgb_matrix_set_color(28, 0, 0, 0); | ||
| 185 | } | ||
| 186 | } | ||
| 187 | } | ||
diff --git a/keyboards/horrortroll/chinese_pcb/m63_rgb/keymaps/via/readme.md b/keyboards/horrortroll/chinese_pcb/m63_rgb/keymaps/via/readme.md new file mode 100644 index 000000000..c60a18804 --- /dev/null +++ b/keyboards/horrortroll/chinese_pcb/m63_rgb/keymaps/via/readme.md | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | # Default Layout with VIA | ||
| 2 | |||
| 3 | Keymap is default 63 qwerty, 60% arrow layout | ||
diff --git a/keyboards/horrortroll/chinese_pcb/m63_rgb/keymaps/via/rules.mk b/keyboards/horrortroll/chinese_pcb/m63_rgb/keymaps/via/rules.mk new file mode 100644 index 000000000..1e5b99807 --- /dev/null +++ b/keyboards/horrortroll/chinese_pcb/m63_rgb/keymaps/via/rules.mk | |||
| @@ -0,0 +1 @@ | |||
| VIA_ENABLE = yes | |||
diff --git a/keyboards/horrortroll/chinese_pcb/m63_rgb/m63_rgb.c b/keyboards/horrortroll/chinese_pcb/m63_rgb/m63_rgb.c new file mode 100644 index 000000000..ef1eabddf --- /dev/null +++ b/keyboards/horrortroll/chinese_pcb/m63_rgb/m63_rgb.c | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
| 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 "m63_rgb.h" | ||
| 18 | |||
| 19 | #ifdef RGB_MATRIX_ENABLE | ||
| 20 | led_config_t g_led_config = { { | ||
| 21 | { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 }, | ||
| 22 | { 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 }, | ||
| 23 | { 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, NO_LED, 40 }, | ||
| 24 | { 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, NO_LED, 52, 53 }, | ||
| 25 | { 54, 55, 56, NO_LED, NO_LED, 57, NO_LED, NO_LED, NO_LED, 58, 59, 60, 61, 62 } | ||
| 26 | }, { | ||
| 27 | // Key matrix (0 -> 62) | ||
| 28 | {0 , 0}, {16 , 0}, {33 , 0}, {49 , 0}, {66 , 0}, {82 , 0}, {99 , 0}, {115, 0}, {132, 0}, {148, 0}, {165, 0}, {181, 0}, {198, 0}, {214, 0}, | ||
| 29 | {3 , 16}, {23 , 16}, {39 , 16}, {56 , 16}, {72 , 16}, {88 , 16}, {105, 16}, {121, 16}, {138, 16}, {154, 16}, {171, 16}, {187, 16}, {204, 16}, {220, 16}, | ||
| 30 | {5 , 32}, {26 , 32}, {42 , 32}, {59 , 32}, {75 , 32}, {92 , 32}, {108, 32}, {124, 32}, {141, 32}, {157, 32}, {174, 32}, {190, 32}, {214, 32}, | ||
| 31 | {8 , 48}, {28 , 48}, {48 , 48}, {65 , 48}, {81 , 48}, {98 , 48}, {114, 48}, {131, 48}, {147, 48}, {164, 48}, {186, 48}, {208, 48}, {224, 48}, | ||
| 32 | {2 , 64}, {20 , 64}, {38 , 64}, {100, 64}, {160, 64}, {176, 64}, {192, 64}, {208, 64}, {224, 64}, | ||
| 33 | |||
| 34 | // Underglow (63 -> 74) | ||
| 35 | {216, 56}, {181, 57}, {138, 59}, {105, 58}, {52 , 60}, {10 , 60}, | ||
| 36 | {20 , 12}, {54 , 12}, {102, 10}, {145, 13}, {182, 9}, {211, 10}, | ||
| 37 | }, { | ||
| 38 | // Key matrix (0 -> 62) | ||
| 39 | 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, | ||
| 40 | 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, | ||
| 41 | 8, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, | ||
| 42 | 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 4, 4, | ||
| 43 | 1, 1, 1, 4, 1, 1, 4, 4, 4, | ||
| 44 | |||
| 45 | // Underglow (63 -> 74) | ||
| 46 | 2, 2, 2, 2, 2, 2, | ||
| 47 | 2, 2, 2, 2, 2, 2 | ||
| 48 | } }; | ||
| 49 | #endif | ||
diff --git a/keyboards/horrortroll/chinese_pcb/m63_rgb/m63_rgb.h b/keyboards/horrortroll/chinese_pcb/m63_rgb/m63_rgb.h new file mode 100644 index 000000000..b2461758e --- /dev/null +++ b/keyboards/horrortroll/chinese_pcb/m63_rgb/m63_rgb.h | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
| 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 XXX KC_NO | ||
| 22 | |||
| 23 | /* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ | ||
| 24 | * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0A │0B │0C │0D │ | ||
| 25 | * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ | ||
| 26 | * │10 │11 │12 │13 │14 │15 │16 │17 │18 │19 │1A │1B │1C │1D │ | ||
| 27 | * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ | ||
| 28 | * │20 │21 │22 │23 │24 │25 │26 │27 │28 │29 │2A │2B │2D │ | ||
| 29 | * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┬───┤ | ||
| 30 | * │30 │31 │32 │33 │34 │35 │36 │37 │38 │39 │3A │3C │3D │ | ||
| 31 | * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬───┼───┼───┤ | ||
| 32 | * │40 │41 │42 │45 │49 │4A │4B │4C │4D │ | ||
| 33 | * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ | ||
| 34 | */ | ||
| 35 | |||
| 36 | #define LAYOUT_60_ansi_arrow( \ | ||
| 37 | K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ | ||
| 38 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ | ||
| 39 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ | ||
| 40 | K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3C, K3D, \ | ||
| 41 | K40, K41, K42, K45, K49, K4A, K4B, K4C, K4D \ | ||
| 42 | ) { \ | ||
| 43 | { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ | ||
| 44 | { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ | ||
| 45 | { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D }, \ | ||
| 46 | { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, XXX, K3C, K3D }, \ | ||
| 47 | { K40, K41, K42, XXX, XXX, K45, XXX, XXX, XXX, K49, K4A, K4B, K4C, K4D } \ | ||
| 48 | } | ||
diff --git a/keyboards/horrortroll/chinese_pcb/m63_rgb/readme.md b/keyboards/horrortroll/chinese_pcb/m63_rgb/readme.md new file mode 100644 index 000000000..7ec01047b --- /dev/null +++ b/keyboards/horrortroll/chinese_pcb/m63_rgb/readme.md | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | # M63 RGB | ||
| 2 | |||
| 3 | Support STM32F072CBU6 keyboard. | ||
| 4 | |||
| 5 | * Keyboard Maintainer: [HorrorTroll](https://github.com/HorrorTroll) | ||
| 6 | * Hardware Supported: STM32F072CBU6 | ||
| 7 | |||
| 8 | Make example for this keyboard (after setting up your build environment): | ||
| 9 | |||
| 10 | make horrortroll/chinese_pcb/m63_rgb:default | ||
| 11 | |||
| 12 | Flashing example for this keyboard: | ||
| 13 | |||
| 14 | make horrortroll/chinese_pcb/m63_rgb:default:flash | ||
| 15 | |||
| 16 | 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). | ||
| 17 | |||
| 18 | ## Bootloader | ||
| 19 | |||
| 20 | Enter the bootloader in 3 ways: | ||
| 21 | |||
| 22 | * **Bootmagic reset**: Hold down the key at (3,5) in the matrix (B key) and plug in the keyboard | ||
| 23 | * **Physical reset button**: Press and hold the button on the back of the PCB, then plug in the keyboard | ||
| 24 | * **Keycode in layout**: Press the key mapped to `RESET` if it is available | ||
diff --git a/keyboards/horrortroll/chinese_pcb/m63_rgb/rules.mk b/keyboards/horrortroll/chinese_pcb/m63_rgb/rules.mk new file mode 100644 index 000000000..9291499b7 --- /dev/null +++ b/keyboards/horrortroll/chinese_pcb/m63_rgb/rules.mk | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | # MCU name | ||
| 2 | MCU = STM32F072 | ||
| 3 | |||
| 4 | # Bootloader selection | ||
| 5 | BOOTLOADER = stm32-dfu | ||
| 6 | |||
| 7 | # Build Options | ||
| 8 | # change yes to no to disable | ||
| 9 | # | ||
| 10 | BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite | ||
| 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 | NKRO_ENABLE = yes # Enable N-Key Rollover | ||
| 16 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
| 17 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow | ||
| 18 | AUDIO_ENABLE = no # Audio output | ||
| 19 | |||
| 20 | # RGB Matrix enabled | ||
| 21 | RGB_MATRIX_ENABLE = yes | ||
| 22 | RGB_MATRIX_DRIVER = WS2812 | ||
diff --git a/keyboards/horrortroll/chinese_pcb/readme.md b/keyboards/horrortroll/chinese_pcb/readme.md index 466767875..3aa0ce619 100644 --- a/keyboards/horrortroll/chinese_pcb/readme.md +++ b/keyboards/horrortroll/chinese_pcb/readme.md | |||
| @@ -2,12 +2,13 @@ | |||
| 2 | 2 | ||
| 3 | This is a folder for collection code of Chinese PCB, where they only sold one-time limited on Taobao and no source code or contact info of Maker. Everything was re-write by using multimeter and sometimes with ISP/ICP flashing! | 3 | This is a folder for collection code of Chinese PCB, where they only sold one-time limited on Taobao and no source code or contact info of Maker. Everything was re-write by using multimeter and sometimes with ISP/ICP flashing! |
| 4 | 4 | ||
| 5 | ## List for the reason why these keyboard in here: | 5 | ## List for those keyboard in here: |
| 6 | <details> | 6 | <details> |
| 7 | <summary>Click to expand!</summary> | 7 | <summary>Click to expand!</summary> |
| 8 | 8 | ||
| 9 | | Keyboard name | MCU | Layout | LED | OLED | Other | Reason | | 9 | | Keyboard name | MCU | Layout | Hotswap | LED | OLED | Other | |
| 10 | | ------------- | ----------- | ------------- | ---- | ---- | ----- | ---------------------------------------------------- | | 10 | | ------------- | ------------- | ------------- | ------- | ---- | ---- | ----- | |
| 11 | | Devil68 Pro | Atmega32U4 | 68 Keys (65%) | RGB | No | No | Lost contact info of Maker on Taobao, no source code | | 11 | | Devil68 Pro | Atmega32U4 | 68 Keys (65%) | Yes | RGB | No | No | |
| 12 | | | | | | | | | | 12 | | M63 RGB | STM32F072CBU6 | 63 Keys (60%) | Yes | RGB | No | No | |
| 13 | | | | | | | | | | ||
| 13 | </details> | 14 | </details> |
