diff options
author | Jack Humbert <jack.humb@gmail.com> | 2015-10-27 12:42:30 -0400 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2015-10-27 12:42:30 -0400 |
commit | 547da78335298df6666200c6063ac6f1aba312fd (patch) | |
tree | 47df0252ee24b1ecc27b9dd0458c51f20bf088c3 /converter | |
parent | a766918d5c48204375f4c207b30bbbf1389df14f (diff) | |
parent | fa33719adab1393753312d298b8c365e04e844b9 (diff) |
merging tmk
Diffstat (limited to 'converter')
59 files changed, 1137 insertions, 704 deletions
diff --git a/converter/adb_usb/Makefile b/converter/adb_usb/Makefile index bbb7810eef..2369ee70ac 100644 --- a/converter/adb_usb/Makefile +++ b/converter/adb_usb/Makefile @@ -42,7 +42,7 @@ TARGET = adb_usb_lufa # Directory common source filess exist -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core # Directory keyboard dependent files exist TARGET_DIR = . @@ -122,6 +122,10 @@ CONSOLE_ENABLE = yes # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend #NKRO_ENABLE = yes # USB Nkey Rollover +ADB_MOUSE_ENABLE = yes + +# ADB Mice need acceleration for todays much bigger screens. +OPT_DEFS += -DADB_MOUSE_MAXACC=8 # Optimize size but this may cause error "relocation truncated to fit" @@ -129,9 +133,9 @@ COMMAND_ENABLE = yes # Commands for debug and configuration # Search Path VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) -include $(TOP_DIR)/protocol/lufa.mk -include $(TOP_DIR)/protocol.mk -include $(TOP_DIR)/common.mk -include $(TOP_DIR)/rules.mk +include $(TMK_DIR)/protocol/lufa.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/rules.mk diff --git a/converter/adb_usb/Makefile.pjrc b/converter/adb_usb/Makefile.pjrc index 2eb41b34b4..c320c09d25 100644 --- a/converter/adb_usb/Makefile.pjrc +++ b/converter/adb_usb/Makefile.pjrc @@ -2,7 +2,7 @@ TARGET = adb_usb_pjrc # Directory common source filess exist -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core # Directory keyboard dependent files exist TARGET_DIR = . @@ -57,13 +57,17 @@ CONSOLE_ENABLE = yes # Console for debug COMMAND_ENABLE = yes # Commands for debug and configuration #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend #NKRO_ENABLE = yes # USB Nkey Rollover(+500) +ADB_MOUSE_ENABLE = yes + +# ADB Mice need acceleration for todays much bigger screens. +OPT_DEFS += -DADB_MOUSE_MAXACC=8 # Search Path VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) -include $(TOP_DIR)/protocol/pjrc.mk -include $(TOP_DIR)/protocol.mk -include $(TOP_DIR)/common.mk -include $(TOP_DIR)/rules.mk +include $(TMK_DIR)/protocol/pjrc.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/rules.mk diff --git a/converter/adb_usb/README.md b/converter/adb_usb/README.md index 21ad318c1d..46082ff67f 100644 --- a/converter/adb_usb/README.md +++ b/converter/adb_usb/README.md @@ -7,70 +7,69 @@ But binary size is about 10KB or more it doesn't fit into 8K flash like ATMega8U Discuss: http://geekhack.org/showwiki.php?title=Island:14290 + +README FIRST +------------ +https://github.com/tmk/tmk_keyboard +https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb + +Also check these when you are in trouble. + +https://github.com/tmk/tmk_keyboard/wiki +https://github.com/tmk/tmk_keyboard/labels/NOTE + + Wiring ------ -0. Connect ADB keyboard to Teensy by 3 lines(Vcc, GND, Data). By default Data line uses port PD0. - This converter uses AVR's internal pull-up, but it seems to be too weak, in particular when you want to use a long or coiled cable. - The external pull-up resistor(1K-10K Ohm) on Data is strongly recommended. -1. Define following macros for ADB connection in config.h if you use other than port PD0. - ADB_PORT, ADB_PIN, ADB_DDR, ADB_DATA_BIT -2. make -3. program Teensy +Connect ADB pins to controller just by 3 lines(Vcc, GND, Data). By default Data line uses port PD0. + +ADB female socket from the front: + + ,--_--. + / o4 3o \ 1: DATA + | o2 1o | 2: Power SW + - === - 3: VCC + `-___-' 4: GND + +This converter uses AVR's internal pull-up, but it seems to be too weak, in particular when you want to use a long or coiled cable. The external pull-up resistor(1K-10K Ohm) on Data is strongly recommended.(It is almost must!) +https://github.com/tmk/tmk_keyboard/wiki/FAQ#pull-up-resistor + +Pull-up resister: + + Keyboard Conveter + ,------. + 5V------+------|VCC | + | | | + [R] | | + | | | + Signal--+------|PD0 | + | | + GND------------|GND | + `------' + R: 1K Ohm resistor + + +Define following macros for ADB connection in config.h if you use other than port PD0. + + ADB_PORT, ADB_PIN, ADB_DDR, ADB_DATA_BIT Build ----- -Just make +See doc/build.md. In short, $ make clean $ make -If your keyboard is ISO layout +You can select keymap(ansi is default) like this: - $ make KEYMAP=iso - - -LOCKING CAPSLOCK ----------------- -Many of old ADB keyboards have mechanical push-lock switch for Capslock key and this converter supports the locking Capslock key by default. See README in top directory for more detail about this feature. - -Also you may want to remove locking pin from the push-lock switch to use capslock as a normal momentary switch. -http://www.youtube.com/watch?v=9wqnt2mGJ2Y + $ make KEYMAP=[ansi|iso|hasu] Keymap ------ -You can change a keymap by editing code of keymap.c like following. -This is a keymap for AEK, however, also used for other keyboards. -How to define the keymap is probably obvious. You can find key symbols in keycode.h. -If you want to define some keymaps than just one, see hhkb/keymap.c and -macway/keymap.c as examples. Keymap(layer) switching may needs a bit of -effort at this time. - - /* Default Layer: plain keymap - * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,---. - * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Pwr| - * `---' `---------------' `---------------' `---------------' `-----------' `---' - * ,-----------------------------------------------------------. ,-----------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| =| /| *| - * |-----------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| -| - * |-----------------------------------------------------------| `-----------' |---------------| - * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| +| - * |-----------------------------------------------------------| ,---. |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| | - * |-----------------------------------------------------------| ,-----------. |-----------|Ent| - * |Ctrl |Alt |Gui | Space |Gui |Alt |Ctrl | |Lef|Dow|Rig| | 0| .| | - * `-----------------------------------------------------------' `-----------' `---------------' - */ - KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, PWR, - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,EQL, PSLS,PAST, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, PMNS, - LCAP,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, - LCTL,LGUI,LALT, SPC, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), +You can change a keymap by editing code of keymap_[ansi|iso|hasu|yours].c. +How to define the keymap is probably obvious. You can find key symbols in common/keycode.h. And see doc/keymap.md for more detail. Magic command @@ -78,6 +77,14 @@ Magic command To get help press `h` holding Magic key. Magic key is `Power key`. +Locking CapsLock +---------------- +Many of old ADB keyboards have mechanical push-lock switch for Capslock key and this converter supports the locking Capslock key by default. See README in top directory for more detail about this feature. +https://github.com/tmk/tmk_keyboard/blob/master/README.md#mechanical-locking-support + +Also you may want to remove locking pin from the push-lock switch to use capslock as a normal momentary switch. + + Notes ----- Not-extended ADB keyboards have no discrimination between right modifier and left one, diff --git a/converter/adb_usb/keymap_ansi.c b/converter/adb_usb/keymap_ansi.c index 0d0bae99b5..4ea601be0a 100644 --- a/converter/adb_usb/keymap_ansi.c +++ b/converter/adb_usb/keymap_ansi.c @@ -3,7 +3,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KEYMAP_EXT_ANSI( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, PWR, + ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, NO, GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PEQL,PSLS,PAST, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, PMNS, LCAP,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, diff --git a/converter/adb_usb/keymap_hasu.c b/converter/adb_usb/keymap_hasu.c index f2e59b3e91..a0b3f1fc68 100644 --- a/converter/adb_usb/keymap_hasu.c +++ b/converter/adb_usb/keymap_hasu.c @@ -22,7 +22,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, NO, GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,EQL, PSLS,PAST, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,FN0, DEL, END, PGDN, P7, P8, P9, PMNS, - CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, + LCAP,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, LCTL,LGUI,LALT, SPC, RGUI,RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT ), @@ -47,7 +47,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, NO, ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, INS, HOME,PGUP, NLCK,BTN1,BTN2,BTN3, TAB, Q, W, E, R, T, Y, U, PSCR,SLCK,PAUS,UP, INS, FN0, DEL, END, PGDN, WH_D,MS_U,WH_U,WH_D, - CAPS,VOLD,VOLU,MUTE,F, G, H, J, HOME,PGUP,LEFT,RGHT, ENT, MS_L,MS_D,MS_R,WH_U, + LCAP,VOLD,VOLU,MUTE,F, G, H, J, HOME,PGUP,LEFT,RGHT, ENT, MS_L,MS_D,MS_R,WH_U, LSFT,Z, X, C, V, B, N, M, END, PGDN,DOWN, RSFT, PGUP, WH_L,MS_D,WH_R, LCTL,LGUI,LALT, SPC, RGUI,RCTL, HOME,PGDN,END, BTN1, BTN2,BTN3 ), diff --git a/converter/adb_usb/keymap_iso.c b/converter/adb_usb/keymap_iso.c index 451d3d2c35..a1b1a5ebd3 100644 --- a/converter/adb_usb/keymap_iso.c +++ b/converter/adb_usb/keymap_iso.c @@ -3,7 +3,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KEYMAP_EXT_ISO( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, PWR, + ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, NO, GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PEQL,PSLS,PAST, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,ENT, DEL, END, PGDN, P7, P8, P9, PMNS, LCAP,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NUHS, P4, P5, P6, PPLS, diff --git a/converter/adb_usb/matrix.c b/converter/adb_usb/matrix.c index 405391865f..6220ee6e1c 100644 --- a/converter/adb_usb/matrix.c +++ b/converter/adb_usb/matrix.c @@ -27,6 +27,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "debug.h" #include "adb.h" #include "matrix.h" +#include "report.h" +#include "host.h" #if (MATRIX_COLS > 16) @@ -38,6 +40,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. static bool is_modified = false; +static report_mouse_t mouse_report = {}; // matrix state buffer(1:on, 0:off) #if (MATRIX_COLS <= 8) @@ -86,6 +89,64 @@ void matrix_init(void) return; } +#ifdef ADB_MOUSE_ENABLE + +#ifdef MAX +#undef MAX +#endif +#define MAX(X, Y) ((X) > (Y) ? (X) : (Y)) + +void adb_mouse_task(void) +{ + uint16_t codes; + int16_t x, y; + static int8_t mouseacc; + _delay_ms(12); // delay for preventing overload of poor ADB keyboard controller + codes = adb_host_mouse_recv(); + // If nothing received reset mouse acceleration, and quit. + if (!codes) { + mouseacc = 1; + return; + }; + // Bit sixteen is button. + if (~codes & (1 << 15)) + mouse_report.buttons |= MOUSE_BTN1; + if (codes & (1 << 15)) + mouse_report.buttons &= ~MOUSE_BTN1; + // lower seven bits are movement, as signed int_7. + // low byte is X-axis, high byte is Y. + y = (codes>>8 & 0x3F); + x = (codes>>0 & 0x3F); + // bit seven and fifteen is negative + // usb does not use int_8, but int_7 (measuring distance) with sign-bit. + if (codes & (1 << 6)) + x = (x-0x40); + if (codes & (1 << 14)) + y = (y-0x40); + // Accelerate mouse. (They weren't meant to be used on screens larger than 320x200). + x *= mouseacc; + y *= mouseacc; + // Cap our two bytes per axis to one byte. + // Easier with a MIN-function, but since -MAX(-a,-b) = MIN(a,b)... + // I.E. MIN(MAX(x,-127),127) = -MAX(-MAX(x, -127), -127) = MIN(-MIN(-x,127),127) + mouse_report.x = -MAX(-MAX(x, -127), -127); + mouse_report.y = -MAX(-MAX(y, -127), -127); + if (debug_mouse) { + print("adb_host_mouse_recv: "); print_bin16(codes); print("\n"); + print("adb_mouse raw: ["); + phex(mouseacc); print(" "); + phex(mouse_report.buttons); print("|"); + print_decs(mouse_report.x); print(" "); + print_decs(mouse_report.y); print("]\n"); + } + // Send result by usb. + host_mouse_send(&mouse_report); + // increase acceleration of mouse + mouseacc += ( mouseacc < ADB_MOUSE_MAXACC ? 1 : 0 ); + return; +} +#endif + uint8_t matrix_scan(void) { /* extra_key is volatile and more convoluted than necessary because gcc refused diff --git a/converter/ascii_usb/Makefile b/converter/ascii_usb/Makefile index 408aa42375..6d977afc05 100644 --- a/converter/ascii_usb/Makefile +++ b/converter/ascii_usb/Makefile @@ -2,7 +2,7 @@ TARGET = ascii_usb # Directory common source filess exist -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core # Directory keyboard dependent files exist TARGET_DIR = . @@ -73,10 +73,10 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Search Path VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) -include $(TOP_DIR)/protocol/lufa.mk -include $(TOP_DIR)/protocol.mk -include $(TOP_DIR)/common.mk -include $(TOP_DIR)/rules.mk +include $(TMK_DIR)/protocol/lufa.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/rules.mk diff --git a/converter/ibm4704_usb/Makefile b/converter/ibm4704_usb/Makefile index 112b00129d..b5c97d2d31 100644 --- a/converter/ibm4704_usb/Makefile +++ b/converter/ibm4704_usb/Makefile @@ -2,7 +2,7 @@ TARGET = ibm4704_usb # Directory common source filess exist -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core # Directory keyboard dependent files exist TARGET_DIR = . @@ -85,9 +85,9 @@ COMMAND_ENABLE = yes # Commands for debug and configuration # Search Path VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) -include $(TOP_DIR)/protocol.mk -include $(TOP_DIR)/protocol/lufa.mk -include $(TOP_DIR)/common.mk -include $(TOP_DIR)/rules.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/protocol/lufa.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/rules.mk diff --git a/converter/ibm4704_usb/README.md b/converter/ibm4704_usb/README.md index a3af4ab31d..68db4bd050 100644 --- a/converter/ibm4704_usb/README.md +++ b/converter/ibm4704_usb/README.md @@ -5,13 +5,21 @@ This firmware converts IBM 4704 keyboard protocol to USB HID. 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.** +Update +------ +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. + + + Supported Keyboard ------------------ ### IBM capacitive switch models: -- 6019273 Model 100 50-key (grid layout) http://kishy.dyndns.org/?p=977 -- 6019284 Model 200 62-key Alpha(60% layout) http://kishy.dyndns.org/?p=894 -- 6019303 Model 300 77-key Expanded Alpha http://kbtalking.cool3c.com/article/23272 -- 6020218 Model 400 107-key Full key http://kishy.dyndns.org/?p=980 +- 6019273 Model 100 50-key (grid layout) http://kishy.ca/?p=894 +- 6019284 Model 200 62-key Alpha(60% layout) http://kishy.ca/?p=894 +- 6019303 Model 300 77-key Expanded Alpha http://deskthority.net/photos-f62/ibm-6019303-t8502.html +- 6020218 Model 400 107-key Full key http://kishy.ca/?p=894 ### Alps switch(vintage Green) models: @@ -60,3 +68,5 @@ To select keymap: Keymap ------ Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `keymap_<name>.c` and see keymap document(you can find in top README.md) and existent keymap files. + +Use `KEYMAP_ALPS102()` to define your keymap for Alps models. diff --git a/converter/ibm4704_usb/config.h b/converter/ibm4704_usb/config.h index 4f82f49ad3..2fee10fd61 100644 --- a/converter/ibm4704_usb/config.h +++ b/converter/ibm4704_usb/config.h @@ -41,9 +41,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. -/* - * Busywait - */ +/* Pin configuration */ #define IBM4704_CLOCK_PORT PORTD #define IBM4704_CLOCK_PIN PIND #define IBM4704_CLOCK_DDR DDRD @@ -53,22 +51,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define IBM4704_DATA_DDR DDRD #define IBM4704_DATA_BIT 0 -/* - * Pin interrupt - */ -#ifdef IBM4704_USE_INT -#define IBM4704_INT_INIT() do { \ - EICRA |= ((1<<ISC11) | \ - (0<<ISC10)); \ -} while (0) -#define IBM4704_INT_ON() do { \ - EIMSK |= (1<<INT1); \ -} while (0) -#define IBM4704_INT_OFF() do { \ - EIMSK &= ~(1<<INT1); \ -} while (0) +/* Pin interrupt on rising edge of clock */ +#define IBM4704_INT_INIT() do { EICRA |= ((1<<ISC11)|(1<<ISC10)); } while (0) +#define IBM4704_INT_ON() do { EIFR |= (1<<INTF1); EIMSK |= (1<<INT1); } while (0) +#define IBM4704_INT_OFF() do { EIMSK &= ~(1<<INT1); } while (0) #define IBM4704_INT_VECT INT1_vect -#endif #endif diff --git a/converter/ibm4704_usb/ibm4704.txt b/converter/ibm4704_usb/ibm4704.txt index 877d8fdb9a..e2d42f08fd 100644 --- a/converter/ibm4704_usb/ibm4704.txt +++ b/converter/ibm4704_usb/ibm4704.txt @@ -1,10 +1,10 @@ IBM 4704 Keyboard ================= IBM capacitive switch models: - 6019273 Model 100 50-key (grid layout) http://kishy.dyndns.org/?p=977 - 6019284 Model 200 62-key Alpha(60% layout) http://kishy.dyndns.org/?p=894 - 6019303 Model 300 77-key Expanded Alpha http://kbtalking.cool3c.com/article/23272 - 6020218 Model 400 107-key Full key http://kishy.dyndns.org/?p=980 + 6019273 Model 100 50-key (grid layout) http://kishy.ca/?p=894 + 6019284 Model 200 62-key Alpha(60% layout) http://kishy.ca/?p=894 + 6019303 Model 300 77-key Expanded Alpha http://deskthority.net/photos-f62/ibm-6019303-t8502.html + 6020218 Model 400 107-key Full key http://kishy.ca/?p=894 Alps switch(vintage Green) models: 5954339 Japanese 102-key http://deskthority.net/post87127.html#p87127 @@ -33,7 +33,7 @@ so that it doesn't send any scancode until you send 'FF'(End of FC command mode) Model 100 50-key A2h Model 200 62-key A3h Model 300 77-key A4h - Model 400 107-key ?? + Model 400 107-key A5h Japanese/Chinese 102-key A6h @@ -57,15 +57,15 @@ Keyboard to Host ---------------- Data bits are LSB first and Pairty is odd. Clock has around 60us high and 30us low part. - ____ __ __ __ __ __ __ __ __ __ ________ - Clock \____/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ + ____ __ __ __ __ __ __ __ __ __ _______ + Clock \_____/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ Data ____/ X____X____X____X____X____X____X____X____X____X________ Start 0 1 2 3 4 5 6 7 P Stop Start bit: can be long as 300-350us. Inhibit: Pull Data line down to inhibit keyboard to send. -Timing: Host reads bit while Clock is hi. +Timing: Host reads bit while Clock is hi.(rising edge) Stop bit: Keyboard pulls down Data line to lo after 9th clock. @@ -166,13 +166,14 @@ Data sent from host: | `-----`--- scan code `------------- enable bit(0: enable repeat, 1: enable break) - 00-77 Enable repeat(78-7F: invalid scancode) - 80-F7 Enable break(F8-FF: invalid scancode) + 00-79 Enable repeat + 80-F9 Enable break(FA-FF are used as other commands, see above.) FE Resend(011ah) no need to use FF End(0114h) exits FC command mode. Response from keyboard: FD Out of bound - Invalid scancode + -- OK - No response means that command is accepted. Examples: To enable break code of all keys. diff --git a/converter/ibm4704_usb/keymap_50key.c b/converter/ibm4704_usb/keymap_50key.c new file mode 100644 index 0000000000..97294fb45d --- /dev/null +++ b/converter/ibm4704_usb/keymap_50key.c @@ -0,0 +1,17 @@ +#include "keymap_common.h" + + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + KEYMAP_50( + F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, \ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, \ + Q, W, E, R, T, Y, U, I, O, P, \ + A, S, D, F, G, H, J, K, L, SCLN, \ + Z, X, C, V, B, N, M, COMM,DOT, SLSH \ + ), +}; + +const uint16_t PROGMEM fn_actions[] = { +}; + + diff --git a/converter/ibm4704_usb/keymap_alps102key.c b/converter/ibm4704_usb/keymap_alps102key.c new file mode 100644 index 0000000000..f3dda718ac --- /dev/null +++ b/converter/ibm4704_usb/keymap_alps102key.c @@ -0,0 +1,50 @@ +#include "keymap_common.h" + + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Layer 0: + * ,---------------------------------------------------------------. ,-----------. ,---------------. + * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|BS |BS |F21| |PSC|SLK|PAU| |F1 |F2 |F3 |F4 | + * |---------------------------------------------------------------| |-----------| |---------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|F22| |Ins|Hom|PgU| |F5 |F6 |F7 |F8 | + * |---------------------------------------------------------------| |-----------| |---------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Ret|Ret |F23| |Del|End|PgD| |F9 |F10|F11|F12| + * |---------------------------------------------------------------| |-----------| |---------------| + * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shf|Shift |F24| | |Up | | |F13|F14|F15|F16| + * |---------------------------------------------------------------| |-----------| |---------------| + * |Fn0 |Gui|Alt | Space |Alt* |Gui|Fn0 | |Lef|Dow|Rig| |F17|F18|F19|F20| + * `---------------------------------------------------------------' `-----------' `---------------' + */ + KEYMAP_ALPS102( + ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC,BSPC,F21, PSCR,SLCK,PAUS, F1, F2, F3, F4, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, F22, INS, HOME,PGUP, F5, F6, F7, F8, \ + LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,GRV, ENT, F23, DEL, END, PGDN, F9, F10, F11, F12, \ + LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT,RSFT, F24, NO, UP, NO, F13, F14, F15, F16, \ + FN0, LGUI,LALT, SPC, RALT,RGUI, FN0, LEFT,DOWN,RGHT, F17, F18, F19, F20 \ + ), + + /* Layer 1: + * ,---------------------------------------------------------------. ,-----------. ,---------------. + * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|BS |BS |F21| |VoD|VoU|Mut| |F1 |F2 |F3 |F4 | + * |---------------------------------------------------------------| |-----------| |---------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|F22| |Ins|Hom|PgU| |F5 |F6 |F7 |F8 | + * |---------------------------------------------------------------| |-----------| |---------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Ret|Ret |F23| |Del|End|PgD| |F9 |F10|F11|F12| + * |---------------------------------------------------------------| |-----------| |---------------| + * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shf|Shift |F24| | |PgU| | |F13|F14|F15|F16| + * |---------------------------------------------------------------| |-----------| |---------------| + * |Fn0 |Gui|Alt | Space |Alt* |Gui|Fn0 | |Hom|PgD|End| |F17|F18|F19|F20| + * `---------------------------------------------------------------' `-----------' `---------------' + */ + KEYMAP_ALPS102( + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, VOLD,VOLU,MUTE, 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,PGUP,TRNS, TRNS,TRNS,TRNS,TRNS, \ + TRNS,TRNS,TRNS, TRNS, TRNS,TRNS, TRNS, HOME,PGDN,END, TRNS,TRNS,TRNS,TRNS \ + ), +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), +}; diff --git a/converter/ibm4704_usb/keymap_common.h b/converter/ibm4704_usb/keymap_common.h index c55a817205..9cb23b0b83 100644 --- a/converter/ibm4704_usb/keymap_common.h +++ b/converter/ibm4704_usb/keymap_common.h @@ -34,40 +34,113 @@ extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; extern const uint16_t fn_actions[]; -/* Original keys */ +/* 107-key */ #define KEYMAP( \ + K46,K64, K00,K18,K19,K1A,K10,K11,K12,K08,K09,K0A,K0F,K1F,K0D,K0C,K0E, K6A,K6B,K6C, K47,K48,K49,K4A, \ + K56,K66, K04,K05,K06,K13,K14,K15,K16,K17,K01,K02,K03,K1B,K1C,K1D, K6D,K6E,K6F, K4B,K4C,K4D,K4E, \ + K71,K77, K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K2A,K2B,K2C,K2D, K70,K65,K72, K50,K51,K52,K53, \ + K44,K45, K30,K3E,K32,K33,K34,K35,K36,K37,K38,K39,K3A,K3B,K3C,K3D, K74,K75,K76, K5E,K58,K59,K5A, \ + K54,K55, K31,K41,K3F, K40, K42,K2F, K78,K67,K79, K5B,K5C,K5D,K57 \ +) { \ + { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_NO }, \ + { KC_##K08, KC_##K09, KC_##K0A, KC_NO, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \ + { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ + { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_NO, KC_##K1F }, \ + { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ + { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_NO, KC_##K2F }, \ + { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, \ + { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F }, \ + { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, \ + { KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_NO }, \ + { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ + { KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_##K5C, KC_##K5D, KC_##K5E, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \ + { KC_NO, KC_NO, KC_##K6A, KC_##K6B, KC_##K6C, KC_##K6D, KC_##K6E, KC_##K6F }, \ + { KC_##K70, KC_##K71, KC_##K72, KC_NO, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \ + { KC_##K78, KC_##K79, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ +} + +/* 77-key */ +#define KEYMAP_77( \ + K00,K18,K19,K1A,K10,K11,K12,K08,K09,K0A,K0F,K1F,K0D,K0C,K0E, K6A,K6B,K6C, \ + K04,K05,K06,K13,K14,K15,K16,K17,K01,K02,K03,K1B,K1C,K1D, K6D,K6E,K6F, \ + K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K2A,K2B,K2C,K2D, K70,K65,K72, \ + K30,K3E,K32,K33,K34,K35,K36,K37,K38,K39,K3A,K3B,K3C,K3D, K74,K75,K76, \ + K31,K41,K3F, K40, K42,K2F, K78,K67,K79 \ +) KEYMAP( \ + F1, F2, K00,K18,K19,K1A,K10,K11,K12,K08,K09,K0A,K0F,K1F,K0D,K0C,K0E, K6A,K6B,K6C, NLCK,PSLS,PAST,PMNS, \ + F3, F4, K04,K05,K06,K13,K14,K15,K16,K17,K01,K02,K03,K1B,K1C,K1D, K6D,K6E,K6F, P7, P8, P9, PPLS, \ + F5, F6, K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K2A,K2B,K2C,K2D, K70,K65,K72, P4, P5, P6, PPLS, \ + F7, F8, K30,K3E,K32,K33,K34,K35,K36,K37,K38,K39,K3A,K3B,K3C,K3D, K74,K75,K76, P1, P2, P3, PENT, \ + F9, F10, K31,K41,K3F, K40, K42,K2F, K78,K67,K79 P0, P0, PDOT,PENT \ +) + +/* 62-key */ +#define KEYMAP_62( \ K00,K18,K19,K1A,K10,K11,K12,K08,K09,K0A,K0F,K1F,K0D,K0C,K0E, \ K04,K05,K06,K13,K14,K15,K16,K17,K01,K02,K03,K1B,K1C,K1D, \ K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K2A,K2B,K2C,K2D, \ K30,K3E,K32,K33,K34,K35,K36,K37,K38,K39,K3A,K3B,K3C,K3D, \ - K31,K41,K3F, K40, K42,K2F \ + K31,K41,K3F, K40, K42,K2F \ +) KEYMAP( \ + F1, F2, K00,K18,K19,K1A,K10,K11,K12,K08,K09,K0A,K0F,K1F,K0D,K0C,K0E, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, \ + F3, F4, K04,K05,K06,K13,K14,K15,K16,K17,K01,K02,K03,K1B,K1C,K1D, DEL, END, PGDN, P7, P8, P9, PPLS, \ + F5, F6, K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K2A,K2B,K2C,K2D, PSCR,SLCK,PAUS, P4, P5, P6, PPLS, \ + F7, F8, K30,K3E,K32,K33,K34,K35,K36,K37,K38,K39,K3A,K3B,K3C,K3D, F11, UP, F12, P1, P2, P3, PENT, \ + F9, F10, K31,K41,K3F, K40, K42,K2F, LEFT,DOWN,RGHT, P0, P0, PDOT,PENT \ +) + +/* 50-key */ +#define KEYMAP_50( \ + K00,K01,K02, K03,K04,K05, K20,K21,K22,K23, \ + K08,K09,K0A, K0B,K0C,K0D, K28,K29,K2A,K35, \ + K10,K11,K12, K13,K14,K15, K30,K31,K32,K36, \ + K18,K19,K1A, K1B,K1C,K1D, K38,K39,K3A,K37, \ + K16,K1E,K0E, K0F,K1F,K17, K33,K3B,K2B,K3F \ ) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_NO }, \ - { KC_##K08, KC_##K09, KC_##K0A, KC_NO, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \ + { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_NO, KC_NO, }, \ + { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \ { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ - { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_NO, KC_##K1F }, \ + { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \ + { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_NO, KC_NO, KC_NO, KC_NO, }, \ + { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_NO, KC_NO, KC_NO, KC_NO, }, \ + { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_NO, KC_##K35, KC_##K36, KC_##K37 }, \ + { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_NO, KC_NO, KC_NO, KC_##K3F }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, } \ +} + +/* Alps 102-key */ +#define KEYMAP_ALPS102( \ + K00, K0F, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K44, K45, K46, K43, K41, K42, K4A, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K54, K55, K56, K50, K51, K52, K5A, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K64, K65, K66, K60, K61, K62, K6B, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K74, K75, K76, K70, K71, K72, K7B, \ + K31, K47, K3F, K40, K4F, K48, K2F, K77, K67, K57, K73, K63, K53, K4E \ +) { \ + { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ + { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \ + { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ + { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_NO, }, \ { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ - { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_NO, KC_##K2F }, \ + { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \ { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, \ { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, \ + { KC_##K48, KC_NO, KC_##K4A, KC_NO, KC_NO, KC_NO, KC_##K4E, KC_##K4F }, \ + { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ + { KC_NO, KC_NO, KC_##K5A, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, }, \ + { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \ + { KC_NO, KC_NO, KC_NO, KC_##K6B, KC_NO, KC_NO, KC_NO, KC_NO, }, \ + { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \ + { KC_NO, KC_NO, KC_NO, KC_##K7B, KC_NO, KC_NO, KC_NO, KC_NO, } \ } -#endif -/* - { K48, K49, K4A, K4B, K4C, K4D, K4E, K4F }, \ - { K50, K51, K52, K53, K54, K55, K56, K57 }, \ - { K58, K59, K5A, K5B, K5C, K5D, K5E, K5F }, \ - { K60, K61, K62, K63, K64, K65, K66, K67 }, \ - { K68, K69, K6A, K6B, K6C, K6D, K6E, K6F }, \ - { K70, K71, K72, K73, K74, K75, K76, K77 }, \ - { K78, K79, K7A, K7B, K7C, K7D, K7E, K7F }, \ -*/ +#endif diff --git a/converter/ibm4704_usb/keymap_hasu.c b/converter/ibm4704_usb/keymap_hasu.c index 7545b0923d..14c171179c 100644 --- a/converter/ibm4704_usb/keymap_hasu.c +++ b/converter/ibm4704_usb/keymap_hasu.c @@ -15,7 +15,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl |Gui|Alt | Space |Alt |Gui|Ctrl | * `-----------------------------------------------------------' */ - KEYMAP( + KEYMAP_62( ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS,GRV, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \ LCTL,A, S, D, F, G, H, J, K, L, FN1, QUOT,NO, ENT, \ @@ -23,7 +23,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LCTL,LGUI,LALT, FN3, RGUI,RCTL \ ), - KEYMAP( + KEYMAP_62( ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ CAPS,NO, NO, NO, NO, NO, NO, NO, PSCR,SLCK,PAUS, UP, NO, BSPC, \ LCTL,VOLD,VOLU,MUTE,NO, NO, PAST,PSLS,HOME,PGUP,LEFT,RGHT,NO, ENT, \ @@ -31,7 +31,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LCTL,LGUI,LALT, SPC, RGUI,RCTL \ ), - KEYMAP( + KEYMAP_62( ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ TAB, NO, NO, NO, NO, NO, WH_L,WH_D,WH_U,WH_R,WSTP,WBAK,WFWD,BSPC, \ LCTL,NO, ACL0,ACL1,ACL2,NO, MS_L,MS_D,MS_U,MS_R,TRNS,NO, NO, ENT, \ @@ -39,7 +39,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LCTL,LGUI,LALT, BTN1, RGUI,RCTL \ ), - KEYMAP( + KEYMAP_62( ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ TAB, HOME,PGDN,UP, PGUP,END, HOME,PGDN,PGUP,END, NO, NO, NO, BSPC, \ LCTL,NO, LEFT,DOWN,RGHT,NO, LEFT,DOWN,UP, RGHT,NO, NO, NO, ENT, \ @@ -47,7 +47,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LCTL,LGUI,LALT, SPC, RGUI,RCTL \ ), - KEYMAP( + KEYMAP_62( ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ TAB, NO, NO, NO, NO, NO, WH_L,WH_D,MS_U,WH_U,WH_R,BTN4,BTN5,FN4, \ LCTL,VOLD,VOLU,MUTE,NO, NO, BTN2,MS_L,MS_D,MS_R,BTN1,NO, NO, ENT, \ diff --git a/converter/ibm4704_usb/keymap_plain.c b/converter/ibm4704_usb/keymap_plain.c index a121634ef7..4aed684e4c 100644 --- a/converter/ibm4704_usb/keymap_plain.c +++ b/converter/ibm4704_usb/keymap_plain.c @@ -8,28 +8,40 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------| * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| * |-----------------------------------------------------------| - * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| #|Ret | + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Ret|Ret | * |-----------------------------------------------------------| - * |Shif| \| Z| X| C| V| B| N| M| ,| ,| /|???|Shift | + * |Shif|Shf| Z| X| C| V| B| N| M| ,| ,| /|???|Shift | * |-----------------------------------------------------------| - * |Ctrl |Gui|Alt | Space |Alt* |Gui|Ctrl | + * |Ctrl |Gui|Alt | Space |Alt* |Gui|Fn | * `-----------------------------------------------------------' */ KEYMAP( - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS,BSPC, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \ - LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NUHS,ENT, \ - LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH,NO, FN0, \ - LCTL,LGUI,LALT, SPC, RGUI,RCTL \ + F1, F2, GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NO, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, \ + F3, F4, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, PPLS, \ + F5, F6, LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, ENT, PSCR,SLCK,PAUS, P4, P5, P6, PPLS, \ + F7, F8, LSFT,LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,NO, RSFT, F11, UP, F12, P1, P2, P3, PENT, \ + F9, F10, LCTL,LGUI,LALT, SPC, RGUI,FN0, LEFT,DOWN,RGHT, P0, P0, PDOT,PENT \ ), - /* 1: HHKB */ + /* 1: HHKB + * ,-----------------------------------------------------------. + * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|???|Del| + * |-----------------------------------------------------------| + * |Caps | | | | | | | |Psc|Slk|Pau| Up| | Ins| + * |-----------------------------------------------------------| + * |Ctrl |VoD|VoU|VoM| | | *| /|Hom|PgU|Lef|Rig|Ret|Ret | + * |-----------------------------------------------------------| + * |Shif|Shi| | | | | | +| -|End|PgD|Dow|???|Shift | + * |-----------------------------------------------------------| + * |Ctrl |Gui|Alt | Space |Alt* |Gui|Fn | + * `-----------------------------------------------------------' + */ KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - CAPS,NO, NO, NO, NO, NO, NO, NO, PSCR,SLCK,PAUS, UP, NO, INS, \ - LCTL,VOLD,VOLU,MUTE,NO, NO, PAST,PSLS,HOME,PGUP,LEFT,RGHT,NO, ENT, \ - LSFT,NO, NO, NO, NO, NO, NO, PPLS,PMNS,END, PGDN,DOWN,NO, TRNS, \ - LCTL,LGUI,LALT, SPC, RGUI,RCTL \ + F1, F2, ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, NO, DEL, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, \ + F3, F4, CAPS,NO, NO, NO, NO, NO, NO, NO, PSCR,SLCK,PAUS, UP, NO, INS, DEL, END, PGDN, P7, P8, P9, PPLS, \ + F5, F6, TRNS,VOLD,VOLU,MUTE,NO, NO, PAST,PSLS,HOME,PGUP,LEFT,RGHT,ENT, ENT, PSCR,SLCK,PAUS, P4, P5, P6, PPLS, \ + F7, F8, TRNS,TRNS,NO, NO, NO, NO, NO, PPLS,PMNS,END, PGDN,DOWN,NO, TRNS, F11, UP, F12, P1, P2, P3, PENT, \ + F9, F10, TRNS,TRNS,TRNS, TRNS, TRNS,TRNS, LEFT,DOWN,RGHT, P0, P0, PDOT,PENT \ ), }; diff --git a/converter/ibm4704_usb/matrix.c b/converter/ibm4704_usb/matrix.c index 0bfda2b158..5b91d49f81 100644 --- a/converter/ibm4704_usb/matrix.c +++ b/converter/ibm4704_usb/matrix.c @@ -67,43 +67,33 @@ uint8_t matrix_cols(void) static void enable_break(void) { - uint8_t ret; print("Enable break: "); - // valid scancode: 00-77h - for (uint8_t code = 0; code < 0x78; code++) { - while (ibm4704_send(0x80|code) != 0) { - print("z"); - _delay_us(500); - } - _delay_us(2000); - ret = ibm4704_recv(); - if (ret != 0xff) { - xprintf("c%02X:r%02X ", code, ret); - } - _delay_us(1000); + while (ibm4704_send(0xFC)) { _delay_ms(10); } + // valid scancode: 00-79h + for (uint8_t code = 0; code < 0x7F; code++) { + while (ibm4704_send(0x80|code)) _delay_ms(10); + _delay_ms(5); // wait for response + // No response(FF) when ok, FD when out of bound + xprintf("s%02X:r%02X ", code, ibm4704_recv()); } - _delay_us(1000); - while (ibm4704_send(0xFF) != 0) { _delay_us(500); } // End + while (ibm4704_send(0xFF)) { _delay_ms(10); } // End print("End\n"); } -void matrix_init(void) -{ - uint8_t ret; - debug_enable = true; +void matrix_setup(void) +{ ibm4704_init(); - matrix_clear(); +} - // read keyboard id - while ((ret = ibm4704_recv()) == 0xFF) { - ibm4704_send(0xFE); - _delay_us(100); - } +void matrix_init(void) +{ + debug_enable = true; - _delay_ms(2000); // wait for starting up debug console print("IBM 4704 converter\n"); - xprintf("Keyboard ID: %02X\n", ret); + matrix_clear(); + _delay_ms(2000); // wait for keyboard starting up + xprintf("Keyboard ID: %02X\n", ibm4704_recv()); enable_break(); } @@ -116,14 +106,16 @@ uint8_t matrix_scan(void) if (code==0xFF) { // Not receivd return 0; - } else if ((code&0x78)==0x78) { - // 0xFF-F8 and 0x7F-78 is not scancode - xprintf("Error: %0X\n", code); + } else if ((code&0x7F) >= 0x7A) { + // 0xFF-FA and 0x7F-7A is not scancode + xprintf("Error: %02X\n", code); matrix_clear(); return 0; } else if (code&0x80) { + dprintf("%02X\n", code); matrix_make(code); } else { + dprintf("%02X\n", code); matrix_break(code); } return 1; diff --git a/converter/m0110_usb/Makefile b/converter/m0110_usb/Makefile index 6f20396f59..e836456326 100644 --- a/converter/m0110_usb/Makefile +++ b/converter/m0110_usb/Makefile @@ -2,7 +2,7 @@ TARGET = m0110_lufa # Directory common source filess exist -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core # Directory keyboard dependent files exist TARGET_DIR = . @@ -87,10 +87,10 @@ PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex # Search Path VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) -include $(TOP_DIR)/protocol/lufa.mk -include $(TOP_DIR)/protocol.mk -include $(TOP_DIR)/common.mk -include $(TOP_DIR)/rules.mk +include $(TMK_DIR)/protocol/lufa.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/rules.mk diff --git a/converter/m0110_usb/Makefile.teensy b/converter/m0110_usb/Makefile.teensy index 9a5c41068e..394b660508 100644 --- a/converter/m0110_usb/Makefile.teensy +++ b/converter/m0110_usb/Makefile.teensy @@ -2,7 +2,7 @@ TARGET = m0110_lufa # Directory common source filess exist -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core # Directory keyboard dependent files exist TARGET_DIR = . @@ -89,10 +89,10 @@ PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex # Search Path VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) -include $(TOP_DIR)/protocol/lufa.mk -include $(TOP_DIR)/protocol.mk -include $(TOP_DIR)/common.mk -include $(TOP_DIR)/rules.mk +include $(TMK_DIR)/protocol/lufa.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/rules.mk diff --git a/converter/m0110_usb/Makefile.pjrc b/converter/m0110_usb/Makefile.tmk_rev1 index 37977a384b..f36fcc4b5d 100644 --- a/converter/m0110_usb/Makefile.pjrc +++ b/converter/m0110_usb/Makefile.tmk_rev1 @@ -1,8 +1,8 @@ # Target file name (without extension). -TARGET = m0110_pjrc +TARGET = m0110_lufa # Directory common source filess exist -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core # Directory keyboard dependent files exist TARGET_DIR = . @@ -10,13 +10,14 @@ TARGET_DIR = . # keyboard dependent files SRC = matrix.c \ led.c \ + keymap_common.c \ m0110.c # To use own keymap file run make like: make keymap=hasu -ifdef keymap - SRC += keymap_$(keymap).c +ifdef KEYMAP + SRC += keymap_$(KEYMAP).c else - SRC += keymap.c + SRC += keymap_default.c endif CONFIG_H = config.h @@ -24,10 +25,8 @@ 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 # TMK converter rev2 +MCU = atmega32u4 # TMK converter rev1 # Processor frequency. @@ -38,6 +37,29 @@ MCU = atmega32u4 # Teensy 2.0 F_CPU = 16000000 +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# 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) + +# Interrupt driven control endpoint task +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + # Boot Section Size in bytes # Teensy halfKay 512 # Atmel DFU loader 4096 @@ -55,6 +77,7 @@ CONSOLE_ENABLE = yes # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend #NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA +#KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor @@ -64,10 +87,10 @@ PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex # Search Path VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) -include $(TOP_DIR)/protocol/pjrc.mk -include $(TOP_DIR)/protocol.mk -include $(TOP_DIR)/common.mk -include $(TOP_DIR)/rules.mk +include $(TMK_DIR)/protocol/lufa.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/rules.mk diff --git a/converter/m0110_usb/Makefile.tmk_rev2 b/converter/m0110_usb/Makefile.tmk_rev2 new file mode 100644 index 0000000000..e836456326 --- /dev/null +++ b/converter/m0110_usb/Makefile.tmk_rev2 @@ -0,0 +1,96 @@ +# Target file name (without extension). +TARGET = m0110_lufa + +# Directory common source filess exist +TMK_DIR = ../../tmk_core + +# Directory keyboard dependent files exist +TARGET_DIR = . + +# keyboard dependent files +SRC = matrix.c \ + led.c \ + keymap_common.c \ + m0110.c + +# To use own keymap file run make like: make keymap=hasu +ifdef KEYMAP + SRC += keymap_$(KEYMAP).c +else + SRC += keymap_default.c +endif + +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 = atmega32u2 # TMK converter rev2 +#MCU = atmega32u4 # TMK converter rev1 + + +# Processor frequency. +# Normally the first thing your program should do is set the clock prescaler, +# 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 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# 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) + +# Interrupt driven control endpoint task +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in bytes +# Teensy halfKay 512 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# 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 +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA +#KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor + + + +#---------------- Programming Options -------------------------- +PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex + + +# Search Path +VPATH += $(TARGET_DIR) +VPATH += $(TMK_DIR) + + +include $(TMK_DIR)/protocol/lufa.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/rules.mk diff --git a/converter/m0110_usb/README.md b/converter/m0110_usb/README.md index c1ecb53b0b..bfd3261df5 100644 --- a/converter/m0110_usb/README.md +++ b/converter/m0110_usb/README.md @@ -59,19 +59,16 @@ To compile firmware you need AVR GCC. You can edit *Makefile* and *config.h* to $ git clone git://github.com/tmk/tmk_keyboard.git (or download source) $ cd m0110_usb - $ make -f Makefile clean - $ make -f Makefile [KEYMAP={default|plain|intl|spacefn|hasu}] + $ make -f Makefile.rev2 clean + $ make -f Makefile.rev2 [KEYMAP={default|intl|spacefn|hasu}] -Use `Makefile.teensy` instead for Teensy. +Use `Maefile.tmk_rev1` for TMK converter Rev.1, `Makefile.teensy` for Teensy instead. Keymap ------ -To create your own keymap copy existent keymap file to `keymap_name.c` and edit it. You can build it like this. - - $ make -f Makefile clean - $ make -f Makefile KEYMAP=name +To create your own keymap copy existent keymap file to `keymap_name.c` and edit it. diff --git a/converter/m0110_usb/keymap_common.h b/converter/m0110_usb/keymap_common.h index 8bde7473dd..925556d977 100644 --- a/converter/m0110_usb/keymap_common.h +++ b/converter/m0110_usb/keymap_common.h @@ -1,5 +1,5 @@ /* -Copyright 2011,2012,2014 Jun Wako <wakojun@gmail.com> +Copyright 2011,2012,2014,2015 Jun Wako <wakojun@gmail.com> 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 @@ -24,64 +24,49 @@ extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; extern const uint16_t fn_actions[]; -/* - * The keymap works with both M0110 and M0110A keyboards. As you can see, the M0110A is a superset - * of the M0110 keyboard, with only one exception: 'Enter' in M0110 does not exist - * on the M0110A, but since it generates a unique scan code which is not used for some other key in - * the M0110A, they are totally interchangeable. In fact, the M0110A is functionally (almost) - * identical to the combination of the M0110 along with the M0120 keypad. The only difference - * (which is causing some problems as you will read below) is that the M0110+M0120 don't have - * dedicated arrow keys, while the M0110A does. However, the M0120 did have arrow keys, which - * doubled as the [comma], [/], [*] and [+] keys, when used with the [Shift] key. The M0110A has - * substituted the [comma] key with the [=] key, however its scancode is the same. +/* Common layout for M0110 and M0110A + * This keymap works with both keyboards. As you can see, the M0110A is + * a superset of M0110 keyboard, only one exception is 'Enter'(34) of M0110 + * does not exist on the M0110A. * - * Physical layout: - * M0110A * ,---------------------------------------------------------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Bcksp| |Clr| =| /| *| + * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Clr| =| /| *| * |---------------------------------------------------------| |---------------| * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -| * |-----------------------------------------------------' | |---------------| * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +| * |---------------------------------------------------------| |---------------| * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| | - * |---------------------------------------------------------' |-----------|Ent| - * |Opt |Mac | Space | \|Lft|Rgt|Dn | | 0| .| | + * |---------------------------------------------------------| |-----------|Ent| + * |Opt |Mac | Space |Ent| \|Lft|Rgt|Dn | | 0| .| | * `---------------------------------------------------------' `---------------' * - * M0110 M0120 + * M0110A scan codes * ,---------------------------------------------------------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Clr| -| +| *| + * | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62| * |---------------------------------------------------------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | 7| 8| 9| /| - * |---------------------------------------------------------| |---------------| - * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| ,| + * | 30| 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E| | | 59| 5B| 5C| 4E| + * |-----------------------------------------------------' | |---------------| + * | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66| * |---------------------------------------------------------| |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | | 1| 2| 3| | - * `---------------------------------------------------------' |-----------|Ent| - * |Opt|Mac | Space |Ent |Opt| | 0| .| | - * `-----------------------------------------------' `---------------' - * With Shift keys on M0120 work as curosor.(-:Left *:Right /:Up ,:Down) + * | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 38| 4D| | 53| 54| 55| | + * `---------------------------------------------------------' |-----------| 4C| + * | 3A| 37| 31 | 2A| 46| 42| 48| | 52| 41| | + * `---------------------------------------------------------' `---------------' * - * NOTE: \ is located differently. - * NOTE: Enter on M0110 is different from Enter on keypad(M0120 and M0110A). - * NOTE: Left Shift and right Shift are logically same key. - * NOTE: Left Option and right Option are logically same key. - */ - -/* Keymap definition Macro + * M0110 + M0120 scan codes * ,---------------------------------------------------------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Clr| =| /| *| + * | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62| * |---------------------------------------------------------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -| - * |-----------------------------------------------------' | |---------------| - * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +| + * | 30| 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E| 2A| | 59| 5B| 5C| 4E| * |---------------------------------------------------------| |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| | - * |---------------------------------------------------------| |-----------|Ent| - * |Opt |Mac | Space |Ent| \|Lft|Rgt|Dn | | 0| .| | - * `---------------------------------------------------------' `---------------' - * NOTE: Ent between Space and \ means Enter on M0110. + * | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66| + * |---------------------------------------------------------| |---------------| + * | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 38| | 53| 54| 55| | + * `---------------------------------------------------------' |-----------| 4C| + * | 3A| 37| 31 | 34| 3A| | 52| 41| | + * `------------------------------------------------' `---------------' + * Two right and left keys of 38 and 3A are identical, you cannot discriminate those two. */ #define KEYMAP( \ K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K47,K68,K6D,K62, \ @@ -106,25 +91,30 @@ extern const uint16_t fn_actions[]; { KC_##K68, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K6D, KC_NO, KC_NO }, \ } -/* International keyboard - * ,---------------------------------------------------------. - * | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| - * |---------------------------------------------------------| - * | 30| 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E| 2A| - * |------------------------------------------------------, | - * | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | - * |---------------------------------------------------------| - * | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 0A| 38| - * `---------------------------------------------------------' - * | 3A| 37| 34 | 31| 3A| - * `------------------------------------------------' +/* International keyboard layout for M0110 + M0120 + * https://en.wikipedia.org/wiki/File:Apple_Macintosh_Plus_Keyboard.jpg + * Probably International keyboard layout of M0110A doesn't exist. + * + * M0110 + M0120 scan codes + * ,---------------------------------------------------------. ,---------------. + * | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62| + * |---------------------------------------------------------| |---------------| + * | 30| 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E| 2A| | 59| 5B| 5C| 4E| + * |------------------------------------------------------, | |---------------| + * | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | | 56| 57| 58| 66| + * |---------------------------------------------------------| |---------------| + * | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 0A| 38| | 53| 54| 55| | + * `---------------------------------------------------------' |-----------| 4C| + * | 3A| 37| 34 | 31| 3A| | 52| 41| | + * `------------------------------------------------' `---------------' + * Two right and left keys of 38 and 3A are identical, you cannot discriminate those two. */ #define KEYMAP_INTL( \ K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K47,K68,K6D,K62, \ K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E,K2A, K59,K5B,K5C,K4E, \ K39,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27,K24, K56,K57,K58,K66, \ - K38,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C,K0A, K4D, K53,K54,K55,K4C, \ - K3A,K37, K34, K31, K46,K42,K48, K52, K41 \ + K38,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C,K0A, K53,K54,K55,K4C, \ + K3A,K37, K34, K31, K52, K41 \ ) { \ { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \ @@ -134,8 +124,8 @@ extern const uint16_t fn_actions[]; { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \ { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_NO, KC_NO, KC_##K37 }, \ { KC_##K38, KC_##K39, KC_##K3A, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_NO, KC_##K46, KC_##K47 }, \ - { KC_##K48, KC_NO, KC_NO, KC_NO, KC_##K4C, KC_##K4D, KC_##K4E, KC_NO }, \ + { KC_NO, KC_##K41, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K47 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_##K4C, KC_NO, KC_##K4E, KC_NO }, \ { KC_NO, KC_NO, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ { KC_##K58, KC_##K59, KC_NO, KC_##K5B, KC_##K5C, KC_NO, KC_NO, KC_NO }, \ { KC_NO, KC_NO, KC_##K62, KC_NO, KC_NO, KC_NO, KC_##K66, KC_NO }, \ diff --git a/converter/m0110_usb/keymap_default.c b/converter/m0110_usb/keymap_default.c index b0b8ee220a..ff7478d1b5 100644 --- a/converter/m0110_usb/keymap_default.c +++ b/converter/m0110_usb/keymap_default.c @@ -20,15 +20,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. +#ifdef KEYMAP_SECTION_ENABLE +const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".keymap.keymaps"))) = { +#else const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { +#endif /* Default: * M0110 M0120 * ,---------------------------------------------------------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Nlk| -| +| *| + * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Nlk| =| /| *| * |---------------------------------------------------------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | 7| 8| 9| /| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | 7| 8| 9| -| * |---------------------------------------------------------| |---------------| - * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| ,| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +| * |---------------------------------------------------------| |---------------| * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | | 1| 2| 3| | * `---------------------------------------------------------' |-----------|Ent| @@ -52,27 +56,40 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, P7, P8, P9, PMNS, LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, UP, P1, P2, P3, PENT, - LALT,LGUI, SPC, FN0, BSLS,LEFT,RGHT,DOWN, P0, PDOT + LALT,LGUI, SPC, FN0, FN13,LEFT,RGHT,DOWN, P0, PDOT ), - /* Cursor Layer + /* Cursor Layer: + * M0110 M0120 * ,---------------------------------------------------------. ,---------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk| -| +| *| + * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk| =| /| *| * |---------------------------------------------------------| |---------------| - * |Caps |Hom| Up|PgU| | | | |Psc|Slk|Pau|Up | |INS| | 7| 8| 9| /| + * |Caps |Hom| Up|PgU| | | | |Psc|Slk|Pau|Up |INS| | | 7| 8| 9| -| * |---------------------------------------------------------| |---------------| - * |Ctrl |Lef|Dow|Rig| | | | |Hom|PgU|Lef|Rig|Return| | 4| 5| 6| ,| + * |Ctrl |Lef|Dow|Rig| | | | |Hom|PgU|Lef|Rig|Return| | 4| 5| 6| +| * |---------------------------------------------------------| |---------------| * |Shift |End| |PgD| | | | |End|PgD|Dow|Shift | | 1| 2| 3| | * `---------------------------------------------------------' |-----------|Ent| * |Opt|Mac | Space |Fn |Opt| | 0| .| | * `-----------------------------------------------' `---------------' + * M0110A + * ,---------------------------------------------------------. ,---------------. + * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk| =| /| *| + * |---------------------------------------------------------| |---------------| + * |Caps |Hom| Up|PgU| | | | |Psc|Slk|Pau|Up |INS| | | 7| 8| 9| -| + * |-----------------------------------------------------' | |---------------| + * |Ctrl |Lef|Dow|Rig| | | | |Hom|PgU|Lef|Rig|Return| | 4| 5| 6| +| + * |---------------------------------------------------------| |---------------| + * |Shift |End| |PgD| | | | |End|PgD|Dow|Shft|PgU| | 1| 2| 3| | + * |---------------------------------------------------------| |-----------|Ent| + * |Opt |Mac | Space | \|Hom|End|PgD| | 0| .| | + * `---------------------------------------------------------' `---------------' */ [1] = KEYMAP( ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, - CAPS,HOME,UP, PGUP,NO, NO, NO, NO, PSCR,SLCK,PAUS,UP, NO, P7, P8, P9, PMNS, + CAPS,HOME,UP, PGUP,NO, NO, NO, NO, PSCR,SLCK,PAUS,UP, INS, P7, P8, P9, PMNS, LCTL,LEFT,DOWN,RGHT,NO, NO, NO, NO, HOME,PGUP,LEFT,RGHT, ENT, P4, P5, P6, PPLS, LSFT,END, NO, PGDN,NO, NO, NO, NO, END, PGDN,DOWN, PGUP, P1, P2, P3, PENT, - LALT,LGUI, SPC, FN0, INS, HOME,END, PGDN, P0, PDOT + LALT,LGUI, SPC, FN0, FN13,HOME,END, PGDN, P0, PDOT ), }; @@ -80,6 +97,41 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { /* * Fn action definition */ +#ifdef KEYMAP_SECTION_ENABLE +const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = { +#else const uint16_t fn_actions[] PROGMEM = { +#endif [0] = ACTION_LAYER_MOMENTARY(1), + [1] = ACTION_LAYER_MOMENTARY(2), + [2] = ACTION_LAYER_MOMENTARY(3), + [3] = ACTION_LAYER_MOMENTARY(4), + [4] = ACTION_LAYER_MOMENTARY(5), + [5] = ACTION_LAYER_MOMENTARY(6), + [6] = ACTION_LAYER_MOMENTARY(7), + [7] = ACTION_LAYER_TOGGLE(1), + [8] = ACTION_LAYER_TOGGLE(2), + [9] = ACTION_LAYER_TOGGLE(3), + [10] = ACTION_LAYER_TAP_TOGGLE(1), + [11] = ACTION_LAYER_TAP_TOGGLE(2), + [12] = ACTION_LAYER_TAP_TOGGLE(3), + [13] = ACTION_LAYER_TAP_KEY(1, KC_BSLASH), + [14] = ACTION_LAYER_TAP_KEY(2, KC_TAB), + [15] = ACTION_LAYER_TAP_KEY(3, KC_ENTER), + [16] = ACTION_LAYER_TAP_KEY(4, KC_SPACE), + [17] = ACTION_LAYER_TAP_KEY(5, KC_SCOLON), + [18] = ACTION_LAYER_TAP_KEY(6, KC_QUOTE), + [19] = ACTION_LAYER_TAP_KEY(7, KC_SLASH), + [20] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_SPACE), + [21] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_SPACE), + [22] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_QUOTE), + [23] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENTER), + [24] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ESC), + [25] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_BSPACE), + [26] = ACTION_MODS_ONESHOT(MOD_LCTL), + [27] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_ESC), + [28] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_BSPACE), + [29] = ACTION_MODS_ONESHOT(MOD_LSFT), + [30] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_GRAVE), + [31] = ACTION_MODS_TAP_KEY(MOD_RALT, KC_BSLASH), }; diff --git a/converter/m0110_usb/keymap_for_editor.c b/converter/m0110_usb/keymap_for_editor.c deleted file mode 100644 index d20f298f87..0000000000 --- a/converter/m0110_usb/keymap_for_editor.c +++ /dev/null @@ -1,118 +0,0 @@ -/* -Copyright 2014 Jun Wako <wakojun@gmail.com> - -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 <stdint.h> -#include "keycode.h" -#include "keymap_common.h" - - -#ifdef KEYMAP_SECTION_ENABLE -const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".keymap.keymaps"))) = { -#else -const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { -#endif - /* Default: - * ,---------------------------------------------------------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Clr| =| /| *| - * |---------------------------------------------------------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -| - * |-----------------------------------------------------' | |---------------| - * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Enter | | 4| 5| 6| +| - * |---------------------------------------------------------| |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| | - * |---------------------------------------------------------| |-----------|Ent| - * |Ctl |Gui | Space |Alt| \|Lft|Rgt|Dn | | 0| .| | - * `---------------------------------------------------------' `---------------' - */ - [0] = KEYMAP( - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, CLR, EQL, PSLS,PAST, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, P7, P8, P9, PMNS, - LCAP,A, S, D, F, G, H, J, K, L, SCLN,QUOT, FN15, P4, P5, P6, PPLS, - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, UP, P1, P2, P3, PENT, - LCTL,LGUI, FN16, LALT,FN31,LEFT,RGHT,DOWN, P0, PDOT - ), - /* Cursor Layer(WASD, IJKL) - * ,---------------------------------------------------------. ,---------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk| =| /| *| - * |---------------------------------------------------------| |---------------| - * |Caps |Hom| Up|PgU| | | | |Psc|Slk|Pau|Up |Ins| | | 7| 8| 9| -| - * |-----------------------------------------------------' | |---------------| - * |Caps |Lef|Dow|Rig| | | | |Hom|PgU|Lef|Rig|Enter | | 4| 5| 6| +| - * |---------------------------------------------------------| |---------------| - * |Shift |End| |PgD| | | | |End|PgD|Dow|Shif|PgU| | 1| 2| 3| | - * |---------------------------------------------------------| |-----------|Ent| - * |Ctl |Gui | Space |Alt | \|Hom|End|PgD| | 0| .| | - * `---------------------------------------------------------' `---------------' - */ - [3] = KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, - CAPS,HOME,UP, PGUP,NO, NO, NO, NO, PSCR,SLCK,PAUS,UP, INS, P7, P8, P9, PMNS, - LCAP,LEFT,DOWN,RGHT,NO, NO, NO, NO, HOME,PGUP,LEFT,RGHT, FN15, P4, P5, P6, PPLS, - LSFT,END, NO, PGDN,NO, NO, NO, NO, END, PGDN,DOWN, PGUP, P1, P2, P3, PENT, - LCTL,LGUI, FN16, LALT,FN31,HOME,END, PGDN, P0, PDOT - ), - [4] = KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, - CAPS,HOME,UP, PGUP,NO, NO, NO, NO, PSCR,SLCK,PAUS,UP, INS, P7, P8, P9, PMNS, - LCAP,LEFT,DOWN,RGHT,NO, NO, NO, NO, HOME,PGUP,LEFT,RGHT, FN15, P4, P5, P6, PPLS, - LSFT,END, NO, PGDN,NO, NO, NO, NO, END, PGDN,DOWN, PGUP, P1, P2, P3, PENT, - LCTL,LGUI, FN16, LALT,FN31,HOME,END, PGDN, P0, PDOT - ), - [7] = {}, -}; - - -/* - * Fn action definition - */ -#ifdef KEYMAP_SECTION_ENABLE -const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = { -#else -const uint16_t fn_actions[] PROGMEM = { -#endif - [0] = ACTION_LAYER_MOMENTARY(1), - [1] = ACTION_LAYER_MOMENTARY(2), - [2] = ACTION_LAYER_MOMENTARY(3), - [3] = ACTION_LAYER_MOMENTARY(4), - [4] = ACTION_LAYER_MOMENTARY(5), - [5] = ACTION_LAYER_MOMENTARY(6), - [6] = ACTION_LAYER_MOMENTARY(7), - [7] = ACTION_LAYER_TOGGLE(1), - [8] = ACTION_LAYER_TOGGLE(2), - [9] = ACTION_LAYER_TOGGLE(3), - [10] = ACTION_LAYER_TAP_TOGGLE(1), - [11] = ACTION_LAYER_TAP_TOGGLE(2), - [12] = ACTION_LAYER_TAP_TOGGLE(3), - [13] = ACTION_LAYER_TAP_KEY(1, KC_F), - [14] = ACTION_LAYER_TAP_KEY(2, KC_J), - [15] = ACTION_LAYER_TAP_KEY(3, KC_ENTER), - [16] = ACTION_LAYER_TAP_KEY(4, KC_SPACE), - [17] = ACTION_LAYER_TAP_KEY(5, KC_SCOLON), - [18] = ACTION_LAYER_TAP_KEY(6, KC_QUOTE), - [19] = ACTION_LAYER_TAP_KEY(7, KC_SLASH), - [20] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_SPACE), - [21] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_SPACE), - [22] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_QUOTE), - [23] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENTER), - [24] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ESC), - [25] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_BSPACE), - [26] = ACTION_MODS_ONESHOT(MOD_LCTL), - [27] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_ESC), - [28] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_BSPACE), - [29] = ACTION_MODS_ONESHOT(MOD_LSFT), - [30] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_GRAVE), - [31] = ACTION_MODS_TAP_KEY(MOD_RALT, KC_BSLASH), -}; diff --git a/converter/m0110_usb/keymap_intl.c b/converter/m0110_usb/keymap_intl.c index 80b029305f..6cc251a289 100644 --- a/converter/m0110_usb/keymap_intl.c +++ b/converter/m0110_usb/keymap_intl.c @@ -30,29 +30,17 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { * |------------------------------------------------------, | |---------------| * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| \| | | 4| 5| 6| ,| * |---------------------------------------------------------| |---------------| - * |Shif| <| Z| X| C| V| B| N| M| ,| ,| /|Shift | | 1| 2| 3| | + * |Shif| <| Z| X| C| V| B| N| M| ,| ,| /| | | 1| 2| 3| | * `---------------------------------------------------------' |-----------|Ent| - * |Opt|Mac | Space |Fn |Opt| | 0| .| | + * |Opt|Mac | Space |Fn | | | 0| .| | * `-----------------------------------------------' `---------------' - * M0110A(not existent?) - * ,---------------------------------------------------------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Nlk| =| /| *| - * |---------------------------------------------------------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Ret| | 7| 8| 9| -| - * |------------------------------------------------------, | |---------------| - * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| \| | | 4| 5| 6| +| - * |---------------------------------------------------------| |---------------| - * |Shif| <| Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| | - * |---------------------------------------------------------| |-----------|Ent| - * |Opt |Mac | Space | \|Lft|Rgt|Dn | | 0| .| | - * `---------------------------------------------------------' `---------------' */ [0] = KEYMAP_INTL( GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, NLCK,EQL, PSLS,PAST, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,ENT, P7, P8, P9, PMNS, LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,BSLS, P4, P5, P6, PPLS, - LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, UP, P1, P2, P3, PENT, - LALT,LGUI, SPC, FN0, LEFT,RGHT,DOWN, P0, PDOT + LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, P1, P2, P3, PENT, + LALT,LGUI, SPC, FN0, P0, PDOT ), /* Cursor Layer * ,---------------------------------------------------------. ,---------------. @@ -62,17 +50,17 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { * |------------------------------------------------------, | |---------------| * |Ctrl |Lef|Dow|Rig| | | | |Hom|PgU|Lef|Rig|Ins| | | 4| 5| 6| ,| * |---------------------------------------------------------| |---------------| - * |Shif| <|End| |PgD| | | | |End|PgD|Dow|Shift | | 1| 2| 3| | + * |Shif| <|End| |PgD| | | | |End|PgD|Dow| | | 1| 2| 3| | * `---------------------------------------------------------' |-----------|Ent| - * |Opt|Mac | Space |Fn |Opt| | 0| .| | + * |Opt|Mac | Space |Fn | | | 0| .| | * `-----------------------------------------------' `---------------' */ [1] = KEYMAP_INTL( ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, CAPS,HOME,UP, PGUP,NO, NO, NO, NO, PSCR,SLCK,PAUS,UP, NO, ENT, P7, P8, P9, PMNS, LCTL,LEFT,DOWN,RGHT,NO, NO, NO, NO, HOME,PGUP,LEFT,RGHT,INS, P4, P5, P6, PPLS, - LSFT,NO, END, NO, PGDN,NO, NO, NO, NO, END, PGDN,DOWN, PGUP, P1, P2, P3, PENT, - LALT,LGUI, SPC, FN0, HOME,END, PGDN, P0, PDOT + LSFT,NO, END, NO, PGDN,NO, NO, NO, NO, END, PGDN,DOWN, P1, P2, P3, PENT, + LALT,LGUI, SPC, FN0, P0, PDOT ), }; diff --git a/converter/m0110_usb/keymap_plain.c b/converter/m0110_usb/keymap_plain.c deleted file mode 100644 index d1507fcaa9..0000000000 --- a/converter/m0110_usb/keymap_plain.c +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2014 Jun Wako <wakojun@gmail.com> - -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 <stdint.h> -#include "keycode.h" -#include "keymap_common.h" - - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Default: - * M0110 M0120 - * ,---------------------------------------------------------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Nlk| -| +| *| - * |---------------------------------------------------------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | 7| 8| 9| /| - * |---------------------------------------------------------| |---------------| - * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| ,| - * |---------------------------------------------------------| |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | | 1| 2| 3| | - * `---------------------------------------------------------' |-----------|Ent| - * |Opt|Mac | Space |Mac |Opt| | 0| .| | - * `-----------------------------------------------' `---------------' - * M0110A - * ,---------------------------------------------------------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Bcksp| |Nlk| =| /| *| - * |---------------------------------------------------------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -| - * |-----------------------------------------------------' | |---------------| - * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +| - * |---------------------------------------------------------| |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| | - * |---------------------------------------------------------' |-----------|Ent| - * |Opt |Mac | Space | \|Lft|Rgt|Dn | | 0| .| | - * `---------------------------------------------------------' `---------------' - */ - [0] = KEYMAP( - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, NLCK,PEQL,PSLS,PAST, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, P7, P8, P9, PMNS, - LCAP,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, UP, P1, P2, P3, PENT, - LALT,LGUI, SPC, RGUI,BSLS,LEFT,RGHT,DOWN, P0, PDOT - ), -}; - -/* - * Fn action definition - */ -const uint16_t fn_actions[] PROGMEM = { -}; - - diff --git a/converter/news_usb/Makefile.pjrc b/converter/news_usb/Makefile.pjrc index 98f8d57693..80cadcc730 100644 --- a/converter/news_usb/Makefile.pjrc +++ b/converter/news_usb/Makefile.pjrc @@ -7,7 +7,7 @@ TARGET = news_usb_pjrc # Directory common source filess exist -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core # Directory keyboard dependent files exist TARGET_DIR = . @@ -65,10 +65,10 @@ PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex # Search Path VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) -include $(TOP_DIR)/protocol/pjrc.mk -include $(TOP_DIR)/protocol.mk -include $(TOP_DIR)/common.mk -include $(TOP_DIR)/rules.mk +include $(TMK_DIR)/protocol/pjrc.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/rules.mk diff --git a/converter/next_usb/Makefile b/converter/next_usb/Makefile index fef539a147..7190f1eaf4 100644 --- a/converter/next_usb/Makefile +++ b/converter/next_usb/Makefile @@ -2,7 +2,7 @@ TARGET = next_usb # Directory common source filess exist -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core # Directory keyboard dependent files exist TARGET_DIR = . @@ -17,10 +17,10 @@ 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 = atmega32u4 # Teensy 2.0 #MCU = at90usb646 # Teensy++ 1.0 #MCU = at90usb1286 # Teensy++ 2.0 -#MCU = atmega32u2 # TMK converter +MCU = atmega32u2 # TMK converter # Processor frequency. @@ -78,10 +78,10 @@ SRC += next_kbd.c # Search Path VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) -include $(TOP_DIR)/protocol.mk -include $(TOP_DIR)/protocol/lufa.mk -include $(TOP_DIR)/common.mk -include $(TOP_DIR)/rules.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/protocol/lufa.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/rules.mk diff --git a/converter/next_usb/Makefile.pjrc b/converter/next_usb/Makefile.pjrc index 51d9de6b11..5813c9d6d2 100644 --- a/converter/next_usb/Makefile.pjrc +++ b/converter/next_usb/Makefile.pjrc @@ -2,7 +2,7 @@ TARGET = next_usb # Directory common source filess exist -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core # Directory keyboard dependent files exist TARGET_DIR = . @@ -54,10 +54,10 @@ SRC += next_kbd.c # Search Path VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) -include $(TOP_DIR)/protocol.mk -include $(TOP_DIR)/protocol/pjrc.mk -include $(TOP_DIR)/common.mk -include $(TOP_DIR)/rules.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/protocol/pjrc.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/rules.mk diff --git a/converter/next_usb/config.h b/converter/next_usb/config.h index cd80b5af1b..a06affc5e8 100644 --- a/converter/next_usb/config.h +++ b/converter/next_usb/config.h @@ -45,7 +45,7 @@ POSSIBILITY OF SUCH DAMAGE. */ -#define VENDOR_ID 0xBCBC +#define VENDOR_ID 0xFEED #define PRODUCT_ID 0xBCBC #define DEVICE_VER 0x0500 #define MANUFACTURER t.m.k. @@ -56,14 +56,15 @@ POSSIBILITY OF SUCH DAMAGE. #define MATRIX_ROWS 12 // keycode bit: 3-0 #define MATRIX_COLS 8 // keycode bit: 6-4 -//#define DEBUG_ON_INIT 1 +#define DEBUG_ON_INIT 1 //#define TEENSY_CONFIG 1 -#define PRO_MICRO_CONFIG 1 -//#define TMK_CONFIG 1 +//#define PRO_MICRO_CONFIG 1 +#define TMK_CONFIG 1 -// comment out if you don't want the keyboard's LEDs to flash upon initialization -#define NEXT_KBD_INIT_FLASH_LEDS +// comment out if you don't want the keyboard's LEDs to flash upon initialization or pressing shift +//#define NEXT_KBD_INIT_FLASH_LEDS +//#define NEXT_KBD_SHIFT_FLASH_LEDS //============= Start of Arduino Pro Micro Configuration ============== #ifdef PRO_MICRO_CONFIG @@ -183,6 +184,7 @@ POSSIBILITY OF SUCH DAMAGE. /* key combination for command */ #define IS_COMMAND() ( \ - (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))|| \ - (keyboard_report->mods == (MOD_BIT(KC_RALT) | MOD_BIT(KC_RCTL))) \ + (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) || \ + (keyboard_report->mods == (MOD_BIT(KC_RALT) | MOD_BIT(KC_RALT))) || \ + (keyboard_report->mods == (MOD_BIT(KC_RGUI) | MOD_BIT(KC_RGUI))) \ ) diff --git a/converter/next_usb/keymap.c b/converter/next_usb/keymap.c index 3a51075483..0041df543f 100644 --- a/converter/next_usb/keymap.c +++ b/converter/next_usb/keymap.c @@ -159,7 +159,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TRNS,PAUS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,FN3, BSLS,TRNS, VOLD, PGDN, BTN1,MS_U,BTN2,WH_U, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, MS_L,MS_D,MS_R,WH_D, TRNS, FN4, FN5, FN6, FN7, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS, TRNS,TRNS,TRNS, - TRNS,RALT, TRNS, RGUI,TRNS, TRNS,TRNS,TRNS, TRNS, TRNS,TRNS + TRNS,TRNS, TRNS, TRNS,TRNS, TRNS,TRNS,TRNS, TRNS, TRNS,TRNS ) }; diff --git a/converter/next_usb/led.c b/converter/next_usb/led.c index 24db15e16a..2bd0ef6dd4 100644 --- a/converter/next_usb/led.c +++ b/converter/next_usb/led.c @@ -47,9 +47,14 @@ POSSIBILITY OF SUCH DAMAGE. #include "stdint.h" #include "led.h" +#include "next_kbd.h" void led_set(uint8_t usb_led) { - + if (usb_led & (1<<USB_LED_CAPS_LOCK)) { + next_kbd_set_leds(true, true); + } else { + next_kbd_set_leds(false, false); + } } diff --git a/converter/next_usb/matrix.c b/converter/next_usb/matrix.c index fd6eb9d64f..d91cd25774 100644 --- a/converter/next_usb/matrix.c +++ b/converter/next_usb/matrix.c @@ -160,7 +160,7 @@ void matrix_init(void) /* scan all key states on matrix */ uint8_t matrix_scan(void) { - _delay_ms(20); + _delay_ms(5); //next_kbd_set_leds(false, false); NEXT_KBD_LED1_OFF; @@ -194,10 +194,12 @@ uint8_t matrix_scan(void) NEXT_KBD_LED1_ON; +#ifdef NEXT_KBD_SHIFT_FLASH_LEDS next_kbd_set_leds( NEXT_KBD_PRESSED_SHIFT_LEFT(resp) ? true : false, NEXT_KBD_PRESSED_SHIFT_RGHT(resp) ? true : false ); +#endif dprintf("[ r=%04lX keycode=%02X pressed=%X CTRL=%X SHIFT_LEFT=%X SHIFT_RGHT=%X CMD_LEFT=%X CMD_RGHT=%X ALT_LEFT=%X ALT_RGHT=%X ]\n", \ resp, \ diff --git a/converter/pc98_usb/Makefile b/converter/pc98_usb/Makefile index 71c7858f37..9892276d7f 100644 --- a/converter/pc98_usb/Makefile +++ b/converter/pc98_usb/Makefile @@ -2,7 +2,7 @@ TARGET = pc98_usb # Directory common source filess exist -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core # Directory keyboard dependent files exist TARGET_DIR = . @@ -74,10 +74,10 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Search Path VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) -include $(TOP_DIR)/protocol/lufa.mk -include $(TOP_DIR)/protocol.mk -include $(TOP_DIR)/common.mk -include $(TOP_DIR)/rules.mk +include $(TMK_DIR)/protocol/lufa.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/rules.mk diff --git a/converter/ps2_usb/Makefile b/converter/ps2_usb/Makefile index 1dd23c157e..51b2225661 100644 --- a/converter/ps2_usb/Makefile +++ b/converter/ps2_usb/Makefile @@ -5,7 +5,7 @@ TARGET = ps2_usb_lufa # Directory common source filess exist -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core # Directory keyboard dependent files exist TARGET_DIR = . @@ -87,8 +87,8 @@ NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA # PS/2 Options # -PS2_USE_USART = yes # uses hardware USART engine for PS/2 signal receive(recomened) -#PS2_USE_INT = yes # uses external interrupt for falling edge of PS/2 clock pin +#PS2_USE_USART = yes # uses hardware USART engine for PS/2 signal receive(recomened) +PS2_USE_INT = yes # uses external interrupt for falling edge of PS/2 clock pin #PS2_USE_BUSYWAIT = yes # uses primitive reference code @@ -97,9 +97,9 @@ PS2_USE_USART = yes # uses hardware USART engine for PS/2 signal receive(recomen # Search Path VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) -include $(TOP_DIR)/protocol.mk -include $(TOP_DIR)/protocol/lufa.mk -include $(TOP_DIR)/common.mk -include $(TOP_DIR)/rules.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/protocol/lufa.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/rules.mk diff --git a/converter/ps2_usb/Makefile.mbed b/converter/ps2_usb/Makefile.mbed index ff8a0de7a4..a7ea5bcf24 100644 --- a/converter/ps2_usb/Makefile.mbed +++ b/converter/ps2_usb/Makefile.mbed @@ -1,7 +1,7 @@ PROJECT = ps2_usb -TMK_DIR = ../.. -MBED_DIR = $(TMK_DIR)/mbed-sdk +TMK_DIR = ../../tmk_core +MBED_DIR = $(TMK_DIR)/tool/mbed/mbed-sdk #VPATH += $(MBED_DIR):$(TMK_DIR) vpath %.s .:$(MBED_DIR):$(TMK_DIR) diff --git a/converter/ps2_usb/Makefile.pjrc b/converter/ps2_usb/Makefile.pjrc index 0e175f8b45..64319aca88 100644 --- a/converter/ps2_usb/Makefile.pjrc +++ b/converter/ps2_usb/Makefile.pjrc @@ -2,7 +2,7 @@ TARGET = ps2_usb_pjrc # Directory common source filess exist -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core # Directory keyboard dependent files exist TARGET_DIR = . @@ -66,10 +66,10 @@ PS2_USE_BUSYWAIT = yes # uses primitive reference code # Search Path VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) -include $(TOP_DIR)/protocol.mk -include $(TOP_DIR)/protocol/pjrc.mk -include $(TOP_DIR)/common.mk -include $(TOP_DIR)/rules.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/protocol/pjrc.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/rules.mk diff --git a/converter/ps2_usb/Makefile.tmk_rev1 b/converter/ps2_usb/Makefile.tmk_rev1 index 59c44f75fc..6aaef49969 100644 --- a/converter/ps2_usb/Makefile.tmk_rev1 +++ b/converter/ps2_usb/Makefile.tmk_rev1 @@ -6,7 +6,7 @@ TARGET = ps2_usb_tmk_rev1 # Directory common source filess exist -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core # Directory keyboard dependent files exist TARGET_DIR = . @@ -90,9 +90,9 @@ PS2_USE_USART = yes # uses hardware USART engine for PS/2 signal receive(recomen # Search Path VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) -include $(TOP_DIR)/protocol.mk -include $(TOP_DIR)/protocol/lufa.mk -include $(TOP_DIR)/common.mk -include $(TOP_DIR)/rules.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/protocol/lufa.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/rules.mk diff --git a/converter/ps2_usb/Makefile.tmk_rev2 b/converter/ps2_usb/Makefile.tmk_rev2 index bad958c36b..5049a22703 100644 --- a/converter/ps2_usb/Makefile.tmk_rev2 +++ b/converter/ps2_usb/Makefile.tmk_rev2 @@ -6,7 +6,7 @@ TARGET = ps2_usb_tmk_rev2 # Directory common source filess exist -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core # Directory keyboard dependent files exist TARGET_DIR = . @@ -90,9 +90,9 @@ PS2_USE_INT = yes # uses external interrupt for falling edge of PS/2 clock pin # Search Path VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) -include $(TOP_DIR)/protocol.mk -include $(TOP_DIR)/protocol/lufa.mk -include $(TOP_DIR)/common.mk -include $(TOP_DIR)/rules.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/protocol/lufa.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/rules.mk diff --git a/converter/ps2_usb/Makefile.vusb b/converter/ps2_usb/Makefile.vusb index ddf1868459..d9fa12bcda 100644 --- a/converter/ps2_usb/Makefile.vusb +++ b/converter/ps2_usb/Makefile.vusb @@ -2,7 +2,7 @@ TARGET = ps2_usb_vusb # Directory common source filess exist -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core # Directory keyboard dependent files exist TARGET_DIR = . @@ -18,13 +18,13 @@ else SRC := keymap_plain.c $(SRC) endif -# Use USART for PS/2. With V-USB INT and BUSYWAIT code is not useful. -SRC += protocol/ps2_usart.c -OPT_DEFS += -DPS2_USE_USART - CONFIG_H = config.h +# Use USART for PS/2. With V-USB INT and BUSYWAIT code is not useful. +PS2_USE_USART = yes + + # V-USB debug level: To use ps2_usart.c level must be 0 # ps2_usart.c requires USART to receive PS/2 signal. OPT_DEFS += -DDEBUG_LEVEL=0 @@ -98,10 +98,10 @@ OPT_DEFS += -DBOOTLOADER_SIZE=2048 # Search Path VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) -include $(TOP_DIR)/protocol.mk -include $(TOP_DIR)/common.mk -include $(TOP_DIR)/protocol/vusb.mk -include $(TOP_DIR)/rules.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/protocol/vusb.mk +include $(TMK_DIR)/rules.mk diff --git a/converter/ps2_usb/README.md b/converter/ps2_usb/README.md index 8a535949d8..74464e2640 100644 --- a/converter/ps2_usb/README.md +++ b/converter/ps2_usb/README.md @@ -14,7 +14,7 @@ In case of Teensy2.0(ATMega32U4): - **USART**: **Clock** is on `PD5` and **Data** on `PD2`. 3. Optionally you need pull-up resistor. 1K-10K Ohm is OK. -To change pin configuration edit config.h. +To change pin configuration edit **config.h** and **Makefile**. Build Firmware diff --git a/converter/ps2_usb/config.h b/converter/ps2_usb/config.h index c9bab1b072..c0a4fab13b 100644 --- a/converter/ps2_usb/config.h +++ b/converter/ps2_usb/config.h @@ -50,11 +50,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define PS2_CLOCK_PORT PORTD #define PS2_CLOCK_PIN PIND #define PS2_CLOCK_DDR DDRD -#define PS2_CLOCK_BIT 5 +#define PS2_CLOCK_BIT 1 #define PS2_DATA_PORT PORTD #define PS2_DATA_PIN PIND #define PS2_DATA_DDR DDRD -#define PS2_DATA_BIT 2 +#define PS2_DATA_BIT 0 #endif /* @@ -69,7 +69,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define PS2_DATA_PORT PORTD #define PS2_DATA_PIN PIND #define PS2_DATA_DDR DDRD -#define PS2_DATA_BIT 2 +#define PS2_DATA_BIT 0 #define PS2_INT_INIT() do { \ EICRA |= ((1<<ISC11) | \ (0<<ISC10)); \ diff --git a/converter/serialmouse_usb/Makefile b/converter/serialmouse_usb/Makefile index ea0e439bd7..34f550b314 100644 --- a/converter/serialmouse_usb/Makefile +++ b/converter/serialmouse_usb/Makefile @@ -5,7 +5,7 @@ TARGET = serialmouse_usb # Directory common source filess exist -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core # Directory keyboard dependent files exist TARGET_DIR = . @@ -98,9 +98,9 @@ SERIAL_MOUSE_USE_SOFT = yes # use software serial implementation # Search Path VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) -include $(TOP_DIR)/protocol.mk -include $(TOP_DIR)/protocol/lufa.mk -include $(TOP_DIR)/common.mk -include $(TOP_DIR)/rules.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/protocol/lufa.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/rules.mk diff --git a/converter/sun_usb/Makefile b/converter/sun_usb/Makefile index b32497cd95..f046bfdd36 100644 --- a/converter/sun_usb/Makefile +++ b/converter/sun_usb/Makefile @@ -2,7 +2,7 @@ TARGET = sun_usb # Directory common source filess exist -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core # Directory keyboard dependent files exist TARGET_DIR = . @@ -76,10 +76,10 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Search Path VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) -include $(TOP_DIR)/protocol/lufa.mk -include $(TOP_DIR)/protocol.mk -include $(TOP_DIR)/common.mk -include $(TOP_DIR)/rules.mk +include $(TMK_DIR)/protocol/lufa.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/rules.mk diff --git a/converter/sun_usb/README b/converter/sun_usb/README index 276f6bfff8..98340dd315 100644 --- a/converter/sun_usb/README +++ b/converter/sun_usb/README @@ -1,11 +1,18 @@ Sun to USB keyboard protocol converter ====================================== Target MCU is ATMega32u4 but other USB capable AVR will also work. -Supported keyboards: Sun Type 5 Keyboard, CTCSP SHORT TYPE KEYBOARD(CKUB) -CTCSP SHORT TYPE KEYBOARD: http://imgur.com/a/QIv6p +This converter will work with Sun Type 2-5 Keyboards. +Tested on: +Sun Type 3 Keyboard: http://blog.daveastels.com.s3-website-us-west-2.amazonaws.com/2014/12/27/type-3-keyboard.html +CTCSP SHORT TYPE KEYBOARD(Type 5): http://imgur.com/a/QIv6p + + +Keymap of Type 3(keymap_sun3.c) were impoted from dastels's repository. +https://github.com/dastels/tmk_keyboard/tree/master/converter/sun3_usb + Connector diff --git a/converter/sun_usb/config.h b/converter/sun_usb/config.h index cfd39cd513..66036da931 100644 --- a/converter/sun_usb/config.h +++ b/converter/sun_usb/config.h @@ -56,12 +56,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define SERIAL_SOFT_RXD_BIT 2 #define SERIAL_SOFT_RXD_VECT INT2_vect /* RXD Interupt */ +#ifdef SERIAL_SOFT_LOGIC_NEGATIVE +/* enable interrupt: INT2(rising edge) */ +#define INTR_TRIG_EDGE ((1<<ISC21)|(1<<ISC20)) +#else +/* enable interrupt: INT2(falling edge) */ +#define INTR_TRIG_EDGE ((1<<ISC21)|(0<<ISC20)) +#endif #define SERIAL_SOFT_RXD_INIT() do { \ /* pin configuration: input with pull-up */ \ SERIAL_SOFT_RXD_DDR &= ~(1<<SERIAL_SOFT_RXD_BIT); \ SERIAL_SOFT_RXD_PORT |= (1<<SERIAL_SOFT_RXD_BIT); \ - /* enable interrupt: INT2(rising edge) */ \ - EICRA |= ((1<<ISC21)|(1<<ISC20)); \ + EICRA |= INTR_TRIG_EDGE; \ EIMSK |= (1<<INT2); \ sei(); \ } while (0) diff --git a/converter/sun_usb/keymap_sun3.c b/converter/sun_usb/keymap_sun3.c new file mode 100644 index 0000000000..273cd9442f --- /dev/null +++ b/converter/sun_usb/keymap_sun3.c @@ -0,0 +1,173 @@ +/* +Copyright 2012 Jun Wako <wakojun@gmail.com> + +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 <stdint.h> +#include <stdbool.h> +#include <avr/pgmspace.h> +#include "keycode.h" +#include "util.h" +#include "keymap.h" + + +/* 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 | + `-----------------------------------------------------------' +*/ + + +#define KEYMAP( \ + 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 \ +) { \ + { KC_NO, KC_##K01, KC_NO, KC_##K03, KC_NO, KC_##K05, KC_##K06, KC_NO }, \ + { KC_##K08, KC_NO, KC_##K0A, KC_NO, KC_##K0C, KC_NO, KC_##K0E, KC_NO }, \ + { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_NO, KC_##K15, KC_##K16, KC_##K17 }, \ + { KC_NO, KC_##K19, KC_##K1A, KC_NO, KC_NO, KC_##K1D, KC_##K1E, KC_##K1F }, \ + { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ + { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_NO, KC_##K2D, KC_##K2E, KC_##K2F }, \ + { KC_NO, KC_##K31, KC_NO, KC_##K33, KC_NO, KC_##K35, KC_##K36, KC_##K37 }, \ + { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F }, \ + { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_##K44, KC_##K45, KC_##K46, KC_NO }, \ + { KC_##K48, KC_##K49, KC_NO, KC_NO, KC_##K4C, KC_##K4D, KC_##K4E, KC_##K4F }, \ + { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ + { KC_##K58, KC_##K59, KC_NO, KC_##K5B, KC_##K5C, KC_##K5D, KC_NO, KC_##K5F }, \ + { KC_NO, KC_##K61, KC_NO, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \ + { KC_##K68, KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_##K6D, KC_##K6E, KC_##K6F }, \ + { KC_##K70, KC_##K71, KC_##K72, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K77 }, \ + { KC_##K78, KC_##K79, KC_##K7A, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ +} + +// Assign Fn key(0-7) to a layer to which switch with the Fn key pressed. +static const uint8_t PROGMEM fn_layer[] = { + 2, // Fn0 + 3, // Fn1 + 4, // Fn2 + 0, // Fn3 + 0, // Fn4 + 0, // Fn5 + 0, // Fn6 + 0 // Fn7 +}; + +// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. +// See layer.c for details. +static const uint8_t PROGMEM fn_keycode[] = { + KC_NO, // Fn0 + KC_SCLN, // Fn1 + KC_SLSH, // Fn2 + KC_NO, // Fn3 + KC_NO, // Fn4 + KC_NO, // Fn5 + KC_NO, // Fn6 + KC_NO // Fn7 +}; + + +static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + KEYMAP( + 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, INSERT, RIGHT, + F18, F19, LSFT, Z, X, C, V, B, N, M, COMM,DOT,SLSH, RSFT,RCTL, END, DOWN, PGDOWN, + LGUI, LALT, SPC, RALT,RGUI + ), + /* + // 0: default + SHORT_TYPE( + STOP, F1,F2,F3,F4, F5, F6, CUT,PASTE,COPY,PWR, INS, HOME,PGUP, + F7,F8,F9,F10,F11,F12, DEL, END, PGDN, + ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS,GRV, + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSPC, + LCTL, A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, + LSFT, Z, X, C, V, B, N, M, COMM,DOT, SLSH, RALT,UP, RSFT, + CAPS,LALT,LGUI, SPC, RGUI,APP, NLCK,LEFT,DOWN,RGHT + ), + // 1: with layer keys + SHORT_TYPE( + ESC, F1,F2,F3,F4, F5, F6, CUT,PASTE,COPY,PWR, INS, HOME,PGUP, + F7,F8,F9,F10,F11,F12, DEL, END, PGDN, + ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS,GRV, + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSPC, + LCTL, A, S, D, F, G, H, J, K, L, FN1, QUOT, ENT, + LSFT, Z, X, C, V, B, N, M, COMM,DOT, FN2, RSFT,UP, FN0, + CAPS,LALT,LGUI, SPC, RGUI,RALT,FN0, LEFT,DOWN,RGHT + ), + // 2: HHKB + SHORT_TYPE( + ESC, F1,F2,F3,F4, F5, F6, CUT,PASTE,COPY,PWR, INS, HOME,PGUP, + F7,F8,F9,F10,F11,F12, DEL, END, PGDN, + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, + CAPS, NO, NO, NO, NO, NO, NO, NO, PSCR,SLCK,PAUS,UP, NO, BSPC, + LCTL, VOLD,VOLU,MUTE,NO, NO, NO, NO, HOME,PGUP,LEFT,RGHT, ENT, + LSFT, Z, X, C, V, B, NO, NO, END, PGDN,DOWN, RSFT,PGUP,FN0, + CAPS,LALT,LGUI, SPC, RGUI,RALT,FN0, HOME,PGDN,END + ), + // 3: Mousekey + SHORT_TYPE( + ESC, F1,F2,F3,F4, F5, F6, CUT,PASTE,COPY,PWR, INS, HOME,PGUP, + F7,F8,F9,F10,F11,F12, DEL, END, PGDN, + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, + CAPS, NO, NO, NO, NO, NO, WH_L,WH_D,WH_U,WH_R,NO, NO, NO, BSPC, + LCTL, NO, ACL0,ACL1,ACL2,NO, MS_L,MS_D,MS_U,MS_R,FN1, NO, ENT, + LSFT, NO, NO, NO, NO, BTN3,BTN2,BTN1,NO, NO, NO, RSFT,UP, NO, + CAPS,LALT,LGUI, BTN1, RGUI,RALT,NO, LEFT,DOWN,RGHT + ), + // 4: Cursor + SHORT_TYPE( + ESC, F1,F2,F3,F4, F5, F6, CUT,PASTE,COPY,PWR, INS, HOME,PGUP, + F7,F8,F9,F10,F11,F12, DEL, END, PGDN, + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, + CAPS, NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, NO, NO, NO, BSPC, + LCTL, NO, NO, NO, NO, NO, LEFT,DOWN,UP, RGHT,NO, NO, ENT, + LSFT, NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, FN2, RSFT,UP, NO, + CAPS,LALT,LGUI, BTN1, RGUI,RALT,NO, LEFT,DOWN,RGHT + ), + */ +}; + + +uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col) +{ + return pgm_read_byte(&keymaps[(layer)][(row)][(col)]); +} + +uint8_t keymap_fn_layer(uint8_t index) +{ + return pgm_read_byte(&fn_layer[index]); +} + +uint8_t keymap_fn_keycode(uint8_t index) +{ + return pgm_read_byte(&fn_keycode[index]); +} diff --git a/converter/sun_usb/led.c b/converter/sun_usb/led.c index 48c3f1c2b2..809398faa5 100644 --- a/converter/sun_usb/led.c +++ b/converter/sun_usb/led.c @@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdint.h" #include "serial.h" #include "led.h" +#include "debug.h" void led_set(uint8_t usb_led) @@ -27,6 +28,7 @@ void led_set(uint8_t usb_led) if (usb_led & (1<<USB_LED_COMPOSE)) sun_led |= (1<<1); if (usb_led & (1<<USB_LED_SCROLL_LOCK)) sun_led |= (1<<2); if (usb_led & (1<<USB_LED_CAPS_LOCK)) sun_led |= (1<<3); + xprintf("LED: %02X\n", usb_led); serial_send(0x0E); serial_send(sun_led); diff --git a/converter/sun_usb/matrix.c b/converter/sun_usb/matrix.c index f333f542bd..3126bd33ca 100644 --- a/converter/sun_usb/matrix.c +++ b/converter/sun_usb/matrix.c @@ -72,6 +72,21 @@ void matrix_init(void) // initialize matrix state: all keys off for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; + // wait for keyboard coming up + // otherwise LED status update fails + print("Reseting "); + while (1) { + print("."); + while (serial_recv()); + serial_send(0x01); + _delay_ms(500); + if (serial_recv() == 0xFF) { + _delay_ms(500); + if (serial_recv() == 0x04) + break; + } + } + print(" Done\n"); return; } @@ -86,17 +101,26 @@ uint8_t matrix_scan(void) debug_hex(code); debug(" "); switch (code) { - case 0xFF: // reset success - case 0xFE: // layout - case 0x7E: // reset fail - if (code == 0xFF) print("reset: 0xFF "); - if (code == 0x7E) print("reset fail: 0x7E "); - if (code == 0xFE) print("layout: 0xFE "); - // response byte + case 0xFF: // reset success: FF 04 + print("reset: "); + _delay_ms(500); + code = serial_recv(); + xprintf("%02X\n", code); + if (code == 0x04) { + // LED status + led_set(host_keyboard_leds()); + } + return 0; + case 0xFE: // layout: FE <layout> + print("layout: "); + _delay_ms(500); + xprintf("%02X\n", serial_recv()); + return 0; + case 0x7E: // reset fail: 7E 01 + print("reset fail: "); _delay_ms(500); - if (code = serial_recv()) print_hex8(code); - print("\n"); - // FALL THROUGH + xprintf("%02X\n", serial_recv()); + return 0; case 0x7F: // all keys up for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; diff --git a/converter/terminal_bluefruit/Makefile b/converter/terminal_bluefruit/Makefile index 28b7397bae..dec9233ec9 100644 --- a/converter/terminal_bluefruit/Makefile +++ b/converter/terminal_bluefruit/Makefile @@ -2,7 +2,7 @@ TARGET = terminal_bluefruit # Directory common source filess exist -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core # Directory keyboard dependent files exist TARGET_DIR = . @@ -89,11 +89,11 @@ PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex # Search Path VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) -include $(TOP_DIR)/protocol.mk -include $(TOP_DIR)/protocol/bluefruit.mk -include $(TOP_DIR)/protocol.mk -include $(TOP_DIR)/common.mk -include $(TOP_DIR)/rules.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/protocol/bluefruit.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/rules.mk diff --git a/converter/terminal_usb/Makefile b/converter/terminal_usb/Makefile index 16df638b94..42184521d2 100644 --- a/converter/terminal_usb/Makefile +++ b/converter/terminal_usb/Makefile @@ -2,7 +2,7 @@ TARGET = terminal_lufa # Directory common source filess exist -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core # Directory keyboard dependent files exist TARGET_DIR = . @@ -89,10 +89,10 @@ PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex # Search Path VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) -include $(TOP_DIR)/protocol/lufa.mk -include $(TOP_DIR)/protocol.mk -include $(TOP_DIR)/common.mk -include $(TOP_DIR)/rules.mk +include $(TMK_DIR)/protocol/lufa.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/rules.mk diff --git a/converter/terminal_usb/keymap.c b/converter/terminal_usb/keymap.c index 73009cb47e..8ca66b5e6a 100644 --- a/converter/terminal_usb/keymap.c +++ b/converter/terminal_usb/keymap.c @@ -70,6 +70,36 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. { KC_NO, KC_NO, KC_NO, KC_##K83, KC_##K84, KC_NO, KC_NO, KC_NO, }, \ } +/* + * IBM Terminal keyboard 1399625, 101-key + */ +#define KEYMAP_101( \ + K08, K07,K0F,K17,K1F,K27,K2F,K37,K3F,K47,K4F,K56,K5E, K57,K5F,K62, \ + \ + K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, K67,K6E,K6F, K76,K77,K7E,K84, \ + K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5C, K64,K65,K6D, K6C,K75,K7D, \ + K14,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K7C, \ + K12, K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, K63, K69,K72,K7A, \ + K11, K19, K29, K39, K58, K61,K60,K6A, K70, K71,K79 \ +) { \ + { KC_NO, KC_NO , KC_NO, KC_NO , KC_NO , KC_NO , KC_NO , KC_##K07 }, \ + { KC_##K08, KC_NO , KC_NO , KC_NO , KC_NO , KC_##K0D, KC_##K0E, KC_##K0F }, \ + { KC_NO , KC_##K11, KC_##K12, KC_NO , KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ + { KC_NO , KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \ + { KC_NO , KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ + { KC_NO , KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \ + { KC_NO , KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, \ + { KC_NO , KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F }, \ + { KC_NO , KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, \ + { KC_NO , KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_##K4F }, \ + { KC_NO , KC_NO , KC_##K52, KC_NO , KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ + { KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_##K5C, KC_NO , KC_##K5E, KC_##K5F }, \ + { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \ + { KC_NO , KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_##K6D, KC_##K6E, KC_##K6F }, \ + { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \ + { KC_NO , KC_##K79, KC_##K7A, KC_NO , KC_##K7C, KC_##K7D, KC_##K7E, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO , KC_##K84, KC_NO, KC_NO, KC_NO, }, \ +} // Assign Fn key(0-7) to a layer to which switch with the Fn key pressed. static const uint8_t PROGMEM fn_layer[] = { @@ -137,6 +167,36 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { APP, INT6, LSFT,LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, NO, RSFT, LEFT,INT2,RGHT, P1, P2, P3, PENT, RGUI,LGUI, LCTL, LALT, SPC, LGUI, GRV, DOWN, NO, P0, PDOT,NO ), + +/* 101-key keymaps + */ + /* 0: default + * ,---. ,---------------. ,---------------. ,---------------. ,-----------. + * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| + * `---' `---------------' `---------------' `---------------' `-----------' + * ,-----------------------------------------------------------. ,-----------. ,---------------. + * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| /| *| -| + * |-----------------------------------------------------------| |-----------| |---------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| | + * |-----------------------------------------------------------| `-----------' |-----------| +| + * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| | + * |-----------------------------------------------------------| ,---. |---------------| + * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| | + * |-----------------------------------------------------------| ,-----------. |-----------|Ent| + * |Ctrl| |Alt | Space |Alt | |Ctrl| |Lef|Dow|Rig| | 0| .| | + * `----' `---------------------------------------' `----' `-----------' `---------------' + */ +/* + KEYMAP_101( + ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK, BRK, + + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0,MINS, EQL,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, + CAPS, A, S, D, F, G, H, J, K, L,SCLN,QUOT, ENT, P4, P5, P6,PPLS, + LSFT, Z, X, C, V, B, N, M,COMM, DOT,SLSH, RSFT, UP, P1, P2, P3, + LCTL, LALT, SPC, RALT, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT + ), +*/ }; diff --git a/converter/usb_usb/Makefile b/converter/usb_usb/Makefile index d6867bb002..0f25232b25 100644 --- a/converter/usb_usb/Makefile +++ b/converter/usb_usb/Makefile @@ -27,7 +27,7 @@ # make flip-ee = Download the eeprom file to the device, using Atmel FLIP # (must have Atmel FLIP installed). # -# make debug = Start either simulavr or avarice as specified for debugging, +# make debug = Start either simulavr or avarice as specified for debugging, # with avr-gdb or avr-insight as the front end for debugging. # # make filename.s = Just compile filename.c into the assembler code only. @@ -41,7 +41,7 @@ # Target file name (without extension). TARGET = usb_usb -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core # Directory keyboard dependent files exist TARGET_DIR = . @@ -93,6 +93,7 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = yes # Media control and System control CONSOLE_ENABLE = yes # Console for debug +#COMMAND_ENABLE = yes # Commands for debug and configuration #NKRO_ENABLE = yes # USB Nkey Rollover # Boot Section Size in bytes @@ -101,12 +102,15 @@ CONSOLE_ENABLE = yes # Console for debug # LUFA bootloader 4096 OPT_DEFS += -DBOOTLOADER_SIZE=4096 +#LDFLAGS += -Wl,--relax +#OPT_DEFS += -DNO_ACTION_TAPPING +#OPT_DEFS += -DNO_ACTION_LAYER +#OPT_DEFS += -DNO_ACTION_MACRO SRC = \ keymap_common.c \ matrix.c \ - led.c \ main.cpp ifdef KEYMAP @@ -121,7 +125,7 @@ CONFIG_H = config.h # Search Path VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) @@ -130,7 +134,7 @@ PROGRAM_CMD = avrdude -p$(MCU) -cavr109 -b57600 -Uflash:w:$(TARGET).hex -P$(DEV) -include $(TOP_DIR)/protocol/usb_hid.mk -include $(TOP_DIR)/protocol/lufa.mk -include $(TOP_DIR)/common.mk -include $(TOP_DIR)/rules.mk +include $(TMK_DIR)/protocol/usb_hid.mk +include $(TMK_DIR)/protocol/lufa.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/rules.mk diff --git a/converter/usb_usb/keymap.c b/converter/usb_usb/keymap.c index c14a8aa553..5397de519f 100644 --- a/converter/usb_usb/keymap.c +++ b/converter/usb_usb/keymap.c @@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: default + /* 0: plain Qwerty without layer switching * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,-----------. * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Pwr|Slp|Wak| * `---' `---------------' `---------------' `---------------' `-----------' `-----------' @@ -37,28 +37,6 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ KEYMAP( ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, 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, - CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, - LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, GRV, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), - - /* 1: plain Qwerty without layer switching - * ,-----------------------------------------------------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| - * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| - * |-----------------------------------------------------------| - * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | - * |-----------------------------------------------------------| - * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| - * `-----------------------------------------------------------' - */ - KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, 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, CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, @@ -66,7 +44,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT ), - /* 2: Colemak http://colemak.com + /* 1: Colemak http://colemak.com * ,-----------------------------------------------------------. * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| * |-----------------------------------------------------------| @@ -88,7 +66,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT ), - /* 3: Dvorak http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard + /* 2: Dvorak http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard * ,-----------------------------------------------------------. * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| [| ]|Backspa| * |-----------------------------------------------------------| @@ -110,7 +88,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT ), - /* 4: Workman http://viralintrospection.wordpress.com/2010/09/06/a-different-philosophy-in-designing-keyboard-layouts/ + /* 3: Workman http://viralintrospection.wordpress.com/2010/09/06/a-different-philosophy-in-designing-keyboard-layouts/ * ,-----------------------------------------------------------. * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| * |-----------------------------------------------------------| diff --git a/converter/usb_usb/led.c b/converter/usb_usb/led.c deleted file mode 100644 index fc0eeb0ff7..0000000000 --- a/converter/usb_usb/led.c +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2012 Jun Wako <wakojun@gmail.com> - -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 "stdint.h" -#include "led.h" - - -void led_set(uint8_t usb_led) -{ -} diff --git a/converter/usb_usb/main.cpp b/converter/usb_usb/main.cpp index 30fd3348a3..652c805734 100644 --- a/converter/usb_usb/main.cpp +++ b/converter/usb_usb/main.cpp @@ -5,10 +5,10 @@ // USB HID host #include "Usb.h" +#include "usbhub.h" #include "hid.h" #include "hidboot.h" #include "parser.h" -#include "usbhub.h" // LUFA #include "lufa.h" @@ -17,22 +17,31 @@ #include "sendchar.h" #include "debug.h" #include "keyboard.h" +#include "led.h" + + +/* LED ping configuration */ +#define TMK_LED +//#define LEONARDO_LED +#if defined(TMK_LED) +// For TMK converter and Teensy +#define LED_TX_INIT (DDRD |= (1<<6)) +#define LED_TX_ON (PORTD |= (1<<6)) +#define LED_TX_OFF (PORTD &= ~(1<<6)) +#define LED_TX_TOGGLE (PORTD ^= (1<<6)) +#elif defined(LEONARDO_LED) +// For Leonardo(TX LED) +#define LED_TX_INIT (DDRD |= (1<<5)) +#define LED_TX_ON (PORTD &= ~(1<<5)) +#define LED_TX_OFF (PORTD |= (1<<5)) +#define LED_TX_TOGGLE (PORTD ^= (1<<5)) +#else +#define LED_TX_INIT +#define LED_TX_ON +#define LED_TX_OFF +#define LED_TX_TOGGLE +#endif -#include "leonardo_led.h" - - -static USB usb_host; -static HIDBoot<HID_PROTOCOL_KEYBOARD> kbd(&usb_host); -static KBDReportParser kbd_parser; -static USBHub hub1(&usb_host); // one hub is enough for HHKB pro2 -/* may be needed for other device with more hub -static USBHub hub2(&usb_host); -static USBHub hub3(&usb_host); -static USBHub hub4(&usb_host); -static USBHub hub5(&usb_host); -static USBHub hub6(&usb_host); -static USBHub hub7(&usb_host); -*/ static void LUFA_setup(void) { @@ -53,18 +62,24 @@ static void LUFA_setup(void) print_set_sendchar(sendchar); } -static void HID_setup() + + +/* + * USB Host Shield HID keyboard + */ +USB usb_host; +USBHub hub1(&usb_host); +HIDBoot<HID_PROTOCOL_KEYBOARD> kbd(&usb_host); +KBDReportParser kbd_parser; + + +void led_set(uint8_t usb_led) { - if (usb_host.Init() == -1) { - debug("HID init: failed\n"); - LED_TX_OFF; - } - - _delay_ms(200); - - kbd.SetReportParser(0, (HIDReportParser*)&kbd_parser); + kbd.SetReport(0, 0, 2, 0, 1, &usb_led); } + + int main(void) { // LED for debug @@ -72,35 +87,32 @@ int main(void) LED_TX_ON; debug_enable = true; -/* - debug_matrix = true; debug_keyboard = true; - debug_mouse = true; -*/ host_set_driver(&lufa_driver); keyboard_init(); LUFA_setup(); + + // USB Host Shield setup + usb_host.Init(); + kbd.SetReportParser(0, (HIDReportParser*)&kbd_parser); + + /* NOTE: Don't insert time consuming job here. + * It'll cause unclear initialization failure when DFU reset(worm start). + */ sei(); -uint8_t ret; // wait for startup of sendchar routine while (USB_DeviceState != DEVICE_STATE_Configured) ; if (debug_enable) { _delay_ms(1000); } - debug("init: start\n"); - HID_setup(); - debug("init: done\n"); uint16_t timer; -// to see loop pulse with oscillo scope -DDRF = (1<<7); for (;;) { -PORTF ^= (1<<7); keyboard_task(); timer = timer_read(); @@ -115,6 +127,6 @@ if (timer > 100) { USB_USBTask(); #endif } - + return 0; } diff --git a/converter/x68k_usb/Makefile b/converter/x68k_usb/Makefile index 948622c7c8..60e9a57467 100644 --- a/converter/x68k_usb/Makefile +++ b/converter/x68k_usb/Makefile @@ -7,7 +7,7 @@ TARGET = x68k_usb_pjrc # Directory common source filess exist -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core # Directory keyboard dependent files exist TARGET_DIR = . @@ -92,10 +92,10 @@ PROGRAM_CMD = dfu-programmer atmega32u4 flash $(TARGET).hex # Search Path VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) -include $(TOP_DIR)/protocol/pjrc.mk -include $(TOP_DIR)/protocol.mk -include $(TOP_DIR)/common.mk -include $(TOP_DIR)/rules.mk +include $(TMK_DIR)/protocol/pjrc.mk +include $(TMK_DIR)/protocol.mk +include $(TMK_DIR)/common.mk +include $(TMK_DIR)/rules.mk |