From 49746830402cc0e1c0227c6c3c06ebc22fcd016c Mon Sep 17 00:00:00 2001 From: iw0rm3r <49209191+iw0rm3r@users.noreply.github.com> Date: Mon, 15 Apr 2019 06:58:56 +0300 Subject: [PATCH] [Keyboard] IBM Model M (ANSI/ISO) Teensy 2.0++ conversion (#5560) * Added initial modelm101 config * Update keyboards/modelm101/keymaps/default/keymap.c Co-Authored-By: iw0rm3r <49209191+iw0rm3r@users.noreply.github.com> * Update keyboards/modelm101/keymaps/iw0rm3r/keymap.c Co-Authored-By: iw0rm3r <49209191+iw0rm3r@users.noreply.github.com> * Update keyboards/modelm101/readme.md Co-Authored-By: iw0rm3r <49209191+iw0rm3r@users.noreply.github.com> * Added wiring notes to clarify use of the config * Small fix * Small fix * Moved modelm101 to converter directory * Added info.json file for QMK configurator * Corrected path Co-Authored-By: iw0rm3r <49209191+iw0rm3r@users.noreply.github.com> * Update keyboards/converter/modelm101/readme.md Co-Authored-By: iw0rm3r <49209191+iw0rm3r@users.noreply.github.com> * Update keyboards/converter/modelm101/modelm101.c Co-Authored-By: iw0rm3r <49209191+iw0rm3r@users.noreply.github.com> * Update keyboards/converter/modelm101/modelm101.c Co-Authored-By: iw0rm3r <49209191+iw0rm3r@users.noreply.github.com> * Update keyboards/converter/modelm101/modelm101.c Co-Authored-By: iw0rm3r <49209191+iw0rm3r@users.noreply.github.com> * Update keyboards/converter/modelm101/modelm101.c Co-Authored-By: iw0rm3r <49209191+iw0rm3r@users.noreply.github.com> * Update keyboards/converter/modelm101/modelm101.c Co-Authored-By: iw0rm3r <49209191+iw0rm3r@users.noreply.github.com> * Update keyboards/converter/modelm101/modelm101.c Co-Authored-By: iw0rm3r <49209191+iw0rm3r@users.noreply.github.com> * Replaced DDR and PORT with QMK functions --- keyboards/converter/modelm101/config.h | 123 ++++++++++++++++++ keyboards/converter/modelm101/info.json | 12 ++ .../modelm101/keymaps/default/config.h | 19 +++ .../modelm101/keymaps/default/keymap.c | 43 ++++++ .../modelm101/keymaps/default/readme.md | 1 + .../modelm101/keymaps/iw0rm3r/config.h | 19 +++ .../modelm101/keymaps/iw0rm3r/keymap.c | 43 ++++++ .../modelm101/keymaps/iw0rm3r/readme.md | 5 + keyboards/converter/modelm101/modelm101.c | 67 ++++++++++ keyboards/converter/modelm101/modelm101.h | 45 +++++++ keyboards/converter/modelm101/readme.md | 42 ++++++ keyboards/converter/modelm101/rules.mk | 81 ++++++++++++ 12 files changed, 500 insertions(+) create mode 100644 keyboards/converter/modelm101/config.h create mode 100644 keyboards/converter/modelm101/info.json create mode 100644 keyboards/converter/modelm101/keymaps/default/config.h create mode 100644 keyboards/converter/modelm101/keymaps/default/keymap.c create mode 100644 keyboards/converter/modelm101/keymaps/default/readme.md create mode 100644 keyboards/converter/modelm101/keymaps/iw0rm3r/config.h create mode 100644 keyboards/converter/modelm101/keymaps/iw0rm3r/keymap.c create mode 100644 keyboards/converter/modelm101/keymaps/iw0rm3r/readme.md create mode 100644 keyboards/converter/modelm101/modelm101.c create mode 100644 keyboards/converter/modelm101/modelm101.h create mode 100644 keyboards/converter/modelm101/readme.md create mode 100644 keyboards/converter/modelm101/rules.mk diff --git a/keyboards/converter/modelm101/config.h b/keyboards/converter/modelm101/config.h new file mode 100644 index 000000000..97b78614c --- /dev/null +++ b/keyboards/converter/modelm101/config.h @@ -0,0 +1,123 @@ +/* +Copyright 2019 iw0rm3r + +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 . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER iw0rm3r +#define PRODUCT IBM Model M 101/102 +#define DESCRIPTION Controlled by AVR chip + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 16 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F7, F6, F5, F4, F3, F2, F1, F0 } +#define MATRIX_COL_PINS { C7, C6, C5, C4, C3, C2, C1, C0, E1, E0, D7, D6, D5, D4, D3, D2 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION ROW2COL + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed (5 is default) */ +#define DEBOUNCING_DELAY 5 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION \ No newline at end of file diff --git a/keyboards/converter/modelm101/info.json b/keyboards/converter/modelm101/info.json new file mode 100644 index 000000000..868cd89b1 --- /dev/null +++ b/keyboards/converter/modelm101/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "IBM Model M 101 ANSI/102 ISO", + "url": "https://github.com/iw0rm3r/qmk_firmware/tree/modelm101/keyboards/converter/modelm101", + "maintainer": "iw0rm3r", + "width": 22.5, + "height": 6.5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Num Lock", "x":18.5, "y":1.5}, {"label":"/", "x":19.5, "y":1.5}, {"label":"*", "x":20.5, "y":1.5}, {"label":"-", "x":21.5, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"7", "x":18.5, "y":2.5}, {"label":"8", "x":19.5, "y":2.5}, {"label":"9", "x":20.5, "y":2.5}, {"label":"+", "x":21.5, "y":2.5, "h":2}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.5}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"~", "x":12.75, "y":3.5}, {"label":"Enter", "x":13.75, "y":3.5, "w":1.25}, {"label":"4", "x":18.5, "y":3.5}, {"label":"5", "x":19.5, "y":3.5}, {"label":"6", "x":20.5, "y":3.5}, {"label":"Shift", "x":0, "y":4.5, "w":1.25}, {"label":"|", "x":1.25, "y":4.5}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"1", "x":18.5, "y":4.5}, {"label":"2", "x":19.5, "y":4.5}, {"label":"3", "x":20.5, "y":4.5}, {"label":"Enter", "x":21.5, "y":4.5, "h":2}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.5}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.5}, {"x":4, "y":5.5, "w":7}, {"label":"Alt", "x":11, "y":5.5, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":5.5, "w":1.5}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}, {"label":"0", "x":18.5, "y":5.5, "w":2}, {"label":".", "x":20.5, "y":5.5}] + } + } +} \ No newline at end of file diff --git a/keyboards/converter/modelm101/keymaps/default/config.h b/keyboards/converter/modelm101/keymaps/default/config.h new file mode 100644 index 000000000..779e5a858 --- /dev/null +++ b/keyboards/converter/modelm101/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 iw0rm3r + * + * 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 . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/converter/modelm101/keymaps/default/keymap.c b/keyboards/converter/modelm101/keymaps/default/keymap.c new file mode 100644 index 000000000..4a8614a3f --- /dev/null +++ b/keyboards/converter/modelm101/keymaps/default/keymap.c @@ -0,0 +1,43 @@ +/* Copyright 2019 iw0rm3r + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base layer */ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_LGUI, + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/converter/modelm101/keymaps/default/readme.md b/keyboards/converter/modelm101/keymaps/default/readme.md new file mode 100644 index 000000000..fb91a8ebe --- /dev/null +++ b/keyboards/converter/modelm101/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for modelm101 \ No newline at end of file diff --git a/keyboards/converter/modelm101/keymaps/iw0rm3r/config.h b/keyboards/converter/modelm101/keymaps/iw0rm3r/config.h new file mode 100644 index 000000000..779e5a858 --- /dev/null +++ b/keyboards/converter/modelm101/keymaps/iw0rm3r/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 iw0rm3r + * + * 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 . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/converter/modelm101/keymaps/iw0rm3r/keymap.c b/keyboards/converter/modelm101/keymaps/iw0rm3r/keymap.c new file mode 100644 index 000000000..26ced801e --- /dev/null +++ b/keyboards/converter/modelm101/keymaps/iw0rm3r/keymap.c @@ -0,0 +1,43 @@ +/* Copyright 2019 iw0rm3r + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base layer */ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_LGUI, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_CAPS, + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_APP, KC_PDOT + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/converter/modelm101/keymaps/iw0rm3r/readme.md b/keyboards/converter/modelm101/keymaps/iw0rm3r/readme.md new file mode 100644 index 000000000..17b0f40da --- /dev/null +++ b/keyboards/converter/modelm101/keymaps/iw0rm3r/readme.md @@ -0,0 +1,5 @@ +# This is my personal keymap for modelm101 + +Caps Lock is mapped as LGUI (Windows key). +Num Enter is mapped as Caps Lock. +Num0 is mapped as App key (context menu). \ No newline at end of file diff --git a/keyboards/converter/modelm101/modelm101.c b/keyboards/converter/modelm101/modelm101.c new file mode 100644 index 000000000..c2204bea6 --- /dev/null +++ b/keyboards/converter/modelm101/modelm101.c @@ -0,0 +1,67 @@ +/* Copyright 2019 iw0rm3r + * + * 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 . + */ +#include "modelm101.h" + +void keyboard_pre_init_kb(void) { + /* Setting status LEDs pins to output and +5V (off) */ + setPinOutput(B4); + setPinOutput(B5); + setPinOutput(B6); + writePinHigh(B4); + writePinHigh(B5); + writePinHigh(B6); +} + +void matrix_init_kb(void) { + /* put your keyboard start-up code here + * runs once when the firmware starts up */ + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + /* put your looping keyboard code here + * runs every cycle (a lot) */ + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + /* put your per-action keyboard code here + * runs for every action, just before processing by the firmware */ + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + if (usb_led & (1<. + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * The first section contains "names" for physical keys of the keyboard + * and defines their position on the board. + * The second section defines position of the keys on the switch matrix + * (where COLUMNS and ROWS crosses). */ + +#define LAYOUT( \ + K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5P, \ + \ + K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O, K4P, K4Q, K4R, K4S, K4T, K4U, \ + K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3N, K3O, K3P, K3Q, K3R, K3S, K3T, K3U, \ + K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2M, K2N, K2O, K2P, K2Q, \ + K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1L, K1M, K1N, K1O, K1P, K1Q, K1R, \ + K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, K0I, K0J \ +) \ +{ \ +/* 00 */ { KC_NO, KC_NO, K5A, K1B, K5E, K2F, K5F, K2G, K5G, KC_NO, K2L, KC_NO, K0I, K0J, K1N, K0B }, \ +/* 01 */ { KC_NO, K1A, K3A, K2A, K5D, K3F, K4N, K3G, K3M, K5H, K3L, K2O, K2P, K2Q, KC_NO, KC_NO }, \ +/* 02 */ { K0A, KC_NO, K4A, K5B, K5C, K4F, K5J, K4G, K4M, K5I, K4L, K3O, K4O, K4Q, K4P, KC_NO }, \ +/* 03 */ { KC_NO, KC_NO, K4B, K4C, K4D, K4E, K5K, K4H, K4I, K4J, K4K, K5L, K5M, K3Q, K3P, K5N }, \ +/* 04 */ { KC_NO, KC_NO, K3B, K3C, K3D, K3E, KC_NO, K3H, K3I, K3J, K3K, K3R, K3S, K3T, K3U, K5O }, \ +/* 05 */ { KC_NO, KC_NO, K2B, K2C, K2D, K2E, K3N, K2H, K2I, K2J, K2K, K1O, K1P, K1Q, K1R, KC_NO }, \ +/* 06 */ { K0E, K1M, K1C, K1D, K1E, K1F, K2N, K1I, K1J, K1K, K2M, K4R, K4S, K4T, K5P, KC_NO }, \ +/* 07 */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K1G, K0C, K1H, KC_NO, KC_NO, K1L, K0G, K0H, K4U, K0F, K0D }, \ +} +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ \ No newline at end of file diff --git a/keyboards/converter/modelm101/readme.md b/keyboards/converter/modelm101/readme.md new file mode 100644 index 000000000..5355c8007 --- /dev/null +++ b/keyboards/converter/modelm101/readme.md @@ -0,0 +1,42 @@ +# modelm101 + +![IBM Model M 101 ANSI/102 ISO](https://i.imgur.com/DAE3W7g.jpg) + +This is a configuration for the QMK firmware for reversible conversion of IBM's Model M keyboards (common 101-key ANSI and 102-key ISO models) from stock, power-hungry controller, to a modern one, running the USB bus. +Configuration is build for the Atmel AT90USB1286 controller, which you can easily use on the Teensy 2.0++ board (produced by PJRC). +Project is heavely based on 2 other projects: +1. Teensy 2.0++-based custom Model M controller running TMK firmware ('modelm" by [lmorchard](https://blog.lmorchard.com/2016/02/21/modelm-controller/)); - had a few issues. +2. Teensy 2.0++-based custom Model M 122-key controller running QMK firmware ("ibm122m" by [lukexorz](https://github.com/lukexorz)); - had wrong layout for 101/102-key boards and no status LED support. + +For this conversion you will need: +1. Teensy 2.0++ dev board itself (can be used a different dev board, but it will require some changes in configuration); +2. Ribbon connectors to connect the membrane to a dev board. Depending on your Model M variation, you will need 1 Trio-mate 16pin connector (6-520315-6 or 6-520415-6) and 1 Trio-mate 8pin connector (5-120628-8 or 5-520314-8), or 2 Trio-mate 16pin connectors; +3. Full-sized breadboard (without power rails; half-size should do, but full-sized one looks more native) or a PCB to wire everything up; +4. A bunch of jumper wires; +5. mini-USB male cable with any USB socket you want to use to connect Teensy inside the keyboard to your PC (I use short mini-USB male to mini-USB female cable); +6. (optional) Resistors for connecting status LEDs if your LED PCB doesn't have any; +7. (optional) Double-sided tape to fix USB socket on or inside the keyboard case. + +Pins of the Teensy board you should use by default: +``` +Columns: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 +Pins: C7 C6 C5 C4 C3 C2 C1 C0 E1 E0 D7 D6 D5 D4 D3 D2 +-------------------------------------------------------- +Rows: 1 2 3 4 5 6 7 8 +Pins: F7 F6 F5 F4 F3 F2 F1 F0 +-------------------------------------------------------- +Status LEDs: CapsLock +5V ScrollLock NumLock +Pins: B6 5V B5 B4 +``` + +Please note that some versions of Model M have LED connected with a ribbon cable, and not with separate wires. + +Keyboard Maintainer: [iw0rm3r](https://github.com/iw0rm3r) +Hardware Supported: Teensy 2.0++ board by PJRC +Hardware Availability: https://www.pjrc.com/store/teensypp.html + +Make example for this keyboard (after setting up your build environment): + + make converter/modelm101:default:teensy + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/converter/modelm101/rules.mk b/keyboards/converter/modelm101/rules.mk new file mode 100644 index 000000000..620526971 --- /dev/null +++ b/keyboards/converter/modelm101/rules.mk @@ -0,0 +1,81 @@ +# MCU name +MCU = at90usb1286 +#MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# 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(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = halfkay + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +#OPT_DEFS += -DBOOTLOADER_SIZE=1024 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)