]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
sun_usb: Add unimap support
authortmk <hasu@tmk-kbd.com>
Wed, 8 Apr 2020 05:53:10 +0000 (14:53 +0900)
committertmk <hasu@tmk-kbd.com>
Wed, 8 Apr 2020 08:38:33 +0000 (17:38 +0900)
converter/sun_usb/Makefile
converter/sun_usb/unimap.c [new file with mode: 0644]
converter/sun_usb/unimap_trans.h [new file with mode: 0644]

index 12eceb5e74fc0f348c86c7c649cf0ca9b6502431..20addfc9de8a1e230260fcf1f704ae3a7b341d70 100644 (file)
@@ -1,29 +1,28 @@
 # Target file name (without extension).
-TARGET = sun_usb
+TARGET ?= sun_usb
 
 # Directory common source filess exist
-TMK_DIR = ../../tmk_core
+TMK_DIR ?= ../../tmk_core
 
 # Directory keyboard dependent files exist
-TARGET_DIR = .
+TARGET_DIR ?= .
 
 # keyboard dependent files
-SRC =  keymap.c \
-       matrix.c \
+SRC ?= matrix.c \
        led.c \
        command_extra.c
 
 
-CONFIG_H = config.h
+CONFIG_H ?= config.h
 
 
 # MCU name, you MUST set this to match the board you are using
 # type "make clean" after changing this, so all files will be rebuilt
-#MCU = at90usb162       # Teensy 1.0
-#MCU = atmega32u4       # Teensy 2.0
-#MCU = at90usb646       # Teensy++ 1.0
-#MCU = at90usb1286      # Teensy++ 2.0
-MCU = atmega32u2
+# at90usb162       # Teensy 1.0
+# atmega32u4       # Teensy 2.0
+# at90usb646       # Teensy++ 1.0
+# at90usb1286      # Teensy++ 2.0
+MCU ?= atmega32u2
 
 
 # Processor frequency.
@@ -31,14 +30,14 @@ MCU = atmega32u2
 #   so your program will run at the correct speed.  You should also set this
 #   variable to same clock speed.  The _delay_ms() macro uses this, and many
 #   examples use this variable to calculate timings.  Do not add a "UL" here.
-F_CPU = 16000000
+F_CPU ?= 16000000
 
 
 #
 # LUFA specific
 #
 # Target architecture (see library "Board Types" documentation).
-ARCH = AVR8
+ARCH ?= AVR8
 
 # Input clock frequency.
 #     This will define a symbol, F_USB, in all source code files equal to the
@@ -51,7 +50,7 @@ ARCH = AVR8
 #
 #     If no clock division is performed on the input clock inside the AVR (via the
 #     CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
-F_USB = $(F_CPU)
+F_USB ?= $(F_CPU)
 
 # Interrupt driven control endpoint task
 OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
@@ -60,12 +59,14 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
 # Build Options
 #   *Comment out* to disable the options.
 #
-MOUSEKEY_ENABLE = yes  # Mouse keys
-EXTRAKEY_ENABLE = yes  # Audio control and System control
-CONSOLE_ENABLE = yes   # Console for debug
-COMMAND_ENABLE = yes    # Commands for debug and configuration
-#HARDWARE_SERIAL = yes  # Use hardware serial (requires inverted serial, see README)
-#NKRO_ENABLE = yes     # USB Nkey Rollover
+MOUSEKEY_ENABLE ?= yes # Mouse keys
+EXTRAKEY_ENABLE ?= yes # Audio control and System control
+CONSOLE_ENABLE ?= yes  # Console for debug
+COMMAND_ENABLE ?= yes    # Commands for debug and configuration
+#HARDWARE_SERIAL ?= yes  # Use hardware serial (requires inverted serial, see README)
+#NKRO_ENABLE ?= yes    # USB Nkey Rollover
+UNIMAP_ENABLE = yes
+KEYMAP_SECTION_ENABLE = yes
 
 ifdef HARDWARE_SERIAL
        SRC := protocol/serial_uart.c $(SRC)
@@ -78,7 +79,27 @@ endif
 #   Teensy halfKay   512
 #   Atmel DFU loader 4096
 #   LUFA bootloader  4096
