@@ -26,7 +26,7 @@ const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] __attribute__ ((section (" | |||
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = { | |||
#endif | |||
UNIMAP( | |||
MPLY,NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, PWR, | |||
MPLY,NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, F24, | |||
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE, | |||
FN0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NO, BSPC, INS, HOME,PGUP, NLCK,PEQL,PSLS,PAST, | |||
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, FN1, DEL, END, PGDN, P7, P8, P9, PMNS, |
@@ -1,24 +1,36 @@ | |||
# Target file name (without extension). | |||
TARGET = ibm4704_usb | |||
TARGET ?= ibm4704_usb | |||
# Directory common source filess exist | |||
TMK_DIR = ../../tmk_core | |||
TMK_DIR ?= ../../tmk_core | |||
# Directory keyboard dependent files exist | |||
TARGET_DIR = . | |||
TARGET_DIR ?= . | |||
# project specific files | |||
SRC = matrix.c \ | |||
SRC ?= matrix.c \ | |||
led.c \ | |||
protocol/ibm4704.c | |||
# | |||
# Keymap file | |||
# | |||
ifdef UNIMAP_ENABLE | |||
KEYMAP_FILE = unimap | |||
else | |||
ifdef ACTIONMAP_ENABLE | |||
KEYMAP_FILE = actionmap | |||
else | |||
KEYMAP_FILE = keymap | |||
endif | |||
endif | |||
ifdef KEYMAP | |||
SRC := keymap_$(KEYMAP).c $(SRC) | |||
SRC := $(KEYMAP_FILE)_$(KEYMAP).c $(SRC) | |||
else | |||
SRC := keymap_plain.c $(SRC) | |||
SRC := $(KEYMAP_FILE)_plain.c $(SRC) | |||
endif | |||
CONFIG_H = config.h | |||
CONFIG_H ?= config.h | |||
# MCU name | |||
@@ -36,14 +48,14 @@ MCU ?= atmega32u2 | |||
# does not *change* the processor frequency - it should merely be updated to | |||
# reflect the processor speed set externally so that the code can use accurate | |||
# software delays. | |||
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 | |||
@@ -56,7 +68,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 | |||
@@ -68,18 +80,19 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT | |||
# Atmel DFU loader 4096 | |||
# LUFA bootloader 4096 | |||
# USBaspLoader 2048 | |||
OPT_DEFS += -DBOOTLOADER_SIZE=4096 | |||
BOOTLOADER_SIZE ?= 4096 | |||
OPT_DEFS += -DBOOTLOADER_SIZE=$(BOOTLOADER_SIZE) | |||
# Build Options | |||
# comment out to disable the options. | |||
# | |||
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) | |||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700) | |||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | |||
CONSOLE_ENABLE = yes # Console for debug(+400) | |||
COMMAND_ENABLE = yes # Commands for debug and configuration | |||
#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA | |||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) | |||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) | |||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) | |||
CONSOLE_ENABLE ?= yes # Console for debug(+400) | |||
COMMAND_ENABLE ?= yes # Commands for debug and configuration | |||
NKRO_ENABLE ?= no # USB Nkey Rollover | |||
# Search Path |
@@ -1,5 +1,6 @@ | |||
# TMK Converter rev.1 | |||
# which looks like this: | |||
# https://github.com/tmk/keyboard_converter#pcb-rev1 | |||
TARGET = ibm4704_usb_rev1 | |||
MCU = atmega32u4 | |||
include Makefile |
@@ -1,6 +1,6 @@ | |||
# TMK Converter rev.2 | |||
# which looks like this: | |||
# https://github.com/tmk/keyboard_converter#pcb-rev2 | |||
TARGET = ibm4704_usb_rev2 | |||
MCU = atmega32u2 | |||
include Makefile | |||
@@ -0,0 +1,7 @@ | |||
TARGET = ibm4704_usb_rev1_alps_unimap | |||
MCU = atmega32u4 | |||
UNIMAP_ENABLE = yes | |||
KEYMAP_SECTION_ENABLE = yes | |||
OPT_DEFS += -DIBM4704_ALPS | |||
include Makefile |
@@ -0,0 +1,7 @@ | |||
TARGET = ibm4704_usb_rev2_alps_unimap | |||
MCU = atmega32u2 | |||
UNIMAP_ENABLE = yes | |||
KEYMAP_SECTION_ENABLE = yes | |||
OPT_DEFS += -DIBM4704_ALPS | |||
include Makefile |
@@ -0,0 +1,7 @@ | |||
TARGET = ibm4704_usb_rev1_unimap | |||
MCU = atmega32u4 | |||
UNIMAP_ENABLE = yes | |||
KEYMAP_SECTION_ENABLE = yes | |||
#OPT_DEFS += -DIBM4704_ALPS | |||
include Makefile |
@@ -0,0 +1,7 @@ | |||
TARGET = ibm4704_usb_rev2_unimap | |||
MCU = atmega32u2 | |||
UNIMAP_ENABLE = yes | |||
KEYMAP_SECTION_ENABLE = yes | |||
#OPT_DEFS += -DIBM4704_ALPS | |||
include Makefile |
@@ -1,12 +1,14 @@ | |||
IBM 4704 to USB keyboard converter | |||
================================== | |||
This firmware converts IBM 4704 keyboard protocol to USB HID. | |||
Keyboard initialization process takes a few seconds at start up. **You may need to plug USB cable after hooking up your keyboard to the converter.** | |||
Keyboard initialization process takes a few seconds at start up. During that you will hear buzzer from the keyboard. **You need to plug USB cable after hooking up your keyboard to the converter.** | |||
TMK Converter for IBM4704 is available here: https://geekhack.org/index.php?topic=72052.0 | |||
Update | |||
------ | |||
- 2016/09/30 Unimap editor support | |||
- 2015/09/07 Added keymap for Alps 102-key. Thanks, tai @ geekhack! | |||
- 2015/05/05 Added keymaps for 107-key, 77-key and 50-key. Thanks, orihalcon @ geekhack! | |||
- 2015/05/19 Fixed a protocol handling bug. | |||
@@ -63,17 +65,17 @@ Just run `make`: | |||
$ make -f <makefile> | |||
For TMK Converter rev.1 use `Makefile.tmk_rev1` as makefile: | |||
For TMK Converter rev.1 use `Makefile.rev1` as makefile: | |||
$ make -f Makefile.tmk_rev1 | |||
$ make -f Makefile.rev1 | |||
For TMK Converter rev.2 use `Makefile.tmk_rev2` as makefile: | |||
For TMK Converter rev.2 use `Makefile.rev2` as makefile: | |||
$ make -f Makefile.tmk_rev2 | |||
$ make -f Makefile.rev2 | |||
To select keymap: | |||
$ make -f <makefile> KEYMAP=[plain|...] | |||
$ make -f <makefile> KEYMAP=[plain|alsp102key|...] | |||
To indentify your TMK Converter revision see [this](https://github.com/tmk/keyboard_converter#pcb-revisions). | |||
@@ -0,0 +1,45 @@ | |||
/* | |||
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) | |||
#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( | |||
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, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE, | |||
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, | |||
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, DEL, END, PGDN, P7, P8, P9, PPLS, | |||
CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NUHS,ENT, P4, P5, P6, PCMM, | |||
LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PEQL, | |||
LCTL,LGUI,LALT,MHEN, SPC, HENK,KANA,RALT,RGUI,APP, FN0, LEFT,DOWN,RGHT, P0, PDOT,PENT | |||
), | |||
UNIMAP( | |||
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, | |||
GRV, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, | |||
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, | |||
CAPS,TRNS,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,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, PGUP, TRNS,TRNS,TRNS,TRNS, | |||
TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, HOME,PGDN,END, TRNS, TRNS,TRNS | |||
), | |||
}; |
@@ -0,0 +1,113 @@ | |||
/* | |||
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_TRNAS_H | |||
#define UNIMAP_TRNAS_H | |||
#include <stdint.h> | |||
#include <avr/pgmspace.h> | |||
#include "unimap.h" | |||
const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = { // 16*8 | |||
#ifndef IBM4704_ALPS | |||
/* IBM4740 Capcitive models(62-key/77-key/107-key) | |||
* ,-------. ,-----------------------------------------------------------. ,-----------. ,---------------. | |||
* | F1| F2| | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|BSp| |Ins|Hom|PgU| |NmL| /| *| -| | |||
* |-------| |-----------------------------------------------------------| |-----------| |---------------| | |||
* | F3| F4| |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| +| | |||
* |-------| |-----------------------------------------------------------| |-----------| |---------------| | |||
* | F5| F6| |Caps | A| S| D| F| G| H| J| K| L| ;| '| #|Retn| |PrS|ScL|Pau| | 4| 5| 6|KP,| | |||
* |-------| |-----------------------------------------------------------| |-----------| |---------------| | |||
* | F7| F8| |Shif| <| Z| X| C| V| B| N| M| ,| .| /| RO|Shift | |F11| Up|F12| | 1| 2| 3|KP=| | |||
* |-------| |-----------------------------------------------------------| |-----------| |---------------| | |||
* | F9|F10| |Ctrl |Gui|Alt | Space |Alt* |Gui|Ctrl | |Lef|Dow|Rig| |Esc| 0|KP.|Ent| | |||
* `-------' `-----------------------------------------------------------' `-----------' `---------------' | |||
* scan codes | |||
* ,-------. ,-----------------------------------------------------------. ,-----------. ,---------------. | |||
* | 46| 64| | 00| 18| 19| 1A| 10| 11| 12| 08| 09| 0A| 0F| 1F| 0D| 0C| 0E| | 6A| 6B| 6C| | 47| 48| 49| 4A| | |||
* |-------| |-----------------------------------------------------------| |-----------| |---------------| | |||
* | 56| 66| | 04 | 05| 06| 13| 14| 15| 16| 17| 01| 02| 03| 1B| 1C| 1D| | 6D| 6E| 6F| | 4B| 4C| 4D| 4E| | |||
* |-------| |-----------------------------------------------------------| |-----------| |---------------| | |||
* | 71| 77| | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2A| 2B| 2C| 2D| | 70| 65| 72| | 50| 51| 52| 53| | |||
* |-------| |-----------------------------------------------------------| |-----------| |---------------| | |||
* | 44| 45| | 30 | 3E| 32| 33| 34| 35| 36| 37| 38| 39| 3A| 3B| 3C| 3D| | 74| 75| 76| | 5E| 58| 59| 5A| | |||
* |-------| |-----------------------------------------------------------| |-----------| |---------------| | |||
* | 54| 55| | 31 | 41| 3F | 40 | *3F | 42| 2F | | 78| 67| 79| | 5B| 5C| 5D| 57| | |||
* `-------' `-----------------------------------------------------------' `-----------' `---------------' | |||
* Both Alt keys spit same scan code 3F. | |||
*/ | |||
{ UNIMAP_GRV, UNIMAP_I, UNIMAP_O, UNIMAP_P, UNIMAP_TAB, UNIMAP_Q, UNIMAP_W, UNIMAP_NO }, // 00-07 | |||
{ UNIMAP_7, UNIMAP_8, UNIMAP_9, UNIMAP_NO, UNIMAP_JYEN, UNIMAP_EQL, UNIMAP_BSPC, UNIMAP_0 }, // 08-0F | |||
{ UNIMAP_4, UNIMAP_5, UNIMAP_6, UNIMAP_E, UNIMAP_R, UNIMAP_T, UNIMAP_Y, UNIMAP_U }, // 10-17 | |||
{ UNIMAP_1, UNIMAP_2, UNIMAP_3, UNIMAP_LBRC, UNIMAP_RBRC, UNIMAP_BSLS, UNIMAP_NO, UNIMAP_MINS }, // 18-1F | |||
{ UNIMAP_CAPS, UNIMAP_A, UNIMAP_S, UNIMAP_D, UNIMAP_F, UNIMAP_G, UNIMAP_H, UNIMAP_J }, // 20-27 | |||
{ UNIMAP_K, UNIMAP_L, UNIMAP_SCLN, UNIMAP_QUOT, UNIMAP_NUHS, UNIMAP_ENT, UNIMAP_NO, UNIMAP_RCTL }, // 28-2F | |||
{ UNIMAP_LSFT, UNIMAP_LCTL, UNIMAP_Z, UNIMAP_X, UNIMAP_C, UNIMAP_V, UNIMAP_B, UNIMAP_N, }, // 30-37 | |||
{ UNIMAP_M, UNIMAP_COMM, UNIMAP_DOT, UNIMAP_SLSH, UNIMAP_RO, UNIMAP_RSFT, UNIMAP_NUBS, UNIMAP_LALT }, // 38-3F | |||
{ UNIMAP_SPC, UNIMAP_LGUI, UNIMAP_RGUI, UNIMAP_NO, UNIMAP_F7, UNIMAP_F8, UNIMAP_F1, UNIMAP_NLCK }, // 40-47 | |||
{ UNIMAP_PSLS, UNIMAP_PAST, UNIMAP_PMNS, UNIMAP_P7, UNIMAP_P8, UNIMAP_P9, UNIMAP_PPLS, UNIMAP_NO }, // 48-4F | |||
{ UNIMAP_P4, UNIMAP_P5, UNIMAP_P6, UNIMAP_PCMM, UNIMAP_F9, UNIMAP_F10, UNIMAP_F3, UNIMAP_PENT }, // 50-57 | |||
{ UNIMAP_P2, UNIMAP_P3, UNIMAP_PEQL, UNIMAP_ESC, UNIMAP_P0, UNIMAP_PDOT, UNIMAP_P1, UNIMAP_NO }, // 58-5F | |||
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_F2, UNIMAP_SLCK, UNIMAP_F4, UNIMAP_DOWN }, // 60-67 | |||
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_INS, UNIMAP_HOME, UNIMAP_PGUP, UNIMAP_DEL, UNIMAP_END, UNIMAP_PGDN }, // 68-6F | |||
{ UNIMAP_PSCR, UNIMAP_F5, UNIMAP_PAUS, UNIMAP_NO, UNIMAP_F11, UNIMAP_UP, UNIMAP_F12, UNIMAP_F6 }, // 70-77 | |||
{ UNIMAP_LEFT, UNIMAP_RGHT, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO } // 78-7F | |||
#else | |||
/* IBM4740 Alps models(102-key) | |||
* ,---------------------------------------------------------------. ,-----------. ,---------------. | |||
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|BSp| F1| |Ins|Hom|PgU| |NmL| /| *| -| | |||
* |---------------------------------------------------------------| |-----------| |---------------| | |||
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| F2| |Del|End|PgD| | 7| 8| 9| +| | |||
* |---------------------------------------------------------------| |-----------| |---------------| | |||
* |Caps | A| S| D| F| G| H| J| K| L| ;| '| #|Retn| F3| |PrS|ScL|Pau| | 4| 5| 6|KP,| | |||
* |---------------------------------------------------------------| |-----------| |---------------| | |||
* |Shift | Z| X| C| V| B| N| M| ,| .| /| RO|Shift | F4| |F11| Up|F12| | 1| 2| 3|KP=| | |||
* |---------------------------------------------------------------| |-----------| |---------------| | |||
* |Ctrl |Gui|Alt | Space |Alt |Gui| Ctrl | |Lef|Dow|Rig| |Esc| 0|KP.|Ent| | |||
* `---------------------------------------------------------------' `-----------' `---------------' | |||
* ,---------------------------------------------------------------. ,-----------. ,---------------. | |||
* | 00| 0F| 01| 02| 03| 04| 05| 06| 07| 08| 09| 0A| 0B| 0C| 0D| 0E| | 44| 45| 46| | 43| 41| 42| 4A| | |||
* |---------------------------------------------------------------| |-----------| |---------------| | |||
* | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1A| 1B| 1C| 1D | 1E| | 54| 55| 56| | 50| 51| 52| 5A| | |||
* |---------------------------------------------------------------| |-----------| |---------------| | |||
* | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2A| 2B| 2C| 2D | 2E| | 64| 65| 66| | 60| 61| 62| 6B| | |||
* |---------------------------------------------------------------| |-----------| |---------------| | |||
* | 30 | 32| 33| 34| 35| 36| 37| 38| 39| 3A| 3B| 3C| 3D | 3E| | 74| 75| 76| | 70| 71| 72| 7B| | |||
* |---------------------------------------------------------------| |-----------| |---------------| | |||
* | 31 | 47| 3F | 40 | 4F | 48| 2F | | 77| 67| 57| | 73| 63| 53| 4E| | |||
* `---------------------------------------------------------------' `-----------' `---------------' | |||
*/ | |||
{ UNIMAP_GRV, UNIMAP_2, UNIMAP_3, UNIMAP_4, UNIMAP_5, UNIMAP_6, UNIMAP_7, UNIMAP_8 }, // 00-07 | |||
{ UNIMAP_9, UNIMAP_0, UNIMAP_MINS, UNIMAP_EQL, UNIMAP_JYEN, UNIMAP_BSPC, UNIMAP_F1, UNIMAP_1 }, // 08-0F | |||
{ UNIMAP_TAB, UNIMAP_Q, UNIMAP_W, UNIMAP_E, UNIMAP_R, UNIMAP_T, UNIMAP_Y, UNIMAP_U }, // 10-17 | |||
{ UNIMAP_I, UNIMAP_O, UNIMAP_P, UNIMAP_LBRC, UNIMAP_RBRC, UNIMAP_BSLS, UNIMAP_F2, UNIMAP_NO }, // 18-1F | |||
{ UNIMAP_CAPS, UNIMAP_A, UNIMAP_S, UNIMAP_D, UNIMAP_F, UNIMAP_G, UNIMAP_H, UNIMAP_J }, // 20-27 | |||
{ UNIMAP_K, UNIMAP_L, UNIMAP_SCLN, UNIMAP_QUOT, UNIMAP_NUHS, UNIMAP_ENT, UNIMAP_F3, UNIMAP_RCTL }, // 28-2F | |||
{ UNIMAP_LSFT, UNIMAP_LCTL, UNIMAP_Z, UNIMAP_X, UNIMAP_C, UNIMAP_V, UNIMAP_B, UNIMAP_N }, // 30-37 | |||
{ UNIMAP_M, UNIMAP_COMM, UNIMAP_DOT, UNIMAP_SLSH, UNIMAP_RO, UNIMAP_RSFT, UNIMAP_F4, UNIMAP_LALT }, // 38-3F | |||
{ UNIMAP_SPC, UNIMAP_PSLS, UNIMAP_PAST, UNIMAP_NLCK, UNIMAP_INS, UNIMAP_HOME, UNIMAP_PGUP, UNIMAP_LGUI }, // 40-47 | |||
{ UNIMAP_RGUI, UNIMAP_NO, UNIMAP_PMNS, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_PENT, UNIMAP_RALT }, // 48-4F | |||
{ UNIMAP_P7, UNIMAP_P8, UNIMAP_P9, UNIMAP_PDOT, UNIMAP_DEL, UNIMAP_END, UNIMAP_PGDN, UNIMAP_RGHT }, // 50-57 | |||
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_PPLS, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, }, // 58-5F | |||
{ UNIMAP_P4, UNIMAP_P5, UNIMAP_P6, UNIMAP_P0, UNIMAP_PSCR, UNIMAP_SLCK, UNIMAP_PAUS, UNIMAP_DOWN }, // 60-67 | |||
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_PCMM, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, }, // 68-6F | |||
{ UNIMAP_P1, UNIMAP_P2, UNIMAP_P3, UNIMAP_ESC, UNIMAP_F11, UNIMAP_UP, UNIMAP_F12, UNIMAP_LEFT }, // 70-77 | |||
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, } // 78-7F | |||
#endif | |||
}; | |||
#endif |
@@ -0,0 +1,2 @@ | |||
OPT_DEFS += -DINFINITY_LED | |||
include Makefile |
@@ -0,0 +1,2 @@ | |||
OPT_DEFS += -DINFINITY_PROTOTYPE | |||
include Makefile |
@@ -26,8 +26,12 @@ http://cache.freescale.com/files/32bit/doc/data_sheet/K20P48M50SF0.pdf | |||
Pin Usage | |||
========= | |||
Key Matrix: | |||
Strobe(output high): PTB0 PTB1 PTB2 PTB3 PTB16 PTB17 PTC4 PTC5 PTD0 | |||
Sense(input with pull-down): PTD1 PTD2 PTD3 PTD4 PTD5 PTD6 PTD7 | |||
For v1.0 (without LED support) | |||
strobe(output high): ptb0 ptb1 ptb2 ptb3 ptb16 ptb17 ptc4 ptc5 ptd0 | |||
sense(input with pull-down): ptd1 ptd2 ptd3 ptd4 ptd5 ptd6 ptd7 | |||
For v1.1a (with LED support) | |||
strobe(output high): ptc0 ptc1 ptc2 ptc3 ptc4 ptc5 ptc6 ptc7 ptd0 | |||
sense(input with pull-down): ptd1 ptd2 ptd3 ptd4 ptd5 ptd6 ptd7 | |||
SWD pinout: | |||
@@ -47,7 +51,7 @@ kiibohd bootloader: Lib/mk20dx128vlf5.bootloader.ld | |||
| .vectors | ------------. | StackPointer0 | of Bootloader | |||
| .startup | \ | ResetHandler1 | | |||
| .rodata | `--+---------------+ 0xF8 | |||
0x0000_0400 | .flashconfig(0x10)| | |||
0x0000_0400 | .flashconfig(0x10)| | |||
_0410 | .text | | |||
| .init | | |||
0x0000_1000 +-------------------+ -----------------+---------------+ Vector table | |||
@@ -62,7 +66,7 @@ kiibohd bootloader: Lib/mk20dx128vlf5.bootloader.ld | |||
0x1FFF_E000 +-------------------+ -----------------+---------------+ Vector table | |||
_E0F8 | | ------------. | | of App(copied) | |||
| | \ | | | |||
| | \ | | | |||
| | `--+---------------+ mbed NVIC | |||
| | | |||
| RAM | |
@@ -34,10 +34,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
#define MATRIX_COLS 7 // Sense | |||
/* key combination for command */ | |||
#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) | |||
#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) | |||
/* for prototype */ | |||
//#define INFINITY_PROTOTYPE | |||
/* Version 1.1a of the board */ | |||
//#define INFINITY_LED | |||
#endif |
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
#include "led.h" | |||
/* HHKB has no LEDs */ | |||
/* TODO: setup led support for 1.1a version of the board */ | |||
void led_set(uint8_t usb_led) | |||
{ | |||
} |
@@ -39,6 +39,7 @@ void matrix_init(void) | |||
gpio_init_in_ex(&col[5], PTD6, PullDown); | |||
gpio_init_in_ex(&col[6], PTD7, PullDown); | |||
#ifndef INFINITY_LED | |||
/* Row(strobe) */ | |||
gpio_init_out_ex(&row[0], PTB0, 0); | |||
gpio_init_out_ex(&row[1], PTB1, 0); | |||
@@ -49,6 +50,18 @@ void matrix_init(void) | |||
gpio_init_out_ex(&row[6], PTC4, 0); | |||
gpio_init_out_ex(&row[7], PTC5, 0); | |||
gpio_init_out_ex(&row[8], PTD0, 0); | |||
#else | |||
gpio_init_out_ex(&row[0], PTC0, 0); | |||
gpio_init_out_ex(&row[1], PTC1, 0); | |||
gpio_init_out_ex(&row[2], PTC2, 0); | |||
gpio_init_out_ex(&row[3], PTC3, 0); | |||
gpio_init_out_ex(&row[4], PTC4, 0); | |||
gpio_init_out_ex(&row[5], PTC5, 0); | |||
gpio_init_out_ex(&row[6], PTC6, 0); | |||
gpio_init_out_ex(&row[7], PTC7, 0); | |||
gpio_init_out_ex(&row[8], PTD0, 0); | |||
#endif | |||
} | |||
uint8_t matrix_scan(void) |
@@ -27,6 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
#include "action_util.h" | |||
#include "action.h" | |||
#include "hook.h" | |||
#include "wait.h" | |||
#ifdef DEBUG_ACTION | |||
#include "debug.h" | |||
@@ -365,6 +366,7 @@ void register_code(uint8_t code) | |||
#endif | |||
add_key(KC_CAPSLOCK); | |||
send_keyboard_report(); | |||
wait_ms(100); | |||
del_key(KC_CAPSLOCK); | |||
send_keyboard_report(); | |||
} | |||
@@ -375,6 +377,7 @@ void register_code(uint8_t code) | |||
#endif | |||
add_key(KC_NUMLOCK); | |||
send_keyboard_report(); | |||
wait_ms(100); | |||
del_key(KC_NUMLOCK); | |||
send_keyboard_report(); | |||
} | |||
@@ -385,6 +388,7 @@ void register_code(uint8_t code) | |||
#endif | |||
add_key(KC_SCROLLLOCK); | |||
send_keyboard_report(); | |||
wait_ms(100); | |||
del_key(KC_SCROLLLOCK); | |||
send_keyboard_report(); | |||
} | |||
@@ -440,6 +444,7 @@ void unregister_code(uint8_t code) | |||
#endif | |||
add_key(KC_CAPSLOCK); | |||
send_keyboard_report(); | |||
wait_ms(100); | |||
del_key(KC_CAPSLOCK); | |||
send_keyboard_report(); | |||
} | |||
@@ -450,6 +455,7 @@ void unregister_code(uint8_t code) | |||
#endif | |||
add_key(KC_NUMLOCK); | |||
send_keyboard_report(); | |||
wait_ms(100); | |||
del_key(KC_NUMLOCK); | |||
send_keyboard_report(); | |||
} | |||
@@ -460,6 +466,7 @@ void unregister_code(uint8_t code) | |||
#endif | |||
add_key(KC_SCROLLLOCK); | |||
send_keyboard_report(); | |||
wait_ms(100); | |||
del_key(KC_SCROLLLOCK); | |||
send_keyboard_report(); | |||
} |
@@ -23,6 +23,7 @@ CC_FLAGS += \ | |||
-fdata-sections \ | |||
-fomit-frame-pointer | |||
CC_FLAGS += -MMD -MP | |||
CC_FLAGS += $(OPT_DEFS) | |||
LD_FLAGS = $(CPU) -Wl,--gc-sections --specs=nano.specs | |||
#LD_FLAGS += -u _printf_float -u _scanf_float |