From 73cf1923f5cb5e728abe1fbb2a51262c3ea90fa7 Mon Sep 17 00:00:00 2001 From: listofoptions Date: Fri, 21 Sep 2018 22:00:15 -0400 Subject: [PATCH 01/10] funged git history, restarting --- keyboards/converter/HP_46010A/HP_46010A.c | 3 + keyboards/converter/HP_46010A/HP_46010A.h | 66 ++++++ keyboards/converter/HP_46010A/config.h | 44 ++++ keyboards/converter/HP_46010A/info.json | 6 + .../HP_46010A/keymaps/default/keymap.c | 45 ++++ keyboards/converter/HP_46010A/matrix.c | 216 ++++++++++++++++++ keyboards/converter/HP_46010A/matrix.csv | 107 +++++++++ keyboards/converter/HP_46010A/read_a_key.ino | 152 ++++++++++++ keyboards/converter/HP_46010A/readme.md | 17 ++ keyboards/converter/HP_46010A/rules.mk | 73 ++++++ 10 files changed, 729 insertions(+) create mode 100644 keyboards/converter/HP_46010A/HP_46010A.c create mode 100644 keyboards/converter/HP_46010A/HP_46010A.h create mode 100644 keyboards/converter/HP_46010A/config.h create mode 100644 keyboards/converter/HP_46010A/info.json create mode 100644 keyboards/converter/HP_46010A/keymaps/default/keymap.c create mode 100644 keyboards/converter/HP_46010A/matrix.c create mode 100644 keyboards/converter/HP_46010A/matrix.csv create mode 100644 keyboards/converter/HP_46010A/read_a_key.ino create mode 100644 keyboards/converter/HP_46010A/readme.md create mode 100644 keyboards/converter/HP_46010A/rules.mk diff --git a/keyboards/converter/HP_46010A/HP_46010A.c b/keyboards/converter/HP_46010A/HP_46010A.c new file mode 100644 index 000000000000..1c65ccdc7a91 --- /dev/null +++ b/keyboards/converter/HP_46010A/HP_46010A.c @@ -0,0 +1,3 @@ +#include "HP_46010A.h" +#include +#include "quantum.h" \ No newline at end of file diff --git a/keyboards/converter/HP_46010A/HP_46010A.h b/keyboards/converter/HP_46010A/HP_46010A.h new file mode 100644 index 000000000000..973a96d4dbfe --- /dev/null +++ b/keyboards/converter/HP_46010A/HP_46010A.h @@ -0,0 +1,66 @@ +/* +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 . +*/ + +#ifndef HP_46010A +#define HP_46010A + +#include "quantum.h" + +/* ,---------. ,---------------------------------------------------------. ,---------. ,-------------------. + * | res|stop| | f1| f2| f3| f4|menu|user| f5| f6| f7| f8| |clrl|clrd| | | | | | + * `---------' `---------------------------------------------------------' `---------' `-------------------' + * ,------------------------------------------------------------------------..---------. ,-------------------. + * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| +| back||insl|dell| | *| /| +| -| + * |------------------------------------------------------------------------||---------| |-------------------| + * | tab| q| w| e| r| t| y| u| i| o| p| [| ]| \||insc|delc| | 7| 8| 9|pade| + * |------------------------------------------------------------------------||---------| |-------------------| + * |caps|ctrl| a| s| d| f| g| h| j| k| l| ;| '| retr|| cur|prev| | 4| 5| 6| ,| + * |------------------------------------------------------------------------------------ |-------------------| + * |dele|lshf | z| x| c| v| b| n| m| ,| .| /|rshf |sel | up|next| | 1| 2| 3| tab| + * |-------------------------------------------------------------------------|---------| |--------------- | + * |prnt| |lalt| space |ralt| |left|down|rght| | 0| .| | + * `-----------------------------------------------------------------------------------' `-------------------' + */ + +#define LAYOUT_HP_46010A( \ + KEY_RES, KEY_STOP, KEY_F1, KEY_F2, KEY_F3, KEY_F4,KEY_MENU,KEY_USER, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_CLRL, KEY_CLRD, KEY_B1, KEY_B2, KEY_B3, KEY_B4, \ + KEY_GRAV, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_0, KEY_MINU, KEY_PLUS, KEY_BACK, KEY_INSL, KEY_DELL, KEY_MULT, KEY_DIV, KEY_ADD, KEY_SUBT, \ + KEY_TAB, KEY_Q,KEY_W, KEY_E, KEY_R, KEY_T, KEY_Y, KEY_U, KEY_I, KEY_O, KEY_P, KEY_LBRA, KEY_RBRA, KEY_PIPE, KEY_INSC, KEY_DELC, KEY_P7, KEY_P8, KEY_P9, KEY_PADE, \ + KEY_CAPS, KEY_CTRL, KEY_A, KEY_S, KEY_D, KEY_F, KEY_G, KEY_H, KEY_J, KEY_K, KEY_L, KEY_SEMI, KEY_QUOT, KEY_RETR, KEY_CUR, KEY_PREV, KEY_P4, KEY_P5, KEY_P6, KEY_PCOM, \ + KEY_DELE, KEY_LSHF, KEY_Z, KEY_X, KEY_C, KEY_V, KEY_B, KEY_N, KEY_M, KEY_COMA, KEY_DOT, KEY_SLAS,KEY_RSHF, KEY_SEL, KEY_UP, KEY_NEXT, KEY_P1, KEY_P2, KEY_P3, KEY_PTAB, \ + KEY_PRNT, KEY_LALT, KEY_SPACE , KEY_RALT, KEY_LEFT, KEY_DOWN, KEY_RGHT, KEY_P0, KEY_PDOT \ +) { \ + {KEY_USER, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_CLRL, KEY_CLRD, KEY_MENU }, \ + {KEY_9, KEY_0, KEY_MINU, KEY_PLUS, KEY_BACK, KEY_INSL, KEY_DELL, KEY_8 }, \ + {KEY_O, KEY_P, KEY_LBRA, KEY_RBRA, KEY_PIPE, KEY_INSC, KEY_DELC, KEY_I }, \ + {KEY_K, KEY_L, KEY_SEMI, KEY_QUOT, KEY_RETR, KEY_CUR, KEY_PREV, KEY_J }, \ + {KEY_COMA, KEY_DOT, KEY_SLAS, KEY_1, KEY_SEL, KEY_UP, KEY_NEXT, KEY_M }, \ + {KEY_SPACE, KEY_LALT, KEY_RALT, KC_NO, KEY_LEFT, KEY_DOWN, KEY_RGHT, KC_NO }, \ + {KEY_F3, KEY_F2, KEY_F1, KEY_GRAV, KEY_CTRL, KEY_STOP, KEY_G, KEY_F4 }, \ + {KEY_6, KEY_5, KEY_4, KEY_3, KEY_CAPS, KEY_RSHF, KEY_LSHF, KEY_7 }, \ + {KEY_Y, KEY_T, KEY_R, KEY_E, KEY_W, KEY_Q, KEY_TAB, KEY_U }, \ + {KEY_RES, KEY_F, KEY_D, KEY_S, KEY_A, KC_NO, KEY_2, KEY_H }, \ + {KEY_P7, KEY_P4, KEY_P8, KEY_P5, KEY_P7, KEY_P6, KEY_PADE, KEY_PCOM }, \ + {KEY_MULT, KEY_P1, KEY_DIV, KEY_P2, KEY_PLUS, KEY_P3, KEY_MINU, KEY_PTAB }, \ + {KEY_B1, KEY_P0, KEY_B2, KC_NO, KEY_B3, KEY_PDOT, KEY_B4, KC_NO }, \ + {KEY_B, KEY_V, KEY_C, KEY_X, KEY_Z, KEY_PRNT, KEY_DELE, KEY_N }, \ +} + +#define KEYMAP LAYOUT_HP_46010A +#define KC_LAYOUT_HP_46010A LAYOUT_HP_46010A + +#endif //HP_46010A \ No newline at end of file diff --git a/keyboards/converter/HP_46010A/config.h b/keyboards/converter/HP_46010A/config.h new file mode 100644 index 000000000000..e86b78dacd9b --- /dev/null +++ b/keyboards/converter/HP_46010A/config.h @@ -0,0 +1,44 @@ +/* +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 1 +#define MANUFACTURER QMK +#define PRODUCT 46010A keyboard converter +#define DESCRIPTION 46010A keyboard converter + +#define MATRIX_ROWS 14 +#define MATRIX_COLS 8 + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION CUSTOM_MATRIX +#undef MATRIX_HAS_GHOST + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +//#define QMK_KEYS_PER_SCAN 107 + + + +#endif // CONFIG_H diff --git a/keyboards/converter/HP_46010A/info.json b/keyboards/converter/HP_46010A/info.json new file mode 100644 index 000000000000..de68a122858b --- /dev/null +++ b/keyboards/converter/HP_46010A/info.json @@ -0,0 +1,6 @@ +{ + "keyboard_name": "HP_46010A", + "keyboard_folder": "converter/HP_46010A", + "url": "https://deskthority.net/wiki/HP_46010A", + "maintainer": "listofoptions", +} diff --git a/keyboards/converter/HP_46010A/keymaps/default/keymap.c b/keyboards/converter/HP_46010A/keymaps/default/keymap.c new file mode 100644 index 000000000000..0a5b88d9d3ee --- /dev/null +++ b/keyboards/converter/HP_46010A/keymaps/default/keymap.c @@ -0,0 +1,45 @@ +/* +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 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* ,---------. ,---------------------------------------------------------. ,---------. ,-------------------. + * | esc|xxxx| | f1| f2| f3| f4|xxxx|xxxx| f5| f6| f7| f8| |xxxx|xxxx| | f9| f10| f11| f12| + * `---------' `---------------------------------------------------------' `---------' `-------------------' + * ,------------------------------------------------------------------------..---------. ,-------------------. + * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| back||ins |home| | *| /| +| -| + * |------------------------------------------------------------------------||---------| |-------------------| + * | tab| q| w| e| r| t| y| u| i| o| p| [| ]| \||del | end| | 7| 8| 9|pade| + * |------------------------------------------------------------------------||---------| |-------------------| + * |caps|ctrl| a| s| d| f| g| h| j| k| l| ;| '| retr||xxxx|pgup| | 4| 5| 6| ,| + * |------------------------------------------------------------------------------------ |-------------------| + * |del |lsft | z| x| c| v| b| n| m| ,| .| /|rsft |xxxx| up|pgdn| | 1| 2| 3| tab| + * |-------------------------------------------------------------------------|---------| |--------------- | + * | gui| |lalt| space |ralt| |left|down|rght| | 0| .| | + * `-----------------------------------------------------------------------------------' `-------------------' + */ + + [0] = KEYMAP( + KC_ESC, KC_NO, KC_F1, KC_F2, KC_F3, KC_F4,KC_NO, KC_NO, KC_F5, KC_F6, KC_F7, KC_F8, KC_NO, KC_NO, KC_F9, KC_F10, KC_F11, KC_F12, \ + KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQUAL, KC_BSPC, KC_INS, KC_HOME, KC_PAST, KC_PSLS, KC_PPLS, 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_P7, KC_P8, KC_P9, KC_PENT, \ + KC_CAPS, 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_ENT, KC_NO, KC_PGUP, KC_P4, KC_P5, KC_P6, KC_PCMM, \ + KC_DEL, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH,KC_RSFT, KC_NO, KC_UP, KC_PGDN, KC_P1, KC_P2, KC_P3, KC_TAB, \ + KC_LGUI, KC_LALT, KC_SPACE , KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT \ + ) +} ; \ No newline at end of file diff --git a/keyboards/converter/HP_46010A/matrix.c b/keyboards/converter/HP_46010A/matrix.c new file mode 100644 index 000000000000..46ad986846bf --- /dev/null +++ b/keyboards/converter/HP_46010A/matrix.c @@ -0,0 +1,216 @@ +/* +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 + +#if ( DEBOUNCING_DELAY > 0 ) +static uint16_t debouncing_time ; +static bool debouncing = false ; +#endif + +static uint8_t matrix [MATRIX_ROWS] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +#if ( DEBOUNCING_DELAY > 0 ) +static uint8_t matrix_debounce_old [MATRIX_ROWS] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static uint8_t matrix_debounce_new [MATRIX_ROWS] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +#endif + +__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) { +} + +// the keyboard's internal wiring is such that the inputs to the logic are +// a clock signal, and a reset line. +// the output is a single output pin. im bitbanging here, but the SPI controller +// would work normally +// +// the device functions, by using the clock signal to count 128 bits, the lower +// 3 bits of this 7 bit counter are tied to a 1-of-8 multiplexer, this forms +// the columns. +// the upper 4 bits form the rows, and are decoded using bcd to decimal +// decoders, so that 14 out of 16 of the outputs are wired to the rows of the +// matrix. each switch has a diode, such that the row signal feeds into the +// switch, and then into the diode, then into one of the columns into the +// matrix. the reset pin can be used to reset the entire counter. + +uint8_t matrix_ReceiveByte (void) ; + +void matrix_init () { + //debug_enable=true ; + // PB0 (SS) and PB1 (SCLK) set to outputs + DDRB |= ((1 << 0) | (1 << 1)) ; + // PB2, is unused, and PB3 is our serial input + DDRB &= ~(1 << 3) ; + + // SS is reset for this board, and is active High + // SCLK is the serial clock and is active High + PORTB &= ~((1 << 0) | (1 << 1)) ; + + matrix_init_quantum(); +} + +uint8_t matrix_scan(void) { +#if ( DEBOUNCING_DELAY > 0 ) + + //toggle reset, to put the keyboard logic into a known state + PORTB ^= 1 ; + _delay_us( 30 ) ; // make sure the line is stable + PORTB ^= 1 ; + + for ( uint8_t current_row = 0 ; current_row < MATRIX_ROWS ; ++current_row ) { + // the first byte of the keyboard's output data can be ignored + if ( current_row == 0 ) { + // we dont really care about this first byte, but we need to do something to shut up gcc + matrix_debounce_old[0] = matrix_ReceiveByte() ; + // so we just overwrite them later on... + } else { + //transfer old debouncing values + matrix_debounce_old[current_row - 8] = matrix_debounce_new[current_row - 8] ; + // read new key-states in + matrix_debounce_new[current_row - 8] = matrix_ReceiveByte() ; + } + } + + // detect matrix changes (exit on first change) + for ( uint8_t i = 0 ; i < MATRIX_ROWS ; ++i ) { + if ( !( matrix_debounce_new[i] ^ matrix_debounce_old[i] ) ) { + debouncing = true ; + debouncing_time = timer_read() ; + break ; + } + } + +#else + // without debouncing we simply just read in the raw matrix + for ( uint8_t current_row = 0 ; current_row < MATRIX_ROWS ; ++current_row ) { + matrix[current_row] = matrix_ReceiveByte() ; + } +#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_new[i] ; + } + debouncing = false ; + } +#endif + + matrix_scan_quantum() ; + return 1; +} + +inline +uint8_t matrix_get_row( uint8_t row ) { + return matrix[row]; +} + +void matrix_print(void) +{ + print("\nr/c 01234567\n"); + + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + phex(row); print(": "); + print_bin_reverse8(matrix_get_row(row)); + print("\n"); + } +} + +uint8_t matrix_ReceiveByte (void) { + uint8_t received = 0; + for ( uint8_t bit = 0; bit < MATRIX_COLS; ++bit ) { + // toggle the clock + PORTB ^= (1 << 1) ; + _delay_us( 30 ) ; // make sure the line is stable + PORTB ^= (1 << 1) ; + + // read bit using PB3, and cram it into a byte + received |= (PINB & (1 << 3) << bit) ; + } + + return received ; +} + +inline +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +// as an aside, I used the M0110 converter: +// tmk_core/common/keyboard.c, quantum/matrix.c, and the project layout of the planck +// the online ducmentation starting from : +// https://docs.qmk.fm/#/config_options +// https://docs.qmk.fm/#/understanding_qmk +// and probably a few i forgot.... \ No newline at end of file diff --git a/keyboards/converter/HP_46010A/matrix.csv b/keyboards/converter/HP_46010A/matrix.csv new file mode 100644 index 000000000000..12c39b8445c9 --- /dev/null +++ b/keyboards/converter/HP_46010A/matrix.csv @@ -0,0 +1,107 @@ +menu, 0b00000001,1,1,11,17 +user, 0b10000000,128,1,801,2049 +f5 , 0b01000000,64,1,401,1025 +f6 , 0b00100000,32,1,201,513 +f7 , 0b00010000,16,1,101,257 +f8 , 0b00001000,8,1,81,129 +clrl, 0b00000100,4,1,41,65 +clrd, 0b00000010,2,1,21,33 +8, 0b00000001,1,2,12,18 +9, 0b10000000,128,2,802,2050 +0, 0b01000000,64,2,402,1026 +- , 0b00100000,32,2,202,514 += , 0b00010000,16,2,102,258 +back, 0b00001000,8,2,82,130 +insl, 0b00000100,4,2,42,66 +dell, 0b00000010,2,2,22,34 +i , 0b00000001,1,3,13,19 +o , 0b10000000,128,3,803,2051 +p , 0b01000000,64,3,403,1027 +[ , 0b00100000,32,3,203,515 +] , 0b00010000,16,3,103,259 + \ , 0b00001000,8,3,83,131 +insc, 0b00000100,4,3,43,67 +delc, 0b00000010,2,3,23,35 +j , 0b00000001,1,4,14,20 +k , 0b10000000,128,4,804,2052 +l , 0b01000000,64,4,404,1028 +; , 0b00100000,32,4,204,516 +' , 0b00010000,16,4,104,260 +ret , 0b00001000,8,4,84,132 +cur , 0b00000100,4,4,44,68 +prev, 0b00000010,2,4,24,36 +1, 0b00010000,16,5,105,261 +m , 0b00000001,1,5,15,21 +", ", 0b10000000,128,5,805,2053 +. , 0b01000000,64,5,405,1029 +/ , 0b00100000,32,5,205,517 +sel , 0b00001000,8,5,85,133 +up , 0b00000100,4,5,45,69 +next, 0b00000010,2,5,25,37 +lalt, 0b01000000,64,6,406,1030 +spce, 0b10000000,128,6,806,2054 +ralt, 0b00100000,32,6,206,518 +left, 0b00001000,8,6,86,134 +down, 0b00000100,4,6,46,70 +rght, 0b00000010,2,6,26,38 +stop, 0b00000100,4,7,47,71 +f1 , 0b00100000,32,7,207,519 +f2 , 0b01000000,64,7,407,1031 +f3 , 0b10000000,128,7,807,2055 +f4 , 0b00000001,1,7,17,23 +`~ , 0b00010000,16,7,107,263 +ctrl, 0b00001000,8,7,87,135 +g , 0b00000010,2,7,27,39 +3, 0b00010000,16,8,108,264 +4, 0b00100000,32,8,208,520 +5, 0b01000000,64,8,408,1032 +6, 0b10000000,128,8,808,2056 +7, 0b00000001,1,8,18,24 +caps, 0b00001000,8,8,88,136 +lshf, 0b00000010,2,8,28,40 +rshf, 0b00000100,4,8,48,72 +tab , 0b00000010,2,9,29,41 +q , 0b00000100,4,9,49,73 +w , 0b00001000,8,9,89,137 +e , 0b00010000,16,9,109,265 +r , 0b00100000,32,9,209,521 +t , 0b01000000,64,9,409,1033 +y , 0b10000000,128,9,809,2057 +u , 0b00000001,1,9,19,25 +res , 0b10000000,128,10,80A,2058 +2, 0b00000010,2,10,2A,42 +a , 0b00001000,8,10,8A,138 +s , 0b00010000,16,10,10A,266 +d , 0b00100000,32,10,20A,522 +f , 0b01000000,64,10,40A,1034 +h , 0b00000001,1,10,1A,26 +pad7, 0b10000000,128,11,80B,2059 +pad8, 0b00100000,32,11,20B,523 +pad9, 0b00001000,8,11,8B,139 +pade, 0b00000010,2,11,2B,43 +pad4, 0b01000000,64,11,40B,1035 +pad5, 0b00010000,16,11,10B,267 +pad6, 0b00000100,4,11,4B,75 +"pad,", 0b00000001,1,11,1B,27 +pad*, 0b10000000,128,12,80C,2060 +pad/, 0b00100000,32,12,20C,524 +pad+, 0b00001000,8,12,8C,140 +pad-, 0b00000010,2,12,2C,44 +pad1, 0b01000000,64,12,40C,1036 +pad2, 0b00010000,16,12,10C,268 +pad3, 0b00000100,4,12,4C,76 +padt, 0b00000001,1,12,1C,28 +b1 , 0b10000000,128,13,80D,2061 +b2 , 0b00100000,32,13,20D,525 +b3 , 0b00001000,8,13,8D,141 +b4 , 0b00000010,2,13,2D,45 +pad0, 0b01000000,64,13,40D,1037 +pad., 0b00000100,4,13,4D,77 +del , 0b00000010,2,14,2E,46 +z , 0b00001000,8,14,8E,142 +x , 0b00010000,16,14,10E,270 +c , 0b00100000,32,14,20E,526 +v , 0b01000000,64,14,40E,1038 +b , 0b10000000,128,14,80E,2062 +n , 0b00000001,1,14,1E,30 +prnt, 0b00000100,4,14,4E,78 diff --git a/keyboards/converter/HP_46010A/read_a_key.ino b/keyboards/converter/HP_46010A/read_a_key.ino new file mode 100644 index 000000000000..dc650eaedfaf --- /dev/null +++ b/keyboards/converter/HP_46010A/read_a_key.ino @@ -0,0 +1,152 @@ + +/* +this isketch requires the use of the teensyduino environment if running on a teensy 2.0. i have not tried to run it on other boards. +it should ask for you to press a series of button on the board and it will record the corresponding key pattern out as it reads the entire matrix of the board. +the pins used on the teensy, are SS, SCLK, MISO, aka PB0, PB1, and PB3. + +in order to use this program, you have to have an acutual terminal, the one that comes with the arduino environment is subpar. +for windows i suggest putty, there are tutorials on how to us it with a serial port on the internet. +for linux there isnt really any special program needed, as linux is mostly terminal programs anyway, so simply telneting into the corresponding serial port will work just fine. +when the program starts up it will ask for the user to press the key, but will not continue until prompted further. just hit enter/return on the computer (not the 46010a under test) +make sure that you are pressing and holding the key under test and not tapping it, the matrix is read out really fast so any switch bounce will be easily caught. +when the program has finished scanning the board, it will emit all of the codes with their corresponding clock. +*/ + +#include +#include +#include + +// BYTE_TO_BINARY_PATTERN, BYTE_TO_BINARY are from: +// https://stackoverflow.com/questions/111928/is-there-a-printf-converter-to-print-in-binary-format + +#define BYTE_TO_BINARY_PATTERN "%c%c%c%c%c%c%c%c" + +#define BYTE_TO_BINARY(byte) \ + (byte & 0x80 ? '1' : '0'), \ + (byte & 0x40 ? '1' : '0'), \ + (byte & 0x20 ? '1' : '0'), \ + (byte & 0x10 ? '1' : '0'), \ + (byte & 0x08 ? '1' : '0'), \ + (byte & 0x04 ? '1' : '0'), \ + (byte & 0x02 ? '1' : '0'), \ + (byte & 0x01 ? '1' : '0') + +const int resetPin = 0 + , ledPin = 11 + ; + +const char keyNames [ 107 ] [ 5 ] = + { "res ", "stop", "f1 ", "f2 ", "f3 ", "f4 ", "menu", "user", "f5 ", "f6 ", "f7 ", "f8 ", "clrl", "clrd", "b1 ", "b2 ", "b3 ", "b4 " + , "`~ ", "1 ", "2 ", "3 ", "4 ", "5 ", "6 ", "7 ", "8 ", "9 ", "0 ", "- ", "= ", "back", "insl", "dell", "pad*", "pad/", "pad+", "pad-" + , "tab ", "q ", "w ", "e ", "r ", "t ", "y ", "u ", "i ", "o ", "p ", "[ ", "] ", "\\ ", "insc", "delc", "pad7", "pad8", "pad9", "pade" + , "caps", "ctrl", "a ", "s ", "d ", "f ", "g ", "h ", "j ", "k ", "l ", "; ", "' ", "ret ", "cur ", "prev", "pad4", "pad5", "pad6", "pad," + , "del ", "lshf", "z ", "x ", "c ", "v ", "b ", "n ", "m ", ", ", ". ", "/ ", "rshf", "sel ", "up ", "next", "pad1", "pad2", "pad3", "padt" + , "prnt", "lalt", "spce", "ralt", "left", "down", "rght", "pad0", "pad." + } ; + +struct code { + char keycodeMask ; // the bit mask of this key + unsigned char clockStart ; // the starting clock number of the byte this key is found in +} ; + + + char serialOutBuffer [ 29 ] ; +unsigned char matrixOld [ 16 ] ; +unsigned char matrixNew [ 16 ] ; + code matrixCodes [ 107 ] ; +unsigned char currentKey ; + +void setup() { + currentKey = 0 ; + + Serial.begin( 115200 ) ; + while ( !Serial ) ; + + pinMode( resetPin, OUTPUT ) ; + pinMode( ledPin, OUTPUT ) ; + + digitalWrite( ledPin, LOW ) ; + digitalWrite( resetPin, LOW ) ; + + SPI.begin() ; + + // grab the initial matrix of the keyboard + digitalWrite( resetPin, HIGH ) ; + digitalWrite( resetPin, LOW ) ; + SPI.beginTransaction( SPISettings( 200, LSBFIRST, SPI_MODE1 ) ) ; + SPI.transfer( matrixOld, 16 ) ; + SPI.endTransaction(); + + memcpy( matrixNew, matrixOld, 16 ) ; +} + +void loop() { + if ( currentKey < 108 ) { + Serial.write(27); // ESC command + Serial.print("[2J"); // clear screen command + Serial.write(27); + Serial.print("[H"); // cursor to home command + + // find and manually map each key + Serial.print( "\npress " ) ; + Serial.print( keyNames[currentKey] ); + + while ( Serial.read() == -1 ) {} + + // read 16 bytes from the keyboard + digitalWrite( resetPin, HIGH ) ; + digitalWrite( resetPin, LOW ) ; + SPI.beginTransaction( SPISettings( 3200, LSBFIRST, SPI_MODE1 ) ) ; + SPI.transfer( matrixNew, 16 ) ; + SPI.endTransaction(); + +/* if you need debuggin uncommenting the following might help. it displays the entire matrix as set of 16 bytes */ +// Serial.write(27); // ESC command +// Serial.print("[2J"); // clear screen command +// Serial.write(27); +// Serial.print("[H"); // cursor to home command +// Serial.println( "keyboard bitmap" ) ; +// // display fetched bytes as binary +// for ( unsigned int i = 0; i < 16 ; ++i ) { +// sprintf( serialOutBuffer, "clocks: %3i to %3i : " BYTE_TO_BINARY_PATTERN, i*8, i*8 + 7, BYTE_TO_BINARY( matrixNew[i] ) ) ; +// Serial.println( serialOutBuffer ) ; +// memset( serialOutBuffer, '\0', 29 ) ; +// } + + // this little burb simply finds the first bit that differs from the previous mask (wich would be the empty no keys pressed state) + for ( unsigned int i = 0; i < 16; ++i ) { + if ( matrixOld[i] != matrixNew[i] ) { + matrixCodes[currentKey].keycodeMask = matrixNew[i] ; + matrixCodes[currentKey].clockStart = i*8 ; + break ; + } + } + + ++currentKey ; + memcpy( matrixNew, matrixOld, 16 ) ; + } else { + + Serial.write(27); // ESC command + Serial.print("[2J"); // clear screen command + Serial.write(27); + Serial.print("[H"); // cursor to home command + Serial.println( "code bitmask clock" ) ; + + // print out byte code for each key + + for ( unsigned int i = 0 ; i < 107; ++i ) { + sprintf( serialOutBuffer, "%4s " BYTE_TO_BINARY_PATTERN " %3i " + , keyNames[i] + , BYTE_TO_BINARY( matrixCodes[i].keycodeMask ) + , matrixCodes[i].clockStart + ) ; + + Serial.println( serialOutBuffer ) ; + + memset( serialOutBuffer, '\0', 29 ) ; + } + + while ( 1 ) {} + } +} + diff --git a/keyboards/converter/HP_46010A/readme.md b/keyboards/converter/HP_46010A/readme.md new file mode 100644 index 000000000000..e7536d90c4ab --- /dev/null +++ b/keyboards/converter/HP_46010A/readme.md @@ -0,0 +1,17 @@ +# HP 46010A + +![46010A](https://deskthority.net/w/images/a/a5/HP_46010A_--_top.jpg) + +A converter for the eponymous keyboard. + +Keyboard Maintainer: [Listofoptions](https://github.com/listofoptions) +Hardware Supported: HP 46010A, Teensy 2.0 + +Make example for this keyboard (after setting up your build environment): + + make converter/HP_46010A:default + +included in this directory is a arduino program for teensy 2.0 (only one tested, might work on others) to grab a copy of the keyboard matrix. +also included is a csv containing the matrix as an ordered by clock #, byte array + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/converter/HP_46010A/rules.mk b/keyboards/converter/HP_46010A/rules.mk new file mode 100644 index 000000000000..5b4b620cc315 --- /dev/null +++ b/keyboards/converter/HP_46010A/rules.mk @@ -0,0 +1,73 @@ +# 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 = yes # 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 = HP_46010A +LAYOUTS_HAS_RGB = NO + +CUSTOM_MATRIX = yes +SRC = matrix.c \ No newline at end of file From f8b875fb74edc4c42ccc4cf2669468b0909fe5a3 Mon Sep 17 00:00:00 2001 From: listofoptions Date: Sat, 22 Sep 2018 20:53:11 -0400 Subject: [PATCH 02/10] tested and working (message typed on this) --- keyboards/converter/HP_46010A/HP_46010A.h | 2 +- keyboards/converter/HP_46010A/config.h | 7 - keyboards/converter/HP_46010A/matrix.c | 150 +++++++++++++--------- keyboards/converter/HP_46010A/rules.mk | 4 +- 4 files changed, 92 insertions(+), 71 deletions(-) diff --git a/keyboards/converter/HP_46010A/HP_46010A.h b/keyboards/converter/HP_46010A/HP_46010A.h index 973a96d4dbfe..914f36490ca7 100644 --- a/keyboards/converter/HP_46010A/HP_46010A.h +++ b/keyboards/converter/HP_46010A/HP_46010A.h @@ -54,7 +54,7 @@ along with this program. If not, see . {KEY_6, KEY_5, KEY_4, KEY_3, KEY_CAPS, KEY_RSHF, KEY_LSHF, KEY_7 }, \ {KEY_Y, KEY_T, KEY_R, KEY_E, KEY_W, KEY_Q, KEY_TAB, KEY_U }, \ {KEY_RES, KEY_F, KEY_D, KEY_S, KEY_A, KC_NO, KEY_2, KEY_H }, \ - {KEY_P7, KEY_P4, KEY_P8, KEY_P5, KEY_P7, KEY_P6, KEY_PADE, KEY_PCOM }, \ + {KEY_P7, KEY_P4, KEY_P8, KEY_P5, KEY_P9, KEY_P6, KEY_PADE, KEY_PCOM }, \ {KEY_MULT, KEY_P1, KEY_DIV, KEY_P2, KEY_PLUS, KEY_P3, KEY_MINU, KEY_PTAB }, \ {KEY_B1, KEY_P0, KEY_B2, KC_NO, KEY_B3, KEY_PDOT, KEY_B4, KC_NO }, \ {KEY_B, KEY_V, KEY_C, KEY_X, KEY_Z, KEY_PRNT, KEY_DELE, KEY_N }, \ diff --git a/keyboards/converter/HP_46010A/config.h b/keyboards/converter/HP_46010A/config.h index e86b78dacd9b..3f22ce5f6822 100644 --- a/keyboards/converter/HP_46010A/config.h +++ b/keyboards/converter/HP_46010A/config.h @@ -30,15 +30,8 @@ along with this program. If not, see . #define MATRIX_ROWS 14 #define MATRIX_COLS 8 -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION CUSTOM_MATRIX -#undef MATRIX_HAS_GHOST - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCING_DELAY 5 -//#define QMK_KEYS_PER_SCAN 107 - - #endif // CONFIG_H diff --git a/keyboards/converter/HP_46010A/matrix.c b/keyboards/converter/HP_46010A/matrix.c index 46ad986846bf..2ca7d0357e39 100644 --- a/keyboards/converter/HP_46010A/matrix.c +++ b/keyboards/converter/HP_46010A/matrix.c @@ -29,6 +29,7 @@ along with this program. If not, see . #include "util.h" #include "matrix.h" #include "timer.h" +#include "LUFA/Drivers/Peripheral/SPI.h" #include "config.h" @@ -42,18 +43,11 @@ static uint16_t debouncing_time ; static bool debouncing = false ; #endif -static uint8_t matrix [MATRIX_ROWS] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; +static uint8_t matrix [MATRIX_ROWS] = {0}; #if ( DEBOUNCING_DELAY > 0 ) -static uint8_t matrix_debounce_old [MATRIX_ROWS] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static uint8_t matrix_debounce_new [MATRIX_ROWS] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; +static uint8_t matrix_debounce_old [MATRIX_ROWS] = {0}; +static uint8_t matrix_debounce_new [MATRIX_ROWS] = {0}; #endif __attribute__ ((weak)) @@ -98,57 +92,104 @@ void matrix_scan_user(void) { // switch, and then into the diode, then into one of the columns into the // matrix. the reset pin can be used to reset the entire counter. -uint8_t matrix_ReceiveByte (void) ; +#define RESET _BV(PB0) +#define SCLK _BV(PB1) +#define SDATA _BV(PB3) +#define LED _BV(PD6) + +inline +static +void SCLK_increment(void) { + PORTB &= ~SCLK ; + _delay_us( 4 ) ; // make sure the line is stable + PORTB |= SCLK ; + _delay_us( 4 ) ; + + return ; +} + +inline +static +void Matrix_Reset(void) { + PORTB |= RESET ; + _delay_us( 4 ) ; // make sure the line is stable + PORTB &= ~RESET ; + + return ; +} + +inline +static +uint8_t Matrix_ReceiveByte (void) { + uint8_t received = 0 ; + uint8_t temp = 0 ; + for ( uint8_t bit = 0; bit < MATRIX_COLS; ++bit ) { + // toggle the clock + SCLK_increment(); + temp = (PINB & SDATA) << 4 ; + received |= temp >> bit ; + } + + return received ; +} + +inline +static +void Matrix_ThrowByte(void) { + // we use MATRIX_COLS - 1 here because that would put us at 7 clocks + for ( uint8_t bit = 0; bit < MATRIX_COLS - 1; ++bit ) { + // toggle the clock + SCLK_increment(); + } + + return ; +} void matrix_init () { - //debug_enable=true ; + // debug_matrix = 1; // PB0 (SS) and PB1 (SCLK) set to outputs - DDRB |= ((1 << 0) | (1 << 1)) ; + DDRB |= RESET | SCLK ; // PB2, is unused, and PB3 is our serial input - DDRB &= ~(1 << 3) ; - + DDRB &= ~SDATA ; + // SS is reset for this board, and is active High // SCLK is the serial clock and is active High - PORTB &= ~((1 << 0) | (1 << 1)) ; + PORTB &= ~RESET ; + PORTB |= SCLK ; + + // led pin + DDRD |= LED ; + PORTD &= ~LED ; matrix_init_quantum(); + + //toggle reset, to put the keyboard logic into a known state + Matrix_Reset() ; } -uint8_t matrix_scan(void) { -#if ( DEBOUNCING_DELAY > 0 ) +uint8_t matrix_scan(void) { - //toggle reset, to put the keyboard logic into a known state - PORTB ^= 1 ; - _delay_us( 30 ) ; // make sure the line is stable - PORTB ^= 1 ; + // the first byte of the keyboard's output data can be ignored + Matrix_ThrowByte(); - for ( uint8_t current_row = 0 ; current_row < MATRIX_ROWS ; ++current_row ) { - // the first byte of the keyboard's output data can be ignored - if ( current_row == 0 ) { - // we dont really care about this first byte, but we need to do something to shut up gcc - matrix_debounce_old[0] = matrix_ReceiveByte() ; - // so we just overwrite them later on... - } else { - //transfer old debouncing values - matrix_debounce_old[current_row - 8] = matrix_debounce_new[current_row - 8] ; - // read new key-states in - matrix_debounce_new[current_row - 8] = matrix_ReceiveByte() ; - } - } - - // detect matrix changes (exit on first change) - for ( uint8_t i = 0 ; i < MATRIX_ROWS ; ++i ) { - if ( !( matrix_debounce_new[i] ^ matrix_debounce_old[i] ) ) { - debouncing = true ; +#if ( DEBOUNCING_DELAY > 0 ) + + for ( uint8_t row = 0 ; row < MATRIX_ROWS ; ++row ) { + //transfer old debouncing values + matrix_debounce_old[row] = matrix_debounce_new[row] ; + // read new key-states in + matrix_debounce_new[row] = Matrix_ReceiveByte() ; + + if ( matrix_debounce_new[row] != matrix_debounce_old[row] ) { + debouncing = true ; debouncing_time = timer_read() ; - break ; } } #else // without debouncing we simply just read in the raw matrix - for ( uint8_t current_row = 0 ; current_row < MATRIX_ROWS ; ++current_row ) { - matrix[current_row] = matrix_ReceiveByte() ; + for ( uint8_t row = 0 ; row < MATRIX_ROWS ; ++row ) { + matrix[row] = Matrix_ReceiveByte ; } #endif @@ -156,13 +197,15 @@ uint8_t matrix_scan(void) { #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_new[i] ; + for ( uint8_t row = 0 ; row < MATRIX_ROWS ; ++row ) { + matrix[row] = matrix_debounce_new[row] ; } + debouncing = false ; } #endif - + Matrix_Reset() ; + matrix_scan_quantum() ; return 1; } @@ -183,21 +226,6 @@ void matrix_print(void) } } -uint8_t matrix_ReceiveByte (void) { - uint8_t received = 0; - for ( uint8_t bit = 0; bit < MATRIX_COLS; ++bit ) { - // toggle the clock - PORTB ^= (1 << 1) ; - _delay_us( 30 ) ; // make sure the line is stable - PORTB ^= (1 << 1) ; - - // read bit using PB3, and cram it into a byte - received |= (PINB & (1 << 3) << bit) ; - } - - return received ; -} - inline uint8_t matrix_rows(void) { return MATRIX_ROWS; diff --git a/keyboards/converter/HP_46010A/rules.mk b/keyboards/converter/HP_46010A/rules.mk index 5b4b620cc315..24663f5e170b 100644 --- a/keyboards/converter/HP_46010A/rules.mk +++ b/keyboards/converter/HP_46010A/rules.mk @@ -48,8 +48,8 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # 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) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = yes # 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 From c45a41ce7ed4b76e7e86596064a36ebee23c5977 Mon Sep 17 00:00:00 2001 From: listofoptions Date: Sat, 22 Sep 2018 21:17:19 -0400 Subject: [PATCH 03/10] updated documentation to include wiring directions --- keyboards/converter/HP_46010A/readme.md | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/keyboards/converter/HP_46010A/readme.md b/keyboards/converter/HP_46010A/readme.md index e7536d90c4ab..53f803896214 100644 --- a/keyboards/converter/HP_46010A/readme.md +++ b/keyboards/converter/HP_46010A/readme.md @@ -15,3 +15,37 @@ included in this directory is a arduino program for teensy 2.0 (only one tested, also included is a csv containing the matrix as an ordered by clock #, byte array See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. + +to build the actual converter, you are going to need to either splice into the a connector or, use a multi-meter to buzz/ohm out which wires go where. +from the bottom of the pcb the pins are arraged as follows: + +` + 4 5 6 + 3 2 1 +` + +connect a six pin modular connector of the 6p6c variaty. +then lop off the other end of the cable, striping the wires inside. +use the ohm-meter to find the corresponding wire for each pin on the bottom of the pcb + +the pin meanings are as follows: +1 reset +2 no connection +3 vcc +4 data out +5 clock +6 ground + +wire the ground and power pins to ground and 5v power on the teensy (or other avr device of your choice) +connect +on the teensy the connection is as follows + +` +teensy - hp 46010A +gnd - gnd (6) +vcc - vcc (3) +PB0 - reset (1) +PB1 - clock (5) +PB3 - data out (4) +gnd - no connection (2) -- optional +` From b582544b83e59322b4c5a21a88baae289e8b912d Mon Sep 17 00:00:00 2001 From: listofoptions Date: Sat, 22 Sep 2018 21:23:55 -0400 Subject: [PATCH 04/10] formatting --- keyboards/converter/HP_46010A/readme.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/keyboards/converter/HP_46010A/readme.md b/keyboards/converter/HP_46010A/readme.md index 53f803896214..406d7586975b 100644 --- a/keyboards/converter/HP_46010A/readme.md +++ b/keyboards/converter/HP_46010A/readme.md @@ -19,10 +19,10 @@ See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) to build the actual converter, you are going to need to either splice into the a connector or, use a multi-meter to buzz/ohm out which wires go where. from the bottom of the pcb the pins are arraged as follows: -` + 4 5 6 3 2 1 -` + connect a six pin modular connector of the 6p6c variaty. then lop off the other end of the cable, striping the wires inside. @@ -40,12 +40,12 @@ wire the ground and power pins to ground and 5v power on the teensy (or other av connect on the teensy the connection is as follows -` -teensy - hp 46010A -gnd - gnd (6) -vcc - vcc (3) -PB0 - reset (1) -PB1 - clock (5) -PB3 - data out (4) -gnd - no connection (2) -- optional -` + +teensy | HP 46010A +----|----- +gnd | gnd (6) +vcc | vcc (3) +PB0 | reset (1) +PB1 | clock (5) +PB3 | data out (4) +gnd | no connection (2) -- optional From ddb30b30909822253371c083da62f4a33bd20578 Mon Sep 17 00:00:00 2001 From: listofoptions Date: Sun, 23 Sep 2018 13:15:37 -0400 Subject: [PATCH 05/10] updated matrix and default layout a bit --- .../HP_46010A/keymaps/default/keymap.c | 4 +- keyboards/converter/HP_46010A/masks.csv | 112 ++++++++++++++++++ keyboards/converter/HP_46010A/matrix.csv | 107 ----------------- 3 files changed, 114 insertions(+), 109 deletions(-) create mode 100644 keyboards/converter/HP_46010A/masks.csv delete mode 100644 keyboards/converter/HP_46010A/matrix.csv diff --git a/keyboards/converter/HP_46010A/keymaps/default/keymap.c b/keyboards/converter/HP_46010A/keymaps/default/keymap.c index 0a5b88d9d3ee..e104f1f6eb07 100644 --- a/keyboards/converter/HP_46010A/keymaps/default/keymap.c +++ b/keyboards/converter/HP_46010A/keymaps/default/keymap.c @@ -28,7 +28,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------------------------------------------------------------------------||---------| |-------------------| * |caps|ctrl| a| s| d| f| g| h| j| k| l| ;| '| retr||xxxx|pgup| | 4| 5| 6| ,| * |------------------------------------------------------------------------------------ |-------------------| - * |del |lsft | z| x| c| v| b| n| m| ,| .| /|rsft |xxxx| up|pgdn| | 1| 2| 3| tab| + * |del |lsft | z| x| c| v| b| n| m| ,| .| /|rsft | app| up|pgdn| | 1| 2| 3| tab| * |-------------------------------------------------------------------------|---------| |--------------- | * | gui| |lalt| space |ralt| |left|down|rght| | 0| .| | * `-----------------------------------------------------------------------------------' `-------------------' @@ -39,7 +39,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQUAL, KC_BSPC, KC_INS, KC_HOME, KC_PAST, KC_PSLS, KC_PPLS, 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_P7, KC_P8, KC_P9, KC_PENT, \ KC_CAPS, 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_ENT, KC_NO, KC_PGUP, KC_P4, KC_P5, KC_P6, KC_PCMM, \ - KC_DEL, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH,KC_RSFT, KC_NO, KC_UP, KC_PGDN, KC_P1, KC_P2, KC_P3, KC_TAB, \ + KC_DEL, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH,KC_RSFT, KC_APP, KC_UP, KC_PGDN, KC_P1, KC_P2, KC_P3, KC_TAB, \ KC_LGUI, KC_LALT, KC_SPACE , KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT \ ) } ; \ No newline at end of file diff --git a/keyboards/converter/HP_46010A/masks.csv b/keyboards/converter/HP_46010A/masks.csv new file mode 100644 index 000000000000..dfea6160ce6a --- /dev/null +++ b/keyboards/converter/HP_46010A/masks.csv @@ -0,0 +1,112 @@ +menu,1,8,1 +clrd,10,8,1 +clrl,100,8,1 +f8 ,1000,8,1 +f7 ,10000,8,1 +f6 ,100000,8,1 +f5 ,1000000,8,1 +user,10000000,8,1 +8,1,16,2 +dell,10,16,2 +insl,100,16,2 +back,1000,16,2 += ,10000,16,2 +- ,100000,16,2 +0,1000000,16,2 +9,10000000,16,2 +i ,1,24,3 +delc,10,24,3 +insc,100,24,3 + \ ,1000,24,3 +] ,10000,24,3 +[ ,100000,24,3 +p ,1000000,24,3 +o ,10000000,24,3 +j ,1,32,4 +prev,10,32,4 +cur ,100,32,4 +ret ,1000,32,4 +' ,10000,32,4 +; ,100000,32,4 +l ,1000000,32,4 +k ,10000000,32,4 +m ,1,40,5 +next,10,40,5 +up ,100,40,5 +sel ,1000,40,5 +1,10000,40,5 +/ ,100000,40,5 +. ,1000000,40,5 +", ",10000000,40,5 +,1,48,6 +rght,10,48,6 +down,100,48,6 +left,1000,48,6 +,10000,48,6 +ralt,100000,48,6 +lalt,1000000,48,6 +spce,10000000,48,6 +f4 ,1,56,7 +g ,10,56,7 +stop,100,56,7 +ctrl,1000,56,7 +`~ ,10000,56,7 +f1 ,100000,56,7 +f2 ,1000000,56,7 +f3 ,10000000,56,7 +7,1,64,8 +lshf,10,64,8 +rshf,100,64,8 +caps,1000,64,8 +3,10000,64,8 +4,100000,64,8 +5,1000000,64,8 +6,10000000,64,8 +u ,1,72,9 +tab ,10,72,9 +q ,100,72,9 +w ,1000,72,9 +e ,10000,72,9 +r ,100000,72,9 +t ,1000000,72,9 +y ,10000000,72,9 +h ,1,80,10 +2,10,80,10 +,100,80,10 +a ,1000,80,10 +s ,10000,80,10 +d ,100000,80,10 +f ,1000000,80,10 +res ,10000000,80,10 +"pad,",1,88,11 +pade,10,88,11 +pad6,100,88,11 +pad9,1000,88,11 +pad5,10000,88,11 +pad8,100000,88,11 +pad4,1000000,88,11 +pad7,10000000,88,11 +padt,1,96,12 +pad-,10,96,12 +pad3,100,96,12 +pad+,1000,96,12 +pad2,10000,96,12 +pad/,100000,96,12 +pad1,1000000,96,12 +pad*,10000000,96,12 +,1,104,13 +b4 ,10,104,13 +pad.,100,104,13 +b3 ,1000,104,13 +,10000,104,13 +b2 ,100000,104,13 +pad0,1000000,104,13 +b1 ,10000000,104,13 +n ,1,112,14 +del ,10,112,14 +prnt,100,112,14 +z ,1000,112,14 +x ,10000,112,14 +c ,100000,112,14 +v ,1000000,112,14 +b ,10000000,112,14 diff --git a/keyboards/converter/HP_46010A/matrix.csv b/keyboards/converter/HP_46010A/matrix.csv deleted file mode 100644 index 12c39b8445c9..000000000000 --- a/keyboards/converter/HP_46010A/matrix.csv +++ /dev/null @@ -1,107 +0,0 @@ -menu, 0b00000001,1,1,11,17 -user, 0b10000000,128,1,801,2049 -f5 , 0b01000000,64,1,401,1025 -f6 , 0b00100000,32,1,201,513 -f7 , 0b00010000,16,1,101,257 -f8 , 0b00001000,8,1,81,129 -clrl, 0b00000100,4,1,41,65 -clrd, 0b00000010,2,1,21,33 -8, 0b00000001,1,2,12,18 -9, 0b10000000,128,2,802,2050 -0, 0b01000000,64,2,402,1026 -- , 0b00100000,32,2,202,514 -= , 0b00010000,16,2,102,258 -back, 0b00001000,8,2,82,130 -insl, 0b00000100,4,2,42,66 -dell, 0b00000010,2,2,22,34 -i , 0b00000001,1,3,13,19 -o , 0b10000000,128,3,803,2051 -p , 0b01000000,64,3,403,1027 -[ , 0b00100000,32,3,203,515 -] , 0b00010000,16,3,103,259 - \ , 0b00001000,8,3,83,131 -insc, 0b00000100,4,3,43,67 -delc, 0b00000010,2,3,23,35 -j , 0b00000001,1,4,14,20 -k , 0b10000000,128,4,804,2052 -l , 0b01000000,64,4,404,1028 -; , 0b00100000,32,4,204,516 -' , 0b00010000,16,4,104,260 -ret , 0b00001000,8,4,84,132 -cur , 0b00000100,4,4,44,68 -prev, 0b00000010,2,4,24,36 -1, 0b00010000,16,5,105,261 -m , 0b00000001,1,5,15,21 -", ", 0b10000000,128,5,805,2053 -. , 0b01000000,64,5,405,1029 -/ , 0b00100000,32,5,205,517 -sel , 0b00001000,8,5,85,133 -up , 0b00000100,4,5,45,69 -next, 0b00000010,2,5,25,37 -lalt, 0b01000000,64,6,406,1030 -spce, 0b10000000,128,6,806,2054 -ralt, 0b00100000,32,6,206,518 -left, 0b00001000,8,6,86,134 -down, 0b00000100,4,6,46,70 -rght, 0b00000010,2,6,26,38 -stop, 0b00000100,4,7,47,71 -f1 , 0b00100000,32,7,207,519 -f2 , 0b01000000,64,7,407,1031 -f3 , 0b10000000,128,7,807,2055 -f4 , 0b00000001,1,7,17,23 -`~ , 0b00010000,16,7,107,263 -ctrl, 0b00001000,8,7,87,135 -g , 0b00000010,2,7,27,39 -3, 0b00010000,16,8,108,264 -4, 0b00100000,32,8,208,520 -5, 0b01000000,64,8,408,1032 -6, 0b10000000,128,8,808,2056 -7, 0b00000001,1,8,18,24 -caps, 0b00001000,8,8,88,136 -lshf, 0b00000010,2,8,28,40 -rshf, 0b00000100,4,8,48,72 -tab , 0b00000010,2,9,29,41 -q , 0b00000100,4,9,49,73 -w , 0b00001000,8,9,89,137 -e , 0b00010000,16,9,109,265 -r , 0b00100000,32,9,209,521 -t , 0b01000000,64,9,409,1033 -y , 0b10000000,128,9,809,2057 -u , 0b00000001,1,9,19,25 -res , 0b10000000,128,10,80A,2058 -2, 0b00000010,2,10,2A,42 -a , 0b00001000,8,10,8A,138 -s , 0b00010000,16,10,10A,266 -d , 0b00100000,32,10,20A,522 -f , 0b01000000,64,10,40A,1034 -h , 0b00000001,1,10,1A,26 -pad7, 0b10000000,128,11,80B,2059 -pad8, 0b00100000,32,11,20B,523 -pad9, 0b00001000,8,11,8B,139 -pade, 0b00000010,2,11,2B,43 -pad4, 0b01000000,64,11,40B,1035 -pad5, 0b00010000,16,11,10B,267 -pad6, 0b00000100,4,11,4B,75 -"pad,", 0b00000001,1,11,1B,27 -pad*, 0b10000000,128,12,80C,2060 -pad/, 0b00100000,32,12,20C,524 -pad+, 0b00001000,8,12,8C,140 -pad-, 0b00000010,2,12,2C,44 -pad1, 0b01000000,64,12,40C,1036 -pad2, 0b00010000,16,12,10C,268 -pad3, 0b00000100,4,12,4C,76 -padt, 0b00000001,1,12,1C,28 -b1 , 0b10000000,128,13,80D,2061 -b2 , 0b00100000,32,13,20D,525 -b3 , 0b00001000,8,13,8D,141 -b4 , 0b00000010,2,13,2D,45 -pad0, 0b01000000,64,13,40D,1037 -pad., 0b00000100,4,13,4D,77 -del , 0b00000010,2,14,2E,46 -z , 0b00001000,8,14,8E,142 -x , 0b00010000,16,14,10E,270 -c , 0b00100000,32,14,20E,526 -v , 0b01000000,64,14,40E,1038 -b , 0b10000000,128,14,80E,2062 -n , 0b00000001,1,14,1E,30 -prnt, 0b00000100,4,14,4E,78 From 10d98f1bb9ecb2ba77ca9be3153b784e4c2278f2 Mon Sep 17 00:00:00 2001 From: listofoptions Date: Sun, 23 Sep 2018 17:20:20 -0400 Subject: [PATCH 06/10] getting ready for merge into main repo --- keyboards/converter/{HP_46010A => hp_46010a}/config.h | 4 +--- .../{HP_46010A/HP_46010A.c => hp_46010a/hp_46010a.c} | 2 +- .../{HP_46010A/HP_46010A.h => hp_46010a/hp_46010a.h} | 5 +---- keyboards/converter/{HP_46010A => hp_46010a}/info.json | 0 .../{HP_46010A => hp_46010a}/keymaps/default/keymap.c | 0 keyboards/converter/{HP_46010A => hp_46010a}/masks.csv | 0 keyboards/converter/{HP_46010A => hp_46010a}/matrix.c | 0 keyboards/converter/{HP_46010A => hp_46010a}/read_a_key.ino | 0 keyboards/converter/{HP_46010A => hp_46010a}/readme.md | 2 +- keyboards/converter/{HP_46010A => hp_46010a}/rules.mk | 3 +-- 10 files changed, 5 insertions(+), 11 deletions(-) rename keyboards/converter/{HP_46010A => hp_46010a}/config.h (95%) rename keyboards/converter/{HP_46010A/HP_46010A.c => hp_46010a/hp_46010a.c} (63%) rename keyboards/converter/{HP_46010A/HP_46010A.h => hp_46010a/hp_46010a.h} (98%) rename keyboards/converter/{HP_46010A => hp_46010a}/info.json (100%) rename keyboards/converter/{HP_46010A => hp_46010a}/keymaps/default/keymap.c (100%) rename keyboards/converter/{HP_46010A => hp_46010a}/masks.csv (100%) rename keyboards/converter/{HP_46010A => hp_46010a}/matrix.c (100%) rename keyboards/converter/{HP_46010A => hp_46010a}/read_a_key.ino (100%) rename keyboards/converter/{HP_46010A => hp_46010a}/readme.md (84%) rename keyboards/converter/{HP_46010A => hp_46010a}/rules.mk (98%) diff --git a/keyboards/converter/HP_46010A/config.h b/keyboards/converter/hp_46010a/config.h similarity index 95% rename from keyboards/converter/HP_46010A/config.h rename to keyboards/converter/hp_46010a/config.h index 3f22ce5f6822..f77ed4115f9a 100644 --- a/keyboards/converter/HP_46010A/config.h +++ b/keyboards/converter/hp_46010a/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -34,4 +33,3 @@ along with this program. If not, see . #define DEBOUNCING_DELAY 5 -#endif // CONFIG_H diff --git a/keyboards/converter/HP_46010A/HP_46010A.c b/keyboards/converter/hp_46010a/hp_46010a.c similarity index 63% rename from keyboards/converter/HP_46010A/HP_46010A.c rename to keyboards/converter/hp_46010a/hp_46010a.c index 1c65ccdc7a91..915a220f9199 100644 --- a/keyboards/converter/HP_46010A/HP_46010A.c +++ b/keyboards/converter/hp_46010a/hp_46010a.c @@ -1,3 +1,3 @@ -#include "HP_46010A.h" +#include "hp_46010a.h" #include #include "quantum.h" \ No newline at end of file diff --git a/keyboards/converter/HP_46010A/HP_46010A.h b/keyboards/converter/hp_46010a/hp_46010a.h similarity index 98% rename from keyboards/converter/HP_46010A/HP_46010A.h rename to keyboards/converter/hp_46010a/hp_46010a.h index 914f36490ca7..ed8582a9ce9d 100644 --- a/keyboards/converter/HP_46010A/HP_46010A.h +++ b/keyboards/converter/hp_46010a/hp_46010a.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef HP_46010A -#define HP_46010A +#pragma once #include "quantum.h" @@ -62,5 +61,3 @@ along with this program. If not, see . #define KEYMAP LAYOUT_HP_46010A #define KC_LAYOUT_HP_46010A LAYOUT_HP_46010A - -#endif //HP_46010A \ No newline at end of file diff --git a/keyboards/converter/HP_46010A/info.json b/keyboards/converter/hp_46010a/info.json similarity index 100% rename from keyboards/converter/HP_46010A/info.json rename to keyboards/converter/hp_46010a/info.json diff --git a/keyboards/converter/HP_46010A/keymaps/default/keymap.c b/keyboards/converter/hp_46010a/keymaps/default/keymap.c similarity index 100% rename from keyboards/converter/HP_46010A/keymaps/default/keymap.c rename to keyboards/converter/hp_46010a/keymaps/default/keymap.c diff --git a/keyboards/converter/HP_46010A/masks.csv b/keyboards/converter/hp_46010a/masks.csv similarity index 100% rename from keyboards/converter/HP_46010A/masks.csv rename to keyboards/converter/hp_46010a/masks.csv diff --git a/keyboards/converter/HP_46010A/matrix.c b/keyboards/converter/hp_46010a/matrix.c similarity index 100% rename from keyboards/converter/HP_46010A/matrix.c rename to keyboards/converter/hp_46010a/matrix.c diff --git a/keyboards/converter/HP_46010A/read_a_key.ino b/keyboards/converter/hp_46010a/read_a_key.ino similarity index 100% rename from keyboards/converter/HP_46010A/read_a_key.ino rename to keyboards/converter/hp_46010a/read_a_key.ino diff --git a/keyboards/converter/HP_46010A/readme.md b/keyboards/converter/hp_46010a/readme.md similarity index 84% rename from keyboards/converter/HP_46010A/readme.md rename to keyboards/converter/hp_46010a/readme.md index 406d7586975b..a3137ec66090 100644 --- a/keyboards/converter/HP_46010A/readme.md +++ b/keyboards/converter/hp_46010a/readme.md @@ -14,7 +14,7 @@ Make example for this keyboard (after setting up your build environment): included in this directory is a arduino program for teensy 2.0 (only one tested, might work on others) to grab a copy of the keyboard matrix. also included is a csv containing the matrix as an ordered by clock #, byte array -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +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). to build the actual converter, you are going to need to either splice into the a connector or, use a multi-meter to buzz/ohm out which wires go where. from the bottom of the pcb the pins are arraged as follows: diff --git a/keyboards/converter/HP_46010A/rules.mk b/keyboards/converter/hp_46010a/rules.mk similarity index 98% rename from keyboards/converter/HP_46010A/rules.mk rename to keyboards/converter/hp_46010a/rules.mk index 24663f5e170b..ddd2d593bd21 100644 --- a/keyboards/converter/HP_46010A/rules.mk +++ b/keyboards/converter/hp_46010a/rules.mk @@ -41,7 +41,7 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # 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 +BOOTLOADER = halfkay # Build Options # change to "no" to disable the options, or define them in the Makefile in @@ -66,7 +66,6 @@ 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 = HP_46010A LAYOUTS_HAS_RGB = NO CUSTOM_MATRIX = yes From d9c387bc5cc0fa5c587a1a58fceadf31e186c0b4 Mon Sep 17 00:00:00 2001 From: listofoptions Date: Sun, 23 Sep 2018 17:38:53 -0400 Subject: [PATCH 07/10] getting ready for merge into main repo v2 --- keyboards/converter/hp_46010a/hp_46010a.h | 2 +- keyboards/converter/hp_46010a/keymaps/default/keymap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/converter/hp_46010a/hp_46010a.h b/keyboards/converter/hp_46010a/hp_46010a.h index ed8582a9ce9d..d2fa7c81ff6b 100644 --- a/keyboards/converter/hp_46010a/hp_46010a.h +++ b/keyboards/converter/hp_46010a/hp_46010a.h @@ -59,5 +59,5 @@ along with this program. If not, see . {KEY_B, KEY_V, KEY_C, KEY_X, KEY_Z, KEY_PRNT, KEY_DELE, KEY_N }, \ } -#define KEYMAP LAYOUT_HP_46010A +#define LAYOUT LAYOUT_HP_46010A #define KC_LAYOUT_HP_46010A LAYOUT_HP_46010A diff --git a/keyboards/converter/hp_46010a/keymaps/default/keymap.c b/keyboards/converter/hp_46010a/keymaps/default/keymap.c index e104f1f6eb07..cb65bd422e51 100644 --- a/keyboards/converter/hp_46010a/keymaps/default/keymap.c +++ b/keyboards/converter/hp_46010a/keymaps/default/keymap.c @@ -34,7 +34,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' `-------------------' */ - [0] = KEYMAP( + [0] = LAYOUT( KC_ESC, KC_NO, KC_F1, KC_F2, KC_F3, KC_F4,KC_NO, KC_NO, KC_F5, KC_F6, KC_F7, KC_F8, KC_NO, KC_NO, KC_F9, KC_F10, KC_F11, KC_F12, \ KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQUAL, KC_BSPC, KC_INS, KC_HOME, KC_PAST, KC_PSLS, KC_PPLS, 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_P7, KC_P8, KC_P9, KC_PENT, \ From de6ab727a74893e1baeab9125e8840eb433f4edd Mon Sep 17 00:00:00 2001 From: listofoptions Date: Sun, 23 Sep 2018 18:50:17 -0400 Subject: [PATCH 08/10] cleaning --- keyboards/converter/hp_46010a/hp_46010a.h | 1 - 1 file changed, 1 deletion(-) diff --git a/keyboards/converter/hp_46010a/hp_46010a.h b/keyboards/converter/hp_46010a/hp_46010a.h index d2fa7c81ff6b..db64ce24a586 100644 --- a/keyboards/converter/hp_46010a/hp_46010a.h +++ b/keyboards/converter/hp_46010a/hp_46010a.h @@ -60,4 +60,3 @@ along with this program. If not, see . } #define LAYOUT LAYOUT_HP_46010A -#define KC_LAYOUT_HP_46010A LAYOUT_HP_46010A From b04520c12221c9c87500854abe31bbe8c6bab109 Mon Sep 17 00:00:00 2001 From: listofoptions Date: Sun, 23 Sep 2018 21:11:36 -0400 Subject: [PATCH 09/10] cleaning repo of extranious files --- keyboards/converter/hp_46010a/masks.csv | 112 -------------- keyboards/converter/hp_46010a/read_a_key.ino | 152 ------------------- 2 files changed, 264 deletions(-) delete mode 100644 keyboards/converter/hp_46010a/masks.csv delete mode 100644 keyboards/converter/hp_46010a/read_a_key.ino diff --git a/keyboards/converter/hp_46010a/masks.csv b/keyboards/converter/hp_46010a/masks.csv deleted file mode 100644 index dfea6160ce6a..000000000000 --- a/keyboards/converter/hp_46010a/masks.csv +++ /dev/null @@ -1,112 +0,0 @@ -menu,1,8,1 -clrd,10,8,1 -clrl,100,8,1 -f8 ,1000,8,1 -f7 ,10000,8,1 -f6 ,100000,8,1 -f5 ,1000000,8,1 -user,10000000,8,1 -8,1,16,2 -dell,10,16,2 -insl,100,16,2 -back,1000,16,2 -= ,10000,16,2 -- ,100000,16,2 -0,1000000,16,2 -9,10000000,16,2 -i ,1,24,3 -delc,10,24,3 -insc,100,24,3 - \ ,1000,24,3 -] ,10000,24,3 -[ ,100000,24,3 -p ,1000000,24,3 -o ,10000000,24,3 -j ,1,32,4 -prev,10,32,4 -cur ,100,32,4 -ret ,1000,32,4 -' ,10000,32,4 -; ,100000,32,4 -l ,1000000,32,4 -k ,10000000,32,4 -m ,1,40,5 -next,10,40,5 -up ,100,40,5 -sel ,1000,40,5 -1,10000,40,5 -/ ,100000,40,5 -. ,1000000,40,5 -", ",10000000,40,5 -,1,48,6 -rght,10,48,6 -down,100,48,6 -left,1000,48,6 -,10000,48,6 -ralt,100000,48,6 -lalt,1000000,48,6 -spce,10000000,48,6 -f4 ,1,56,7 -g ,10,56,7 -stop,100,56,7 -ctrl,1000,56,7 -`~ ,10000,56,7 -f1 ,100000,56,7 -f2 ,1000000,56,7 -f3 ,10000000,56,7 -7,1,64,8 -lshf,10,64,8 -rshf,100,64,8 -caps,1000,64,8 -3,10000,64,8 -4,100000,64,8 -5,1000000,64,8 -6,10000000,64,8 -u ,1,72,9 -tab ,10,72,9 -q ,100,72,9 -w ,1000,72,9 -e ,10000,72,9 -r ,100000,72,9 -t ,1000000,72,9 -y ,10000000,72,9 -h ,1,80,10 -2,10,80,10 -,100,80,10 -a ,1000,80,10 -s ,10000,80,10 -d ,100000,80,10 -f ,1000000,80,10 -res ,10000000,80,10 -"pad,",1,88,11 -pade,10,88,11 -pad6,100,88,11 -pad9,1000,88,11 -pad5,10000,88,11 -pad8,100000,88,11 -pad4,1000000,88,11 -pad7,10000000,88,11 -padt,1,96,12 -pad-,10,96,12 -pad3,100,96,12 -pad+,1000,96,12 -pad2,10000,96,12 -pad/,100000,96,12 -pad1,1000000,96,12 -pad*,10000000,96,12 -,1,104,13 -b4 ,10,104,13 -pad.,100,104,13 -b3 ,1000,104,13 -,10000,104,13 -b2 ,100000,104,13 -pad0,1000000,104,13 -b1 ,10000000,104,13 -n ,1,112,14 -del ,10,112,14 -prnt,100,112,14 -z ,1000,112,14 -x ,10000,112,14 -c ,100000,112,14 -v ,1000000,112,14 -b ,10000000,112,14 diff --git a/keyboards/converter/hp_46010a/read_a_key.ino b/keyboards/converter/hp_46010a/read_a_key.ino deleted file mode 100644 index dc650eaedfaf..000000000000 --- a/keyboards/converter/hp_46010a/read_a_key.ino +++ /dev/null @@ -1,152 +0,0 @@ - -/* -this isketch requires the use of the teensyduino environment if running on a teensy 2.0. i have not tried to run it on other boards. -it should ask for you to press a series of button on the board and it will record the corresponding key pattern out as it reads the entire matrix of the board. -the pins used on the teensy, are SS, SCLK, MISO, aka PB0, PB1, and PB3. - -in order to use this program, you have to have an acutual terminal, the one that comes with the arduino environment is subpar. -for windows i suggest putty, there are tutorials on how to us it with a serial port on the internet. -for linux there isnt really any special program needed, as linux is mostly terminal programs anyway, so simply telneting into the corresponding serial port will work just fine. -when the program starts up it will ask for the user to press the key, but will not continue until prompted further. just hit enter/return on the computer (not the 46010a under test) -make sure that you are pressing and holding the key under test and not tapping it, the matrix is read out really fast so any switch bounce will be easily caught. -when the program has finished scanning the board, it will emit all of the codes with their corresponding clock. -*/ - -#include -#include -#include - -// BYTE_TO_BINARY_PATTERN, BYTE_TO_BINARY are from: -// https://stackoverflow.com/questions/111928/is-there-a-printf-converter-to-print-in-binary-format - -#define BYTE_TO_BINARY_PATTERN "%c%c%c%c%c%c%c%c" - -#define BYTE_TO_BINARY(byte) \ - (byte & 0x80 ? '1' : '0'), \ - (byte & 0x40 ? '1' : '0'), \ - (byte & 0x20 ? '1' : '0'), \ - (byte & 0x10 ? '1' : '0'), \ - (byte & 0x08 ? '1' : '0'), \ - (byte & 0x04 ? '1' : '0'), \ - (byte & 0x02 ? '1' : '0'), \ - (byte & 0x01 ? '1' : '0') - -const int resetPin = 0 - , ledPin = 11 - ; - -const char keyNames [ 107 ] [ 5 ] = - { "res ", "stop", "f1 ", "f2 ", "f3 ", "f4 ", "menu", "user", "f5 ", "f6 ", "f7 ", "f8 ", "clrl", "clrd", "b1 ", "b2 ", "b3 ", "b4 " - , "`~ ", "1 ", "2 ", "3 ", "4 ", "5 ", "6 ", "7 ", "8 ", "9 ", "0 ", "- ", "= ", "back", "insl", "dell", "pad*", "pad/", "pad+", "pad-" - , "tab ", "q ", "w ", "e ", "r ", "t ", "y ", "u ", "i ", "o ", "p ", "[ ", "] ", "\\ ", "insc", "delc", "pad7", "pad8", "pad9", "pade" - , "caps", "ctrl", "a ", "s ", "d ", "f ", "g ", "h ", "j ", "k ", "l ", "; ", "' ", "ret ", "cur ", "prev", "pad4", "pad5", "pad6", "pad," - , "del ", "lshf", "z ", "x ", "c ", "v ", "b ", "n ", "m ", ", ", ". ", "/ ", "rshf", "sel ", "up ", "next", "pad1", "pad2", "pad3", "padt" - , "prnt", "lalt", "spce", "ralt", "left", "down", "rght", "pad0", "pad." - } ; - -struct code { - char keycodeMask ; // the bit mask of this key - unsigned char clockStart ; // the starting clock number of the byte this key is found in -} ; - - - char serialOutBuffer [ 29 ] ; -unsigned char matrixOld [ 16 ] ; -unsigned char matrixNew [ 16 ] ; - code matrixCodes [ 107 ] ; -unsigned char currentKey ; - -void setup() { - currentKey = 0 ; - - Serial.begin( 115200 ) ; - while ( !Serial ) ; - - pinMode( resetPin, OUTPUT ) ; - pinMode( ledPin, OUTPUT ) ; - - digitalWrite( ledPin, LOW ) ; - digitalWrite( resetPin, LOW ) ; - - SPI.begin() ; - - // grab the initial matrix of the keyboard - digitalWrite( resetPin, HIGH ) ; - digitalWrite( resetPin, LOW ) ; - SPI.beginTransaction( SPISettings( 200, LSBFIRST, SPI_MODE1 ) ) ; - SPI.transfer( matrixOld, 16 ) ; - SPI.endTransaction(); - - memcpy( matrixNew, matrixOld, 16 ) ; -} - -void loop() { - if ( currentKey < 108 ) { - Serial.write(27); // ESC command - Serial.print("[2J"); // clear screen command - Serial.write(27); - Serial.print("[H"); // cursor to home command - - // find and manually map each key - Serial.print( "\npress " ) ; - Serial.print( keyNames[currentKey] ); - - while ( Serial.read() == -1 ) {} - - // read 16 bytes from the keyboard - digitalWrite( resetPin, HIGH ) ; - digitalWrite( resetPin, LOW ) ; - SPI.beginTransaction( SPISettings( 3200, LSBFIRST, SPI_MODE1 ) ) ; - SPI.transfer( matrixNew, 16 ) ; - SPI.endTransaction(); - -/* if you need debuggin uncommenting the following might help. it displays the entire matrix as set of 16 bytes */ -// Serial.write(27); // ESC command -// Serial.print("[2J"); // clear screen command -// Serial.write(27); -// Serial.print("[H"); // cursor to home command -// Serial.println( "keyboard bitmap" ) ; -// // display fetched bytes as binary -// for ( unsigned int i = 0; i < 16 ; ++i ) { -// sprintf( serialOutBuffer, "clocks: %3i to %3i : " BYTE_TO_BINARY_PATTERN, i*8, i*8 + 7, BYTE_TO_BINARY( matrixNew[i] ) ) ; -// Serial.println( serialOutBuffer ) ; -// memset( serialOutBuffer, '\0', 29 ) ; -// } - - // this little burb simply finds the first bit that differs from the previous mask (wich would be the empty no keys pressed state) - for ( unsigned int i = 0; i < 16; ++i ) { - if ( matrixOld[i] != matrixNew[i] ) { - matrixCodes[currentKey].keycodeMask = matrixNew[i] ; - matrixCodes[currentKey].clockStart = i*8 ; - break ; - } - } - - ++currentKey ; - memcpy( matrixNew, matrixOld, 16 ) ; - } else { - - Serial.write(27); // ESC command - Serial.print("[2J"); // clear screen command - Serial.write(27); - Serial.print("[H"); // cursor to home command - Serial.println( "code bitmask clock" ) ; - - // print out byte code for each key - - for ( unsigned int i = 0 ; i < 107; ++i ) { - sprintf( serialOutBuffer, "%4s " BYTE_TO_BINARY_PATTERN " %3i " - , keyNames[i] - , BYTE_TO_BINARY( matrixCodes[i].keycodeMask ) - , matrixCodes[i].clockStart - ) ; - - Serial.println( serialOutBuffer ) ; - - memset( serialOutBuffer, '\0', 29 ) ; - } - - while ( 1 ) {} - } -} - From 62d288ad66d2bfc3e9975319c37242c8dc428631 Mon Sep 17 00:00:00 2001 From: listofoptions Date: Sun, 23 Sep 2018 21:15:30 -0400 Subject: [PATCH 10/10] updated documentation --- keyboards/converter/hp_46010a/readme.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/keyboards/converter/hp_46010a/readme.md b/keyboards/converter/hp_46010a/readme.md index a3137ec66090..2321faa6e16c 100644 --- a/keyboards/converter/hp_46010a/readme.md +++ b/keyboards/converter/hp_46010a/readme.md @@ -10,12 +10,13 @@ Hardware Supported: HP 46010A, Teensy 2.0 Make example for this keyboard (after setting up your build environment): make converter/HP_46010A:default - -included in this directory is a arduino program for teensy 2.0 (only one tested, might work on others) to grab a copy of the keyboard matrix. -also included is a csv containing the matrix as an ordered by clock #, byte array 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). +to get a matrix created if your board uses a different one (i used the US layout) please see the following gists: +for the matrix itself: https://gist.github.com/listofoptions/cdf70d94767e9c6c027741850a24c568 +for the program to generate the matrix: https://gist.github.com/listofoptions/d245e370678024edbe5bed8c8ab17999 + to build the actual converter, you are going to need to either splice into the a connector or, use a multi-meter to buzz/ohm out which wires go where. from the bottom of the pcb the pins are arraged as follows: