diff options
| author | Whale Mo <ncwhale@gmail.com> | 2020-08-07 13:47:59 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-06 22:47:59 -0700 |
| commit | 871d35aa432f149b67d986b584bb31b80bd1573e (patch) | |
| tree | 138e93f02803e89640b0d2cf55939885ea4eb932 /keyboards | |
| parent | 2d8703f6cc61918aaefd3ce04a064a82ab238140 (diff) | |
| download | qmk_firmware-871d35aa432f149b67d986b584bb31b80bd1573e.tar.gz qmk_firmware-871d35aa432f149b67d986b584bb31b80bd1573e.zip | |
[Keyboard] Add Whale's Split Keyboard(ver.3) (#9859)
Co-authored-by: Joel Challis <git@zvecr.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
Diffstat (limited to 'keyboards')
| -rw-r--r-- | keyboards/whale/sk/config.h | 23 | ||||
| -rw-r--r-- | keyboards/whale/sk/keymaps/default/keymap.c | 34 | ||||
| -rw-r--r-- | keyboards/whale/sk/readme.md | 15 | ||||
| -rw-r--r-- | keyboards/whale/sk/rules.mk | 1 | ||||
| -rw-r--r-- | keyboards/whale/sk/sk.c | 1 | ||||
| -rw-r--r-- | keyboards/whale/sk/sk.h | 7 | ||||
| -rw-r--r-- | keyboards/whale/sk/v3/config.h | 53 | ||||
| -rw-r--r-- | keyboards/whale/sk/v3/info.json | 970 | ||||
| -rw-r--r-- | keyboards/whale/sk/v3/rules.mk | 25 | ||||
| -rw-r--r-- | keyboards/whale/sk/v3/v3.c | 134 | ||||
| -rw-r--r-- | keyboards/whale/sk/v3/v3.h | 65 |
11 files changed, 1328 insertions, 0 deletions
diff --git a/keyboards/whale/sk/config.h b/keyboards/whale/sk/config.h new file mode 100644 index 000000000..a3989df89 --- /dev/null +++ b/keyboards/whale/sk/config.h | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | /* Copyright 2020 Whale Mo | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | #include "config_common.h" | ||
| 20 | |||
| 21 | /* USB Device descriptor parameter */ | ||
| 22 | #define VENDOR_ID 0xFEED | ||
| 23 | #define PRODUCT_ID 0x0495 | ||
diff --git a/keyboards/whale/sk/keymaps/default/keymap.c b/keyboards/whale/sk/keymaps/default/keymap.c new file mode 100644 index 000000000..249b1955e --- /dev/null +++ b/keyboards/whale/sk/keymaps/default/keymap.c | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* Copyright 2020 Whale Mo | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | #include QMK_KEYBOARD_H | ||
| 17 | |||
| 18 | // Defines names for use in layer keycodes and the keymap | ||
| 19 | enum layer_names { | ||
| 20 | _BASE, | ||
| 21 | }; | ||
| 22 | |||
| 23 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 24 | [_BASE] = LAYOUT_all( | ||
| 25 | KC_ESC, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_HOME, KC_END, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, | ||
| 26 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_PGUP, KC_PGDOWN, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, | ||
| 27 | KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_DEL, KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, | ||
| 28 | KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LEFT, KC_RIGHT, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLSH, KC_RSHIFT, | ||
| 29 | KC_LBRACKET, KC_LALT, KC_LWIN, KC_APP, KC_HENK, KC_MENU, KC_MENU, KC_MHEN, KC_APP, KC_RWIN, KC_RALT, KC_RBRACKET, | ||
| 30 | KC_F1, KC_F2, KC_F7, KC_F8, | ||
| 31 | KC_SPC, KC_F3, KC_F4, KC_F9, KC_F10, KC_SPC, | ||
| 32 | KC_F5, KC_F6, KC_F11, KC_F12 | ||
| 33 | ), | ||
| 34 | }; | ||
diff --git a/keyboards/whale/sk/readme.md b/keyboards/whale/sk/readme.md new file mode 100644 index 000000000..ab2121a9c --- /dev/null +++ b/keyboards/whale/sk/readme.md | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | # Splite Keyboard | ||
| 2 | |||
| 3 |  | ||
| 4 | |||
| 5 | A splite keyboard (7x6x2) made by Whale Mo. | ||
| 6 | |||
| 7 | * Keyboard Maintainer: [Whale Mo](https://github.com/ncwhale) | ||
| 8 | * Hardware Supported: [Opensource Design](https://github.com/ncwhale/Keyboard_Design), Sparkfun Micro Pro | ||
| 9 | * Hardware Availability: On the way. | ||
| 10 | |||
| 11 | Make example for this keyboard (after setting up your build environment): | ||
| 12 | |||
| 13 | make whale/sk:default | ||
| 14 | |||
| 15 | See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). | ||
diff --git a/keyboards/whale/sk/rules.mk b/keyboards/whale/sk/rules.mk new file mode 100644 index 000000000..1a4ddedfa --- /dev/null +++ b/keyboards/whale/sk/rules.mk | |||
| @@ -0,0 +1 @@ | |||
| DEFAULT_FOLDER = whale/sk/v3 | |||
diff --git a/keyboards/whale/sk/sk.c b/keyboards/whale/sk/sk.c new file mode 100644 index 000000000..c151f73fb --- /dev/null +++ b/keyboards/whale/sk/sk.c | |||
| @@ -0,0 +1 @@ | |||
| #include "sk.h" | |||
diff --git a/keyboards/whale/sk/sk.h b/keyboards/whale/sk/sk.h new file mode 100644 index 000000000..d9c75f15b --- /dev/null +++ b/keyboards/whale/sk/sk.h | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include "quantum.h" | ||
| 4 | |||
| 5 | #ifdef KEYBOARD_whale_sk_v3 | ||
| 6 | #include "v3.h" | ||
| 7 | #endif | ||
diff --git a/keyboards/whale/sk/v3/config.h b/keyboards/whale/sk/v3/config.h new file mode 100644 index 000000000..8fff28ca7 --- /dev/null +++ b/keyboards/whale/sk/v3/config.h | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2020 Whale Mo | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #pragma once | ||
| 19 | |||
| 20 | #include "config_common.h" | ||
| 21 | |||
| 22 | /* USB Device descriptor parameter */ | ||
| 23 | #define DEVICE_VER 0x0003 | ||
| 24 | #define MANUFACTURER Whale Mo | ||
| 25 | #define PRODUCT Splite Keyboard v3 | ||
| 26 | |||
| 27 | /* key matrix size */ | ||
| 28 | /* Notice: HALF of row on the slave side */ | ||
| 29 | #define MATRIX_ROWS 12 | ||
| 30 | #define MATRIX_COLS 7 | ||
| 31 | |||
| 32 | /* | ||
| 33 | * Keyboard Matrix Assignments | ||
| 34 | * | ||
| 35 | * Change this to how you wired your keyboard | ||
| 36 | * COLS: AVR pins used for columns, left to right | ||
| 37 | * ROWS: AVR pins used for rows, top to bottom | ||
| 38 | * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) | ||
| 39 | * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) | ||
| 40 | * | ||
| 41 | */ | ||
| 42 | #define MATRIX_ROW_PINS { B1, B2, B3, B4, B5, B6 } | ||
| 43 | #define MATRIX_COL_PINS { D4, C6, D7, E6, F4, F5, F6 } | ||
| 44 | |||
| 45 | /* COL2ROW, ROW2COL*/ | ||
| 46 | #define DIODE_DIRECTION COL2ROW | ||
| 47 | |||
| 48 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
| 49 | #define DEBOUNCE 3 | ||
| 50 | |||
| 51 | /* disable these deprecated features by default */ | ||
| 52 | #define NO_ACTION_MACRO | ||
| 53 | #define NO_ACTION_FUNCTION | ||
diff --git a/keyboards/whale/sk/v3/info.json b/keyboards/whale/sk/v3/info.json new file mode 100644 index 000000000..b03534650 --- /dev/null +++ b/keyboards/whale/sk/v3/info.json | |||
| @@ -0,0 +1,970 @@ | |||
| 1 | { | ||
| 2 | "keyboard_name": "Splite Keyboard v3", | ||
| 3 | "url": "https://github.com/ncwhale/Keyboard_Design/tree/master/Splite-Keyboard-v3", | ||
| 4 | "maintainer": "ncwhale", | ||
| 5 | "width": 20, | ||
| 6 | "height": 8, | ||
| 7 | "key_count": 84, | ||
| 8 | "layouts": { | ||
| 9 | "LAYOUT_all": { | ||
| 10 | "layout": [ | ||
| 11 | { | ||
| 12 | "label": "Esc", | ||
| 13 | "x": 0.25, | ||
| 14 | "y": 0 | ||
| 15 | }, | ||
| 16 | { | ||
| 17 | "label": "~", | ||
| 18 | "x": 1.25, | ||
| 19 | "y": 0 | ||
| 20 | }, | ||
| 21 | { | ||
| 22 | "label": "1", | ||
| 23 | "x": 2.25, | ||
| 24 | "y": 0 | ||
| 25 | }, | ||
| 26 | { | ||
| 27 | "label": "2", | ||
| 28 | "x": 3.25, | ||
| 29 | "y": 0 | ||
| 30 | }, | ||
| 31 | { | ||
| 32 | "label": "3", | ||
| 33 | "x": 4.25, | ||
| 34 | "y": 0 | ||
| 35 | }, | ||
| 36 | { | ||
| 37 | "label": "4", | ||
| 38 | "x": 5.25, | ||
| 39 | "y": 0 | ||
| 40 | }, | ||
| 41 | { | ||
| 42 | "label": "5", | ||
| 43 | "x": 6.25, | ||
| 44 | "y": 0 | ||
| 45 | }, | ||
| 46 | { | ||
| 47 | "label": "Home", | ||
| 48 | "x": 7.25, | ||
| 49 | "y": 0, | ||
| 50 | "w": 1.25 | ||
| 51 | }, | ||
| 52 | { | ||
| 53 | "label": "End", | ||
| 54 | "x": 11.5, | ||
| 55 | "y": 0, | ||
| 56 | "w": 1.25 | ||
| 57 | }, | ||
| 58 | { | ||
| 59 | "label": "6", | ||
| 60 | "x": 12.75, | ||
| 61 | "y": 0 | ||
| 62 | }, | ||
| 63 | { | ||
| 64 | "label": "7", | ||
| 65 | "x": 13.75, | ||
| 66 | "y": 0 | ||
| 67 | }, | ||
| 68 | { | ||
| 69 | "label": "8", | ||
| 70 | "x": 14.75, | ||
| 71 | "y": 0 | ||
| 72 | }, | ||
| 73 | { | ||
| 74 | "label": "9", | ||
| 75 | "x": 15.75, | ||
| 76 | "y": 0 | ||
| 77 | }, | ||
| 78 | { | ||
| 79 | "label": "0", | ||
| 80 | "x": 16.75, | ||
| 81 | "y": 0 | ||
| 82 | }, | ||
| 83 | { | ||
| 84 | "label": "-", | ||
| 85 | "x": 17.75, | ||
| 86 | "y": 0 | ||
| 87 | }, | ||
| 88 | { | ||
| 89 | "label": "=", | ||
| 90 | "x": 18.75, | ||
| 91 | "y": 0 | ||
| 92 | }, | ||
| 93 | { | ||
| 94 | "label": "Tab", | ||
| 95 | "x": 0.5, | ||
| 96 | "y": 1, | ||
| 97 | "w": 1.5 | ||
| 98 | }, | ||
| 99 | { | ||
| 100 | "label": "Q", | ||
| 101 | "x": 2, | ||
| 102 | "y": 1 | ||
| 103 | }, | ||
| 104 | { | ||
| 105 | "label": "W", | ||
| 106 | "x": 3, | ||
| 107 | "y": 1 | ||
| 108 | }, | ||
| 109 | { | ||
| 110 | "label": "E", | ||
| 111 | "x": 4, | ||
| 112 | "y": 1 | ||
| 113 | }, | ||
| 114 | { | ||
| 115 | "label": "R", | ||
| 116 | "x": 5, | ||
| 117 | "y": 1 | ||
| 118 | }, | ||
| 119 | { | ||
| 120 | "label": "T", | ||
| 121 | "x": 6, | ||
| 122 | "y": 1 | ||
| 123 | }, | ||
| 124 | { | ||
| 125 | "label": "PgUp", | ||
| 126 | "x": 7, | ||
| 127 | "y": 1, | ||
| 128 | "w": 1.5 | ||
| 129 | }, | ||
| 130 | { | ||
| 131 | "label": "PgDn", | ||
| 132 | "x": 11.5, | ||
| 133 | "y": 1, | ||
| 134 | "w": 1.5 | ||
| 135 | }, | ||
| 136 | { | ||
| 137 | "label": "Y", | ||
| 138 | "x": 13, | ||
| 139 | "y": 1 | ||
| 140 | }, | ||
| 141 | { | ||
| 142 | "label": "U", | ||
| 143 | "x": 14, | ||
| 144 | "y": 1 | ||
| 145 | }, | ||
| 146 | { | ||
| 147 | "label": "I", | ||
| 148 | "x": 15, | ||
| 149 | "y": 1 | ||
| 150 | }, | ||
| 151 | { | ||
| 152 | "label": "O", | ||
| 153 | "x": 16, | ||
| 154 | "y": 1 | ||
| 155 | }, | ||
| 156 | { | ||
| 157 | "label": "P", | ||
| 158 | "x": 17, | ||
| 159 | "y": 1 | ||
| 160 | }, | ||
| 161 | { | ||
| 162 | "label": "\\", | ||
| 163 | "x": 18, | ||
| 164 | "y": 1, | ||
| 165 | "w": 1.5 | ||
| 166 | }, | ||
| 167 | { | ||
| 168 | "label": "Control", | ||
| 169 | "x": 0.25, | ||
| 170 | "y": 2, | ||
| 171 | "w": 1.5 | ||
| 172 | }, | ||
| 173 | { | ||
| 174 | "label": "A", | ||
| 175 | "x": 1.75, | ||
| 176 | "y": 2 | ||
| 177 | }, | ||
| 178 | { | ||
| 179 | "label": "S", | ||
| 180 | "x": 2.75, | ||
| 181 | "y": 2 | ||
| 182 | }, | ||
| 183 | { | ||
| 184 | "label": "D", | ||
| 185 | "x": 3.75, | ||
| 186 | "y": 2 | ||
| 187 | }, | ||
| 188 | { | ||
| 189 | "label": "F", | ||
| 190 | "x": 4.75, | ||
| 191 | "y": 2 | ||
| 192 | }, | ||
| 193 | { | ||
| 194 | "label": "G", | ||
| 195 | "x": 5.75, | ||
| 196 | "y": 2 | ||
| 197 | }, | ||
| 198 | { | ||
| 199 | "label": "Del", | ||
| 200 | "x": 6.75, | ||
| 201 | "y": 2, | ||
| 202 | "w": 1.5 | ||
| 203 | }, | ||
| 204 | { | ||
| 205 | "label": "BS", | ||
| 206 | "x": 11.75, | ||
| 207 | "y": 2, | ||
| 208 | "w": 1.5 | ||
| 209 | }, | ||
| 210 | { | ||
| 211 | "label": "H", | ||
| 212 | "x": 13.25, | ||
| 213 | "y": 2 | ||
| 214 | }, | ||
| 215 | { | ||
| 216 | "label": "J", | ||
| 217 | "x": 14.25, | ||
| 218 | "y": 2 | ||
| 219 | }, | ||
| 220 | { | ||
| 221 | "label": "K", | ||
| 222 | "x": 15.25, | ||
| 223 | "y": 2 | ||
| 224 | }, | ||
| 225 | { | ||
| 226 | "label": "L", | ||
| 227 | "x": 16.25, | ||
| 228 | "y": 2 | ||
| 229 | }, | ||
| 230 | { | ||
| 231 | "label": ";", | ||
| 232 | "x": 17.25, | ||
| 233 | "y": 2 | ||
| 234 | }, | ||
| 235 | { | ||
| 236 | "label": "Enter", | ||
| 237 | "x": 18.25, | ||
| 238 | "y": 2, | ||
| 239 | "w": 1.5 | ||
| 240 | }, | ||
| 241 | { | ||
| 242 | "label": "Shift", | ||
| 243 | "x": 0, | ||
| 244 | "y": 3, | ||
| 245 | "w": 1.5 | ||
| 246 | }, | ||
| 247 | { | ||
| 248 | "label": "Z", | ||
| 249 | "x": 1.5, | ||
| 250 | "y": 3 | ||
| 251 | }, | ||
| 252 | { | ||
| 253 | "label": "X", | ||
| 254 | "x": 2.5, | ||
| 255 | "y": 3 | ||
| 256 | }, | ||
| 257 | { | ||
| 258 | "label": "C", | ||
| 259 | "x": 3.5, | ||
| 260 | "y": 3 | ||
| 261 | }, | ||
| 262 | { | ||
| 263 | "label": "V", | ||
| 264 | "x": 4.5, | ||
| 265 | "y": 3 | ||
| 266 | }, | ||
| 267 | { | ||
| 268 | "label": "B", | ||
| 269 | "x": 5.5, | ||
| 270 | "y": 3 | ||
| 271 | }, | ||
| 272 | { | ||
| 273 | "label": "Fn", | ||
| 274 | "x": 6.5, | ||
| 275 | "y": 3 | ||
| 276 | }, | ||
| 277 | { | ||
| 278 | "label": "Fn", | ||
| 279 | "x": 12.5, | ||
| 280 | "y": 3 | ||
| 281 | }, | ||
| 282 | { | ||
| 283 | "label": "N", | ||
| 284 | "x": 13.5, | ||
| 285 | "y": 3 | ||
| 286 | }, | ||
| 287 | { | ||
| 288 | "label": "M", | ||
| 289 | "x": 14.5, | ||
| 290 | "y": 3 | ||
| 291 | }, | ||
| 292 | { | ||
| 293 | "label": ",", | ||
| 294 | "x": 15.5, | ||
| 295 | "y": 3 | ||
| 296 | }, | ||
| 297 | { | ||
| 298 | "label": ".", | ||
| 299 | "x": 16.5, | ||
| 300 | "y": 3 | ||
| 301 | }, | ||
| 302 | { | ||
| 303 | "label": "/", | ||
| 304 | "x": 17.5, | ||
| 305 | "y": 3 | ||
| 306 | }, | ||
| 307 | { | ||
| 308 | "label": "Shift", | ||
| 309 | "x": 18.5, | ||
| 310 | "y": 3, | ||
| 311 | "w": 1.5 | ||
| 312 | }, | ||
| 313 | { | ||
| 314 | "label": "Fn", | ||
| 315 | "x": 0, | ||
| 316 | "y": 4 | ||
| 317 | }, | ||
| 318 | { | ||
| 319 | "label": "Alt", | ||
| 320 | "x": 1, | ||
| 321 | "y": 4 | ||
| 322 | }, | ||
| 323 | { | ||
| 324 | "label": "Meta", | ||
| 325 | "x": 2, | ||
| 326 | "y": 4 | ||
| 327 | }, | ||
| 328 | { | ||
| 329 | "label": "TF", | ||
| 330 | "x": 3, | ||
| 331 | "y": 4 | ||
| 332 | }, | ||
| 333 | { | ||
| 334 | "label": "QB", | ||
| 335 | "x": 4, | ||
| 336 | "y": 4 | ||
| 337 | }, | ||
| 338 | { | ||
| 339 | "label": "Menu", | ||
| 340 | "x": 5, | ||
| 341 | "y": 4 | ||
| 342 | }, | ||
| 343 | { | ||
| 344 | "label": "Menu", | ||
| 345 | "x": 14, | ||
| 346 | "y": 4 | ||
| 347 | }, | ||
| 348 | { | ||
| 349 | "label": "QB", | ||
| 350 | "x": 15, | ||
| 351 | "y": 4 | ||
| 352 | }, | ||
| 353 | { | ||
| 354 | "label": "TF", | ||
| 355 | "x": 16, | ||
| 356 | "y": 4 | ||
| 357 | }, | ||
| 358 | { | ||
| 359 | "label": "Meta", | ||
| 360 | "x": 17, | ||
| 361 | "y": 4 | ||
| 362 | }, | ||
| 363 | { | ||
| 364 | "label": "Alt", | ||
| 365 | "x": 18, | ||
| 366 | "y": 4 | ||
| 367 | }, | ||
| 368 | { | ||
| 369 | "label": "Fn", | ||
| 370 | "x": 19, | ||
| 371 | "y": 4 | ||
| 372 | }, | ||
| 373 | { | ||
| 374 | "label": "F1", | ||
| 375 | "x": 7.5, | ||
| 376 | "y": 4, | ||
| 377 | "r": 30, | ||
| 378 | "rx": 7, | ||
| 379 | "ry": 3.5 | ||
| 380 | }, | ||
| 381 | { | ||
| 382 | "label": "F2", | ||
| 383 | "x": 8.5, | ||
| 384 | "y": 4, | ||
| 385 | "r": 30, | ||
| 386 | "rx": 7, | ||
| 387 | "ry": 3.5 | ||
| 388 | }, | ||
| 389 | { | ||
| 390 | "x": 6.5, | ||
| 391 | "y": 5, | ||
| 392 | "h": 2, | ||
| 393 | "r": 30, | ||
| 394 | "rx": 7, | ||
| 395 | "ry": 3.5 | ||
| 396 | }, | ||
| 397 | { | ||
| 398 | "label": "F3", | ||
| 399 | "x": 7.5, | ||
| 400 | "y": 5, | ||
| 401 | "r": 30, | ||
| 402 | "rx": 7, | ||
| 403 | "ry": 3.5 | ||
| 404 | }, | ||
| 405 | { | ||
| 406 | "label": "F4", | ||
| 407 | "x": 8.5, | ||
| 408 | "y": 5, | ||
| 409 | "r": 30, | ||
| 410 | "rx": 7, | ||
| 411 | "ry": 3.5 | ||
| 412 | }, | ||
| 413 | { | ||
| 414 | "label": "F5", | ||
| 415 | "x": 7.5, | ||
| 416 | "y": 6, | ||
| 417 | "r": 30, | ||
| 418 | "rx": 7, | ||
| 419 | "ry": 3.5 | ||
| 420 | }, | ||
| 421 | { | ||
| 422 | "label": "F6", | ||
| 423 | "x": 8.5, | ||
| 424 | "y": 6, | ||
| 425 | "r": 30, | ||
| 426 | "rx": 7, | ||
| 427 | "ry": 3.5 | ||
| 428 | }, | ||
| 429 | { | ||
| 430 | "label": "F7", | ||
| 431 | "x": 10.5, | ||
| 432 | "y": 4, | ||
| 433 | "r": -30, | ||
| 434 | "rx": 13, | ||
| 435 | "ry": 3.5 | ||
| 436 | }, | ||
| 437 | { | ||
| 438 | "label": "F8", | ||
| 439 | "x": 11.5, | ||
| 440 | "y": 4, | ||
| 441 | "r": -30, | ||
| 442 | "rx": 13, | ||
| 443 | "ry": 3.5 | ||
| 444 | }, | ||
| 445 | { | ||
| 446 | "label": "F9", | ||
| 447 | "x": 10.5, | ||
| 448 | "y": 5, | ||
| 449 | "r": -30, | ||
| 450 | "rx": 13, | ||
| 451 | "ry": 3.5 | ||
| 452 | }, | ||
| 453 | { | ||
| 454 | "label": "F10", | ||
| 455 | "x": 11.5, | ||
| 456 | "y": 5, | ||
| 457 | "r": -30, | ||
| 458 | "rx": 13, | ||
| 459 | "ry": 3.5 | ||
| 460 | }, | ||
| 461 | { | ||
| 462 | "x": 12.5, | ||
| 463 | "y": 5, | ||
| 464 | "h": 2, | ||
| 465 | "r": -30, | ||
| 466 | "rx": 13, | ||
| 467 | "ry": 3.5 | ||
| 468 | }, | ||
| 469 | { | ||
| 470 | "label": "F11", | ||
| 471 | "x": 10.5, | ||
| 472 | "y": 6, | ||
| 473 | "r": -30, | ||
| 474 | "rx": 13, | ||
| 475 | "ry": 3.5 | ||
| 476 | }, | ||
| 477 | { | ||
| 478 | "label": "F12", | ||
| 479 | "x": 11.5, | ||
| 480 | "y": 6, | ||
| 481 | "r": -30, | ||
| 482 | "rx": 13, | ||
| 483 | "ry": 3.5 | ||
| 484 | } | ||
| 485 | ] | ||
| 486 | }, | ||
| 487 | "LAYOUT_left_half_only": { | ||
| 488 | "layout": [ | ||
| 489 | { | ||
| 490 | "label": "Esc", | ||
| 491 | "x": 0.25, | ||
| 492 | "y": 0 | ||
| 493 | }, | ||
| 494 | { | ||
| 495 | "label": "~", | ||
| 496 | "x": 1.25, | ||
| 497 | "y": 0 | ||
| 498 | }, | ||
| 499 | { | ||
| 500 | "label": "1", | ||
| 501 | "x": 2.25, | ||
| 502 | "y": 0 | ||
| 503 | }, | ||
| 504 | { | ||
| 505 | "label": "2", | ||
| 506 | "x": 3.25, | ||
| 507 | "y": 0 | ||
| 508 | }, | ||
| 509 | { | ||
| 510 | "label": "3", | ||
| 511 | "x": 4.25, | ||
| 512 | "y": 0 | ||
| 513 | }, | ||
| 514 | { | ||
| 515 | "label": "4", | ||
| 516 | "x": 5.25, | ||
| 517 | "y": 0 | ||
| 518 | }, | ||
| 519 | { | ||
| 520 | "label": "5", | ||
| 521 | "x": 6.25, | ||
| 522 | "y": 0 | ||
| 523 | }, | ||
| 524 | { | ||
| 525 | "label": "Home", | ||
| 526 | "x": 7.25, | ||
| 527 | "y": 0, | ||
| 528 | "w": 1.25 | ||
| 529 | }, | ||
| 530 | { | ||
| 531 | "label": "Tab", | ||
| 532 | "x": 0.5, | ||
| 533 | "y": 1, | ||
| 534 | "w": 1.5 | ||
| 535 | }, | ||
| 536 | { | ||
| 537 | "label": "Q", | ||
| 538 | "x": 2, | ||
| 539 | "y": 1 | ||
| 540 | }, | ||
| 541 | { | ||
| 542 | "label": "W", | ||
| 543 | "x": 3, | ||
| 544 | "y": 1 | ||
| 545 | }, | ||
| 546 | { | ||
| 547 | "label": "E", | ||
| 548 | "x": 4, | ||
| 549 | "y": 1 | ||
| 550 | }, | ||
| 551 | { | ||
| 552 | "label": "R", | ||
| 553 | "x": 5, | ||
| 554 | "y": 1 | ||
| 555 | }, | ||
| 556 | { | ||
| 557 | "label": "T", | ||
| 558 | "x": 6, | ||
| 559 | "y": 1 | ||
| 560 | }, | ||
| 561 | { | ||
| 562 | "label": "PgUp", | ||
| 563 | "x": 7, | ||
| 564 | "y": 1, | ||
| 565 | "w": 1.5 | ||
| 566 | }, | ||
| 567 | { | ||
| 568 | "label": "Control", | ||
| 569 | "x": 0.25, | ||
| 570 | "y": 2, | ||
| 571 | "w": 1.5 | ||
| 572 | }, | ||
| 573 | { | ||
| 574 | "label": "A", | ||
| 575 | "x": 1.75, | ||
| 576 | "y": 2 | ||
| 577 | }, | ||
| 578 | { | ||
| 579 | "label": "S", | ||
| 580 | "x": 2.75, | ||
| 581 | "y": 2 | ||
| 582 | }, | ||
| 583 | { | ||
| 584 | "label": "D", | ||
| 585 | "x": 3.75, | ||
| 586 | "y": 2 | ||
| 587 | }, | ||
| 588 | { | ||
| 589 | "label": "F", | ||
| 590 | "x": 4.75, | ||
| 591 | "y": 2 | ||
| 592 | }, | ||
| 593 | { | ||
| 594 | "label": "G", | ||
| 595 | "x": 5.75, | ||
| 596 | "y": 2 | ||
| 597 | }, | ||
| 598 | { | ||
| 599 | "label": "Del", | ||
| 600 | "x": 6.75, | ||
| 601 | "y": 2, | ||
| 602 | "w": 1.5 | ||
| 603 | }, | ||
| 604 | { | ||
| 605 | "label": "Shift", | ||
| 606 | "x": 0, | ||
| 607 | "y": 3, | ||
| 608 | "w": 1.5 | ||
| 609 | }, | ||
| 610 | { | ||
| 611 | "label": "Z", | ||
| 612 | "x": 1.5, | ||
| 613 | "y": 3 | ||
| 614 | }, | ||
| 615 | { | ||
| 616 | "label": "X", | ||
| 617 | "x": 2.5, | ||
| 618 | "y": 3 | ||
| 619 | }, | ||
| 620 | { | ||
| 621 | "label": "C", | ||
| 622 | "x": 3.5, | ||
| 623 | "y": 3 | ||
| 624 | }, | ||
| 625 | { | ||
| 626 | "label": "V", | ||
| 627 | "x": 4.5, | ||
| 628 | "y": 3 | ||
| 629 | }, | ||
| 630 | { | ||
| 631 | "label": "B", | ||
| 632 | "x": 5.5, | ||
| 633 | "y": 3 | ||
| 634 | }, | ||
| 635 | { | ||
| 636 | "label": "Fn", | ||
| 637 | "x": 6.5, | ||
| 638 | "y": 3 | ||
| 639 | }, | ||
| 640 | { | ||
| 641 | "label": "Fn", | ||
| 642 | "x": 0, | ||
| 643 | "y": 4 | ||
| 644 | }, | ||
| 645 | { | ||
| 646 | "label": "Alt", | ||
| 647 | "x": 1, | ||
| 648 | "y": 4 | ||
| 649 | }, | ||
| 650 | { | ||
| 651 | "label": "Meta", | ||
| 652 | "x": 2, | ||
| 653 | "y": 4 | ||
| 654 | }, | ||
| 655 | { | ||
| 656 | "label": "TF", | ||
| 657 | "x": 3, | ||
| 658 | "y": 4 | ||
| 659 | }, | ||
| 660 | { | ||
| 661 | "label": "QB", | ||
| 662 | "x": 4, | ||
| 663 | "y": 4 | ||
| 664 | }, | ||
| 665 | { | ||
| 666 | "label": "Menu", | ||
| 667 | "x": 5, | ||
| 668 | "y": 4 | ||
| 669 | }, | ||
| 670 | { | ||
| 671 | "label": "F1", | ||
| 672 | "x": 7.5, | ||
| 673 | "y": 4, | ||
| 674 | "r": 30, | ||
| 675 | "rx": 7, | ||
| 676 | "ry": 3.5 | ||
| 677 | }, | ||
| 678 | { | ||
| 679 | "label": "F2", | ||
| 680 | "x": 8.5, | ||
| 681 | "y": 4, | ||
| 682 | "r": 30, | ||
| 683 | "rx": 7, | ||
| 684 | "ry": 3.5 | ||
| 685 | }, | ||
| 686 | { | ||
| 687 | "x": 6.5, | ||
| 688 | "y": 5, | ||
| 689 | "h": 2, | ||
| 690 | "r": 30, | ||
| 691 | "rx": 7, | ||
| 692 | "ry": 3.5 | ||
| 693 | }, | ||
| 694 | { | ||
| 695 | "label": "F3", | ||
| 696 | "x": 7.5, | ||
| 697 | "y": 5, | ||
| 698 | "r": 30, | ||
| 699 | "rx": 7, | ||
| 700 | "ry": 3.5 | ||
| 701 | }, | ||
| 702 | { | ||
| 703 | "label": "F4", | ||
| 704 | "x": 8.5, | ||
| 705 | "y": 5, | ||
| 706 | "r": 30, | ||
| 707 | "rx": 7, | ||
| 708 | "ry": 3.5 | ||
| 709 | }, | ||
| 710 | { | ||
| 711 | "label": "F5", | ||
| 712 | "x": 7.5, | ||
| 713 | "y": 6, | ||
| 714 | "r": 30, | ||
| 715 | "rx": 7, | ||
| 716 | "ry": 3.5 | ||
| 717 | }, | ||
| 718 | { | ||
| 719 | "label": "F6", | ||
| 720 | "x": 8.5, | ||
| 721 | "y": 6, | ||
| 722 | "r": 30, | ||
| 723 | "rx": 7, | ||
| 724 | "ry": 3.5 | ||
| 725 | } | ||
| 726 | ] | ||
| 727 | }, | ||
| 728 | "LAYOUT_right_half_only": { | ||
| 729 | "layout": [ | ||
| 730 | { | ||
| 731 | "label": "End", | ||
| 732 | "x": 11.5, | ||
| 733 | "y": 0, | ||
| 734 | "w": 1.25 | ||
| 735 | }, | ||
| 736 | { | ||
| 737 | "label": "6", | ||
| 738 | "x": 12.75, | ||
| 739 | "y": 0 | ||
| 740 | }, | ||
| 741 | { | ||
| 742 | "label": "7", | ||
| 743 | "x": 13.75, | ||
| 744 | "y": 0 | ||
| 745 | }, | ||
| 746 | { | ||
| 747 | "label": "8", | ||
| 748 | "x": 14.75, | ||
| 749 | "y": 0 | ||
| 750 | }, | ||
| 751 | { | ||
| 752 | "label": "9", | ||
| 753 | "x": 15.75, | ||
| 754 | "y": 0 | ||
| 755 | }, | ||
| 756 | { | ||
| 757 | "label": "0", | ||
| 758 | "x": 16.75, | ||
| 759 | "y": 0 | ||
| 760 | }, | ||
| 761 | { | ||
| 762 | "label": "-", | ||
| 763 | "x": 17.75, | ||
| 764 | "y": 0 | ||
| 765 | }, | ||
| 766 | { | ||
| 767 | "label": "=", | ||
| 768 | "x": 18.75, | ||
| 769 | "y": 0 | ||
| 770 | }, | ||
| 771 | { | ||
| 772 | "label": "PgDn", | ||
| 773 | "x": 11.5, | ||
| 774 | "y": 1, | ||
| 775 | "w": 1.5 | ||
| 776 | }, | ||
| 777 | { | ||
| 778 | "label": "Y", | ||
| 779 | "x": 13, | ||
| 780 | "y": 1 | ||
| 781 | }, | ||
| 782 | { | ||
| 783 | "label": "U", | ||
| 784 | "x": 14, | ||
| 785 | "y": 1 | ||
| 786 | }, | ||
| 787 | { | ||
| 788 | "label": "I", | ||
| 789 | "x": 15, | ||
| 790 | "y": 1 | ||
| 791 | }, | ||
| 792 | { | ||
| 793 | "label": "O", | ||
| 794 | "x": 16, | ||
| 795 | "y": 1 | ||
| 796 | }, | ||
| 797 | { | ||
| 798 | "label": "P", | ||
| 799 | "x": 17, | ||
| 800 | "y": 1 | ||
| 801 | }, | ||
| 802 | { | ||
| 803 | "label": "\\", | ||
| 804 | "x": 18, | ||
| 805 | "y": 1, | ||
| 806 | "w": 1.5 | ||
| 807 | }, | ||
| 808 | { | ||
| 809 | "label": "BS", | ||
| 810 | "x": 11.75, | ||
| 811 | "y": 2, | ||
| 812 | "w": 1.5 | ||
| 813 | }, | ||
| 814 | { | ||
| 815 | "label": "H", | ||
| 816 | "x": 13.25, | ||
| 817 | "y": 2 | ||
| 818 | }, | ||
| 819 | { | ||
| 820 | "label": "J", | ||
| 821 | "x": 14.25, | ||
| 822 | "y": 2 | ||
| 823 | }, | ||
| 824 | { | ||
| 825 | "label": "K", | ||
| 826 | "x": 15.25, | ||
| 827 | "y": 2 | ||
| 828 | }, | ||
| 829 | { | ||
| 830 | "label": "L", | ||
| 831 | "x": 16.25, | ||
| 832 | "y": 2 | ||
| 833 | }, | ||
| 834 | { | ||
| 835 | "label": ";", | ||
| 836 | "x": 17.25, | ||
| 837 | "y": 2 | ||
| 838 | }, | ||
| 839 | { | ||
| 840 | "label": "Enter", | ||
| 841 | "x": 18.25, | ||
| 842 | "y": 2, | ||
| 843 | "w": 1.5 | ||
| 844 | }, | ||
| 845 | { | ||
| 846 | "label": "Fn", | ||
| 847 | "x": 12.5, | ||
| 848 | "y": 3 | ||
| 849 | }, | ||
| 850 | { | ||
| 851 | "label": "N", | ||
| 852 | "x": 13.5, | ||
| 853 | "y": 3 | ||
| 854 | }, | ||
| 855 | { | ||
| 856 | "label": "M", | ||
| 857 | "x": 14.5, | ||
| 858 | "y": 3 | ||
| 859 | }, | ||
| 860 | { | ||
| 861 | "label": ",", | ||
| 862 | "x": 15.5, | ||
| 863 | "y": 3 | ||
| 864 | }, | ||
| 865 | { | ||
| 866 | "label": ".", | ||
| 867 | "x": 16.5, | ||
| 868 | "y": 3 | ||
| 869 | }, | ||
| 870 | { | ||
| 871 | "label": "/", | ||
| 872 | "x": 17.5, | ||
| 873 | "y": 3 | ||
| 874 | }, | ||
| 875 | { | ||
| 876 | "label": "Shift", | ||
| 877 | "x": 18.5, | ||
| 878 | "y": 3, | ||
| 879 | "w": 1.5 | ||
| 880 | }, | ||
| 881 | { | ||
| 882 | "label": "Menu", | ||
| 883 | "x": 14, | ||
| 884 | "y": 4 | ||
| 885 | }, | ||
| 886 | { | ||
| 887 | "label": "QB", | ||
| 888 | "x": 15, | ||
| 889 | "y": 4 | ||
| 890 | }, | ||
| 891 | { | ||
| 892 | "label": "TF", | ||
| 893 | "x": 16, | ||
| 894 | "y": 4 | ||
| 895 | }, | ||
| 896 | { | ||
| 897 | "label": "Meta", | ||
| 898 | "x": 17, | ||
| 899 | "y": 4 | ||
| 900 | }, | ||
| 901 | { | ||
| 902 | "label": "Alt", | ||
| 903 | "x": 18, | ||
| 904 | "y": 4 | ||
| 905 | }, | ||
| 906 | { | ||
| 907 | "label": "Fn", | ||
| 908 | "x": 19, | ||
| 909 | "y": 4 | ||
| 910 | }, | ||
| 911 | { | ||
| 912 | "label": "F7", | ||
| 913 | "x": 10.5, | ||
| 914 | "y": 4, | ||
| 915 | "r": -30, | ||
| 916 | "rx": 13, | ||
| 917 | "ry": 3.5 | ||
| 918 | }, | ||
| 919 | { | ||
| 920 | "label": "F8", | ||
| 921 | "x": 11.5, | ||
| 922 | "y": 4, | ||
| 923 | "r": -30, | ||
| 924 | "rx": 13, | ||
| 925 | "ry": 3.5 | ||
| 926 | }, | ||
| 927 | { | ||
| 928 | "label": "F9", | ||
| 929 | "x": 10.5, | ||
| 930 | "y": 5, | ||
| 931 | "r": -30, | ||
| 932 | "rx": 13, | ||
| 933 | "ry": 3.5 | ||
| 934 | }, | ||
| 935 | { | ||
| 936 | "label": "F10", | ||
| 937 | "x": 11.5, | ||
| 938 | "y": 5, | ||
| 939 | "r": -30, | ||
| 940 | "rx": 13, | ||
| 941 | "ry": 3.5 | ||
| 942 | }, | ||
| 943 | { | ||
| 944 | "x": 12.5, | ||
| 945 | "y": 5, | ||
| 946 | "h": 2, | ||
| 947 | "r": -30, | ||
| 948 | "rx": 13, | ||
| 949 | "ry": 3.5 | ||
| 950 | }, | ||
| 951 | { | ||
| 952 | "label": "F11", | ||
| 953 | "x": 10.5, | ||
| 954 | "y": 6, | ||
| 955 | "r": -30, | ||
| 956 | "rx": 13, | ||
| 957 | "ry": 3.5 | ||
| 958 | }, | ||
| 959 | { | ||
| 960 | "label": "F12", | ||
| 961 | "x": 11.5, | ||
| 962 | "y": 6, | ||
| 963 | "r": -30, | ||
| 964 | "rx": 13, | ||
| 965 | "ry": 3.5 | ||
| 966 | } | ||
| 967 | ] | ||
| 968 | } | ||
| 969 | } | ||
| 970 | } | ||
diff --git a/keyboards/whale/sk/v3/rules.mk b/keyboards/whale/sk/v3/rules.mk new file mode 100644 index 000000000..cbb4c8dc5 --- /dev/null +++ b/keyboards/whale/sk/v3/rules.mk | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | # MCU name | ||
| 2 | MCU = atmega32u4 | ||
| 3 | |||
| 4 | # Bootloader selection | ||
| 5 | BOOTLOADER = caterina | ||
| 6 | |||
| 7 | # Build Options | ||
| 8 | # change yes to no to disable | ||
| 9 | # | ||
| 10 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration | ||
| 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 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
| 16 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
| 17 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 18 | NKRO_ENABLE = no # USB Nkey Rollover | ||
| 19 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
| 20 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow | ||
| 21 | BLUETOOTH_ENABLE = no # Enable Bluetooth | ||
| 22 | AUDIO_ENABLE = no # Audio output | ||
| 23 | |||
| 24 | SPLIT_KEYBOARD = yes | ||
| 25 | SPLIT_TRANSPORT = custom | ||
diff --git a/keyboards/whale/sk/v3/v3.c b/keyboards/whale/sk/v3/v3.c new file mode 100644 index 000000000..30ffc4dcc --- /dev/null +++ b/keyboards/whale/sk/v3/v3.c | |||
| @@ -0,0 +1,134 @@ | |||
| 1 | #include "v3.h" | ||
| 2 | |||
| 3 | #if defined(__AVR__) | ||
| 4 | # include <avr/io.h> | ||
| 5 | # include <avr/interrupt.h> | ||
| 6 | #endif | ||
| 7 | |||
| 8 | #define ROWS_PER_HAND (MATRIX_ROWS / 2) | ||
| 9 | #define SLAVE_MATRIX_SYNC_ADDR (0x01) | ||
| 10 | |||
| 11 | typedef struct { | ||
| 12 | char* buffer; | ||
| 13 | size_t count; | ||
| 14 | bool* flag; | ||
| 15 | } transmit_status; | ||
| 16 | |||
| 17 | transmit_status irx = {}, itx = {}; | ||
| 18 | |||
| 19 | // Buffer for master/slave matrix scan transmit. | ||
| 20 | // Master: receive buffer. | ||
| 21 | // Slave: transmit buffer. | ||
| 22 | matrix_row_t sync_matrix[ROWS_PER_HAND]; | ||
| 23 | bool matrix_synced = false; | ||
| 24 | |||
| 25 | void USART_init(uint16_t baud) { | ||
| 26 | cli(); | ||
| 27 | |||
| 28 | // UBRR1H = (unsigned char)(baud >>8); | ||
| 29 | // UBRR1L = (unsigned char)(baud); | ||
| 30 | UBRR1 = baud; | ||
| 31 | // Enable U2X1 for double speed. | ||
| 32 | UCSR1A = (1 << U2X1); | ||
| 33 | // Enable RX/TX, 9N1 mode | ||
| 34 | UCSR1B = (1 << RXEN1) | (1 << TXEN1) | (1 << RXCIE1) | (1 << TXCIE1) | (1 << UCSZ12); | ||
| 35 | UCSR1C = (1 << UCSZ10) | (1 << UCSZ11); | ||
| 36 | sei(); | ||
| 37 | } | ||
| 38 | |||
| 39 | ISR(USART1_RX_vect) { | ||
| 40 | // read data from reg. | ||
| 41 | uint8_t status = UCSR1A; | ||
| 42 | uint8_t high_bit = UCSR1B; | ||
| 43 | uint8_t low_data = UDR1; | ||
| 44 | if (status & ((1 << FE1) | (1 << DOR1) | (1 << UPE1))) { | ||
| 45 | // Something error happen, ignore this package. | ||
| 46 | irx.count = 0; | ||
| 47 | return; | ||
| 48 | } | ||
| 49 | |||
| 50 | // Is it a addr? (9th bit is one/zero?) | ||
| 51 | if (high_bit & (1 << RXB81)) { | ||
| 52 | // data is addr. prepend for receive. | ||
| 53 | switch (low_data) { | ||
| 54 | case SLAVE_MATRIX_SYNC_ADDR: | ||
| 55 | irx.buffer = (char *)sync_matrix; | ||
| 56 | irx.count = sizeof(sync_matrix) * sizeof(matrix_row_t); | ||
| 57 | irx.flag = &matrix_synced; | ||
| 58 | break; | ||
| 59 | |||
| 60 | default: | ||
| 61 | // ignore this package. | ||
| 62 | irx.count = 0; | ||
| 63 | break; | ||
| 64 | } | ||
| 65 | |||
| 66 | } else if (irx.count > 0) { | ||
| 67 | *irx.buffer = low_data; | ||
| 68 | ++irx.buffer; | ||
| 69 | if (--irx.count == 0 && irx.flag != NULL) { | ||
| 70 | *irx.flag = true; | ||
| 71 | } | ||
| 72 | } | ||
| 73 | } | ||
| 74 | |||
| 75 | // TX complete | ||
| 76 | ISR(USART1_TX_vect) { | ||
| 77 | // Is in transmit? | ||
| 78 | if (itx.count > 0) { | ||
| 79 | // Send data. | ||
| 80 | UCSR1B &= ~(1 << TXB81); | ||
| 81 | UDR1 = *itx.buffer; | ||
| 82 | |||
| 83 | // Move to next char. | ||
| 84 | ++itx.buffer; | ||
| 85 | if (--itx.count == 0) { | ||
| 86 | *itx.flag = true; | ||
| 87 | } | ||
| 88 | } | ||
| 89 | // TODO: read queue/register for next message. | ||
| 90 | } | ||
| 91 | |||
| 92 | // return: queue depth. | ||
| 93 | int send_packet(uint8_t addr, char* buffer, size_t length, bool* flag) { | ||
| 94 | // See if we can start transmit right now. | ||
| 95 | if ((itx.count == 0) && (UCSR1A & (1 << UDRE1))) { | ||
| 96 | // Ready to write. | ||
| 97 | // Prepend registers. | ||
| 98 | itx.buffer = buffer; | ||
| 99 | itx.count = length; | ||
| 100 | itx.flag = flag; | ||
| 101 | |||
| 102 | // Write addr to kick start transmit. | ||
| 103 | UCSR1B |= (1 << TXB81); | ||
| 104 | UDR1 = addr; | ||
| 105 | // TODO: put request in queue; | ||
| 106 | // }else{ | ||
| 107 | } | ||
| 108 | |||
| 109 | return 0; | ||
| 110 | } | ||
| 111 | |||
| 112 | void transport_master_init(void) { USART_init(0); } | ||
| 113 | |||
| 114 | void transport_slave_init(void) { USART_init(0); } | ||
| 115 | |||
| 116 | // returns false if valid data not received from slave | ||
| 117 | bool transport_master(matrix_row_t matrix[]) { | ||
| 118 | if (matrix_synced) { | ||
| 119 | for (uint8_t i = 0; i < ROWS_PER_HAND; ++i) { | ||
| 120 | matrix[i] = sync_matrix[i]; | ||
| 121 | } | ||
| 122 | matrix_synced = false; | ||
| 123 | return true; | ||
| 124 | } | ||
| 125 | return false; | ||
| 126 | } | ||
| 127 | |||
| 128 | void transport_slave(matrix_row_t matrix[]) { | ||
| 129 | for (uint8_t i = 0; i < ROWS_PER_HAND; ++i) { | ||
| 130 | sync_matrix[i] = matrix[i]; | ||
| 131 | } | ||
| 132 | matrix_synced = false; | ||
| 133 | send_packet(SLAVE_MATRIX_SYNC_ADDR, (char*)sync_matrix, sizeof(sync_matrix) * sizeof(matrix_row_t), &matrix_synced); | ||
| 134 | } | ||
diff --git a/keyboards/whale/sk/v3/v3.h b/keyboards/whale/sk/v3/v3.h new file mode 100644 index 000000000..06ebc45dc --- /dev/null +++ b/keyboards/whale/sk/v3/v3.h | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include "sk.h" | ||
| 4 | |||
| 5 | #include "quantum.h" | ||
| 6 | |||
| 7 | #define LAYOUT_all( \ | ||
| 8 | L00, L01, L02, L03, L04, L05, L06, L46, R46, R06, R05, R04, R03, R02, R01, R00, \ | ||
| 9 | L10, L11, L12, L13, L14, L15, L16, R16, R15, R14, R13, R12, R11, R10, \ | ||
| 10 | L20, L21, L22, L23, L24, L25, L26, R26, R25, R24, R23, R22, R21, R20, \ | ||
| 11 | L30, L31, L32, L33, L34, L35, L36, R36, R35, R34, R33, R32, R31, R30, \ | ||
| 12 | L40, L41, L42, L43, L44, L45, R45, R44, R43, R42, R41, R40, \ | ||
| 13 | L51, L52, R52, R51, \ | ||
| 14 | L50, L53, L54, R54, R53, R50, \ | ||
| 15 | L55, L56, R56, R55 \ | ||
| 16 | ) { \ | ||
| 17 | {L00, L01, L02, L03, L04, L05, L06, }, \ | ||
| 18 | {L10, L11, L12, L13, L14, L15, L16, }, \ | ||
| 19 | {L20, L21, L22, L23, L24, L25, L26, }, \ | ||
| 20 | {L30, L31, L32, L33, L34, L35, L36, }, \ | ||
| 21 | {L40, L41, L42, L43, L44, L45, L46, }, \ | ||
| 22 | {L50, L51, L52, L53, L54, L55, L56, }, \ | ||
| 23 | {R00, R01, R02, R03, R04, R05, R06, }, \ | ||
| 24 | {R10, R11, R12, R13, R14, R15, R16, }, \ | ||
| 25 | {R20, R21, R22, R23, R24, R25, R26, }, \ | ||
| 26 | {R30, R31, R32, R33, R34, R35, R36, }, \ | ||
| 27 | {R40, R41, R42, R43, R44, R45, R46, }, \ | ||
| 28 | {R50, R51, R52, R53, R54, R55, R56 } \ | ||
| 29 | } | ||
| 30 | |||
| 31 | #define LAYOUT_left_half_only(\ | ||
| 32 | L00, L01, L02, L03, L04, L05, L06, L46, \ | ||
| 33 | L10, L11, L12, L13, L14, L15, L16, \ | ||
| 34 | L20, L21, L22, L23, L24, L25, L26, \ | ||
| 35 | L30, L31, L32, L33, L34, L35, L36, \ | ||
| 36 | L40, L41, L42, L43, L44, L45, \ | ||
| 37 | L51, L52, \ | ||
| 38 | L50, L53, L54, \ | ||
| 39 | L55, L56 \ | ||
| 40 | ) { \ | ||
| 41 | {L00, L01, L02, L03, L04, L05, L06, }, \ | ||
| 42 | {L10, L11, L12, L13, L14, L15, L16, }, \ | ||
| 43 | {L20, L21, L22, L23, L24, L25, L26, }, \ | ||
| 44 | {L30, L31, L32, L33, L34, L35, L36, }, \ | ||
| 45 | {L40, L41, L42, L43, L44, L45, L46, }, \ | ||
| 46 | {L50, L51, L52, L53, L54, L55, L56 } \ | ||
| 47 | } | ||
| 48 | |||
| 49 | #define LAYOUT_right_half_only( \ | ||
| 50 | R46, R06, R05, R04, R03, R02, R01, R00, \ | ||
| 51 | R16, R15, R14, R13, R12, R11, R10, \ | ||
| 52 | R26, R25, R24, R23, R22, R21, R20, \ | ||
| 53 | R36, R35, R34, R33, R32, R31, R30, \ | ||
| 54 | R45, R44, R43, R42, R41, R40, \ | ||
| 55 | R52, R51, \ | ||
| 56 | R54, R53, R50, \ | ||
| 57 | R56, R55 \ | ||
| 58 | ) { \ | ||
| 59 | {R00, R01, R02, R03, R04, R05, R06, }, \ | ||
| 60 | {R10, R11, R12, R13, R14, R15, R16, }, \ | ||
| 61 | {R20, R21, R22, R23, R24, R25, R26, }, \ | ||
| 62 | {R30, R31, R32, R33, R34, R35, R36, }, \ | ||
| 63 | {R40, R41, R42, R43, R44, R45, R46, }, \ | ||
| 64 | {R50, R51, R52, R53, R54, R55, R56 } \ | ||
| 65 | } | ||
