Browse Source

next_usb: Add unimap

master
tmk 7 years ago
parent
commit
9b42a33648

+ 33
- 15
converter/next_usb/Makefile View File

@@ -1,18 +1,36 @@
# Target file name (without extension).
TARGET = next_usb
TARGET ?= next_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

CONFIG_H = config.h
CONFIG_H ?= config.h

#
# 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


# 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
@@ -20,7 +38,7 @@ CONFIG_H = config.h
#MCU = atmega32u4 # Teensy 2.0
#MCU = at90usb646 # Teensy++ 1.0
#MCU = at90usb1286 # Teensy++ 2.0
MCU = atmega32u2 # TMK converter
MCU ?= atmega32u2 # TMK converter


# Processor frequency.
@@ -28,14 +46,14 @@ MCU = atmega32u2 # TMK converter
# 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
@@ -48,7 +66,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(+60)
#OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
@@ -67,11 +85,11 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
# *Comment out* to disable the options.
#
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
#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(+400)
COMMAND_ENABLE ?= yes # Commands for debug and configuration
#NKRO_ENABLE ?= yes # USB Nkey Rollover

SRC += next_kbd.c


+ 4
- 0
converter/next_usb/Makefile.unimap View File

@@ -0,0 +1,4 @@
TARGET = next_usb_unimap
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
include Makefile

+ 1217
- 0
converter/next_usb/binary/next_usb_unimap.hex
File diff suppressed because it is too large
View File


+ 50
- 0
converter/next_usb/unimap.c View File

@@ -0,0 +1,50 @@
/*
Copyright 2016 Jun Wako <[email protected]>

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_MOMENTARY(1)
// Undo, Cut, Copy and Paste
#define AC__UND ACTION_MODS_KEY(MOD_LCTL, KC_Z)
#define AC__CUT ACTION_MODS_KEY(MOD_LCTL, KC_X)
#define AC__CPY ACTION_MODS_KEY(MOD_LCTL, KC_C)
#define AC__PST ACTION_MODS_KEY(MOD_LCTL, KC_V)

#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(
NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO,
NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO,
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NO, BSPC, VOLU,MUTE,PGUP, GRV, BSLS,PSLS,PAST,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, VOLD,NO, PGDN, P7, P8, P9, PMNS,
LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NO, ENT, P4, P5, P6, PPLS,
LSFT,NO, Z, X, C, V, B, N, M, COMM,DOT, SLSH, NO, RSFT, UP, P1, P2, P3, NO,
LALT,LGUI,NO, NO, SPC, NO, NO, NO, NO, FN0, RALT, LEFT,DOWN,RGHT, P0, PDOT,PENT
),
UNIMAP(
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,
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,DEL, TRNS,TRNS,TRNS, NLCK,TRNS,TRNS,TRNS,
CAPS,BSLS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP, INS, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,
TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT, TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,
TRNS,TRNS,_UND,_CUT,_CPY,_PST,TRNS,PPLS,PMNS,END, PGDN,DOWN, TRNS,TRNS, PGUP, TRNS,TRNS,TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, HOME,PGDN,END, TRNS, TRNS,TRNS
),
};

+ 86
- 0
converter/next_usb/unimap_trans.h View File

@@ -0,0 +1,86 @@
/*
Copyright 2016 Jun Wako <[email protected]>

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_COMMON_H
#define UNIMAP_COMMON_H

#include <stdint.h>
#include <avr/pgmspace.h>
#include "unimap.h"


/* Mapping to Universal keyboard layout
*
* Universal keyboard layout
* ,-----------------------------------------------.
* |F13|F14|F15|F16|F17|F18|F19|F20|F21|F22|F23|F24|
* ,---. |-----------------------------------------------| ,-----------. ,-----------.
* |Esc| |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|
* `---' `-----------------------------------------------' `-----------' `-----------'
* ,-----------------------------------------------------------. ,-----------. ,---------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -|
* |-----------------------------------------------------------| |-----------| |---------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| +|
* |-----------------------------------------------------------| `-----------' |---------------|
* |CapsL | A| S| D| F| G| H| J| K| L| ;| '| #|Retn| | 4| 5| 6|KP,|
* |-----------------------------------------------------------| ,---. |---------------|
* |Shft| <| Z| X| C| V| B| N| M| ,| .| /| RO|Shift | |Up | | 1| 2| 3|KP=|
* |-----------------------------------------------------------| ,-----------. |---------------|
* |Ctl|Gui|Alt|MHEN| Space |HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent|
* `-----------------------------------------------------------' `-----------' `---------------'
*
* NeXT Matrix(Scan code)
* ,-----------------------------------------------------------. ,-----------. ,---------------.
* | 49| 4A| 4B| 4C| 4D| 50| 4F| 4E| 1E| 1F| 20| 1D| 1C| 1B | | 1A| 58| 19| | 26| 27| 28| 25|
* |-----------------------------------------------------------| |-----------| |---------------|
* | 41 | 42| 43| 44| 45| 48| 47| 46| 06| 07| 08| 05| 04| 03 | | 02| | 01| | 21| 22| 23| 24|
* |-----------------------------------------------------------| `---' `---' |-----------|---|
* | 57 | 39| 3A| 3B| 3C| 3D| 40| 3F| 3E| 2D| 2C| 2B| 2A | | 12| 18| 13| 15|
* |-----------------------------------------------------------| ,---. |---------------|
* | 56 | 31| 32| 33| 34| 35| 37| 36| 2E| 2F| 30| 55 | | 16| | 11| 17| 14| |
* |-----------------------------------------------------------| ,-----------. |-----------| |
* | 52 | 54 | 38 | 53 | 51 | | 09| 0F| 10| |0B | 0C| 0D|
* `-----------------------------------------------------------' `-----------' `---------------'
* ,-----------------------------------------------------------. ,-----------. ,---------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BSpc | |Ins|Hom|PgU| |NmL| /| *| -|
* |-----------------------------------------------------------| |-----------| |---------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del| |PgD| | 7| 8| 9| +|
* |-----------------------------------------------------------| `---' `---' |---------------|
* |CapsL | A| S| D| F| G| H| J| K| L| ;| '| Return| | 4| 5| 6|KP,|
* |-----------------------------------------------------------| ,---. |---------------|
* |Shft| <| Z| X| C| V| B| N| M| ,| .| /| Shift | |Up | | 1| 2| 3| |
* |-----------------------------------------------------------| ,-----------. |-----------| |
* |LCtl |Gui | Space | App | RCtl| |Lef|Dow|Rig| | 0 | .|Ent|
* `-----------------------------------------------------------' `-----------' `---------------'
*/

// Matrix 12 * 8
const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
{ UNIMAP_NO, UNIMAP_PGDN, UNIMAP_DEL, UNIMAP_BSLS, UNIMAP_RBRC, UNIMAP_LBRC, UNIMAP_I, UNIMAP_O }, // 0x00-07
{ UNIMAP_P, UNIMAP_LEFT, UNIMAP_NO, UNIMAP_P0, UNIMAP_PDOT, UNIMAP_PENT, UNIMAP_NO, UNIMAP_DOWN }, // 0x08-0F
{ UNIMAP_RGHT, UNIMAP_P1, UNIMAP_P4, UNIMAP_P6, UNIMAP_P3, UNIMAP_PCMM, UNIMAP_UP, UNIMAP_P2 }, // 0x10-17
{ UNIMAP_P5, UNIMAP_PGUP, UNIMAP_INS, UNIMAP_BSPC, UNIMAP_EQL, UNIMAP_MINS, UNIMAP_8, UNIMAP_9 }, // 0x18-1f
{ UNIMAP_0, UNIMAP_P7, UNIMAP_P8, UNIMAP_P9, UNIMAP_PPLS, UNIMAP_PMNS, UNIMAP_NLCK, UNIMAP_PSLS }, // 0x20-27
{ UNIMAP_PAST, UNIMAP_NO, UNIMAP_ENT, UNIMAP_QUOT, UNIMAP_SCLN, UNIMAP_L, UNIMAP_COMM, UNIMAP_DOT }, // 0x28-2f
{ UNIMAP_SLSH, UNIMAP_Z, UNIMAP_X, UNIMAP_C, UNIMAP_V, UNIMAP_B, UNIMAP_M, UNIMAP_N }, // 0x30-37
{ UNIMAP_SPC, UNIMAP_A, UNIMAP_S, UNIMAP_D, UNIMAP_F, UNIMAP_G, UNIMAP_K, UNIMAP_J }, // 0x38-3f
{ UNIMAP_H, UNIMAP_TAB, UNIMAP_Q, UNIMAP_W, UNIMAP_E, UNIMAP_R, UNIMAP_U, UNIMAP_Y }, // 0x40-47
{ UNIMAP_T, UNIMAP_GRV, UNIMAP_1, UNIMAP_2, UNIMAP_3, UNIMAP_4, UNIMAP_7, UNIMAP_6 }, // 0x48-4f
{ UNIMAP_5, UNIMAP_RCTL, UNIMAP_LCTL, UNIMAP_APP, UNIMAP_LGUI, UNIMAP_RSFT, UNIMAP_LSFT, UNIMAP_CAPS }, // 0x50-57
{ UNIMAP_HOME, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO } // 0x58-5f
};

#endif

Loading…
Cancel
Save