diff options
| author | QMK Bot <hello@qmk.fm> | 2022-12-12 20:11:20 +0000 |
|---|---|---|
| committer | QMK Bot <hello@qmk.fm> | 2022-12-12 20:11:20 +0000 |
| commit | 2d19e59d784582cd2e3768ff4e7f7e0c4618eb2f (patch) | |
| tree | 943e960e1fa56efd06e4b192f2243cf8003e88c1 | |
| parent | 598735a2b8a7c69e3c3d9c05e856736d506a2ade (diff) | |
| parent | 1431f314a446685089c390d01d19c73fd7ff5cee (diff) | |
Merge remote-tracking branch 'origin/master' into develop
31 files changed, 1683 insertions, 0 deletions
diff --git a/keyboards/keychron/q10/ansi_encoder/ansi_encoder.c b/keyboards/keychron/q10/ansi_encoder/ansi_encoder.c new file mode 100644 index 0000000000..c5abcb4f6e --- /dev/null +++ b/keyboards/keychron/q10/ansi_encoder/ansi_encoder.c | |||
| @@ -0,0 +1,157 @@ | |||
| 1 | /* Copyright 2022 @ Keychron (https://www.keychron.com) | ||
| 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 "quantum.h" | ||
| 18 | |||
| 19 | #ifdef RGB_MATRIX_ENABLE | ||
| 20 | |||
| 21 | // clang-format off | ||
| 22 | |||
| 23 | const ckled2001_led PROGMEM g_ckled2001_leds[RGB_MATRIX_LED_COUNT] = { | ||
| 24 | /* Refer to IS31 manual for these locations | ||
| 25 | * driver | ||
| 26 | * | R location | ||
| 27 | * | | G location | ||
| 28 | * | | | B location | ||
| 29 | * | | | | */ | ||
| 30 | {0, C_2, A_2, B_2}, // ESC | ||
| 31 | {0, C_3, A_3, B_3}, // F1 | ||
| 32 | {0, C_4, A_4, B_4}, // F2 | ||
| 33 | {0, C_5, A_5, B_5}, // F3 | ||
| 34 | {0, C_6, A_6, B_6}, // F4 | ||
| 35 | {0, C_7, A_7, B_7}, // F5 | ||
| 36 | {0, C_8, A_8, B_8}, // F6 | ||
| 37 | {0, C_9, A_9, B_9}, // F7 | ||
| 38 | {0, C_10, A_10, B_10}, // F8 | ||
| 39 | {0, C_11, A_11, B_11}, // F9 | ||
| 40 | {0, C_12, A_12, B_12}, // F10 | ||
| 41 | {0, C_13, A_13, B_13}, // F11 | ||
| 42 | {0, C_14, A_14, B_14}, // F12 | ||
| 43 | {0, C_15, A_15, B_15}, // INS | ||
| 44 | {0, C_16, A_16, B_16}, // DEL | ||
| 45 | |||
| 46 | {0, I_1, G_1, H_1}, // M1 | ||
| 47 | {0, I_2, G_2, H_2}, // `~ | ||
| 48 | {0, I_3, G_3, H_3}, // 1! | ||
| 49 | {0, I_4, G_4, H_4}, // 2@ | ||
| 50 | {0, I_5, G_5, H_5}, // 3# | ||
| 51 | {0, I_6, G_6, H_6}, // 4$ | ||
| 52 | {0, I_7, G_7, H_7}, // 5% | ||
| 53 | {0, I_8, G_8, H_8}, // 6^ | ||
| 54 | {0, I_9, G_9, H_9}, // 7& | ||
| 55 | {0, I_10, G_10, H_10}, // 8* | ||
| 56 | {0, I_11, G_11, H_11}, // 9( | ||
| 57 | {0, I_12, G_12, H_12}, // 0) | ||
| 58 | {0, I_13, G_13, H_13}, // -_ | ||
| 59 | {0, I_14, G_14, H_14}, // =+ | ||
| 60 | {0, I_15, G_15, H_15}, // BackSpace | ||
| 61 | {0, I_16, G_16, H_16}, // PgUp | ||
| 62 | |||
| 63 | {0, F_1, D_1, E_1}, // M2 | ||
| 64 | {0, F_2, D_2, E_2}, // TAB | ||
| 65 | {0, F_3, D_3, E_3}, // Q | ||
| 66 | {0, F_4, D_4, E_4}, // W | ||
| 67 | {0, F_5, D_5, E_5}, // E | ||
| 68 | {0, F_6, D_6, E_6}, // R | ||
| 69 | {0, F_7, D_7, E_7}, // T | ||
| 70 | {0, F_8, D_8, E_8}, // Y | ||
| 71 | {0, F_9, D_9, E_9}, // U | ||
| 72 | {0, F_10, D_10, E_10}, // I | ||
| 73 | {0, F_11, D_11, E_11}, // O | ||
| 74 | {0, F_12, D_12, E_12}, // P | ||
| 75 | {0, F_13, D_13, E_13}, // [ | ||
| 76 | {0, F_14, D_14, E_14}, // ] | ||
| 77 | {0, F_15, D_15, E_15}, // | | ||
| 78 | {0, F_16, D_16, E_16}, // PgDn | ||
| 79 | |||
| 80 | {1, C_16, A_16, B_16}, // M3 | ||
| 81 | {1, C_15, A_15, B_15}, // CapsLock | ||
| 82 | {1, C_14, A_14, B_14}, // A | ||
| 83 | {1, C_13, A_13, B_13}, // S | ||
| 84 | {1, C_12, A_12, B_12}, // D | ||
| 85 | {1, C_11, A_11, B_11}, // F | ||
| 86 | {1, C_10, A_10, B_10}, // G | ||
| 87 | {1, C_8, A_8, B_8}, // H | ||
| 88 | {1, C_7, A_7, B_7}, // J | ||
| 89 | {1, C_6, A_6, B_6}, // K | ||
| 90 | {1, C_5, A_5, B_5}, // L | ||
| 91 | {1, C_4, A_4, B_4}, // ; | ||
| 92 | {1, C_3, A_3, B_3}, // ' | ||
| 93 | {1, C_2, A_2, B_2}, // Enter | ||
| 94 | {1, C_1, A_1, B_1}, // Home | ||
| 95 | |||
| 96 | {1, I_16, G_16, H_16}, // M4 | ||
| 97 | {1, I_15, G_15, H_15}, // Shift_L | ||
| 98 | {1, I_13, G_13, H_13}, // Z | ||
| 99 | {1, I_12, G_12, H_12}, // X | ||
| 100 | {1, I_11, G_11, H_11}, // C | ||
| 101 | {1, I_10, G_10, H_10}, // V | ||
| 102 | {1, I_9, G_9, H_9}, // B | ||
| 103 | {1, I_8, G_8, H_8}, // B | ||
| 104 | {1, I_7, G_7, H_7}, // N | ||
| 105 | {1, I_6, G_6, H_6}, // M | ||
| 106 | {1, I_5, G_5, H_5}, // , | ||
| 107 | {1, I_4, G_4, H_4}, // . | ||
| 108 | {1, I_3, G_3, H_3}, // ? | ||
| 109 | {1, I_2, G_2, H_2}, // Shift_R | ||
| 110 | {1, I_1, G_1, H_1}, // Up | ||
| 111 | |||
| 112 | {1, F_16, D_16, E_16}, // M5 | ||
| 113 | {1, F_15, D_15, E_15}, // Ctrl_L | ||
| 114 | {1, F_14, D_14, E_14}, // Win_L | ||
| 115 | {1, F_13, D_13, E_13}, // Alt_L | ||
| 116 | {1, F_12, D_12, E_12}, // Space | ||
| 117 | {1, F_9, D_9, E_9}, // Fn | ||
| 118 | {1, F_8, D_8, E_8}, // Space | ||
| 119 | {1, F_7, D_7, E_7}, // Alt_R | ||
| 120 | {1, F_3, D_3, E_3}, // Left | ||
| 121 | {1, F_2, D_2, E_2}, // Down | ||
| 122 | {1, F_1, D_1, E_1}, // Right | ||
| 123 | }; | ||
| 124 | |||
| 125 | #define __ NO_LED | ||
| 126 | |||
| 127 | led_config_t g_led_config = { | ||
| 128 | { | ||
| 129 | // Key Matrix to LED Index | ||
| 130 | { __, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, | ||
| 131 | { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 }, | ||
| 132 | { 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46 }, | ||
| 133 | { 47, 48, 49, 50, 51, 52, 53, __, 54, 55, 56, 57, 58, 59, 60, 61 }, | ||
| 134 | { 62, 63, __, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76 }, | ||
| 135 | { 77, 78, 79, 80, 81, __, __, 82, 83, 84, __, __, __, 85, 86, 87 }, | ||
| 136 | }, | ||
| 137 | { | ||
| 138 | // LED Index to Physical Position | ||
| 139 | {19,0}, {34,0}, {46,0}, {60,1}, {72,3}, {87,6}, {99,8}, {120,8}, {132,6}, {147,3}, {159,1}, {173,0}, {185,0}, {201,1}, {219,1}, | ||
| 140 | {5,14}, {24,14}, {36,14}, {48,13}, {62,15}, {74,17}, {86,20}, {98,22}, {115,22}, {127,20}, {139,17}, {151,15}, {165,13}, {177,14}, {195,14}, {220,13}, | ||
| 141 | {4,24}, {24,24}, {40,24}, {53,24}, {65,27}, {77,29}, {89,31}, {112,33}, {124,31}, {136,29}, {148,27}, {160,24}, {174,24}, {186,24}, {201,24}, {222,25}, | ||
| 142 | {2,34}, {23,34}, {40,34}, {54,35}, {66,37}, {78,39}, {90,42}, {118,43}, {130,40}, {142,38}, {154,36}, {167,35}, {179,35}, {199,35}, {224,36}, | ||
| 143 | {0,45}, {24,45}, {44,45}, {57,46}, {69,48}, {81,51}, {93,53}, {111,54}, {123,52}, {135,50}, {147,48}, {159,46}, {173,45}, {190,45}, {210,47}, | ||
| 144 | {0,55}, {18,55}, {33,55}, {56,57}, {77,61}, {97,64}, {124,63}, {147,59}, {198,58}, {210,58}, {222,58}, | ||
| 145 | }, | ||
| 146 | { | ||
| 147 | // RGB LED Index to Flag | ||
| 148 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
| 149 | 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, | ||
| 150 | 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, | ||
| 151 | 1, 8, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, | ||
| 152 | 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, | ||
| 153 | 1, 1, 1, 1, 4, 1, 4, 1, 1, 1, 1, | ||
| 154 | } | ||
| 155 | }; | ||
| 156 | |||
| 157 | #endif // RGB_MATRIX_ENABLE | ||
diff --git a/keyboards/keychron/q10/ansi_encoder/ansi_encoder.h b/keyboards/keychron/q10/ansi_encoder/ansi_encoder.h new file mode 100644 index 0000000000..db52563dc4 --- /dev/null +++ b/keyboards/keychron/q10/ansi_encoder/ansi_encoder.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* Copyright 2021 @ Keychron (https://www.keychron.com) | ||
| 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" | ||
diff --git a/keyboards/keychron/q10/ansi_encoder/config.h b/keyboards/keychron/q10/ansi_encoder/config.h new file mode 100644 index 0000000000..d02436c01d --- /dev/null +++ b/keyboards/keychron/q10/ansi_encoder/config.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | /* Copyright 2022 @ Keychron (https://www.keychron.com) | ||
| 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 Matrix Configuration */ | ||
| 20 | #define DRIVER_1_LED_TOTAL 47 | ||
| 21 | #define DRIVER_2_LED_TOTAL 41 | ||
| 22 | #define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) | ||
| 23 | |||
| 24 | /* Encoder Configuration */ | ||
| 25 | #define ENCODERS_PAD_A { A10 } | ||
| 26 | #define ENCODERS_PAD_B { A8 } | ||
| 27 | #define ENCODER_RESOLUTION 4 | ||
| 28 | #define ENCODER_DEFAULT_POS 0x3 | ||
| 29 | |||
| 30 | /* Enable caps-lock LED */ | ||
| 31 | #define CAPS_LOCK_LED_INDEX 48 | ||
diff --git a/keyboards/keychron/q10/ansi_encoder/info.json b/keyboards/keychron/q10/ansi_encoder/info.json new file mode 100644 index 0000000000..caf0d8d6bf --- /dev/null +++ b/keyboards/keychron/q10/ansi_encoder/info.json | |||
| @@ -0,0 +1,111 @@ | |||
| 1 | { | ||
| 2 | "keyboard_name": "Keychron Q10", | ||
| 3 | "manufacturer": "Keychron", | ||
| 4 | "url": "https://github.com/Keychron", | ||
| 5 | "maintainer": "lalalademaxiya1", | ||
| 6 | "usb": { | ||
| 7 | "vid": "0x3434", | ||
| 8 | "pid": "0x01A1", | ||
| 9 | "device_version": "1.0.0" | ||
| 10 | }, | ||
| 11 | "layouts": { | ||
| 12 | "LAYOUT_ansi_89": { | ||
| 13 | "layout": [ | ||
| 14 | {"matrix":[0, 0], "x":0.25, "y":0}, | ||
| 15 | {"matrix":[0, 1], "x":1.75, "y":0}, | ||
| 16 | {"matrix":[0, 2], "x":3, "y":0}, | ||
| 17 | {"matrix":[0, 3], "x":4, "y":0}, | ||
| 18 | {"matrix":[0, 4], "x":5, "y":0}, | ||
| 19 | {"matrix":[0, 5], "x":6, "y":0}, | ||
| 20 | {"matrix":[0, 6], "x":7.25, "y":0}, | ||
| 21 | {"matrix":[0, 7], "x":8.25, "y":0}, | ||
| 22 | {"matrix":[0, 8], "x":11, "y":0}, | ||
| 23 | {"matrix":[0, 9], "x":12, "y":0}, | ||
| 24 | {"matrix":[0,10], "x":13.25, "y":0}, | ||
| 25 | {"matrix":[0,11], "x":14.25, "y":0}, | ||
| 26 | {"matrix":[0,12], "x":15.25, "y":0}, | ||
| 27 | {"matrix":[0,13], "x":16.25, "y":0}, | ||
| 28 | {"matrix":[0,14], "x":17.5, "y":0}, | ||
| 29 | {"matrix":[0,15], "x":18.75, "y":0}, | ||
| 30 | |||
| 31 | {"matrix":[1, 0], "x":0.75, "y":1.25}, | ||
| 32 | {"matrix":[1, 1], "x":2.25, "y":1.25}, | ||
| 33 | {"matrix":[1, 2], "x":3.25, "y":1.25}, | ||
| 34 | {"matrix":[1, 3], "x":4.25, "y":1.25}, | ||
| 35 | {"matrix":[1, 4], "x":5.25, "y":1.25}, | ||
| 36 | {"matrix":[1, 5], "x":6.25, "y":1.25}, | ||
| 37 | {"matrix":[1, 6], "x":7.25, "y":1.25}, | ||
| 38 | {"matrix":[1, 7], "x":8.25, "y":1.25}, | ||
| 39 | {"matrix":[1, 8], "x":10.5, "y":1.25}, | ||
| 40 | {"matrix":[1, 9], "x":11.5, "y":1.25}, | ||
| 41 | {"matrix":[1,10], "x":12.5, "y":1.25}, | ||
| 42 | {"matrix":[1,11], "x":13.5, "y":1.25}, | ||
| 43 | {"matrix":[1,12], "x":14.5, "y":1.25}, | ||
| 44 | {"matrix":[1,13], "x":15.5, "y":1.25}, | ||
| 45 | {"matrix":[1,14], "x":16.5, "y":1.25, "w":2}, | ||
| 46 | {"matrix":[1,15], "x":19, "y":1.25}, | ||
| 47 | |||
| 48 | {"matrix":[2, 0], "x":0.5, "y":2.25}, | ||
| 49 | {"matrix":[2, 1], "x":1.75, "y":2.25, "w":1.5}, | ||
| 50 | {"matrix":[2, 2], "x":3.25, "y":2.25}, | ||
| 51 | {"matrix":[2, 3], "x":4.5, "y":2.25}, | ||
| 52 | {"matrix":[2, 4], "x":5.5, "y":2.25}, | ||
| 53 | {"matrix":[2, 5], "x":6.5, "y":2.25}, | ||
| 54 | {"matrix":[2, 6], "x":7.5, "y":2.25}, | ||
| 55 | {"matrix":[2, 7], "x":10, "y":2.25}, | ||
| 56 | {"matrix":[2, 8], "x":11, "y":2.25}, | ||
| 57 | {"matrix":[2, 9], "x":12, "y":2.25}, | ||
| 58 | {"matrix":[2,10], "x":13, "y":2.25}, | ||
| 59 | {"matrix":[2,11], "x":14, "y":2.25}, | ||
| 60 | {"matrix":[2,12], "x":15.25, "y":2.25}, | ||
| 61 | {"matrix":[2,13], "x":16.25, "y":2.25}, | ||
| 62 | {"matrix":[2,14], "x":17.25, "y":2.25, "w":1.5}, | ||
| 63 | {"matrix":[2,15], "x":19.25, "y":2.25}, | ||
| 64 | |||
| 65 | {"matrix":[3, 0], "x":0.25, "y":3.25}, | ||
| 66 | {"matrix":[3, 1], "x":1.5, "y":3.25, "w":1.75}, | ||
| 67 | {"matrix":[3, 2], "x":3.25, "y":3.25}, | ||
| 68 | {"matrix":[3, 3], "x":4.5, "y":3.25}, | ||
| 69 | {"matrix":[3, 4], "x":5.5, "y":3.25}, | ||
| 70 | {"matrix":[3, 5], "x":6.5, "y":3.25}, | ||
| 71 | {"matrix":[3, 6], "x":7.5, "y":3.25}, | ||
| 72 | {"matrix":[3, 8], "x":10.25, "y":3.25}, | ||
| 73 | {"matrix":[3, 9], "x":11.25, "y":3.25}, | ||
| 74 | {"matrix":[3,10], "x":12.25, "y":3.25}, | ||
| 75 | {"matrix":[3,11], "x":13.25, "y":3.25}, | ||
| 76 | {"matrix":[3,12], "x":14.75, "y":3.25}, | ||
| 77 | {"matrix":[3,13], "x":15.75, "y":3.25}, | ||
| 78 | {"matrix":[3,14], "x":16.75, "y":3.25, "w":2.25}, | ||
| 79 | {"matrix":[3,15], "x":19.5, "y":3.25}, | ||
| 80 | |||
| 81 | {"matrix":[4, 0], "x":0, "y":4.25}, | ||
| 82 | {"matrix":[4, 1], "x":1.5, "y":4.25, "w":2.25}, | ||
| 83 | {"matrix":[4, 3], "x":3.5, "y":4.25}, | ||
| 84 | {"matrix":[4, 4], "x":4.75, "y":4.25}, | ||
| 85 | {"matrix":[4, 5], "x":5.75, "y":4.25}, | ||
| 86 | {"matrix":[4, 6], "x":6.75, "y":4.25}, | ||
| 87 | {"matrix":[4, 7], "x":7.75, "y":4.25}, | ||
| 88 | {"matrix":[4, 8], "x":9.5, "y":4.25}, | ||
| 89 | {"matrix":[4, 9], "x":10.5, "y":4.25}, | ||
| 90 | {"matrix":[4,10], "x":11.5, "y":4.25}, | ||
| 91 | {"matrix":[4,11], "x":12.5, "y":4.25}, | ||
| 92 | {"matrix":[4,12], "x":13.5, "y":4.25}, | ||
| 93 | {"matrix":[4,13], "x":15.25, "y":4.25}, | ||
| 94 | {"matrix":[4,14], "x":16.25, "y":4.25, "w":1.75}, | ||
| 95 | {"matrix":[4,15], "x":18.25, "y":4.5}, | ||
| 96 | |||
| 97 | {"matrix":[5, 0], "x":0, "y":5.25}, | ||
| 98 | {"matrix":[5, 1], "x":1.25, "y":5.25, "w":1.25}, | ||
| 99 | {"matrix":[5, 2], "x":2.5, "y":5.25, "w":1.25}, | ||
| 100 | {"matrix":[5, 3], "x":4.75, "y":5.25, "w":1.25}, | ||
| 101 | {"matrix":[5, 4], "x":6, "y":5.25, "w":2.25}, | ||
| 102 | {"matrix":[5, 7], "x":8.25, "y":5.25}, | ||
| 103 | {"matrix":[5, 8], "x":9.5, "y":5.25, "w":2.75}, | ||
| 104 | {"matrix":[5, 9], "x":12.25, "y":5.25}, | ||
| 105 | {"matrix":[5,13], "x":17.25, "y":5.5}, | ||
| 106 | {"matrix":[5,14], "x":18.25, "y":5.5}, | ||
| 107 | {"matrix":[5,15], "x":19.25, "y":5.5} | ||
| 108 | ] | ||
| 109 | } | ||
| 110 | } | ||
| 111 | } | ||
diff --git a/keyboards/keychron/q10/ansi_encoder/keymaps/default/keymap.c b/keyboards/keychron/q10/ansi_encoder/keymaps/default/keymap.c new file mode 100644 index 0000000000..59a4773771 --- /dev/null +++ b/keyboards/keychron/q10/ansi_encoder/keymaps/default/keymap.c | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | /* Copyright 2022 @ Keychron (https://www.keychron.com) | ||
| 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 | // clang-format off | ||
| 20 | |||
| 21 | enum layers{ | ||
| 22 | MAC_BASE, | ||
| 23 | MAC_FN, | ||
| 24 | WIN_BASE, | ||
| 25 | WIN_FN | ||
| 26 | }; | ||
| 27 | |||
| 28 | #define KC_TASK LGUI(KC_TAB) | ||
| 29 | #define KC_FLXP LGUI(KC_E) | ||
| 30 | |||
| 31 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 32 | [MAC_BASE] = LAYOUT_ansi_89( | ||
| 33 | KC_MUTE, KC_ESC, KC_BRID, KC_BRIU, KC_NO, KC_NO, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_INS, KC_DEL, | ||
| 34 | _______, 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, KC_BSPC, KC_PGUP, | ||
| 35 | _______, 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, KC_PGDN, | ||
| 36 | _______, 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, KC_HOME, | ||
| 37 | _______, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
| 38 | _______, KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, MO(MAC_FN), KC_SPC, KC_RCMD, KC_LEFT, KC_DOWN, KC_RGHT), | ||
| 39 | |||
| 40 | [MAC_FN] = LAYOUT_ansi_89( | ||
| 41 | RGB_TOG, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, | ||
| 42 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 43 | _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 44 | _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 45 | _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, | ||
| 46 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), | ||
| 47 | |||
| 48 | [WIN_BASE] = LAYOUT_ansi_89( | ||
| 49 | KC_MUTE, KC_ESC, 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_INS, KC_DEL, | ||
| 50 | _______, 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, KC_BSPC, KC_PGUP, | ||
| 51 | _______, 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, KC_PGDN, | ||
| 52 | _______, 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, KC_HOME, | ||
| 53 | _______, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
| 54 | _______, KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, MO(WIN_FN), KC_SPC, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT), | ||
| 55 | |||
| 56 | [WIN_FN] = LAYOUT_ansi_89( | ||
| 57 | RGB_TOG, _______, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, | ||
| 58 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 59 | _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 60 | _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 61 | _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, | ||
| 62 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), | ||
| 63 | }; | ||
| 64 | |||
| 65 | #if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) | ||
| 66 | const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { | ||
| 67 | [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, | ||
| 68 | [MAC_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }, | ||
| 69 | [WIN_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, | ||
| 70 | [WIN_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) } | ||
| 71 | }; | ||
| 72 | #endif // ENCODER_MAP_ENABLE | ||
diff --git a/keyboards/keychron/q10/ansi_encoder/keymaps/default/rules.mk b/keyboards/keychron/q10/ansi_encoder/keymaps/default/rules.mk new file mode 100644 index 0000000000..ee32568148 --- /dev/null +++ b/keyboards/keychron/q10/ansi_encoder/keymaps/default/rules.mk | |||
| @@ -0,0 +1 @@ | |||
| ENCODER_MAP_ENABLE = yes | |||
diff --git a/keyboards/keychron/q10/ansi_encoder/keymaps/keychron/keymap.c b/keyboards/keychron/q10/ansi_encoder/keymaps/keychron/keymap.c new file mode 100644 index 0000000000..0693820029 --- /dev/null +++ b/keyboards/keychron/q10/ansi_encoder/keymaps/keychron/keymap.c | |||
| @@ -0,0 +1,83 @@ | |||
| 1 | /* Copyright 2022 @ Keychron (https://www.keychron.com) | ||
| 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 | #include "keychron_common.h" | ||
| 19 | |||
| 20 | // clang-format off | ||
| 21 | |||
| 22 | enum layers{ | ||
| 23 | MAC_BASE, | ||
| 24 | MAC_FN, | ||
| 25 | WIN_BASE, | ||
| 26 | WIN_FN | ||
| 27 | }; | ||
| 28 | |||
| 29 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 30 | [MAC_BASE] = LAYOUT_ansi_89( | ||
| 31 | KC_MUTE, KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_INS, KC_DEL, | ||
| 32 | MACRO01, 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, KC_BSPC, KC_PGUP, | ||
| 33 | MACRO02, 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, KC_PGDN, | ||
| 34 | MACRO03, 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, KC_HOME, | ||
| 35 | MACRO04, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
| 36 | MACRO05, KC_LCTL, KC_LOPTN, KC_LCMMD, KC_SPC, MO(MAC_FN), KC_SPC, KC_RCMMD, KC_LEFT, KC_DOWN, KC_RGHT), | ||
| 37 | |||
| 38 | [MAC_FN] = LAYOUT_ansi_89( | ||
| 39 | RGB_TOG, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, | ||
| 40 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 41 | _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 42 | _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 43 | _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, | ||
| 44 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), | ||
| 45 | |||
| 46 | [WIN_BASE] = LAYOUT_ansi_89( | ||
| 47 | KC_MUTE, KC_ESC, 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_INS, KC_DEL, | ||
| 48 | MACRO01, 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, KC_BSPC, KC_PGUP, | ||
| 49 | MACRO02, 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, KC_PGDN, | ||
| 50 | MACRO03, 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, KC_HOME, | ||
| 51 | MACRO04, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
| 52 | MACRO05, KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, MO(WIN_FN), KC_SPC, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT), | ||
| 53 | |||
| 54 | [WIN_FN] = LAYOUT_ansi_89( | ||
| 55 | RGB_TOG, _______, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, | ||
| 56 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 57 | _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 58 | _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 59 | _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, | ||
| 60 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), | ||
| 61 | }; | ||
| 62 | |||
| 63 | #if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) | ||
| 64 | const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { | ||
| 65 | [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, | ||
| 66 | [MAC_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }, | ||
| 67 | [WIN_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, | ||
| 68 | [WIN_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) } | ||
| 69 | }; | ||
| 70 | #endif // ENCODER_MAP_ENABLE | ||
| 71 | |||
| 72 | // clang-format on | ||
| 73 | |||
| 74 | void housekeeping_task_user(void) { | ||
| 75 | housekeeping_task_keychron(); | ||
| 76 | } | ||
| 77 | |||
| 78 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 79 | if (!process_record_keychron(keycode, record)) { | ||
| 80 | return false; | ||
| 81 | } | ||
| 82 | return true; | ||
| 83 | } | ||
diff --git a/keyboards/keychron/q10/ansi_encoder/keymaps/keychron/rules.mk b/keyboards/keychron/q10/ansi_encoder/keymaps/keychron/rules.mk new file mode 100644 index 0000000000..9cf1a9b56c --- /dev/null +++ b/keyboards/keychron/q10/ansi_encoder/keymaps/keychron/rules.mk | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | VIA_ENABLE = yes | ||
| 2 | ENCODER_MAP_ENABLE = yes | ||
| 3 | |||
| 4 | VPATH += keyboards/keychron/common | ||
| 5 | SRC += keychron_common.c | ||
diff --git a/keyboards/keychron/q10/ansi_encoder/keymaps/via/keymap.c b/keyboards/keychron/q10/ansi_encoder/keymaps/via/keymap.c new file mode 100644 index 0000000000..da55586f86 --- /dev/null +++ b/keyboards/keychron/q10/ansi_encoder/keymaps/via/keymap.c | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | /* Copyright 2022 @ Keychron (https://www.keychron.com) | ||
| 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 | // clang-format off | ||
| 20 | |||
| 21 | enum layers{ | ||
| 22 | MAC_BASE, | ||
| 23 | MAC_FN, | ||
| 24 | WIN_BASE, | ||
| 25 | WIN_FN | ||
| 26 | }; | ||
| 27 | |||
| 28 | #define KC_TASK LGUI(KC_TAB) | ||
| 29 | #define KC_FLXP LGUI(KC_E) | ||
| 30 | |||
| 31 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 32 | [MAC_BASE] = LAYOUT_ansi_89( | ||
| 33 | KC_MUTE, KC_ESC, KC_BRID, KC_BRIU, KC_NO, KC_NO, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_INS, KC_DEL, | ||
| 34 | MACRO01, 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, KC_BSPC, KC_PGUP, | ||
| 35 | MACRO02, 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, KC_PGDN, | ||
| 36 | MACRO03, 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, KC_HOME, | ||
| 37 | MACRO04, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
| 38 | MACRO05, KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, MO(MAC_FN), KC_SPC, KC_RCMD, KC_LEFT, KC_DOWN, KC_RGHT), | ||
| 39 | |||
| 40 | [MAC_FN] = LAYOUT_ansi_89( | ||
| 41 | RGB_TOG, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, | ||
| 42 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 43 | _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 44 | _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 45 | _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, | ||
| 46 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), | ||
| 47 | |||
| 48 | [WIN_BASE] = LAYOUT_ansi_89( | ||
| 49 | KC_MUTE, KC_ESC, 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_INS, KC_DEL, | ||
| 50 | MACRO01, 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, KC_BSPC, KC_PGUP, | ||
| 51 | MACRO02, 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, KC_PGDN, | ||
| 52 | MACRO03, 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, KC_HOME, | ||
| 53 | MACRO04, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
| 54 | MACRO05, KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, MO(WIN_FN), KC_SPC, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT), | ||
| 55 | |||
| 56 | [WIN_FN] = LAYOUT_ansi_89( | ||
| 57 | RGB_TOG, _______, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, | ||
| 58 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 59 | _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 60 | _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 61 | _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, | ||
| 62 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), | ||
| 63 | }; | ||
| 64 | |||
| 65 | #if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) | ||
| 66 | const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { | ||
| 67 | [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, | ||
| 68 | [MAC_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }, | ||
| 69 | [WIN_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, | ||
| 70 | [WIN_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) } | ||
| 71 | }; | ||
| 72 | #endif // ENCODER_MAP_ENABLE | ||
diff --git a/keyboards/keychron/q10/ansi_encoder/keymaps/via/rules.mk b/keyboards/keychron/q10/ansi_encoder/keymaps/via/rules.mk new file mode 100644 index 0000000000..f1adcab005 --- /dev/null +++ b/keyboards/keychron/q10/ansi_encoder/keymaps/via/rules.mk | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | VIA_ENABLE = yes | ||
| 2 | ENCODER_MAP_ENABLE = yes | ||
diff --git a/keyboards/keychron/q10/ansi_encoder/readme.md b/keyboards/keychron/q10/ansi_encoder/readme.md new file mode 100644 index 0000000000..6f7f579659 --- /dev/null +++ b/keyboards/keychron/q10/ansi_encoder/readme.md | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # The ANSI variant of the Keychron Q10 | ||
| 2 | |||
| 3 | - Enable EC11 rotary encoder. | ||
| 4 | - Turn clockwise to increase volume and turn anti-clockwise to decrease volume. | ||
| 5 | - Press top left key pushbutton to mute. | ||
diff --git a/keyboards/keychron/q10/ansi_encoder/rules.mk b/keyboards/keychron/q10/ansi_encoder/rules.mk new file mode 100644 index 0000000000..359346625e --- /dev/null +++ b/keyboards/keychron/q10/ansi_encoder/rules.mk | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | # MCU name | ||
| 2 | MCU = STM32L432 | ||
| 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 = yes # 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 USB 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 | ENCODER_ENABLE = yes # Enable Encoder | ||
| 20 | DIP_SWITCH_ENABLE = yes | ||
| 21 | RGB_MATRIX_ENABLE = yes | ||
| 22 | RGB_MATRIX_DRIVER = CKLED2001 | ||
| 23 | EEPROM_DRIVER = wear_leveling | ||
| 24 | WEAR_LEVELING_DRIVER = embedded_flash | ||
| 25 | |||
| 26 | # Enter lower-power sleep mode when on the ChibiOS idle thread | ||
| 27 | OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE | ||
| 28 | |||
| 29 | # custom matrix setup | ||
| 30 | CUSTOM_MATRIX = lite | ||
| 31 | |||
| 32 | SRC += matrix.c | ||
diff --git a/keyboards/keychron/q10/config.h b/keyboards/keychron/q10/config.h new file mode 100644 index 0000000000..d5f30a12c0 --- /dev/null +++ b/keyboards/keychron/q10/config.h | |||
| @@ -0,0 +1,119 @@ | |||
| 1 | /* Copyright 2022 @ Keychron(https://www.keychron.com) | ||
| 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 | /* key matrix size */ | ||
| 20 | #define MATRIX_ROWS 6 | ||
| 21 | #define MATRIX_COLS 16 | ||
| 22 | |||
| 23 | /* key matrix pins */ | ||
| 24 | #define MATRIX_ROW_PINS \ | ||
| 25 | { B5, B4, B3, A15, A14, A13 } | ||
| 26 | #define MATRIX_COL_PINS \ | ||
| 27 | { C14, C15, A0, A1, A2, A3, A4, A5, NO_PIN, NO_PIN, NO_PIN, NO_PIN, NO_PIN, NO_PIN, NO_PIN, NO_PIN } | ||
| 28 | |||
| 29 | /* COL2ROW or ROW2COL */ | ||
| 30 | #define DIODE_DIRECTION ROW2COL | ||
| 31 | |||
| 32 | /* Set 0 if debouncing isn't needed */ | ||
| 33 | #define DEBOUNCE 5 | ||
| 34 | |||
| 35 | /* RGB Matrix Driver Configuration */ | ||
| 36 | #define DRIVER_COUNT 2 | ||
| 37 | #define DRIVER_ADDR_1 0b1110111 | ||
| 38 | #define DRIVER_ADDR_2 0b1110100 | ||
| 39 | |||
| 40 | /* Increase I2C speed to 1000 KHz */ | ||
| 41 | #define I2C1_TIMINGR_PRESC 0U | ||
| 42 | #define I2C1_TIMINGR_SCLDEL 3U | ||
| 43 | #define I2C1_TIMINGR_SDADEL 0U | ||
| 44 | #define I2C1_TIMINGR_SCLH 15U | ||
| 45 | #define I2C1_TIMINGR_SCLL 51U | ||
| 46 | |||
| 47 | /* Scan phase of led driver set as MSKPHASE_9CHANNEL(defined as 0x03 in CKLED2001.h) */ | ||
| 48 | #define PHASE_CHANNEL MSKPHASE_9CHANNEL | ||
| 49 | #define CKLED2001_CURRENT_TUNE \ | ||
| 50 | { 0x98, 0x98, 0x4A, 0x98, 0x98, 0x4A, 0x98, 0x98, 0x4A, 0x98, 0x98, 0x4A } | ||
| 51 | |||
| 52 | /* DIP switch */ | ||
| 53 | #define DIP_SWITCH_MATRIX_GRID { {5,5} } | ||
| 54 | |||
| 55 | /* Disable DIP switch in matrix data */ | ||
| 56 | #define MATRIX_MASKED | ||
| 57 | |||
| 58 | /* Disable RGB lighting when PC is in suspend */ | ||
| 59 | #define RGB_DISABLE_WHEN_USB_SUSPENDED | ||
| 60 | |||
| 61 | /* EEPROM Driver Configuration */ | ||
| 62 | #define WEAR_LEVELING_LOGICAL_SIZE 2048 | ||
| 63 | #define WEAR_LEVELING_BACKING_SIZE (WEAR_LEVELING_LOGICAL_SIZE * 2) | ||
| 64 | |||
| 65 | /* Specify (0,1) which programmed as "ESC" key on this keyboard as bootmagic key */ | ||
| 66 | #define BOOTMAGIC_LITE_ROW 0 | ||
| 67 | #define BOOTMAGIC_LITE_COLUMN 1 | ||
| 68 | |||
| 69 | // RGB Matrix Animation modes. Explicitly enabled | ||
| 70 | // For full list of effects, see: | ||
| 71 | // https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects | ||
| 72 | // #define ENABLE_RGB_MATRIX_ALPHAS_MODS | ||
| 73 | // #define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN | ||
| 74 | // #define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT | ||
| 75 | #define ENABLE_RGB_MATRIX_BREATHING | ||
| 76 | // #define ENABLE_RGB_MATRIX_BAND_SAT | ||
| 77 | // #define ENABLE_RGB_MATRIX_BAND_VAL | ||
| 78 | // #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT | ||
| 79 | // #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL | ||
| 80 | // #define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT | ||
| 81 | #define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL | ||
| 82 | #define ENABLE_RGB_MATRIX_CYCLE_ALL | ||
| 83 | #define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT | ||
| 84 | #define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN | ||
| 85 | #define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON | ||
| 86 | #define ENABLE_RGB_MATRIX_CYCLE_OUT_IN | ||
| 87 | #define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL | ||
| 88 | #define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL | ||
| 89 | #define ENABLE_RGB_MATRIX_CYCLE_SPIRAL | ||
| 90 | #define ENABLE_RGB_MATRIX_DUAL_BEACON | ||
| 91 | #define ENABLE_RGB_MATRIX_RAINBOW_BEACON | ||
| 92 | // #define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS | ||
| 93 | // #define ENABLE_RGB_MATRIX_RAINDROPS | ||
| 94 | #define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS | ||
| 95 | // #define ENABLE_RGB_MATRIX_HUE_BREATHING | ||
| 96 | // #define ENABLE_RGB_MATRIX_HUE_PENDULUM | ||
| 97 | // #define ENABLE_RGB_MATRIX_HUE_WAVE | ||
| 98 | #define ENABLE_RGB_MATRIX_PIXEL_RAIN | ||
| 99 | // #define ENABLE_RGB_MATRIX_PIXEL_FLOW | ||
| 100 | // #define ENABLE_RGB_MATRIX_PIXEL_FRACTAL | ||
| 101 | // enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined | ||
| 102 | #define ENABLE_RGB_MATRIX_TYPING_HEATMAP | ||
| 103 | #define ENABLE_RGB_MATRIX_DIGITAL_RAIN | ||
| 104 | // enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined | ||
| 105 | #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE | ||
| 106 | // #define ENABLE_RGB_MATRIX_SOLID_REACTIVE | ||
| 107 | // #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE | ||
| 108 | #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE | ||
| 109 | // #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS | ||
| 110 | // #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS | ||
| 111 | // #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS | ||
| 112 | #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS | ||
| 113 | #define ENABLE_RGB_MATRIX_SPLASH | ||
| 114 | // #define ENABLE_RGB_MATRIX_MULTISPLASH | ||
| 115 | #define ENABLE_RGB_MATRIX_SOLID_SPLASH | ||
| 116 | // #define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH | ||
| 117 | |||
| 118 | #define RGB_MATRIX_FRAMEBUFFER_EFFECTS | ||
| 119 | #define RGB_MATRIX_KEYPRESSES | ||
diff --git a/keyboards/keychron/q10/halconf.h b/keyboards/keychron/q10/halconf.h new file mode 100644 index 0000000000..41bddcb279 --- /dev/null +++ b/keyboards/keychron/q10/halconf.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | /* Copyright 2020 QMK | ||
| 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 HAL_USE_I2C TRUE | ||
| 20 | |||
| 21 | #include_next <halconf.h> | ||
diff --git a/keyboards/keychron/q10/iso_encoder/config.h b/keyboards/keychron/q10/iso_encoder/config.h new file mode 100644 index 0000000000..7f4a575432 --- /dev/null +++ b/keyboards/keychron/q10/iso_encoder/config.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | /* Copyright 2022 @ Keychron (https://www.keychron.com) | ||
| 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 Matrix Configuration */ | ||
| 20 | #define DRIVER_1_LED_TOTAL 47 | ||
| 21 | #define DRIVER_2_LED_TOTAL 42 | ||
| 22 | #define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) | ||
| 23 | |||
| 24 | /* Encoder Configuration */ | ||
| 25 | #define ENCODERS_PAD_A { A10 } | ||
| 26 | #define ENCODERS_PAD_B { A8 } | ||
| 27 | #define ENCODER_RESOLUTION 4 | ||
| 28 | #define ENCODER_DEFAULT_POS 0x3 | ||
| 29 | |||
| 30 | /* Enable caps-lock LED */ | ||
| 31 | #define CAPS_LOCK_LED_INDEX 47 | ||
diff --git a/keyboards/keychron/q10/iso_encoder/info.json b/keyboards/keychron/q10/iso_encoder/info.json new file mode 100644 index 0000000000..9978af0b4b --- /dev/null +++ b/keyboards/keychron/q10/iso_encoder/info.json | |||
| @@ -0,0 +1,112 @@ | |||
| 1 | { | ||
| 2 | "keyboard_name": "Keychron Q10", | ||
| 3 | "manufacturer": "Keychron", | ||
| 4 | "url": "https://github.com/Keychron", | ||
| 5 | "maintainer": "lalalademaxiya1", | ||
| 6 | "usb": { | ||
| 7 | "vid": "0x3434", | ||
| 8 | "pid": "0x01A3", | ||
| 9 | "device_version": "1.0.0" | ||
| 10 | }, | ||
| 11 | "layouts": { | ||
| 12 | "LAYOUT_iso_90": { | ||
| 13 | "layout": [ | ||
| 14 | {"matrix":[0, 0], "x":0.25, "y":0}, | ||
| 15 | {"matrix":[0, 1], "x":1.75, "y":0}, | ||
| 16 | {"matrix":[0, 2], "x":3, "y":0}, | ||
| 17 | {"matrix":[0, 3], "x":4, "y":0}, | ||
| 18 | {"matrix":[0, 4], "x":5, "y":0}, | ||
| 19 | {"matrix":[0, 5], "x":6, "y":0}, | ||
| 20 | {"matrix":[0, 6], "x":7.25, "y":0}, | ||
| 21 | {"matrix":[0, 7], "x":8.25, "y":0}, | ||
| 22 | {"matrix":[0, 8], "x":11, "y":0}, | ||
| 23 | {"matrix":[0, 9], "x":12, "y":0}, | ||
| 24 | {"matrix":[0,10], "x":13.25, "y":0}, | ||
| 25 | {"matrix":[0,11], "x":14.25, "y":0}, | ||
| 26 | {"matrix":[0,12], "x":15.25, "y":0}, | ||
| 27 | {"matrix":[0,13], "x":16.25, "y":0}, | ||
| 28 | {"matrix":[0,14], "x":17.5, "y":0}, | ||
| 29 | {"matrix":[0,15], "x":18.75, "y":0}, | ||
| 30 | |||
| 31 | {"matrix":[1, 0], "x":0.75, "y":1.25}, | ||
| 32 | {"matrix":[1, 1], "x":2.25, "y":1.25}, | ||
| 33 | {"matrix":[1, 2], "x":3.25, "y":1.25}, | ||
| 34 | {"matrix":[1, 3], "x":4.25, "y":1.25}, | ||
| 35 | {"matrix":[1, 4], "x":5.25, "y":1.25}, | ||
| 36 | {"matrix":[1, 5], "x":6.25, "y":1.25}, | ||
| 37 | {"matrix":[1, 6], "x":7.25, "y":1.25}, | ||
| 38 | {"matrix":[1, 7], "x":8.25, "y":1.25}, | ||
| 39 | {"matrix":[1, 8], "x":10.5, "y":1.25}, | ||
| 40 | {"matrix":[1, 9], "x":11.5, "y":1.25}, | ||
| 41 | {"matrix":[1,10], "x":12.5, "y":1.25}, | ||
| 42 | {"matrix":[1,11], "x":13.5, "y":1.25}, | ||
| 43 | {"matrix":[1,12], "x":14.5, "y":1.25}, | ||
| 44 | {"matrix":[1,13], "x":15.5, "y":1.25}, | ||
| 45 | {"matrix":[1,14], "x":16.5, "y":1.25, "w":2}, | ||
| 46 | {"matrix":[1,15], "x":19, "y":1.25}, | ||
| 47 | |||
| 48 | {"matrix":[2, 0], "x":0.5, "y":2.25}, | ||
| 49 | {"matrix":[2, 1], "x":1.75, "y":2.25, "w":1.5}, | ||
| 50 | {"matrix":[2, 2], "x":3.25, "y":2.25}, | ||
| 51 | {"matrix":[2, 3], "x":4.5, "y":2.25}, | ||
| 52 | {"matrix":[2, 4], "x":5.5, "y":2.25}, | ||
| 53 | {"matrix":[2, 5], "x":6.5, "y":2.25}, | ||
| 54 | {"matrix":[2, 6], "x":7.5, "y":2.25}, | ||
| 55 | {"matrix":[2, 7], "x":10, "y":2.25}, | ||
| 56 | {"matrix":[2, 8], "x":11, "y":2.25}, | ||
| 57 | {"matrix":[2, 9], "x":12, "y":2.25}, | ||
| 58 | {"matrix":[2,10], "x":13, "y":2.25}, | ||
| 59 | {"matrix":[2,11], "x":14, "y":2.25}, | ||
| 60 | {"matrix":[2,12], "x":15.25, "y":2.25}, | ||
| 61 | {"matrix":[2,13], "x":16.25, "y":2.25}, | ||
| 62 | {"matrix":[2,15], "x":19.25, "y":2.25}, | ||
| 63 | |||
| 64 | {"matrix":[3, 0], "x":0.25, "y":3.25}, | ||
| 65 | {"matrix":[3, 1], "x":1.5, "y":3.25, "w":1.75}, | ||
| 66 | {"matrix":[3, 2], "x":3.25, "y":3.25}, | ||
| 67 | {"matrix":[3, 3], "x":4.5, "y":3.25}, | ||
| 68 | {"matrix":[3, 4], "x":5.5, "y":3.25}, | ||
| 69 | {"matrix":[3, 5], "x":6.5, "y":3.25}, | ||
| 70 | {"matrix":[3, 6], "x":7.5, "y":3.25}, | ||
| 71 | {"matrix":[3, 8], "x":10.25, "y":3.25}, | ||
| 72 | {"matrix":[3, 9], "x":11.25, "y":3.25}, | ||
| 73 | {"matrix":[3,10], "x":12.25, "y":3.25}, | ||
| 74 | {"matrix":[3,11], "x":13.25, "y":3.25}, | ||
| 75 | {"matrix":[3,12], "x":14.75, "y":3.25}, | ||
| 76 | {"matrix":[3,13], "x":15.75, "y":3.25}, | ||
| 77 | {"matrix":[3,14], "x":16.75, "y":3.25}, | ||
| 78 | {"matrix":[2,14], "x":17.75, "y":3.25, "w":1.25, "h":2}, | ||
| 79 | {"matrix":[3,15], "x":19.5, "y":3.25}, | ||
| 80 | |||
| 81 | {"matrix":[4, 0], "x":0, "y":4.25}, | ||
| 82 | {"matrix":[4, 1], "x":1.5, "y":4.25}, | ||
| 83 | {"matrix":[4, 2], "x":2.5, "y":4.25}, | ||
| 84 | {"matrix":[4, 3], "x":3.5, "y":4.25}, | ||
| 85 | {"matrix":[4, 4], "x":4.75, "y":4.25}, | ||
| 86 | {"matrix":[4, 5], "x":5.75, "y":4.25}, | ||
| 87 | {"matrix":[4, 6], "x":6.75, "y":4.25}, | ||
| 88 | {"matrix":[4, 7], "x":7.75, "y":4.25}, | ||
| 89 | {"matrix":[4, 8], "x":9.5, "y":4.25}, | ||
| 90 | {"matrix":[4, 9], "x":10.5, "y":4.25}, | ||
| 91 | {"matrix":[4,10], "x":11.5, "y":4.25}, | ||
| 92 | {"matrix":[4,11], "x":12.5, "y":4.25}, | ||
| 93 | {"matrix":[4,12], "x":13.5, "y":4.25}, | ||
| 94 | {"matrix":[4,13], "x":15.25, "y":4.25}, | ||
| 95 | {"matrix":[4,14], "x":16.25, "y":4.25, "w":1.75}, | ||
| 96 | {"matrix":[4,15], "x":18.25, "y":4.5}, | ||
| 97 | |||
| 98 | {"matrix":[5, 0], "x":0, "y":5.25}, | ||
| 99 | {"matrix":[5, 1], "x":1.25, "y":5.25, "w":1.25}, | ||
| 100 | {"matrix":[5, 2], "x":2.5, "y":5.25, "w":1.25}, | ||
| 101 | {"matrix":[5, 3], "x":4.75, "y":5.25, "w":1.25}, | ||
| 102 | {"matrix":[5, 4], "x":6, "y":5.25, "w":2.25}, | ||
| 103 | {"matrix":[5, 7], "x":8.25, "y":5.25}, | ||
| 104 | {"matrix":[5, 8], "x":9.5, "y":5.25, "w":2.75}, | ||
| 105 | {"matrix":[5, 9], "x":12.25, "y":5.25}, | ||
| 106 | {"matrix":[5,13], "x":17.25, "y":5.5}, | ||
| 107 | {"matrix":[5,14], "x":18.25, "y":5.5}, | ||
| 108 | {"matrix":[5,15], "x":19.25, "y":5.5} | ||
| 109 | ] | ||
| 110 | } | ||
| 111 | } | ||
| 112 | } | ||
diff --git a/keyboards/keychron/q10/iso_encoder/iso_encoder.c b/keyboards/keychron/q10/iso_encoder/iso_encoder.c new file mode 100644 index 0000000000..1e8f80ddd8 --- /dev/null +++ b/keyboards/keychron/q10/iso_encoder/iso_encoder.c | |||
| @@ -0,0 +1,158 @@ | |||
| 1 | /* Copyright 2022 @ Keychron (https://www.keychron.com) | ||
| 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 "quantum.h" | ||
| 18 | |||
| 19 | #ifdef RGB_MATRIX_ENABLE | ||
| 20 | |||
| 21 | // clang-format off | ||
| 22 | |||
| 23 | const ckled2001_led PROGMEM g_ckled2001_leds[RGB_MATRIX_LED_COUNT] = { | ||
| 24 | /* Refer to IS31 manual for these locations | ||
| 25 | * driver | ||
| 26 | * | R location | ||
| 27 | * | | G location | ||
| 28 | * | | | B location | ||
| 29 | * | | | | */ | ||
| 30 | {0, C_2, A_2, B_2}, // ESC | ||
| 31 | {0, C_3, A_3, B_3}, // F1 | ||
| 32 | {0, C_4, A_4, B_4}, // F2 | ||
| 33 | {0, C_5, A_5, B_5}, // F3 | ||
| 34 | {0, C_6, A_6, B_6}, // F4 | ||
| 35 | {0, C_7, A_7, B_7}, // F5 | ||
| 36 | {0, C_8, A_8, B_8}, // F6 | ||
| 37 | {0, C_9, A_9, B_9}, // F7 | ||
| 38 | {0, C_10, A_10, B_10}, // F8 | ||
| 39 | {0, C_11, A_11, B_11}, // F9 | ||
| 40 | {0, C_12, A_12, B_12}, // F10 | ||
| 41 | {0, C_13, A_13, B_13}, // F11 | ||
| 42 | {0, C_14, A_14, B_14}, // F12 | ||
| 43 | {0, C_15, A_15, B_15}, // INS | ||
| 44 | {0, C_16, A_16, B_16}, // DEL | ||
| 45 | |||
| 46 | {0, I_1, G_1, H_1}, // M1 | ||
| 47 | {0, I_2, G_2, H_2}, // `~ | ||
| 48 | {0, I_3, G_3, H_3}, // 1! | ||
| 49 | {0, I_4, G_4, H_4}, // 2@ | ||
| 50 | {0, I_5, G_5, H_5}, // 3# | ||
| 51 | {0, I_6, G_6, H_6}, // 4$ | ||
| 52 | {0, I_7, G_7, H_7}, // 5% | ||
| 53 | {0, I_8, G_8, H_8}, // 6^ | ||
| 54 | {0, I_9, G_9, H_9}, // 7& | ||
| 55 | {0, I_10, G_10, H_10}, // 8* | ||
| 56 | {0, I_11, G_11, H_11}, // 9( | ||
| 57 | {0, I_12, G_12, H_12}, // 0) | ||
| 58 | {0, I_13, G_13, H_13}, // -_ | ||
| 59 | {0, I_14, G_14, H_14}, // =+ | ||
| 60 | {0, I_15, G_15, H_15}, // BackSpace | ||
| 61 | {0, I_16, G_16, H_16}, // PgUp | ||
| 62 | |||
| 63 | {0, F_1, D_1, E_1}, // M2 | ||
| 64 | {0, F_2, D_2, E_2}, // TAB | ||
| 65 | {0, F_3, D_3, E_3}, // Q | ||
| 66 | {0, F_4, D_4, E_4}, // W | ||
| 67 | {0, F_5, D_5, E_5}, // E | ||
| 68 | {0, F_6, D_6, E_6}, // R | ||
| 69 | {0, F_7, D_7, E_7}, // T | ||
| 70 | {0, F_8, D_8, E_8}, // Y | ||
| 71 | {0, F_9, D_9, E_9}, // U | ||
| 72 | {0, F_10, D_10, E_10}, // I | ||
| 73 | {0, F_11, D_11, E_11}, // O | ||
| 74 | {0, F_12, D_12, E_12}, // P | ||
| 75 | {0, F_13, D_13, E_13}, // [ | ||
| 76 | {0, F_14, D_14, E_14}, // ] | ||
| 77 | {0, F_16, D_16, E_16}, // PgDn | ||
| 78 | |||
| 79 | {1, C_16, A_16, B_16}, // M3 | ||
| 80 | {1, C_15, A_15, B_15}, // CapsLock | ||
| 81 | {1, C_14, A_14, B_14}, // A | ||
| 82 | {1, C_13, A_13, B_13}, // S | ||
| 83 | {1, C_12, A_12, B_12}, // D | ||
| 84 | {1, C_11, A_11, B_11}, // F | ||
| 85 | {1, C_10, A_10, B_10}, // G | ||
| 86 | {1, C_8, A_8, B_8}, // H | ||
| 87 | {1, C_7, A_7, B_7}, // J | ||
| 88 | {1, C_6, A_6, B_6}, // K | ||
| 89 | {1, C_5, A_5, B_5}, // L | ||
| 90 | {1, C_4, A_4, B_4}, // ; | ||
| 91 | {1, C_3, A_3, B_3}, // ' | ||
| 92 | {0, F_15, D_15, E_15}, // | | ||
| 93 | {1, C_2, A_2, B_2}, // Enter | ||
| 94 | {1, C_1, A_1, B_1}, // Home | ||
| 95 | |||
| 96 | {1, I_16, G_16, H_16}, // M4 | ||
| 97 | {1, I_15, G_15, H_15}, // Shift_L | ||
| 98 | {1, I_14, G_14, H_14}, | ||
| 99 | {1, I_13, G_13, H_13}, // Z | ||
| 100 | {1, I_12, G_12, H_12}, // X | ||
| 101 | {1, I_11, G_11, H_11}, // C | ||
| 102 | {1, I_10, G_10, H_10}, // V | ||
| 103 | {1, I_9, G_9, H_9}, // B | ||
| 104 | {1, I_8, G_8, H_8}, // B | ||
| 105 | {1, I_7, G_7, H_7}, // N | ||
| 106 | {1, I_6, G_6, H_6}, // M | ||
| 107 | {1, I_5, G_5, H_5}, // , | ||
| 108 | {1, I_4, G_4, H_4}, // . | ||
| 109 | {1, I_3, G_3, H_3}, // ? | ||
| 110 | {1, I_2, G_2, H_2}, // Shift_R | ||
| 111 | {1, I_1, G_1, H_1}, // Up | ||
| 112 | |||
| 113 | {1, F_16, D_16, E_16}, // M5 | ||
| 114 | {1, F_15, D_15, E_15}, // Ctrl_L | ||
| 115 | {1, F_14, D_14, E_14}, // Win_L | ||
| 116 | {1, F_13, D_13, E_13}, // Alt_L | ||
| 117 | {1, F_12, D_12, E_12}, // Space | ||
| 118 | {1, F_9, D_9, E_9}, // Fn | ||
| 119 | {1, F_8, D_8, E_8}, // Space | ||
| 120 | {1, F_7, D_7, E_7}, // Alt_R | ||
| 121 | {1, F_3, D_3, E_3}, // Left | ||
| 122 | {1, F_2, D_2, E_2}, // Down | ||
| 123 | {1, F_1, D_1, E_1}, // Right | ||
| 124 | }; | ||
| 125 | |||
| 126 | #define __ NO_LED | ||
| 127 | |||
| 128 | led_config_t g_led_config = { | ||
| 129 | { | ||
| 130 | // Key Matrix to LED Index | ||
| 131 | { __, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, | ||
| 132 | { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 }, | ||
| 133 | { 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 59, 45 }, | ||
| 134 | { 46, 47, 48, 49, 50, 51, 52, __, 53, 54, 55, 56, 57, 58, 60, 61 }, | ||
| 135 | { 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77 }, | ||
| 136 | { 78, 79, 80, 81, 82, __, __, 83, 84, 85, __, __, __, 86, 87, 88 }, | ||
| 137 | }, | ||
| 138 | { | ||
| 139 | // LED Index to Physical Position | ||
| 140 | {0,0}, {19,0}, {34,0}, {60,1}, {72,3}, {87,6}, {99,8}, {120,8}, {132,6}, {147,3}, {159,1}, {173,0}, {185,0}, {201,1}, {219,1}, | ||
| 141 | {5,14}, {24,14}, {36,14}, {48,13}, {62,15}, {74,17}, {86,20}, {98,22}, {115,22}, {127,20}, {139,17}, {151,15}, {165,13}, {177,14}, {195,14}, {220,15}, | ||
| 142 | {4,24}, {24,24}, {40,24}, {53,24}, {65,27}, {77,29}, {89,31}, {112,33}, {124,31}, {136,29}, {148,27}, {160,24}, {176,24}, {189,24}, {222,25}, | ||
| 143 | {2,34}, {23,34}, {40,34}, {54,35}, {66,37}, {78,39}, {90,42}, {118,43}, {130,40}, {142,38}, {154,36}, {167,35}, {179,35}, {192,35}, {208,31}, {224,36}, | ||
| 144 | {0,45}, {18,45}, {31,45}, {44,45}, {57,46}, {69,48}, {81,51}, {93,53}, {111,54}, {123,52}, {135,50}, {147,48}, {159,46}, {173,45}, {190,45}, {210,47}, | ||
| 145 | {0,55}, {18,55}, {33,55}, {56,57}, {77,61}, {97,64}, {124,63}, {147,59}, {198,58}, {210,58}, {222,58}, | ||
| 146 | }, | ||
| 147 | { | ||
| 148 | // RGB LED Index to Flag | ||
| 149 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
| 150 | 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, | ||
| 151 | 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, | ||
| 152 | 1, 8, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, | ||
| 153 | 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, | ||
| 154 | 1, 1, 1, 1, 4, 1, 4, 1, 1, 1, 1, | ||
| 155 | } | ||
| 156 | }; | ||
| 157 | |||
| 158 | #endif // RGB_MATRIX_ENABLE | ||
diff --git a/keyboards/keychron/q10/iso_encoder/iso_encoder.h b/keyboards/keychron/q10/iso_encoder/iso_encoder.h new file mode 100644 index 0000000000..db52563dc4 --- /dev/null +++ b/keyboards/keychron/q10/iso_encoder/iso_encoder.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* Copyright 2021 @ Keychron (https://www.keychron.com) | ||
| 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" | ||
diff --git a/keyboards/keychron/q10/iso_encoder/keymaps/default/keymap.c b/keyboards/keychron/q10/iso_encoder/keymaps/default/keymap.c new file mode 100644 index 0000000000..68bc5e0954 --- /dev/null +++ b/keyboards/keychron/q10/iso_encoder/keymaps/default/keymap.c | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | /* Copyright 2022 @ Keychron (https://www.keychron.com) | ||
| 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 | // clang-format off | ||
| 20 | |||
| 21 | enum layers{ | ||
| 22 | MAC_BASE, | ||
| 23 | MAC_FN, | ||
| 24 | WIN_BASE, | ||
| 25 | WIN_FN | ||
| 26 | }; | ||
| 27 | |||
| 28 | #define KC_TASK LGUI(KC_TAB) | ||
| 29 | #define KC_FLXP LGUI(KC_E) | ||
| 30 | |||
| 31 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 32 | [MAC_BASE] = LAYOUT_iso_90( | ||
| 33 | KC_MUTE, KC_ESC, KC_BRID, KC_BRIU, KC_NO, KC_NO, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_INS, KC_DEL, | ||
| 34 | _______, 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, KC_BSPC, KC_PGUP, | ||
| 35 | _______, 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_PGDN, | ||
| 36 | _______, 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_NUHS, KC_ENT, KC_HOME, | ||
| 37 | _______, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
| 38 | _______, KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, MO(MAC_FN), KC_SPC, KC_RCMD, KC_LEFT, KC_DOWN, KC_RGHT), | ||
| 39 | |||
| 40 | [MAC_FN] = LAYOUT_iso_90( | ||
| 41 | RGB_TOG, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, | ||
| 42 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 43 | _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 44 | _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 45 | _______, _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, | ||
| 46 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), | ||
| 47 | |||
| 48 | [WIN_BASE] = LAYOUT_iso_90( | ||
| 49 | KC_MUTE, KC_ESC, 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_INS, KC_DEL, | ||
| 50 | _______, 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, KC_BSPC, KC_PGUP, | ||
| 51 | _______, 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_PGDN, | ||
| 52 | _______, 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_NUHS, KC_ENT, KC_HOME, | ||
| 53 | _______, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
| 54 | _______, KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, MO(WIN_FN), KC_SPC, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT), | ||
| 55 | |||
| 56 | [WIN_FN] = LAYOUT_iso_90( | ||
| 57 | RGB_TOG, _______, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, | ||
| 58 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 59 | _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 60 | _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 61 | _______, _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, | ||
| 62 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), | ||
| 63 | }; | ||
| 64 | |||
| 65 | #if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) | ||
| 66 | const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { | ||
| 67 | [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, | ||
| 68 | [MAC_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }, | ||
| 69 | [WIN_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, | ||
| 70 | [WIN_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) } | ||
| 71 | }; | ||
| 72 | #endif // ENCODER_MAP_ENABLE | ||
diff --git a/keyboards/keychron/q10/iso_encoder/keymaps/default/rules.mk b/keyboards/keychron/q10/iso_encoder/keymaps/default/rules.mk new file mode 100644 index 0000000000..ee32568148 --- /dev/null +++ b/keyboards/keychron/q10/iso_encoder/keymaps/default/rules.mk | |||
| @@ -0,0 +1 @@ | |||
| ENCODER_MAP_ENABLE = yes | |||
diff --git a/keyboards/keychron/q10/iso_encoder/keymaps/keychron/keymap.c b/keyboards/keychron/q10/iso_encoder/keymaps/keychron/keymap.c new file mode 100644 index 0000000000..9d19e8b09f --- /dev/null +++ b/keyboards/keychron/q10/iso_encoder/keymaps/keychron/keymap.c | |||
| @@ -0,0 +1,83 @@ | |||
| 1 | /* Copyright 2022 @ Keychron (https://www.keychron.com) | ||
| 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 | #include "keychron_common.h" | ||
| 19 | |||
| 20 | // clang-format off | ||
| 21 | |||
| 22 | enum layers{ | ||
| 23 | MAC_BASE, | ||
| 24 | MAC_FN, | ||
| 25 | WIN_BASE, | ||
| 26 | WIN_FN | ||
| 27 | }; | ||
| 28 | |||
| 29 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 30 | [MAC_BASE] = LAYOUT_iso_90( | ||
| 31 | KC_MUTE, KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_INS, KC_DEL, | ||
| 32 | MACRO01, 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, KC_BSPC, KC_PGUP, | ||
| 33 | MACRO02, 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_PGDN, | ||
| 34 | MACRO03, 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_NUHS, KC_ENT, KC_HOME, | ||
| 35 | MACRO04, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
| 36 | MACRO05, KC_LCTL, KC_LOPTN, KC_LCMMD, KC_SPC, MO(MAC_FN), KC_SPC, KC_RCMMD, KC_LEFT, KC_DOWN, KC_RGHT), | ||
| 37 | |||
| 38 | [MAC_FN] = LAYOUT_iso_90( | ||
| 39 | RGB_TOG, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, | ||
| 40 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 41 | _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 42 | _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 43 | _______, _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, | ||
| 44 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), | ||
| 45 | |||
| 46 | [WIN_BASE] = LAYOUT_iso_90( | ||
| 47 | KC_MUTE, KC_ESC, 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_INS, KC_DEL, | ||
| 48 | MACRO01, 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, KC_BSPC, KC_PGUP, | ||
| 49 | MACRO02, 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_PGDN, | ||
| 50 | MACRO03, 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_NUHS, KC_ENT, KC_HOME, | ||
| 51 | MACRO04, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
| 52 | MACRO05, KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, MO(WIN_FN), KC_SPC, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT), | ||
| 53 | |||
| 54 | [WIN_FN] = LAYOUT_iso_90( | ||
| 55 | RGB_TOG, _______, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, | ||
| 56 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 57 | _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 58 | _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 59 | _______, _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, | ||
| 60 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), | ||
| 61 | }; | ||
| 62 | |||
| 63 | #if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) | ||
| 64 | const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { | ||
| 65 | [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, | ||
| 66 | [MAC_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }, | ||
| 67 | [WIN_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, | ||
| 68 | [WIN_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) } | ||
| 69 | }; | ||
| 70 | #endif // ENCODER_MAP_ENABLE | ||
| 71 | |||
| 72 | // clang-format on | ||
| 73 | |||
| 74 | void housekeeping_task_user(void) { | ||
| 75 | housekeeping_task_keychron(); | ||
| 76 | } | ||
| 77 | |||
| 78 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 79 | if (!process_record_keychron(keycode, record)) { | ||
| 80 | return false; | ||
| 81 | } | ||
| 82 | return true; | ||
| 83 | } | ||
diff --git a/keyboards/keychron/q10/iso_encoder/keymaps/keychron/rules.mk b/keyboards/keychron/q10/iso_encoder/keymaps/keychron/rules.mk new file mode 100644 index 0000000000..9cf1a9b56c --- /dev/null +++ b/keyboards/keychron/q10/iso_encoder/keymaps/keychron/rules.mk | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | VIA_ENABLE = yes | ||
| 2 | ENCODER_MAP_ENABLE = yes | ||
| 3 | |||
| 4 | VPATH += keyboards/keychron/common | ||
| 5 | SRC += keychron_common.c | ||
diff --git a/keyboards/keychron/q10/iso_encoder/keymaps/via/keymap.c b/keyboards/keychron/q10/iso_encoder/keymaps/via/keymap.c new file mode 100644 index 0000000000..7d61df46b9 --- /dev/null +++ b/keyboards/keychron/q10/iso_encoder/keymaps/via/keymap.c | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | /* Copyright 2022 @ Keychron (https://www.keychron.com) | ||
| 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 | // clang-format off | ||
| 20 | |||
| 21 | enum layers{ | ||
| 22 | MAC_BASE, | ||
| 23 | MAC_FN, | ||
| 24 | WIN_BASE, | ||
| 25 | WIN_FN | ||
| 26 | }; | ||
| 27 | |||
| 28 | #define KC_TASK LGUI(KC_TAB) | ||
| 29 | #define KC_FLXP LGUI(KC_E) | ||
| 30 | |||
| 31 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 32 | [MAC_BASE] = LAYOUT_iso_90( | ||
| 33 | KC_MUTE, KC_ESC, KC_BRID, KC_BRIU, KC_NO, KC_NO, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_INS, KC_DEL, | ||
| 34 | MACRO01, 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, KC_BSPC, KC_PGUP, | ||
| 35 | MACRO02, 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_PGDN, | ||
| 36 | MACRO03, 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_NUHS, KC_ENT, KC_HOME, | ||
| 37 | MACRO04, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
| 38 | MACRO05, KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, MO(MAC_FN), KC_SPC, KC_RCMD, KC_LEFT, KC_DOWN, KC_RGHT), | ||
| 39 | |||
| 40 | [MAC_FN] = LAYOUT_iso_90( | ||
| 41 | RGB_TOG, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, | ||
| 42 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 43 | _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 44 | _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 45 | _______, _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, | ||
| 46 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), | ||
| 47 | |||
| 48 | [WIN_BASE] = LAYOUT_iso_90( | ||
| 49 | KC_MUTE, KC_ESC, 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_INS, KC_DEL, | ||
| 50 | MACRO01, 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, KC_BSPC, KC_PGUP, | ||
| 51 | MACRO02, 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_PGDN, | ||
| 52 | MACRO03, 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_NUHS, KC_ENT, KC_HOME, | ||
| 53 | MACRO04, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
| 54 | MACRO05, KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, MO(WIN_FN), KC_SPC, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT), | ||
| 55 | |||
| 56 | [WIN_FN] = LAYOUT_iso_90( | ||
| 57 | RGB_TOG, _______, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, | ||
| 58 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 59 | _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 60 | _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 61 | _______, _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, | ||
| 62 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), | ||
| 63 | }; | ||
| 64 | |||
| 65 | #if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) | ||
| 66 | const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { | ||
| 67 | [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, | ||
| 68 | [MAC_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }, | ||
| 69 | [WIN_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, | ||
| 70 | [WIN_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) } | ||
| 71 | }; | ||
| 72 | #endif // ENCODER_MAP_ENABLE | ||
diff --git a/keyboards/keychron/q10/iso_encoder/keymaps/via/rules.mk b/keyboards/keychron/q10/iso_encoder/keymaps/via/rules.mk new file mode 100644 index 0000000000..f1adcab005 --- /dev/null +++ b/keyboards/keychron/q10/iso_encoder/keymaps/via/rules.mk | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | VIA_ENABLE = yes | ||
| 2 | ENCODER_MAP_ENABLE = yes | ||
diff --git a/keyboards/keychron/q10/iso_encoder/readme.md b/keyboards/keychron/q10/iso_encoder/readme.md new file mode 100644 index 0000000000..e66322443a --- /dev/null +++ b/keyboards/keychron/q10/iso_encoder/readme.md | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # The ISO variant of the Keychron Q10 | ||
| 2 | |||
| 3 | - Enable EC11 rotary encoder. | ||
| 4 | - Turn clockwise to increase volume and turn anti-clockwise to decrease volume. | ||
| 5 | - Press top left key pushbutton to mute. | ||
diff --git a/keyboards/keychron/q10/iso_encoder/rules.mk b/keyboards/keychron/q10/iso_encoder/rules.mk new file mode 100644 index 0000000000..359346625e --- /dev/null +++ b/keyboards/keychron/q10/iso_encoder/rules.mk | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | # MCU name | ||
| 2 | MCU = STM32L432 | ||
| 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 = yes # 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 USB 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 | ENCODER_ENABLE = yes # Enable Encoder | ||
| 20 | DIP_SWITCH_ENABLE = yes | ||
| 21 | RGB_MATRIX_ENABLE = yes | ||
| 22 | RGB_MATRIX_DRIVER = CKLED2001 | ||
| 23 | EEPROM_DRIVER = wear_leveling | ||
| 24 | WEAR_LEVELING_DRIVER = embedded_flash | ||
| 25 | |||
| 26 | # Enter lower-power sleep mode when on the ChibiOS idle thread | ||
| 27 | OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE | ||
| 28 | |||
| 29 | # custom matrix setup | ||
| 30 | CUSTOM_MATRIX = lite | ||
| 31 | |||
| 32 | SRC += matrix.c | ||
diff --git a/keyboards/keychron/q10/matrix.c b/keyboards/keychron/q10/matrix.c new file mode 100644 index 0000000000..5c035b0e42 --- /dev/null +++ b/keyboards/keychron/q10/matrix.c | |||
| @@ -0,0 +1,208 @@ | |||
| 1 | /* Copyright 2021 @ Keychron (https://www.keychron.com) | ||
| 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 "matrix.h" | ||
| 18 | #include "quantum.h" | ||
| 19 | |||
| 20 | // Pin connected to DS of 74HC595 | ||
| 21 | #define DATA_PIN A7 | ||
| 22 | // Pin connected to SH_CP of 74HC595 | ||
| 23 | #define CLOCK_PIN B1 | ||
| 24 | // Pin connected to ST_CP of 74HC595 | ||
| 25 | #define LATCH_PIN B0 | ||
| 26 | |||
| 27 | #ifdef MATRIX_ROW_PINS | ||
| 28 | static pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; | ||
| 29 | #endif // MATRIX_ROW_PINS | ||
| 30 | #ifdef MATRIX_COL_PINS | ||
| 31 | static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; | ||
| 32 | #endif // MATRIX_COL_PINS | ||
| 33 | |||
| 34 | #define ROWS_PER_HAND (MATRIX_ROWS) | ||
| 35 | |||
| 36 | static inline void setPinOutput_writeLow(pin_t pin) { | ||
| 37 | ATOMIC_BLOCK_FORCEON { | ||
| 38 | setPinOutput(pin); | ||
| 39 | writePinLow(pin); | ||
| 40 | } | ||
| 41 | } | ||
| 42 | |||
| 43 | static inline void setPinOutput_writeHigh(pin_t pin) { | ||
| 44 | ATOMIC_BLOCK_FORCEON { | ||
| 45 | setPinOutput(pin); | ||
| 46 | writePinHigh(pin); | ||
| 47 | } | ||
| 48 | } | ||
| 49 | |||
| 50 | static inline void setPinInputHigh_atomic(pin_t pin) { | ||
| 51 | ATOMIC_BLOCK_FORCEON { | ||
| 52 | setPinInputHigh(pin); | ||
| 53 | } | ||
| 54 | } | ||
| 55 | |||
| 56 | static inline uint8_t readMatrixPin(pin_t pin) { | ||
| 57 | if (pin != NO_PIN) { | ||
| 58 | return readPin(pin); | ||
| 59 | } else { | ||
| 60 | return 1; | ||
| 61 | } | ||
| 62 | } | ||
| 63 | |||
| 64 | static void shiftOutMultiple(uint16_t dataOut) { | ||
| 65 | for (uint8_t i = 0; i < 8; i++) { | ||
| 66 | if (dataOut & 0x1) { | ||
| 67 | setPinOutput_writeHigh(DATA_PIN); | ||
| 68 | } else { | ||
| 69 | setPinOutput_writeLow(DATA_PIN); | ||
| 70 | } | ||
| 71 | dataOut = dataOut >> 1; | ||
| 72 | setPinOutput_writeHigh(CLOCK_PIN); | ||
| 73 | setPinOutput_writeLow(CLOCK_PIN); | ||
| 74 | } | ||
| 75 | setPinOutput_writeHigh(LATCH_PIN); | ||
| 76 | setPinOutput_writeLow(LATCH_PIN); | ||
| 77 | } | ||
| 78 | |||
| 79 | static void shiftOut_single(uint8_t dataOut) { | ||
| 80 | if (dataOut & 0x1) { | ||
| 81 | setPinOutput_writeHigh(DATA_PIN); | ||
| 82 | } else { | ||
| 83 | setPinOutput_writeLow(DATA_PIN); | ||
| 84 | } | ||
| 85 | setPinOutput_writeHigh(CLOCK_PIN); | ||
| 86 | setPinOutput_writeLow(CLOCK_PIN); | ||
| 87 | setPinOutput_writeHigh(LATCH_PIN); | ||
| 88 | setPinOutput_writeLow(LATCH_PIN); | ||
| 89 | } | ||
| 90 | |||
| 91 | static bool select_col(uint8_t col) { | ||
| 92 | pin_t pin = col_pins[col]; | ||
| 93 | |||
| 94 | if (pin != NO_PIN) { | ||
| 95 | setPinOutput_writeLow(pin); | ||
| 96 | return true; | ||
| 97 | } else { | ||
| 98 | if (col == (MATRIX_COLS - 8)) { | ||
| 99 | shiftOut_single(0x00); | ||
| 100 | } else { | ||
| 101 | shiftOut_single(0x01); | ||
| 102 | } | ||
| 103 | return true; | ||
| 104 | } | ||
| 105 | return false; | ||
| 106 | } | ||
| 107 | |||
| 108 | static void unselect_col(uint8_t col) { | ||
| 109 | pin_t pin = col_pins[col]; | ||
| 110 | |||
| 111 | if (pin != NO_PIN) { | ||
| 112 | #ifdef MATRIX_UNSELECT_DRIVE_HIGH | ||
| 113 | setPinOutput_writeHigh(pin); | ||
| 114 | #else | ||
| 115 | setPinInputHigh_atomic(pin); | ||
| 116 | #endif | ||
| 117 | } else { | ||
| 118 | if (col == (MATRIX_COLS - 1)) { | ||
| 119 | setPinOutput_writeHigh(CLOCK_PIN); | ||
| 120 | setPinOutput_writeLow(CLOCK_PIN); | ||
| 121 | setPinOutput_writeHigh(LATCH_PIN); | ||
| 122 | setPinOutput_writeLow(LATCH_PIN); | ||
| 123 | } | ||
| 124 | } | ||
| 125 | } | ||
| 126 | |||
| 127 | static void unselect_cols(void) { | ||
| 128 | // unselect column pins | ||
| 129 | for (uint8_t x = 0; x < MATRIX_COLS; x++) { | ||
| 130 | pin_t pin = col_pins[x]; | ||
| 131 | if (pin != NO_PIN) { | ||
| 132 | #ifdef MATRIX_UNSELECT_DRIVE_HIGH | ||
| 133 | setPinOutput_writeHigh(pin); | ||
| 134 | #else | ||
| 135 | setPinInputHigh_atomic(pin); | ||
| 136 | #endif | ||
| 137 | } else { | ||
| 138 | if (x == (MATRIX_COLS - 1)) { | ||
| 139 | // unselect Shift Register | ||
| 140 | shiftOutMultiple(0xFF); | ||
| 141 | } | ||
| 142 | } | ||
| 143 | } | ||
| 144 | } | ||
| 145 | |||
| 146 | static void matrix_init_pins(void) { | ||
| 147 | unselect_cols(); | ||
| 148 | for (uint8_t x = 0; x < MATRIX_ROWS; x++) { | ||
| 149 | if (row_pins[x] != NO_PIN) { | ||
| 150 | setPinInputHigh_atomic(row_pins[x]); | ||
| 151 | } | ||
| 152 | } | ||
| 153 | } | ||
| 154 | |||
| 155 | static void matrix_read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col, matrix_row_t row_shifter) { | ||
| 156 | bool key_pressed = false; | ||
| 157 | |||
| 158 | // Select col | ||
| 159 | if (!select_col(current_col)) { // select col | ||
| 160 | return; // skip NO_PIN col | ||
| 161 | } | ||
| 162 | |||
| 163 | if (current_col < (MATRIX_COLS - 8)) { | ||
| 164 | matrix_output_select_delay(); | ||
| 165 | } else { | ||
| 166 | matrix_output_select_delay(); | ||
| 167 | matrix_output_select_delay(); | ||
| 168 | matrix_output_select_delay(); | ||
| 169 | matrix_output_select_delay(); | ||
| 170 | } | ||
| 171 | |||
| 172 | // For each row... | ||
| 173 | for (uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) { | ||
| 174 | // Check row pin state | ||
| 175 | if (readMatrixPin(row_pins[row_index]) == 0) { | ||
| 176 | // Pin LO, set col bit | ||
| 177 | current_matrix[row_index] |= row_shifter; | ||
| 178 | key_pressed = true; | ||
| 179 | } else { | ||
| 180 | // Pin HI, clear col bit | ||
| 181 | current_matrix[row_index] &= ~row_shifter; | ||
| 182 | } | ||
| 183 | } | ||
| 184 | |||
| 185 | // Unselect col | ||
| 186 | unselect_col(current_col); | ||
| 187 | matrix_output_unselect_delay(current_col, key_pressed); // wait for all Row signals to go HIGH | ||
| 188 | } | ||
| 189 | |||
| 190 | void matrix_init_custom(void) { | ||
| 191 | // initialize key pins | ||
| 192 | matrix_init_pins(); | ||
| 193 | } | ||
| 194 | |||
| 195 | bool matrix_scan_custom(matrix_row_t current_matrix[]) { | ||
| 196 | matrix_row_t curr_matrix[MATRIX_ROWS] = {0}; | ||
| 197 | |||
| 198 | // Set col, read rows | ||
| 199 | matrix_row_t row_shifter = MATRIX_ROW_SHIFTER; | ||
| 200 | for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++, row_shifter <<= 1) { | ||
| 201 | matrix_read_rows_on_col(curr_matrix, current_col, row_shifter); | ||
| 202 | } | ||
| 203 | |||
| 204 | bool changed = memcmp(current_matrix, curr_matrix, sizeof(curr_matrix)) != 0; | ||
| 205 | if (changed) memcpy(current_matrix, curr_matrix, sizeof(curr_matrix)); | ||
| 206 | |||
| 207 | return changed; | ||
| 208 | } | ||
diff --git a/keyboards/keychron/q10/mcuconf.h b/keyboards/keychron/q10/mcuconf.h new file mode 100644 index 0000000000..0ca8c64850 --- /dev/null +++ b/keyboards/keychron/q10/mcuconf.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | /* Copyright 2020 QMK | ||
| 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_next <mcuconf.h> | ||
| 20 | |||
| 21 | #undef STM32_I2C_USE_I2C1 | ||
| 22 | #define STM32_I2C_USE_I2C1 TRUE | ||
diff --git a/keyboards/keychron/q10/q10.c b/keyboards/keychron/q10/q10.c new file mode 100644 index 0000000000..c823e6939f --- /dev/null +++ b/keyboards/keychron/q10/q10.c | |||
| @@ -0,0 +1,87 @@ | |||
| 1 | /* Copyright 2022 @ Keychron (https://www.keychron.com) | ||
| 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 "q10.h" | ||
| 18 | |||
| 19 | const matrix_row_t matrix_mask[] = { | ||
| 20 | 0b1111111111111111, | ||
| 21 | 0b1111111111111111, | ||
| 22 | 0b1111111111111111, | ||
| 23 | 0b1111111111111111, | ||
| 24 | 0b1111111111111111, | ||
| 25 | 0b1111111111011111, | ||
| 26 | }; | ||
| 27 | |||
| 28 | #ifdef DIP_SWITCH_ENABLE | ||
| 29 | |||
| 30 | bool dip_switch_update_kb(uint8_t index, bool active) { | ||
| 31 | if (!dip_switch_update_user(index, active)) { | ||
| 32 | return false; | ||
| 33 | } | ||
| 34 | if (index == 0) { | ||
| 35 | default_layer_set(1UL << (active ? 2 : 0)); | ||
| 36 | } | ||
| 37 | return true; | ||
| 38 | } | ||
| 39 | |||
| 40 | #endif // DIP_SWITCH_ENABLE | ||
| 41 | |||
| 42 | #if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX) | ||
| 43 | |||
| 44 | bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | ||
| 45 | if (!process_record_user(keycode, record)) { | ||
| 46 | return false; | ||
| 47 | } | ||
| 48 | switch (keycode) { | ||
| 49 | # ifdef RGB_MATRIX_ENABLE | ||
| 50 | case RGB_TOG: | ||
| 51 | if (record->event.pressed) { | ||
| 52 | switch (rgb_matrix_get_flags()) { | ||
| 53 | case LED_FLAG_ALL: { | ||
| 54 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
| 55 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 56 | } break; | ||
| 57 | default: { | ||
| 58 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
| 59 | } break; | ||
| 60 | } | ||
| 61 | } | ||
| 62 | if (!rgb_matrix_is_enabled()) { | ||
| 63 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
| 64 | rgb_matrix_enable(); | ||
| 65 | } | ||
| 66 | return false; | ||
| 67 | # endif | ||
| 68 | } | ||
| 69 | return true; | ||
| 70 | } | ||
| 71 | |||
| 72 | bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) { | ||
| 73 | if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) { | ||
| 74 | return false; | ||
| 75 | } | ||
| 76 | |||
| 77 | if (host_keyboard_led_state().caps_lock) { | ||
| 78 | RGB_MATRIX_INDICATOR_SET_COLOR(CAPS_LOCK_LED_INDEX, 255, 255, 255); | ||
| 79 | } else { | ||
| 80 | if (!rgb_matrix_get_flags()) { | ||
| 81 | RGB_MATRIX_INDICATOR_SET_COLOR(CAPS_LOCK_LED_INDEX, 0, 0, 0); | ||
| 82 | } | ||
| 83 | } | ||
| 84 | return true; | ||
| 85 | } | ||
| 86 | |||
| 87 | #endif // CAPS_LOCK_LED_INDEX | ||
diff --git a/keyboards/keychron/q10/q10.h b/keyboards/keychron/q10/q10.h new file mode 100644 index 0000000000..80e747aca3 --- /dev/null +++ b/keyboards/keychron/q10/q10.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | /* Copyright 2022 @ Keychron (https://www.keychron.com) | ||
| 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 | #if defined(KEYBOARD_keychron_q10_ansi_encoder) | ||
| 22 | # include "ansi_encoder.h" | ||
| 23 | #elif defined(KEYBOARD_keychron_q10_iso_encoder) | ||
| 24 | # include "iso_encoder.h" | ||
| 25 | #endif | ||
diff --git a/keyboards/keychron/q10/readme.md b/keyboards/keychron/q10/readme.md new file mode 100644 index 0000000000..ad3c5ebf41 --- /dev/null +++ b/keyboards/keychron/q10/readme.md | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | # Keychron Q10 | ||
| 2 | |||
| 3 | A customizable 75% ergonomic keyboard. | ||
| 4 | |||
| 5 | * Keyboard Maintainer: [Keychron](https://github.com/keychron) | ||
| 6 | * Hardware Supported: Keychron Q10 | ||
| 7 | * Hardware Availability: [Keychron](https://www.keychron.com) | ||
| 8 | |||
| 9 | Make example for this keyboard (after setting up your build environment): | ||
| 10 | |||
| 11 | make keychron/q10/ansi_encoder:default | ||
| 12 | |||
| 13 | Flashing example for this keyboard: | ||
| 14 | |||
| 15 | make keychron/q10/ansi_encoder:default:flash | ||
| 16 | |||
| 17 | **Reset Key**: Hold down the key located at *K01*, which programmed as *Esc* while plugging in the keyboard. | ||
| 18 | |||
| 19 | 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). | ||
