From 4ebd27002a344b017276dc70796435a8e718f46a Mon Sep 17 00:00:00 2001 From: listofoptions <39714365+listofoptions@users.noreply.github.com> Date: Mon, 26 Nov 2018 12:53:49 -0500 Subject: [PATCH] Keyboard: 5291 firmware to replace the existing soarers controller firmware (#4483) * compiles but is not working * still testing 5291 * compiles but is not working * still testing 5291 * fixed a but in the layout (reversed key order in row) * compiles but is not working * still testing 5291 * fixed a but in the layout (reversed key order in row) * fixed some issues * doumentation needed * doumentation needed * documentation needed * documentation needed * Update readme.md documentation * Update readme.md i dislike markdown <_> * merge preperation --- keyboards/converter/ibm_5291/config.h | 42 +++ keyboards/converter/ibm_5291/ibm_5291.c | 3 + keyboards/converter/ibm_5291/ibm_5291.h | 69 +++++ keyboards/converter/ibm_5291/info.json | 6 + .../ibm_5291/keymaps/default/keymap.c | 233 ++++++++++++++ .../keymaps/kbdbabel_doc_ibm5291_kbd.pdf | Bin 0 -> 13054 bytes keyboards/converter/ibm_5291/matrix.c | 284 ++++++++++++++++++ keyboards/converter/ibm_5291/matrix.csv | 96 ++++++ keyboards/converter/ibm_5291/readme.md | 70 +++++ keyboards/converter/ibm_5291/rules.mk | 72 +++++ 10 files changed, 875 insertions(+) create mode 100644 keyboards/converter/ibm_5291/config.h create mode 100644 keyboards/converter/ibm_5291/ibm_5291.c create mode 100644 keyboards/converter/ibm_5291/ibm_5291.h create mode 100644 keyboards/converter/ibm_5291/info.json create mode 100644 keyboards/converter/ibm_5291/keymaps/default/keymap.c create mode 100644 keyboards/converter/ibm_5291/keymaps/kbdbabel_doc_ibm5291_kbd.pdf create mode 100644 keyboards/converter/ibm_5291/matrix.c create mode 100644 keyboards/converter/ibm_5291/matrix.csv create mode 100644 keyboards/converter/ibm_5291/readme.md create mode 100644 keyboards/converter/ibm_5291/rules.mk diff --git a/keyboards/converter/ibm_5291/config.h b/keyboards/converter/ibm_5291/config.h new file mode 100644 index 0000000000..5c9ca1e4a9 --- /dev/null +++ b/keyboards/converter/ibm_5291/config.h @@ -0,0 +1,42 @@ +/* +Copyright 2018 listofoptions + +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" + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 1 +#define MANUFACTURER QMK +#define PRODUCT 5291 keyboard converter +#define DESCRIPTION 5291 keyboard converter + +#define MATRIX_ROWS 24 +#define MATRIX_COLS 4 + +#define MATRIX_ROW_PINS {B2, B3, B4, B5, B6} +#define MATRIX_COL_PINS {B0, B1} +#define MATRIX_DATA_PIN D0 +#define MATRIX_STROBE_PIN D1 +#define LED_PIN D6 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 0 + + diff --git a/keyboards/converter/ibm_5291/ibm_5291.c b/keyboards/converter/ibm_5291/ibm_5291.c new file mode 100644 index 0000000000..9b937a545a --- /dev/null +++ b/keyboards/converter/ibm_5291/ibm_5291.c @@ -0,0 +1,3 @@ +#include "ibm_5291.h" +#include +#include "quantum.h" \ No newline at end of file diff --git a/keyboards/converter/ibm_5291/ibm_5291.h b/keyboards/converter/ibm_5291/ibm_5291.h new file mode 100644 index 0000000000..aa1b403242 --- /dev/null +++ b/keyboards/converter/ibm_5291/ibm_5291.h @@ -0,0 +1,69 @@ +/* +Copyright 2018 listofoptions + +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 "quantum.h" + +/* + * ,-------. ,--------------------------------------------------------------------------. + * | F1| F2| |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BS |NumLck |ScrLck | + * |-------| |--------------------------------------------------------------------------| + * | F3| F4| | Tab | Q| W| E| R| T| Y| U| I| O| P| [| ] | | 7| 8| 9| -| + * |-------| |------------------------------------------------------|Ent|---------------| + * | F5| F6| | Ctrl | A| S| D| F| G| H| J| K| L| ;| '| `| | 4| 5| 6| | + * |-------| |----------------------------------------------------------------------| | + * | F7| F8| |Shif| \| Z| X| C| V| B| N| M| ,| .| /|Shift|PrS| 1| 2| 3| +| + * |-------| |----------------------------------------------------------------------| | + * | F9|F10| | Alt | Space |CapsLck| 0 | . | | + * `-------' `--------------------------------------------------------------------------' +*/ + +#define LAYOUT_5291( \ + KEY_F1,KEY_F2, KEY_ESC, KEY_1, KEY_2,KEY_3,KEY_4,KEY_5,KEY_6,KEY_7,KEY_8,KEY_9, KEY_0, KEY_MIN, KEY_EQU, KEY_BACK, KEY_NLOCK, KEY_SLOCK, \ + KEY_F3,KEY_F4, KEY_TAB, KEY_Q, KEY_W,KEY_E,KEY_R,KEY_T,KEY_Y,KEY_U,KEY_I,KEY_O, KEY_P, KEY_LBRC,KEY_RBRC, KEY_PAD7,KEY_PAD8, KEY_PAD9,KEY_PMIN, \ + KEY_F5,KEY_F6, KEY_LCTR,KEY_A, KEY_S,KEY_D,KEY_F,KEY_G,KEY_H,KEY_J,KEY_K,KEY_L, KEY_SEMI,KEY_QUOT,KEY_TICK, KEY_ENTR,KEY_PAD4,KEY_PAD5, KEY_PAD6, \ + KEY_F7,KEY_F8, KEY_LSFS,KEY_BSLS,KEY_Z,KEY_X,KEY_C,KEY_V,KEY_B,KEY_N,KEY_M,KEY_COMM,KEY_DOT, KEY_SLS,KEY_RSFS, KEY_PAST,KEY_PAD1,KEY_PAD2, KEY_PAD3,KEY_PPLS, \ + KEY_F9,KEY_F10, KEY_LALT, KEY_SPACE, KEY_CLOCK, KEY_PAD0, KEY_PDOT \ +) \ +{ {KEY_Z, KEY_S, KEY_W, KEY_3 }\ +, {KEY_X, KEY_D, KEY_E, KEY_4 }\ +, {KEY_C, KEY_F, KEY_R, KEY_5 }\ +, {KEY_V, KEY_G, KEY_T, KEY_6 }\ +, {KEY_B, KEY_H, KEY_Y, KEY_7 }\ +, {KEY_N, KEY_J, KEY_U, KEY_8 }\ +, {KEY_PAD2, KEY_PAD5,KEY_PAD8,KEY_NLOCK }\ +, {KEY_M, KEY_K, KEY_I, KEY_9 }\ +, {KEY_COMM, KEY_L, KEY_O, KEY_0 }\ +, {KEY_DOT, KEY_SEMI,KEY_P, KEY_MIN }\ +, {KEY_SLS, KEY_QUOT,KEY_LBRC,KEY_EQU }\ +, {KEY_SPACE, KEY_RSFS,KEY_TICK,KEY_RBRC }\ +, {KEY_CLOCK, KEY_PAST,KEY_ENTR,KEY_BACK }\ +, {KEY_PAD0, KEY_PAD1,KEY_PAD4,KEY_PAD7 }\ +, {KEY_PPLS, KC_NO, KEY_PMIN,KEY_SLOCK }\ +, {KEY_PDOT, KEY_PAD3,KEY_PAD6,KEY_PAD9 }\ +, {KEY_BSLS, KEY_A, KEY_Q, KEY_2 }\ +, {KEY_LALT, KC_NO, KC_NO, KEY_1 }\ +, {KEY_F7, KEY_F5, KEY_F3, KEY_F1 }\ +, {KEY_F8, KEY_F6, KEY_F4, KEY_F2 }\ +, {KC_F10, KC_NO, KC_NO, KC_NO }\ +, {KC_F9, KC_NO, KC_NO, KC_NO }\ +, {KEY_LSFS, KEY_LCTR,KEY_TAB, KEY_ESC }\ +, {KC_NO, KC_NO, KC_NO, KC_NO }\ +} + +#define LAYOUT LAYOUT_5291 \ No newline at end of file diff --git a/keyboards/converter/ibm_5291/info.json b/keyboards/converter/ibm_5291/info.json new file mode 100644 index 0000000000..080a16336e --- /dev/null +++ b/keyboards/converter/ibm_5291/info.json @@ -0,0 +1,6 @@ +{ + "keyboard_name": "IBM 5291", + "keyboard_folder": "converter/5291", + "url": "https://deskthority.net/wiki/IBM_Model_F#IBM_5291_Keyboard", + "maintainer": "listofoptions", +} diff --git a/keyboards/converter/ibm_5291/keymaps/default/keymap.c b/keyboards/converter/ibm_5291/keymaps/default/keymap.c new file mode 100644 index 0000000000..9b286c887d --- /dev/null +++ b/keyboards/converter/ibm_5291/keymaps/default/keymap.c @@ -0,0 +1,233 @@ +/* +Copyright 2018 listofoptions + +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 +/* +enum xt_keycodes + { XT_PAST = SAFE_RANGE // XT pad asterisk / print screen + , XT_SLCK // XT scroll lock / break + , XT_F6 // F6 / app key + , XT_F5 // F5 / gui + , XT_F9 // F9 / F11 + , XT_F10 // F10 / F12 + } ; + +static bool shift_pressed = false , + alt_pressed = false , + ctrl_pressed = false , + xt_pscr_pressed = false , + xt_brk_pressed = false , + xt_app_pressed = false , + xt_gui_pressed = false , + xt_lout_pressed = false , + xt_f11_pressed = false , + xt_f12_pressed = false ; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_LSFT: + case KC_RSFT: + if (record->event.pressed) { + shift_pressed = true ; + } else { + shift_pressed = false ; + } + return true; + break; + + case KC_LALT: + if (record->event.pressed) { + alt_pressed = true ; + } else { + alt_pressed = false ; + } + return true; + break; + + case KC_LCTL: + if (record->event.pressed) { + ctrl_pressed = true ; + } else { + ctrl_pressed = false ; + } + return true; + break; + + case XT_PAST: + if (record->event.pressed) { + if (shift_pressed) { + xt_pscr_pressed = true ; + register_code(KC_PSCR); + } else { + register_code(KC_PAST); + } + } else { + if (xt_pscr_pressed) { + xt_pscr_pressed = false ; + unregister_code(KC_PSCR); + } else { + unregister_code(KC_PAST); + } + } + return false; + break; + + case XT_SLCK: + if (record->event.pressed) { + if (ctrl_pressed) { + xt_brk_pressed = true ; + register_code(KC_BRK); + } else { + register_code(KC_SLCK); + } + } else { + if (xt_brk_pressed) { + xt_brk_pressed = false ; + unregister_code(KC_BRK); + } else { + unregister_code(KC_SLCK); + } + } + return false; + break; + + case XT_F6: + if (record->event.pressed) { + if (shift_pressed) { + xt_app_pressed = true ; + register_code(KC_APP); + } else { + register_code(KC_F6); + } + } else { + if (xt_app_pressed) { + xt_app_pressed = false ; + unregister_code(KC_APP); + } else { + unregister_code(KC_F6); + } + } + return false; + break; + + case XT_F5: + if (record->event.pressed) { + if (shift_pressed) { + xt_gui_pressed = true ; + register_code(KC_LGUI); + } else if (ctrl_pressed) { + xt_lout_pressed = true ; + register_code (KC_LGUI) ; + register_code (KC_L) ; + } else { + register_code(KC_F5); + } + } else { + if (xt_gui_pressed) { + xt_gui_pressed = false ; + unregister_code(KC_LGUI); + } else if (xt_lout_pressed) { + xt_lout_pressed = false ; + unregister_code (KC_LGUI) ; + unregister_code (KC_L) ; + } else { + unregister_code(KC_F5); + } + } + return false; + break; + + case XT_F9: + if (record->event.pressed) { + if (shift_pressed) { + xt_f11_pressed = true ; + register_code(KC_F11); + } else { + register_code(KC_F9); + } + } else { + if (xt_f11_pressed) { + xt_f11_pressed = false ; + unregister_code(KC_F11); + } else { + unregister_code(KC_F9); + } + } + return false; + break; + + case XT_F10: + if (record->event.pressed) { + if (shift_pressed) { + xt_f12_pressed = true ; + register_code(KC_F12); + } else { + register_code(KC_F10); + } + } else { + if (xt_f12_pressed) { + xt_f12_pressed = false ; + unregister_code(KC_F12); + } else { + unregister_code(KC_F10); + } + } + return false; + break; + + default: + return true; + break; + } + + return true; +} +*/ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +// default layout is the standard XT layout +/* + * ,-------. ,--------------------------------------------------------------------------. + * | F1| F2| |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BS |NumLck |ScrLck | + * |-------| |--------------------------------------------------------------------------| + * | F3| F4| | Tab | Q| W| E| R| T| Y| U| I| O| P| [| ] | | 7| 8| 9| -| + * |-------| |------------------------------------------------------|Ent|---------------| + * | F5| F6| | Ctrl | A| S| D| F| G| H| J| K| L| ;| '| `| | 4| 5| 6| | + * |-------| |----------------------------------------------------------------------| | + * | F7| F8| |Shif| \| Z| X| C| V| B| N| M| ,| .| /|Shift| *| 1| 2| 3| +| + * |-------| |----------------------------------------------------------------------| | + * | F9|F10| | Alt | Space |CapsLck| 0 | . | | + * `-------' `--------------------------------------------------------------------------' +*/ +/* + [0] = LAYOUT ( + KC_F1,KC_F2, KC_ESC, 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_NLCK, XT_SLCK, + KC_F3,KC_F4, 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_P7,KC_P8, KC_P9, KC_PMNS, + XT_F5,XT_F6, KC_LCTL,KC_A, KC_S,KC_D,KC_F,KC_G,KC_H,KC_J,KC_K,KC_L, KC_SCLN,KC_QUOT,KC_GRV, KC_ENT, KC_P4,KC_P5, KC_P6, + KC_F7,KC_F8, KC_LSFT,KC_BSLS,KC_Z,KC_X,KC_C,KC_V,KC_B,KC_N,KC_M,KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,XT_PAST,KC_P1,KC_P2, KC_P3, KC_PPLS, + XT_F9,XT_F10,KC_LALT, KC_SPACE, KC_CAPS, KC_P0, KC_PDOT + ) +*/ + [0] = LAYOUT ( + KC_F1,KC_F2, KC_ESC, 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_NLCK, KC_SLCK, + KC_F3,KC_F4, 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_P7,KC_P8, KC_P9, KC_PMNS, + KC_F5,KC_F6, KC_LCTL,KC_A, KC_S,KC_D,KC_F,KC_G,KC_H,KC_J,KC_K,KC_L, KC_SCLN,KC_QUOT,KC_GRV, KC_ENT, KC_P4,KC_P5, KC_P6, + KC_F7,KC_F8, KC_LSFT,KC_BSLS,KC_Z,KC_X,KC_C,KC_V,KC_B,KC_N,KC_M,KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,KC_PAST,KC_P1,KC_P2, KC_P3, KC_PPLS, + KC_F9,KC_F10,KC_LALT, KC_SPACE, KC_CAPS, KC_P0, KC_PDOT + ) +} ; + diff --git a/keyboards/converter/ibm_5291/keymaps/kbdbabel_doc_ibm5291_kbd.pdf b/keyboards/converter/ibm_5291/keymaps/kbdbabel_doc_ibm5291_kbd.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3560598f02b8bacc12ef9426875a5b7076e32eab GIT binary patch literal 13054 zcmb_@by$?!*0>x z2-2Y_zZX5{+;h)&pYQwqap&QA-0yzZ+I!_*>s@=vsiUka2o(|~;_UsBP(UOGf`E|L z4~S%C!J2S{y@vxx9GKAqt2#P+z)>Kusx!<3t_-(9+QQ}KiQGL@t#aia^fB@Mua>Vy)h$OAUK-#sv}4wxDD&x^KSi* z_+=G3Jkx#2edkoT9FK7LwiY5BJuqPxqa6~@%N7FV$RD0+7uwH{C$f<3 z{{9E=wvcz;uYosF7_UhAk6U9=?+0c;0;ACOtqKY3ve&x!;oV7< zHhAGxd*@4px=r@f;>_^UXA8d6hdbPI~&dAALzHzEh~d+U%l##-P?w$pZ_!(9oB9|8To&UH|xz2MHpB ze@sCu1B_!4o%^-yXM+ANX_^ml8ps%%BpxbrRh6fAw0x^ML?DK1E`*DZF?~+bA6PPS6i4Ufv+2CI z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wh0P9H- zN&frW%f~-nD#6_0mvRB$hC6$~JsfRdzvu>E&H*As0KKn{2zwCpk}o~5zNfXvrNSEm7Kx|@Q7e|DryT#uyFWLWtlwYRsr(lTw+RIo=^Uv;F zsIa7jy!;;qCad7%3bS#7dw{Ir_KpZS?ys#K+#p9=Ic_5{Er^!uEx3c@Z9f!T-%s1X z#?Q${%9dL}o=8>!2G}KB&ia6@-cifb38(7q~YPqHOJ?^#IHKy&&);$L-+Z;VKOVdwY8ed5Z`kQTAY{l#~=0A`BK576c#!-F*=r zFdspL`wd{fUxYXs|AmHd7y3n$kPXrW>}U*z3PHesZlnybgK~8Ba6}?Nmm9;Zk)9rM z+~U?^5NjJ@h@h~IwVfao3YQXu06#$yDBM~^%1&HVSkm^-om~G$;lFJKya4tR0Ym_d zqyew9^|XPb7QfJ0$Hh=c(IA`Ov{hKTV)pwbWsz$5^A3+Uwrdb|G*P&=wX~#_kv5(#zzL_W z{Qs%{|DwulZT=$D)f46X%fxMMz;I{yB}MLl)}R2Lwl>msNR$fWM%W?Y%+QRK%p3WZJfNFk0+x`~6v!nd)!7n`U zzt;K>%K0?~I4Gbe@L%pPPXzie{r-Ck{p-vFf`A;i_vMKOjQ&03{_RNp(?fawlY{aC z5%AIr02{va10H4ROP_%VLnMH6LE@LYa0BiFfB}B>ze4;KlYCHcJ0b`ODnfL5w*3Bq z#Kpu!#6WhS-*Zriq!*NV;V#4c zKjx(VCmi%Y;Yx`CNy|TRCI81BPzaEs`~waO6$1kNpST_cs1^o9C5Ln;Q4-Uu$ z1f(-aAY-_UrXa97!VU@godAHVFd- literal 0 HcmV?d00001 diff --git a/keyboards/converter/ibm_5291/matrix.c b/keyboards/converter/ibm_5291/matrix.c new file mode 100644 index 0000000000..58f6e37b65 --- /dev/null +++ b/keyboards/converter/ibm_5291/matrix.c @@ -0,0 +1,284 @@ +/* +Copyright 2018 listofoptions + +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 +#include +#include +#if defined(__AVR__) +#include +#endif +#include + +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "timer.h" + +#include "config.h" + + +#ifndef DEBOUNCING_DELAY +# define DEBOUNCING_DELAY 5 +#endif + +#define print_matrix_header() print("\nr/c 01234567\n") +#define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +#define matrix_bitpop(i) bitpop(matrix[i]) +#define ROW_SHIFTER ((uint8_t)1) +#define check_bit(var,pos) ((var) & (1<<(pos))) + +#define NUM_ROW_PINS 5 +#define NUM_COL_PINS 2 + +static const uint8_t row_pins [NUM_ROW_PINS] = MATRIX_ROW_PINS ; +static const uint8_t col_pins [NUM_ROW_PINS] = MATRIX_COL_PINS ; + +#if ( DEBOUNCING_DELAY > 0 ) +static uint16_t debouncing_time ; +static bool debouncing = false ; +#endif + +static uint8_t matrix [MATRIX_ROWS] = {0}; + +#if ( DEBOUNCING_DELAY > 0 ) +static uint8_t matrix_debounce [MATRIX_ROWS] = {0}; +#endif + +static +inline +void toggle_led(void) { + uint8_t pin = LED_PIN ; + _SFR_IO8((pin >> 4) + 2) ^= _BV(pin & 0xF); +} + +static +inline +void init_led(void) { + uint8_t pin = LED_PIN ; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW +} + +static +inline +void init_data(void) { + uint8_t pin = MATRIX_DATA_PIN ; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // LO +} + +static +inline +void init_strobe(void) { + uint8_t pin = MATRIX_STROBE_PIN ; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI +} + +static +inline +void init_rows(void) { + for ( uint8_t i = 0 ; i < NUM_ROW_PINS; ++i ) { + uint8_t pin = row_pins[i]; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW + } +} + +static +inline +void init_cols(void) { + for ( uint8_t i = 0 ; i < NUM_COL_PINS; ++i ) { + uint8_t pin = col_pins[i]; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW + } +} + +static +inline +void select_row(uint8_t current_row) { + for ( uint8_t i = 0 ; i < NUM_ROW_PINS; ++i ) { + uint8_t pin = row_pins[i] ; + if ( check_bit( current_row, i ) ) { + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } else { + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW + } + } + wait_us(30) ; +} + +static +inline +void select_col(uint8_t current_col) { + for ( uint8_t i = 0 ; i < NUM_COL_PINS; ++i ) { + uint8_t pin = col_pins[i] ; + if ( check_bit( current_col, i ) ) { + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } else { + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW + } + } + wait_us(30) ; +} + +static +inline +uint8_t matrix_strobe(uint8_t col_index) { + uint8_t strobe_pin = MATRIX_STROBE_PIN ; + uint8_t data_pin = MATRIX_DATA_PIN ; + + // set strobe pin low + _SFR_IO8((strobe_pin >> 4) + 2) &= ~_BV(strobe_pin & 0xF); + + wait_us(30) ; + + // read data + uint8_t data = (_SFR_IO8(data_pin >> 4) & _BV(data_pin & 0xF)) ; + + // set strobe pin hi + _SFR_IO8((strobe_pin >> 4) + 2) |= _BV(strobe_pin & 0xF); + + uint8_t out = data ? (1 << col_index) : 0 ; + return out ; +} + +static +bool matrix_read(uint8_t current_matrix[], uint8_t current_row) { + // Store last value of row prior to reading + uint8_t last_row_value = current_matrix[current_row]; + + // Clear data in matrix row + current_matrix[current_row] = 0; + + select_row(current_row); + + // For each col... + for(uint8_t col_index = 0; col_index < MATRIX_COLS; ++col_index) { + + select_col(col_index) ; + + // strobe the matrix + // Populate the matrix row with the state of the data pin + current_matrix[current_row] |= matrix_strobe(col_index) ; + } + + bool test = last_row_value != current_matrix[current_row] ; + return test ; +} + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +inline +uint8_t matrix_get_row(uint8_t row) { + return matrix[row]; +} + +void matrix_init(void) { + init_led() ; + init_rows() ; + init_cols() ; + init_data() ; + init_strobe() ; + + // initialize matrix state: all keys off + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; +# if (DEBOUNCING_DELAY > 0) + matrix_debounce [i] = 0; +# endif + } + + matrix_init_quantum() ; +} + +uint8_t matrix_scan(void) { + for ( uint8_t current_row = 0; current_row < MATRIX_ROWS; ++current_row ) { +# if (DEBOUNCING_DELAY > 0) + bool matrix_changed = matrix_read(matrix_debounce, current_row); + + if (matrix_changed) { + debouncing = true ; + debouncing_time = timer_read(); + } + +# else + matrix_read(matrix, current_row); +# endif + } + +# if (DEBOUNCING_DELAY > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debounce[i]; + } + debouncing = false; + } +# endif + + matrix_scan_quantum(); + return 1; +} + +void matrix_print(void) { + print_matrix_header(); + + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + phex(row); print(": "); + print_matrix_row(row); + print("\n"); + } +} diff --git a/keyboards/converter/ibm_5291/matrix.csv b/keyboards/converter/ibm_5291/matrix.csv new file mode 100644 index 0000000000..40462c2143 --- /dev/null +++ b/keyboards/converter/ibm_5291/matrix.csv @@ -0,0 +1,96 @@ +0,Z +1,S +2,W +3,3 +4,X +5,D +6,E +7,4 +8,C +9,F +10,R +11,5 +12,V +13,G +14,T +15,6 +16,B +17,H +18,Y +19,7 +20,N +21,J +22,U +23,8 +24,PAD_2 +25,PAD_5 +26,PAD_8 +27,NUM_LOCK +28,M +29,K +30,I +31,9 +32,COMMA +33,L +34,O +35,0 +36,PERIOD +37,SEMICOLON +38,P +39,MINUS +40,SLASH +41,QUOTE +42,LEFT_BRACE +43,EQUAL +44,SPACE +45,RSHIFT +46,BACK_QUOTE +47,RIGHT_BRACE +48,CAPS_LOCK +49,PAD_ASTERIX +50,ENTER +51,BACKSPACE +52,PAD_0 +53,PAD_1 +54,PAD_4 +55,PAD_7 +56,PAD_PLUS +57,UNASSIGNED +58,PAD_MINUS +59,SCROLL_LOCK +60,PAD_PERIOD +61,PAD_3 +62,PAD_6 +63,PAD_9 +64,BACKSLASH +65,A +66,Q +67,2 +68,LALT +69,UNASSIGNED +70,UNASSIGNED +71,1 +72,F7 +73,F5 +74,F3 +75,F1 +76,F8 +77,F6 +78,F4 +79,F2 +80,F10 +81,UNASSIGNED +82,UNASSIGNED +83,UNASSIGNED +84,F9 +85,UNASSIGNED +86,UNASSIGNED +87,UNASSIGNED +88,LSHIFT +89,LCTRL +90,TAB +91,ESC +92,UNASSIGNED +93,UNASSIGNED +94,UNASSIGNED +95,UNASSIGNED diff --git a/keyboards/converter/ibm_5291/readme.md b/keyboards/converter/ibm_5291/readme.md new file mode 100644 index 0000000000..06ae2e994e --- /dev/null +++ b/keyboards/converter/ibm_5291/readme.md @@ -0,0 +1,70 @@ +# IBM 5291 keyboard converter + +![5291](https://deskthority.net/wiki/IBM_Model_F#IBM_5291_Keyboard) + +A converter for the eponymous keyboard. + +Keyboard Maintainer: [Listofoptions](https://github.com/listofoptions) +Hardware Supported: IBM 5291, Teensy 2.0 + +Make example for this keyboard (after setting up your build environment): + + make converter/ibm_5291:default + +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). + + +the pinout is as follows: + +IBM−5291−Cable to Pinhead−14 + +| pin | description +----|------------------------ +1 | GND +2 | NC +3 | GND +4 | GN) +5 | +5V +6 | D0 +7 | D1 +8 | D2 +9 | D3 +10| D4 +11| D5 +12| D6 +13| Strobe +14| Out + +the pins on this connector are organized ![here](https://geekhack.org/index.php?action=dlattach;topic=48950.0;attach=36759;image) + +IBM−5291−2 Cable with DB15M connector + +| pin | description +----|------------- +|1,2,3 | GND +|4 | +5V +|5 | D0 +|6 | D1 +|7 | D2 +|8 | D3 +|9 | D4 +|10 | D5 +|11 | D6 +|12 | Strobe +|13 | Out +|14 | PE +|15 | NC + +the above connector is actually numbered so it should be easier to determine +where the needed connections are. + +to connect to the teensy, the following are pins are needed (if you should choose not set your own): +* PB0 -> PB6 are connected to D0 -> D6 +* +5V is connected to the corresponding teensy pin +* gnd is as well, only one of the gnd pins needs to be connected though. +* strobe is connected to pin PD1 +* data is connected to PD0 +* PE does not need to be connected to anything, but it could also be connected to gnd + +sources: + http://www.retrocomputing.eu/documents/5291_MaintenanceLibrary.pdf diff --git a/keyboards/converter/ibm_5291/rules.mk b/keyboards/converter/ibm_5291/rules.mk new file mode 100644 index 0000000000..ca0c850c0b --- /dev/null +++ b/keyboards/converter/ibm_5291/rules.mk @@ -0,0 +1,72 @@ +# MCU name +#MCU = at90usb1287 +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 +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = halfkay + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = no +SPLIT_KEYBOARD = no +WAIT_FOR_USB = yes + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +LAYOUTS_HAS_RGB = NO + +CUSTOM_MATRIX = yes +SRC = matrix.c \ No newline at end of file