-OPT_DEFS += -DBOOTLOADER_SIZE=4096
+# Bootloader size can be calculated from fuse bits
+#OPT_DEFS += -DBOOTLOADER_SIZE=4096
+
+
+#
+# Keymap file
+#
+ifeq (yes,$(strip $(UNIMAP_ENABLE)))
+    KEYMAP_FILE = unimap
+else
+    ifeq (yes,$(strip $(ACTIONMAP_ENABLE)))
+        KEYMAP_FILE = actionmap
+    else
+        KEYMAP_FILE = keymap
+    endif
+endif
+ifdef KEYMAP
+    SRC := $(KEYMAP_FILE)_$(KEYMAP).c $(SRC)
+else
+    SRC := $(KEYMAP_FILE).c $(SRC)
+endif
 
 
 # Search Path
diff --git a/converter/sun_usb/unimap.c b/converter/sun_usb/unimap.c
new file mode 100644 (file)
index 0000000..b390680
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+Copyright 2020 Jun Wako <wakojun@gmail.com>
+
+This file is part of TMK keyboard. https://github.com/tmk/tmk_keyboard
+
+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/>.
+*/
+#include "unimap_trans.h"
+
+
+#define AC_FN0 ACTION_LAYER_TAP_KEY(1, KC_APPLICATION)
+
+#ifdef KEYMAP_SECTION_ENABLE
+const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
+#else
+const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = {
+#endif
+    UNIMAP_TYPE5(
+    F23,        F24, F1,  F2,  F3,       F4,  F5,  F6,  F7,  F8,       F9,  F10, F11, F12,   PSCR,SLCK,PAUS,  MUTE,VOLD,VOLU,PWR,
+    F13, F14,   ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSLS,GRV,   INS, HOME,PGUP,  NLCK,PSLS,PAST,PMNS,
+    F15, F16,   TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,     BSPC,  DEL, END, PGDN,  P7,  P8,  P9,  PPLS,
+    F17, F18,   LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,          ENT,                    P4,  P5,  P6,
+    F19, F20,   LSFT,NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,     RO,  RSFT,       UP,         P1,  P2,  P3,  PENT,
+    F21, F22,   CAPS,LALT,LGUI,MHEN,          SPC,                HENK,KANA,RGUI,FN0, RALT,  LEFT,DOWN,RGHT,  P0,       PDOT
+    ),
+    UNIMAP_TYPE5(
+    TRNS,       TRNS,TRNS,TRNS,TRNS,     TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,TRNS,TRNS,TRNS,  TRNS,TRNS,TRNS,  TRNS,TRNS,TRNS,BTLD,
+    TRNS,TRNS,  GRV, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, INS, DEL,   TRNS,TRNS,TRNS,  TRNS,TRNS,TRNS,TRNS,
+    TRNS,TRNS,  TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP,  TRNS,     TRNS,  TRNS,TRNS,TRNS,  TRNS,TRNS,TRNS,TRNS,
+    TRNS,TRNS,  TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,TRNS,TRNS,HOME,PGUP,LEFT,RGHT,          TRNS,                   TRNS,TRNS,TRNS,
+    TRNS,TRNS,  TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,END, PGDN,DOWN,     TRNS,TRNS,       TRNS,       TRNS,TRNS,TRNS,TRNS,
+    TRNS,TRNS,  TRNS,TRNS,TRNS,TRNS,          TRNS,               TRNS,TRNS,TRNS,TRNS,TRNS,  TRNS,TRNS,TRNS,  TRNS,     TRNS
+    ),
+};
+/* Templates:
+    UNIMAP_TYPE5(
+    TRNS,       TRNS,TRNS,TRNS,TRNS,     TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,TRNS,TRNS,TRNS,  TRNS,TRNS,TRNS,  TRNS,TRNS,TRNS,TRNS,
+    TRNS,TRNS,  TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,  TRNS,TRNS,TRNS,  TRNS,TRNS,TRNS,TRNS,
+    TRNS,TRNS,  TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,  TRNS,TRNS,TRNS,  TRNS,TRNS,TRNS,TRNS,
+    TRNS,TRNS,  TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,          TRNS,                   TRNS,TRNS,TRNS,
+    TRNS,TRNS,  TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,TRNS,       TRNS,       TRNS,TRNS,TRNS,TRNS,
+    TRNS,TRNS,  TRNS,TRNS,TRNS,TRNS,          TRNS,               TRNS,TRNS,TRNS,TRNS,TRNS,  TRNS,TRNS,TRNS,  TRNS,     TRNS
+    ),
+
+    UNIMAP_TYPE3(
+    F10, F11,   F1,  F2,  F3,       F4,       F5,       F6,       F7,       F8,  F9,  BSPC,  VOLD,MUTE,VOLU,
+    F12, F13,   ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSLS,GRV,   MPRV,MPLY,MNXT,
+    F14, F15,   TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,     DEL,   HOME,UP,  PGUP,
+    F16, F17,   LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,          ENT,   LEFT,INS, RGHT,
+    F18, F19,   LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          RSFT,RCTL,  END, DOWN,PGDN,
+                LGUI,LALT,                 SPC,                                  RALT,RGUI
+    ),
+*/
diff --git a/converter/sun_usb/unimap_trans.h b/converter/sun_usb/unimap_trans.h
new file mode 100644 (file)
index 0000000..22d3799
--- /dev/null
@@ -0,0 +1,148 @@
+/*
+Copyright 2020 Jun Wako <wakojun@gmail.com>
+
+This file is part of TMK keyboard. https://github.com/tmk/tmk_keyboard
+
+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/>.
+*/
+#ifndef UNIMAP_TRNAS_H
+#define UNIMAP_TRNAS_H
+
+#include <stdint.h>
+#include <avr/pgmspace.h>
+#include "unimap.h"
+
+
+/* Mapping to Universal keyboard layout
+ * ,-------.  ,---,  ,---------------. ,---------------. ,---------------.   ,-----------. ,---------------.
+ * |  76   |  | 0F|  | 05| 06| 08| 0A| | 0C| 0E| 10| 11| | 12| 07| 09| 0B|   | 16| 17| 15| | 2D| 02| 04| 30|
+ * `-------'  `---'  `---------------' `---------------' `---------------'   `-----------' `---------------'
+ * ,-------.  ,-----------------------------------------------------------.  ,-----------. ,---------------.
+ * | 01| 03|  | 1D| 1E| 1F| 20| 21| 22| 23| 24| 25| 26| 27| 28| 29| 58| 2A|  | 2C| 34| 60| | 62| 2E| 2F| 47|
+ * |-------|  |-----------------------------------------------------------|  |------------ |---------------|
+ * | 19| 1A|  |  35 | 36| 37| 38| 39| 3A| 3B| 3C| 3D| 3E| 3F| 40| 41| 2B  |  | 42| 4A| 7B| | 44| 45| 46|   |
+ * |-------|  |-----------------------------------------------------------|  `-----------' |-----------| 7D|
+ * | 31| 33|  |  4C  | 4D| 4E| 4F| 50| 51| 52| 53| 54| 55| 56| 57|   59   |                | 5B| 5C| 5D|   |
+ * |-------|  |-----------------------------------------------------------|      ,---.     |-----------|---|
+ * | 48| 49|  | 63 |+7C| 64| 65| 66| 67| 68| 69| 6A| 6B| 6C| 6D|*6F|  6E  |      | 14|     | 70| 71| 72|   |
+ * |-------|  |-----------------------------------------------------------|  .-----------. |-----------| 5A|
+ * | 5F| 61|  | 77 | 13| 78 |*73 |       79         |*74 |*75| 7A | 43| 0D|  | 18| 1B| 1C| |   5E  | 32|   |
+ * `-------'  `-----------------------------------------------------------'  `-----------' `---------------'
+ * ,-------.  ,---,  ,---------------. ,---------------. ,---------------.   ,-----------. ,---------------.
+ * |  F23  |  |F24|  | F1| F2| F3| F4| | F5| F6| F7| F8| | F9|F10|F11|F12|   |PrS|ScL|Pau| |Mut|VoD|VoU|Ctl|
+ * `-------'  `---'  `---------------' `---------------' `---------------'   `-----------' `---------------'
+ * ,-------.  ,-----------------------------------------------------------.  ,-----------. ,---------------.
+ * |F13|F14|  |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|  \|  `|  |Ins|Hom|PgU| |NmL|  /|  *|  -|
+ * |-------|  |-----------------------------------------------------------|  |------------ |---------------|
+ * |F15|F16|  |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]| Bspc|  |Del|End|PgD| |  7|  8|  9|   |
+ * |-------|  |-----------------------------------------------------------|  `-----------' |-----------|  +|
+ * |F17|F18|  |Ctrl  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|  Return|                |  4|  5|  6|   |
+ * |-------|  |-----------------------------------------------------------|      ,---.     |-----------|---|
+ * |F19|F20|  |Shft| +\|  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /| RO| Shift|      | Up|     |  1|  2|  3|   |
+ * |-------|  |-----------------------------------------------------------|  .-----------. |-----------|Ent|
+ * |F21|F22|  |Caps|Alt|Gui |MHEN|      Space       |HENK|KAN| Gui|App|Alt|  |Lef|Dow|Rig| |      0|  .|   |
+ * `-------'  `-----------------------------------------------------------'  `-----------' `---------------'
+ * SUN scan codes: http://kentie.net/article/sunkbd/KBD.pdf
+ * Japanese specific keys*:  http://shikasan.net/sunkey/sunkey_e.html
+ * ISO key+:  https://bit.ly/3eennkS
+ */
+const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
+    { UNIMAP_NO,   UNIMAP_F13,  UNIMAP_VOLD, UNIMAP_F14,  UNIMAP_VOLU, UNIMAP_F1,   UNIMAP_F2,   UNIMAP_F10  }, /* 00-07 */
+    { UNIMAP_F3,   UNIMAP_F11,  UNIMAP_F4,   UNIMAP_F12,  UNIMAP_F5,   UNIMAP_RALT, UNIMAP_F6,   UNIMAP_F24  }, /* 08-0F */
+    { UNIMAP_F7,   UNIMAP_F8,   UNIMAP_F9,   UNIMAP_LALT, UNIMAP_UP,   UNIMAP_PAUS, UNIMAP_PSCR, UNIMAP_SLCK }, /* 10-17 */
+    { UNIMAP_LEFT, UNIMAP_F15,  UNIMAP_F16,  UNIMAP_DOWN, UNIMAP_RGHT, UNIMAP_ESC,  UNIMAP_1,    UNIMAP_2    }, /* 18-1F */
+    { UNIMAP_3,    UNIMAP_4,    UNIMAP_5,    UNIMAP_6,    UNIMAP_7,    UNIMAP_8,    UNIMAP_9,    UNIMAP_0    }, /* 20-27 */
+    { UNIMAP_MINS, UNIMAP_EQL,  UNIMAP_GRV,  UNIMAP_BSPC, UNIMAP_INS,  UNIMAP_MUTE, UNIMAP_PSLS, UNIMAP_PAST }, /* 28-2F */
+    { UNIMAP_RCTL, UNIMAP_F17,  UNIMAP_PDOT, UNIMAP_F18,  UNIMAP_HOME, UNIMAP_TAB,  UNIMAP_Q,    UNIMAP_W    }, /* 30-37 */
+    { UNIMAP_E,    UNIMAP_R,    UNIMAP_T,    UNIMAP_Y,    UNIMAP_U,    UNIMAP_I,    UNIMAP_O,    UNIMAP_P    }, /* 38-3F */
+    { UNIMAP_LBRC, UNIMAP_RBRC, UNIMAP_DEL,  UNIMAP_APP,  UNIMAP_P7,   UNIMAP_P8,   UNIMAP_P9,   UNIMAP_PMNS }, /* 40-47 */
+    { UNIMAP_F19,  UNIMAP_F20,  UNIMAP_END,  UNIMAP_NO,   UNIMAP_LCTL, UNIMAP_A,    UNIMAP_S,    UNIMAP_D    }, /* 48-4F */
+    { UNIMAP_F,    UNIMAP_G,    UNIMAP_H,    UNIMAP_J,    UNIMAP_K,    UNIMAP_L,    UNIMAP_SCLN, UNIMAP_QUOT }, /* 50-57 */
+    { UNIMAP_BSLS, UNIMAP_ENT,  UNIMAP_PENT, UNIMAP_P4,   UNIMAP_P5,   UNIMAP_P6,   UNIMAP_P0,   UNIMAP_F21  }, /* 58-5F */
+    { UNIMAP_PGUP, UNIMAP_F22,  UNIMAP_NLCK, UNIMAP_LSFT, UNIMAP_Z,    UNIMAP_X,    UNIMAP_C,    UNIMAP_V    }, /* 60-67 */
+    { UNIMAP_B,    UNIMAP_N,    UNIMAP_M,    UNIMAP_COMM, UNIMAP_DOT,  UNIMAP_SLSH, UNIMAP_RSFT, UNIMAP_RO   }, /* 68-6F */
+    { UNIMAP_P1,   UNIMAP_P2,   UNIMAP_P3,   UNIMAP_MHEN, UNIMAP_HENK, UNIMAP_KANA, UNIMAP_F23,  UNIMAP_CAPS }, /* 70-77 */
+    { UNIMAP_LGUI, UNIMAP_SPC,  UNIMAP_RGUI, UNIMAP_PGDN, UNIMAP_NUBS, UNIMAP_PPLS, UNIMAP_NO,   UNIMAP_NO   }, /* 78-7F */
+};
+
+
+/* Sun type 5/5c keyboard
+ * ,-------.  ,---,  ,---------------. ,---------------. ,---------------.   ,-----------. ,---------------.
+ * | Help  |  |   |  | F1| F2| F3| F4| | F5| F6| F7| F8| | F9|F10|F11|F12|   |PrS|ScL|Pau| |Mut|VoD|VoU|Pwr|
+ * `-------'  `---'  `---------------' `---------------' `---------------'   `-----------' `---------------'
+ * ,-------.  ,-----------------------------------------------------------.  ,-----------. ,---------------.
+ * |Stp|Agn|  |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|  \|  `|  |Ins|Hom|PgU| |NmL|  /|  *|  -|
+ * |-------|  |-----------------------------------------------------------|  |------------ |---------------|
+ * |Prp|Und|  |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]| Bspc|  |Del|End|PgD| |  7|  8|  9|   |
+ * |-------|  |-----------------------------------------------------------|  `-----------' |-----------|  +|
+ * |Frt|Cpy|  |Ctrl  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|  Return|                |  4|  5|  6|   |
+ * |-------|  |-----------------------------------------------------------|      ,---.     |-----------|---|
+ * |Opn|Pst|  |Shft| +\|  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /|   | Shift|      | Up|     |  1|  2|  3|   |
+ * |-------|  |-----------------------------------------------------------|  .-----------. |-----------|Ent|
+ * |Fnd|Cut|  |Caps|Alt|Meta|    |      Space       |    |   |Meta|Cmp|Alt|  |Lef|Dow|Rig| |      0|  .|   |
+ * `-------'  `-----------------------------------------------------------'  `-----------' `---------------'
+ */
+#define UNIMAP_TYPE5( \
+    K76,      K0F,  K05,K06,K08,K0A,   K0C,K0E,K10,K11,   K12,K07,K09,K0B,  K16,K17,K15,  K2D,K02,K04,K30, \
+    K01,K03,  K1D,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K58,K2A,  K2C,K34,K60,  K62,K2E,K2F,K47, \
+    K19,K1A,  K35,K36,K37,K38,K39,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,    K2B,  K42,K4A,K7B,  K44,K45,K46,K7D, \
+    K31,K33,  K4C,K4D,K4E,K4F,K50,K51,K52,K53,K54,K55,K56,K57,        K59,                K5B,K5C,K5D,     \
+    K48,K49,  K63,K7C,K64,K65,K66,K67,K68,K69,K6A,K6B,K6C,K6D,    K6F,K6E,      K14,      K70,K71,K72,K5A, \
+    K5F,K61,  K77,K13,K78,K73,        K79,            K74,K75,K7A,K43,K0D,  K18,K1B,K1C,  K5E,    K32      \
+) UNIMAP ( \
+            K01,K03,K19,K1A,K31,K33,K48,K49,K5F,K61,K76,K0F,                                     \
+    K1D,    K05,K06,K08,K0A,K0C,K0E,K10,K11,K12,K07,K09,K0B,      K16,K17,K15,      K02,K04,K2D, \
+    K2A,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,NO, K2B,  K2C,K34,K60,  K62,K2E,K2F,K47, \
+    K35,K36,K37,K38,K39,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,    K58,  K42,K4A,K7B,  K44,K45,K46,K7D, \
+    K77,K4D,K4E,K4F,K50,K51,K52,K53,K54,K55,K56,K57,    NO, K59,                K5B,K5C,K5D,NO,  \
+    K63,K7C,K64,K65,K66,K67,K68,K69,K6A,K6B,K6C,K6D,    K6F,K6E,      K14,      K70,K71,K72,K5A, \
+    K4C,K78,K13,K73,        K79,        K74,K75,K0D,K7A,K43,K30,  K18,K1B,K1C,  K5E,    K32,NO   \
+)
+
+
+/* Sun type 3 keyboard 
+ * ,-------.  ,-----------------------------------------------------------.  ,-----------.
+ * | 01| 03|  | 05| 06|     08|     0A|     0C|     0E|     10| 11| 12| 2B|  | 15| 16| 17|
+ * |-------|  |-----------------------------------------------------------|  |-----------|
+ * | 19| 1A|  | 1D| 1E| 1F| 20| 21| 22| 23| 24| 25| 26| 27| 28| 29| 58| 2A|  | 2D| 2E| 2F|
+ * |-------|  |-----------------------------------------------------------|  |-----------|
+ * | 31| 33|  |  35 | 36| 37| 38| 39| 3A| 3B| 3C| 3D| 3E| 3F| 40| 41| 42  |  | 44| 45| 46|
+ * |-------|  |-----------------------------------------------------------|  |-----------|
+ * | 48| 49|  |  4C  | 4D| 4E| 4F| 50| 51| 52| 53| 54| 55| 56| 57|   59   |  | 5B| 5C| 5D|
+ * |-------|  |-----------------------------------------------------------|  |-----------|
+ * | 5F| 61|  |   63   | 64| 65| 66| 67| 68| 69| 6A| 6B| 6C| 6D|    6E| 6F|  | 70| 71| 72|
+ * `-------'  |-----------------------------------------------------------|  `-----------'
+ *            | 77 | 78  |               79                  | 7A  |   13 |  
+ *            `-----------------------------------------------------------'  
+ * http://blog.daveastels.com.s3-website-us-west-2.amazonaws.com/2014/12/27/type-3-keyboard.html
+ * https://github.com/dastels/tmk_keyboard/blob/master/converter/sun3_usb/keymap.c
+ */
+#define UNIMAP_TYPE3( \
+    K01,K03,  K05,K06,    K08,    K0A,    K0C,    K0E,    K10,K11,K12,K2B,  K15,K16,K17, \
+    K19,K1A,  K1D,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K58,K2A,  K2D,K2E,K2F, \
+    K31,K33,  K35, K36,K37,K38,K39,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,   K42,  K44,K45,K46, \
+    K48,K49,  K4C,  K4D,K4E,K4F,K50,K51,K52,K53,K54,K55,K56,K57,      K59,  K5B,K5C,K5D, \
+    K5F,K61,  K63,   K64,K65,K66,K67,K68,K69,K6A,K6B,K6C,K6D,     K6E,K6F,  K70,K71,K72, \
+              K77,K78,                    K79,                    K7A,K13                \
+) UNIMAP ( \
+            K01,K03,K19,K1A,K31,K33,K48,K49,K5F,K61,NO, NO,                                      \
+    K1D,    K05,K06,K08,K0A,K0C,K0E,K10,K11,K12,NO, NO, NO,       K16,K17,K15,      NO, NO, K2D, \
+    K2A,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,NO, K2B,  NO, NO, NO,   NO, K2E,K2F,NO,  \
+    K35,K36,K37,K38,K39,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,    K58,  K42,NO, NO,   K44,K45,K46,NO,  \
+    K77,K4D,K4E,K4F,K50,K51,K52,K53,K54,K55,K56,K57,    NO, K59,                K5B,K5C,K5D,NO,  \
+    K63,NO, K64,K65,K66,K67,K68,K69,K6A,K6B,K6C,K6D,    K6F,K6E,      NO,       K70,K71,K72,NO,  \
+    K4C,K78,K13,NO,         K79,        NO, NO, NO, K7A,NO, NO,   NO, NO, NO,   NO,     NO, NO   \
+)
+
+#endif