]> git.donarmstrong.com Git - kiibohd-controller.git/blob - Scan/IBMConvertible/matrix.h
Code cleanup
[kiibohd-controller.git] / Scan / IBMConvertible / matrix.h
1 /* Copyright (C) 2012,2015 by Jacob Alexander
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a copy
4  * of this software and associated documentation files (the "Software"), to deal
5  * in the Software without restriction, including without limitation the rights
6  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7  * copies of the Software, and to permit persons to whom the Software is
8  * furnished to do so, subject to the following conditions:
9  *
10  * The above copyright notice and this permission notice shall be included in
11  * all copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19  * THE SOFTWARE.
20  */
21
22 #pragma once
23
24 // ----- Includes -----
25
26 // Compiler Includes
27 #include <stdint.h>
28
29
30
31 // ----- Scan Mode Setting (See matrix_scan.h for more details) -----
32 #define scanMode scanCol_powrRow
33
34
35
36 // ----- Key Settings -----
37
38 #define KEYBOARD_KEYS 90 // # of keys (It actually has 78, but there are markings up to 81 on the PCB and scan lines enough for 90
39 #define MAX_ROW_SIZE   6 // # of rows
40 #define MAX_COL_SIZE  15 // # of columns
41
42
43
44 // ----- Matrix Configuration -----
45 static const uint8_t matrix_pinout[][MAX_COL_SIZE + 1] = {
46
47
48 // GND Pins
49 // Board Pins: 2, 8, 14, 20, 24
50 // OO2 Labels: 3, 7, 13, 19, 25
51
52 // IBM Convertible PCB Matrix
53 // Board Pins labeled as ()
54 // Board Pins: 26     25     23     22     21     19     17     15     13     11      9      7      5      3      1
55 // OO2 Labels:  1      2      4      5      6      8     10     12     14     16     18     20     22     24     26
56 //             C1     C2     C3     C4     C5     C6     C7     C8     C9     C10    C11    C12    C13    C14    C15
57   { scanMode, pinC0, pinC1, pinC2, pinC3, pinC4, pinC5, pinC6, pinC7, pinF0, pinF1, pinF2, pinF3, pinF4, pinF5, pinF6 },
58   { pinE1,    80,    79,    78,    81,    77,    76,    75,    74,    73,    72,    71,    70,    69,    68,    67,   }, // R1 -  9 (18)
59   { pinE2,    14,    13,    12,    15,    11,    10,    9,     8,     7,     6,     5,     4,     3,     2,     1,    }, // R2 - 11 (16)
60   { pinE3,    0,     28,    27,    0,     26,    25,    24,    23,    22,    21,    20,    19,    18,    17,    16,   }, // R3 - 15 (12)
61   { pinE4,    43,    0,     41,    0,     40,    39,    38,    37,    36,    35,    34,    33,    32,    31,    30,   }, // R4 - 17 (10)
62   { pinE5,    57,    0,     56,    0,     55,    54,    53,    52,    51,    50,    49,    48,    47,    46,    44,   }, // R5 - 21 (6)
63   { pinE6,    65,    0,     64,    66,    63,    62,    0,     0,     0,     61,    0,     0,     60,    59,    58,   }, // R6 - 23 (4)
64
65
66
67 };
68