aboutsummaryrefslogtreecommitdiffstats
path: root/keyboards/whale/sk/v3
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/whale/sk/v3')
-rw-r--r--keyboards/whale/sk/v3/config.h53
-rw-r--r--keyboards/whale/sk/v3/info.json970
-rw-r--r--keyboards/whale/sk/v3/rules.mk25
-rw-r--r--keyboards/whale/sk/v3/v3.c134
-rw-r--r--keyboards/whale/sk/v3/v3.h65
5 files changed, 1247 insertions, 0 deletions
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 @@
+/*
+Copyright 2020 Whale Mo
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#pragma once
+
+#include "config_common.h"
+
+/* USB Device descriptor parameter */
+#define DEVICE_VER 0x0003
+#define MANUFACTURER Whale Mo
+#define PRODUCT Splite Keyboard v3
+
+/* key matrix size */
+/* Notice: HALF of row on the slave side */
+#define MATRIX_ROWS 12
+#define MATRIX_COLS 7
+
+/*
+ * Keyboard Matrix Assignments
+ *
+ * Change this to how you wired your keyboard
+ * COLS: AVR pins used for columns, left to right
+ * ROWS: AVR pins used for rows, top to bottom
+ * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
+ * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
+ *
+ */
+#define MATRIX_ROW_PINS { B1, B2, B3, B4, B5, B6 }
+#define MATRIX_COL_PINS { D4, C6, D7, E6, F4, F5, F6 }
+
+/* COL2ROW, ROW2COL*/
+#define DIODE_DIRECTION COL2ROW
+
+/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
+#define DEBOUNCE 3
+
+/* disable these deprecated features by default */
+#define NO_ACTION_MACRO
+#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 @@
+{
+ "keyboard_name": "Splite Keyboard v3",
+ "url": "https://github.com/ncwhale/Keyboard_Design/tree/master/Splite-Keyboard-v3",
+ "maintainer": "ncwhale",
+ "width": 20,
+ "height": 8,
+ "key_count": 84,
+ "layouts": {
+ "LAYOUT_all": {
+ "layout": [
+ {
+ "label": "Esc",
+ "x": 0.25,
+ "y": 0
+ },
+ {
+ "label": "~",
+ "x": 1.25,
+ "y": 0
+ },
+ {
+ "label": "1",
+ "x": 2.25,
+ "y": 0
+ },
+ {
+ "label": "2",
+ "x": 3.25,
+ "y": 0
+ },
+ {
+ "label": "3",
+ "x": 4.25,
+ "y": 0
+ },
+ {
+ "label": "4",
+ "x": 5.25,
+ "y": 0
+ },
+ {
+ "label": "5",
+ "x": 6.25,
+ "y": 0
+ },
+ {
+ "label": "Home",
+ "x": 7.25,
+ "y": 0,
+ "w": 1.25
+ },
+ {
+ "label": "End",
+ "x": 11.5,
+ "y": 0,
+ "w": 1.25
+ },
+ {
+ "label": "6",
+ "x": 12.75,
+ "y": 0
+ },
+ {
+ "label": "7",
+ "x": 13.75,
+ "y": 0
+ },
+ {
+ "label": "8",
+ "x": 14.75,
+ "y": 0
+ },
+ {
+ "label": "9",
+ "x": 15.75,
+ "y": 0
+ },
+ {
+ "label": "0",
+ "x": 16.75,
+ "y": 0
+ },
+ {
+ "label": "-",
+ "x": 17.75,
+ "y": 0
+ },
+ {
+ "label": "=",
+ "x": 18.75,
+ "y": 0
+ },
+ {
+ "label": "Tab",
+ "x": 0.5,
+ "y": 1,
+ "w": 1.5
+ },
+ {
+ "label": "Q",
+ "x": 2,
+ "y": 1
+ },
+ {
+ "label": "W",
+ "x": 3,
+ "y": 1
+ },
+ {
+ "label": "E",
+ "x": 4,
+ "y": 1
+ },
+ {
+ "label": "R",
+ "x": 5,
+ "y": 1
+ },
+ {
+ "label": "T",
+ "x": 6,
+ "y": 1
+ },
+ {
+ "label": "PgUp",
+ "x": 7,
+ "y": 1,
+ "w": 1.5
+ },
+ {
+ "label": "PgDn",
+ "x": 11.5,
+ "y": 1,
+ "w": 1.5
+ },
+ {
+ "label": "Y",
+ "x": 13,
+ "y": 1
+ },
+ {
+ "label": "U",
+ "x": 14,
+ "y": 1
+ },
+ {
+ "label": "I",
+ "x": 15,
+ "y": 1
+ },
+ {
+ "label": "O",
+ "x": 16,
+ "y": 1
+ },
+ {
+ "label": "P",
+ "x": 17,
+ "y": 1
+ },
+ {
+ "label": "\\",
+ "x": 18,
+ "y": 1,
+ "w": 1.5
+ },
+ {
+ "label": "Control",
+ "x": 0.25,
+ "y": 2,
+ "w": 1.5
+ },
+ {
+ "label": "A",
+ "x": 1.75,
+ "y": 2
+ },
+ {
+ "label": "S",
+ "x": 2.75,
+ "y": 2
+ },
+ {
+ "label": "D",
+ "x": 3.75,
+ "y": 2
+ },
+ {
+ "label": "F",
+ "x": 4.75,
+ "y": 2
+ },
+ {
+ "label": "G",
+ "x": 5.75,
+ "y": 2
+ },
+ {
+ "label": "Del",
+ "x": 6.75,
+ "y": 2,
+ "w": 1.5
+ },
+ {
+ "label": "BS",
+ "x": 11.75,
+ "y": 2,
+ "w": 1.5
+ },
+ {
+ "label": "H",
+ "x": 13.25,
+ "y": 2
+ },
+ {
+ "label": "J",
+ "x": 14.25,
+ "y": 2
+ },
+ {
+ "label": "K",
+ "x": 15.25,
+ "y": 2
+ },
+ {
+ "label": "L",
+ "x": 16.25,
+ "y": 2
+ },
+ {
+ "label": ";",
+ "x": 17.25,
+ "y": 2
+ },
+ {
+ "label": "Enter",
+ "x": 18.25,
+ "y": 2,
+ "w": 1.5
+ },
+ {
+ "label": "Shift",
+ "x": 0,
+ "y": 3,
+ "w": 1.5
+ },
+ {
+ "label": "Z",
+ "x": 1.5,
+ "y": 3
+ },
+ {
+ "label": "X",
+ "x": 2.5,
+ "y": 3
+ },
+ {
+ "label": "C",
+ "x": 3.5,
+ "y": 3
+ },
+ {
+ "label": "V",
+ "x": 4.5,
+ "y": 3
+ },
+ {
+ "label": "B",
+ "x": 5.5,
+ "y": 3
+ },
+ {
+ "label": "Fn",
+ "x": 6.5,
+ "y": 3
+ },
+ {
+ "label": "Fn",
+ "x": 12.5,
+ "y": 3
+ },
+ {
+ "label": "N",
+ "x": 13.5,
+ "y": 3
+ },
+ {
+ "label": "M",
+ "x": 14.5,
+ "y": 3
+ },
+ {
+ "label": ",",
+ "x": 15.5,
+ "y": 3
+ },
+ {
+ "label": ".",
+ "x": 16.5,
+ "y": 3
+ },
+ {
+ "label": "/",
+ "x": 17.5,
+ "y": 3
+ },
+ {
+ "label": "Shift",
+ "x": 18.5,
+ "y": 3,
+ "w": 1.5
+ },
+ {
+ "label": "Fn",
+ "x": 0,
+ "y": 4
+ },
+ {
+ "label": "Alt",
+ "x": 1,
+ "y": 4
+ },
+ {
+ "label": "Meta",
+ "x": 2,
+ "y": 4
+ },
+ {
+ "label": "TF",
+ "x": 3,
+ "y": 4
+ },
+ {
+ "label": "QB",
+ "x": 4,
+ "y": 4
+ },
+ {
+ "label": "Menu",
+ "x": 5,
+ "y": 4
+ },
+ {
+ "label": "Menu",
+ "x": 14,
+ "y": 4
+ },
+ {
+ "label": "QB",
+ "x": 15,
+ "y": 4
+ },
+ {
+ "label": "TF",
+ "x": 16,
+ "y": 4
+ },
+ {
+ "label": "Meta",
+ "x": 17,
+ "y": 4
+ },
+ {
+ "label": "Alt",
+ "x": 18,
+ "y": 4
+ },
+ {
+ "label": "Fn",
+ "x": 19,
+ "y": 4
+ },
+ {
+ "label": "F1",
+ "x": 7.5,
+ "y": 4,
+ "r": 30,
+ "rx": 7,
+ "ry": 3.5
+ },
+ {
+ "label": "F2",
+ "x": 8.5,
+ "y": 4,
+ "r": 30,
+ "rx": 7,
+ "ry": 3.5
+ },
+ {
+ "x": 6.5,
+ "y": 5,
+ "h": 2,
+ "r": 30,
+ "rx": 7,
+ "ry": 3.5
+ },
+ {
+ "label": "F3",
+ "x": 7.5,
+ "y": 5,
+ "r": 30,
+ "rx": 7,
+ "ry": 3.5
+ },
+ {
+ "label": "F4",
+ "x": 8.5,
+ "y": 5,
+ "r": 30,
+ "rx": 7,
+ "ry": 3.5
+ },
+ {
+ "label": "F5",
+ "x": 7.5,
+ "y": 6,
+ "r": 30,
+ "rx": 7,
+ "ry": 3.5
+ },
+ {
+ "label": "F6",
+ "x": 8.5,
+ "y": 6,
+ "r": 30,
+ "rx": 7,
+ "ry": 3.5
+ },
+ {
+ "label": "F7",
+ "x": 10.5,
+ "y": 4,
+ "r": -30,
+ "rx": 13,
+ "ry": 3.5
+ },
+ {
+ "label": "F8",
+ "x": 11.5,
+ "y": 4,
+ "r": -30,
+ "rx": 13,
+ "ry": 3.5
+ },
+ {
+ "label": "F9",
+ "x": 10.5,
+ "y": 5,
+ "r": -30,
+ "rx": 13,
+ "ry": 3.5
+ },
+ {
+ "label": "F10",
+ "x": 11.5,
+ "y": 5,
+ "r": -30,
+ "rx": 13,
+ "ry": 3.5
+ },
+ {
+ "x": 12.5,
+ "y": 5,
+ "h": 2,
+ "r": -30,
+ "rx": 13,
+ "ry": 3.5
+ },
+ {
+ "label": "F11",
+ "x": 10.5,
+ "y": 6,
+ "r": -30,
+ "rx": 13,
+ "ry": 3.5
+ },
+ {
+ "label": "F12",
+ "x": 11.5,
+ "y": 6,
+ "r": -30,
+ "rx": 13,
+ "ry": 3.5
+ }
+ ]
+ },
+ "LAYOUT_left_half_only": {
+ "layout": [
+ {
+ "label": "Esc",
+ "x": 0.25,
+ "y": 0
+ },
+ {
+ "label": "~",
+ "x": 1.25,
+ "y": 0
+ },
+ {
+ "label": "1",
+ "x": 2.25,
+ "y": 0
+ },
+ {
+ "label": "2",
+ "x": 3.25,
+ "y": 0
+ },
+ {
+ "label": "3",
+ "x": 4.25,
+ "y": 0
+ },
+ {
+ "label": "4",
+ "x": 5.25,
+ "y": 0
+ },
+ {
+ "label": "5",
+ "x": 6.25,
+ "y": 0
+ },
+ {
+ "label": "Home",
+ "x": 7.25,
+ "y": 0,
+ "w": 1.25
+ },
+ {
+ "label": "Tab",
+ "x": 0.5,
+ "y": 1,
+ "w": 1.5
+ },
+ {
+ "label": "Q",
+ "x": 2,
+ "y": 1
+ },
+ {
+ "label": "W",
+ "x": 3,
+ "y": 1
+ },
+ {
+ "label": "E",
+ "x": 4,
+ "y": 1
+ },
+ {
+ "label": "R",
+ "x": 5,
+ "y": 1
+ },
+ {
+ "label": "T",
+ "x": 6,
+ "y": 1
+ },
+ {
+ "label": "PgUp",
+ "x": 7,
+ "y": 1,
+ "w": 1.5
+ },
+ {
+ "label": "Control",
+ "x": 0.25,
+ "y": 2,
+ "w": 1.5
+ },
+ {
+ "label": "A",
+ "x": 1.75,
+ "y": 2
+ },
+ {
+ "label": "S",
+ "x": 2.75,
+ "y": 2
+ },
+ {
+ "label": "D",
+ "x": 3.75,
+ "y": 2
+ },
+ {
+ "label": "F",
+ "x": 4.75,
+ "y": 2
+ },
+ {
+ "label": "G",
+ "x": 5.75,
+ "y": 2
+ },
+ {
+ "label": "Del",
+ "x": 6.75,
+ "y": 2,
+ "w": 1.5
+ },
+ {
+ "label": "Shift",
+ "x": 0,
+ "y": 3,
+ "w": 1.5
+ },
+ {
+ "label": "Z",
+ "x": 1.5,
+ "y": 3
+ },
+ {
+ "label": "X",
+ "x": 2.5,
+ "y": 3
+ },
+ {
+ "label": "C",
+ "x": 3.5,
+ "y": 3
+ },
+ {
+ "label": "V",
+ "x": 4.5,
+ "y": 3
+ },
+ {
+ "label": "B",
+ "x": 5.5,
+ "y": 3
+ },
+ {
+ "label": "Fn",
+ "x": 6.5,
+ "y": 3
+ },
+ {
+ "label": "Fn",
+ "x": 0,
+ "y": 4
+ },
+ {
+ "label": "Alt",
+ "x": 1,
+ "y": 4
+ },
+ {
+ "label": "Meta",
+ "x": 2,
+ "y": 4
+ },
+ {
+ "label": "TF",
+ "x": 3,
+ "y": 4
+ },
+ {
+ "label": "QB",
+ "x": 4,
+ "y": 4
+ },
+ {
+ "label": "Menu",
+ "x": 5,
+ "y": 4
+ },
+ {
+ "label": "F1",
+ "x": 7.5,
+ "y": 4,
+ "r": 30,
+ "rx": 7,
+ "ry": 3.5
+ },
+ {
+ "label": "F2",
+ "x": 8.5,
+ "y": 4,
+ "r": 30,
+ "rx": 7,
+ "ry": 3.5
+ },
+ {
+ "x": 6.5,
+ "y": 5,
+ "h": 2,
+ "r": 30,
+ "rx": 7,
+ "ry": 3.5
+ },
+ {
+ "label": "F3",
+ "x": 7.5,
+ "y": 5,
+ "r": 30,
+ "rx": 7,
+ "ry": 3.5
+ },
+ {
+ "label": "F4",
+ "x": 8.5,
+ "y": 5,
+ "r": 30,
+ "rx": 7,
+ "ry": 3.5
+ },
+ {
+ "label": "F5",
+ "x": 7.5,
+ "y": 6,
+ "r": 30,
+ "rx": 7,
+ "ry": 3.5
+ },
+ {
+ "label": "F6",
+ "x": 8.5,
+ "y": 6,
+ "r": 30,
+ "rx": 7,
+ "ry": 3.5
+ }
+ ]
+ },
+ "LAYOUT_right_half_only": {
+ "layout": [
+ {
+ "label": "End",
+ "x": 11.5,
+ "y": 0,
+ "w": 1.25
+ },
+ {
+ "label": "6",
+ "x": 12.75,
+ "y": 0
+ },
+ {
+ "label": "7",
+ "x": 13.75,
+ "y": 0
+ },
+ {
+ "label": "8",
+ "x": 14.75,
+ "y": 0
+ },
+ {
+ "label": "9",
+ "x": 15.75,
+ "y": 0
+ },
+ {
+ "label": "0",
+ "x": 16.75,
+ "y": 0
+ },
+ {
+ "label": "-",
+ "x": 17.75,
+ "y": 0
+ },
+ {
+ "label": "=",
+ "x": 18.75,
+ "y": 0
+ },
+ {
+ "label": "PgDn",
+ "x": 11.5,
+ "y": 1,
+ "w": 1.5
+ },
+ {
+ "label": "Y",
+ "x": 13,
+ "y": 1
+ },
+ {
+ "label": "U",
+ "x": 14,
+ "y": 1
+ },
+ {
+ "label": "I",
+ "x": 15,
+ "y": 1
+ },
+ {
+ "label": "O",
+ "x": 16,
+ "y": 1
+ },
+ {
+ "label": "P",
+ "x": 17,
+ "y": 1
+ },
+ {
+ "label": "\\",
+ "x": 18,
+ "y": 1,
+ "w": 1.5
+ },
+ {
+ "label": "BS",
+ "x": 11.75,
+ "y": 2,
+ "w": 1.5
+ },
+ {
+ "label": "H",
+ "x": 13.25,
+ "y": 2
+ },
+ {
+ "label": "J",
+ "x": 14.25,
+ "y": 2
+ },
+ {
+ "label": "K",
+ "x": 15.25,
+ "y": 2
+ },
+ {
+ "label": "L",
+ "x": 16.25,
+ "y": 2
+ },
+ {
+ "label": ";",
+ "x": 17.25,
+ "y": 2
+ },
+ {
+ "label": "Enter",
+ "x": 18.25,
+ "y": 2,
+ "w": 1.5
+ },
+ {
+ "label": "Fn",
+ "x": 12.5,
+ "y": 3
+ },
+ {
+ "label": "N",
+ "x": 13.5,
+ "y": 3
+ },
+ {
+ "label": "M",
+ "x": 14.5,
+ "y": 3
+ },
+ {
+ "label": ",",
+ "x": 15.5,
+ "y": 3
+ },
+ {
+ "label": ".",
+ "x": 16.5,
+ "y": 3
+ },
+ {
+ "label": "/",
+ "x": 17.5,
+ "y": 3
+ },
+ {
+ "label": "Shift",
+ "x": 18.5,
+ "y": 3,
+ "w": 1.5
+ },
+ {
+ "label": "Menu",
+ "x": 14,
+ "y": 4
+ },
+ {
+ "label": "QB",
+ "x": 15,
+ "y": 4
+ },
+ {
+ "label": "TF",
+ "x": 16,
+ "y": 4
+ },
+ {
+ "label": "Meta",
+ "x": 17,
+ "y": 4
+ },
+ {
+ "label": "Alt",
+ "x": 18,
+ "y": 4
+ },
+ {
+ "label": "Fn",
+ "x": 19,
+ "y": 4
+ },
+ {
+ "label": "F7",
+ "x": 10.5,
+ "y": 4,
+ "r": -30,
+ "rx": 13,
+ "ry": 3.5
+ },
+ {
+ "label": "F8",
+ "x": 11.5,
+ "y": 4,
+ "r": -30,
+ "rx": 13,
+ "ry": 3.5
+ },
+ {
+ "label": "F9",
+ "x": 10.5,
+ "y": 5,
+ "r": -30,
+ "rx": 13,
+ "ry": 3.5
+ },
+ {
+ "label": "F10",
+ "x": 11.5,
+ "y": 5,
+ "r": -30,
+ "rx": 13,
+ "ry": 3.5
+ },
+ {
+ "x": 12.5,
+ "y": 5,
+ "h": 2,
+ "r": -30,
+ "rx": 13,
+ "ry": 3.5
+ },
+ {
+ "label": "F11",
+ "x": 10.5,
+ "y": 6,
+ "r": -30,
+ "rx": 13,
+ "ry": 3.5
+ },
+ {
+ "label": "F12",
+ "x": 11.5,
+ "y": 6,
+ "r": -30,
+ "rx": 13,
+ "ry": 3.5
+ }
+ ]
+ }
+ }
+}
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 @@
+# MCU name
+MCU = atmega32u4
+
+# Bootloader selection
+BOOTLOADER = caterina
+
+# Build Options
+# change yes to no to disable
+#
+BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
+MOUSEKEY_ENABLE = yes # Mouse keys
+EXTRAKEY_ENABLE = yes # Audio control and System control
+CONSOLE_ENABLE = no # Console for debug
+COMMAND_ENABLE = no # Commands for debug and configuration
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE = no # USB Nkey Rollover
+BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
+RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
+BLUETOOTH_ENABLE = no # Enable Bluetooth
+AUDIO_ENABLE = no # Audio output
+
+SPLIT_KEYBOARD = yes
+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 @@
+#include "v3.h"
+
+#if defined(__AVR__)
+# include <avr/io.h>
+# include <avr/interrupt.h>
+#endif
+
+#define ROWS_PER_HAND (MATRIX_ROWS / 2)
+#define SLAVE_MATRIX_SYNC_ADDR (0x01)
+
+typedef struct {
+ char* buffer;
+ size_t count;
+ bool* flag;
+} transmit_status;
+
+transmit_status irx = {}, itx = {};
+
+// Buffer for master/slave matrix scan transmit.
+// Master: receive buffer.
+// Slave: transmit buffer.
+matrix_row_t sync_matrix[ROWS_PER_HAND];
+bool matrix_synced = false;
+
+void USART_init(uint16_t baud) {
+ cli();
+
+ // UBRR1H = (unsigned char)(baud >>8);
+ // UBRR1L = (unsigned char)(baud);
+ UBRR1 = baud;
+ // Enable U2X1 for double speed.
+ UCSR1A = (1 << U2X1);
+ // Enable RX/TX, 9N1 mode
+ UCSR1B = (1 << RXEN1) | (1 << TXEN1) | (1 << RXCIE1) | (1 << TXCIE1) | (1 << UCSZ12);
+ UCSR1C = (1 << UCSZ10) | (1 << UCSZ11);
+ sei();
+}
+
+ISR(USART1_RX_vect) {
+ // read data from reg.
+ uint8_t status = UCSR1A;
+ uint8_t high_bit = UCSR1B;
+ uint8_t low_data = UDR1;
+ if (status & ((1 << FE1) | (1 << DOR1) | (1 << UPE1))) {
+ // Something error happen, ignore this package.
+ irx.count = 0;
+ return;
+ }
+
+ // Is it a addr? (9th bit is one/zero?)
+ if (high_bit & (1 << RXB81)) {
+ // data is addr. prepend for receive.
+ switch (low_data) {
+ case SLAVE_MATRIX_SYNC_ADDR:
+ irx.buffer = (char *)sync_matrix;
+ irx.count = sizeof(sync_matrix) * sizeof(matrix_row_t);
+ irx.flag = &matrix_synced;
+ break;
+
+ default:
+ // ignore this package.
+ irx.count = 0;
+ break;
+ }
+
+ } else if (irx.count > 0) {
+ *irx.buffer = low_data;
+ ++irx.buffer;
+ if (--irx.count == 0 && irx.flag != NULL) {
+ *irx.flag = true;
+ }
+ }
+}
+
+// TX complete
+ISR(USART1_TX_vect) {
+ // Is in transmit?
+ if (itx.count > 0) {
+ // Send data.
+ UCSR1B &= ~(1 << TXB81);
+ UDR1 = *itx.buffer;
+
+ // Move to next char.
+ ++itx.buffer;
+ if (--itx.count == 0) {
+ *itx.flag = true;
+ }
+ }
+ // TODO: read queue/register for next message.
+}
+
+// return: queue depth.
+int send_packet(uint8_t addr, char* buffer, size_t length, bool* flag) {
+ // See if we can start transmit right now.
+ if ((itx.count == 0) && (UCSR1A & (1 << UDRE1))) {
+ // Ready to write.
+ // Prepend registers.
+ itx.buffer = buffer;
+ itx.count = length;
+ itx.flag = flag;
+
+ // Write addr to kick start transmit.
+ UCSR1B |= (1 << TXB81);
+ UDR1 = addr;
+ // TODO: put request in queue;
+ // }else{
+ }
+
+ return 0;
+}
+
+void transport_master_init(void) { USART_init(0); }
+
+void transport_slave_init(void) { USART_init(0); }
+
+// returns false if valid data not received from slave
+bool transport_master(matrix_row_t matrix[]) {
+ if (matrix_synced) {
+ for (uint8_t i = 0; i < ROWS_PER_HAND; ++i) {
+ matrix[i] = sync_matrix[i];
+ }
+ matrix_synced = false;
+ return true;
+ }
+ return false;
+}
+
+void transport_slave(matrix_row_t matrix[]) {
+ for (uint8_t i = 0; i < ROWS_PER_HAND; ++i) {
+ sync_matrix[i] = matrix[i];
+ }
+ matrix_synced = false;
+ send_packet(SLAVE_MATRIX_SYNC_ADDR, (char*)sync_matrix, sizeof(sync_matrix) * sizeof(matrix_row_t), &matrix_synced);
+}
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 @@
+#pragma once
+
+#include "sk.h"
+
+#include "quantum.h"
+
+#define LAYOUT_all( \
+ L00, L01, L02, L03, L04, L05, L06, L46, R46, R06, R05, R04, R03, R02, R01, R00, \
+ L10, L11, L12, L13, L14, L15, L16, R16, R15, R14, R13, R12, R11, R10, \
+ L20, L21, L22, L23, L24, L25, L26, R26, R25, R24, R23, R22, R21, R20, \
+ L30, L31, L32, L33, L34, L35, L36, R36, R35, R34, R33, R32, R31, R30, \
+ L40, L41, L42, L43, L44, L45, R45, R44, R43, R42, R41, R40, \
+ L51, L52, R52, R51, \
+ L50, L53, L54, R54, R53, R50, \
+ L55, L56, R56, R55 \
+) { \
+ {L00, L01, L02, L03, L04, L05, L06, }, \
+ {L10, L11, L12, L13, L14, L15, L16, }, \
+ {L20, L21, L22, L23, L24, L25, L26, }, \
+ {L30, L31, L32, L33, L34, L35, L36, }, \
+ {L40, L41, L42, L43, L44, L45, L46, }, \
+ {L50, L51, L52, L53, L54, L55, L56, }, \
+ {R00, R01, R02, R03, R04, R05, R06, }, \
+ {R10, R11, R12, R13, R14, R15, R16, }, \
+ {R20, R21, R22, R23, R24, R25, R26, }, \
+ {R30, R31, R32, R33, R34, R35, R36, }, \
+ {R40, R41, R42, R43, R44, R45, R46, }, \
+ {R50, R51, R52, R53, R54, R55, R56 } \
+}
+
+#define LAYOUT_left_half_only(\
+ L00, L01, L02, L03, L04, L05, L06, L46, \
+ L10, L11, L12, L13, L14, L15, L16, \
+ L20, L21, L22, L23, L24, L25, L26, \
+ L30, L31, L32, L33, L34, L35, L36, \
+ L40, L41, L42, L43, L44, L45, \
+ L51, L52, \
+ L50, L53, L54, \
+ L55, L56 \
+) { \
+ {L00, L01, L02, L03, L04, L05, L06, }, \
+ {L10, L11, L12, L13, L14, L15, L16, }, \
+ {L20, L21, L22, L23, L24, L25, L26, }, \
+ {L30, L31, L32, L33, L34, L35, L36, }, \
+ {L40, L41, L42, L43, L44, L45, L46, }, \
+ {L50, L51, L52, L53, L54, L55, L56 } \
+}
+
+#define LAYOUT_right_half_only( \
+ R46, R06, R05, R04, R03, R02, R01, R00, \
+ R16, R15, R14, R13, R12, R11, R10, \
+ R26, R25, R24, R23, R22, R21, R20, \
+ R36, R35, R34, R33, R32, R31, R30, \
+ R45, R44, R43, R42, R41, R40, \
+ R52, R51, \
+ R54, R53, R50, \
+ R56, R55 \
+) { \
+ {R00, R01, R02, R03, R04, R05, R06, }, \
+ {R10, R11, R12, R13, R14, R15, R16, }, \
+ {R20, R21, R22, R23, R24, R25, R26, }, \
+ {R30, R31, R32, R33, R34, R35, R36, }, \
+ {R40, R41, R42, R43, R44, R45, R46, }, \
+ {R50, R51, R52, R53, R54, R55, R56 } \
+}