]> git.donarmstrong.com Git - kiibohd-controller.git/blob - Scan/SKM67001/matrix.h
Code cleanup
[kiibohd-controller.git] / Scan / SKM67001 / 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 85 // # of keys (It actually has 66, but there are markings up to 80 on the PCB); 85 due to there being 5 "switch" keys, that have no numbers
39 #define MAX_ROW_SIZE   9 // # of keys in the largest row
40 #define MAX_COL_SIZE   9 // # of keys in the largest column
41
42
43
44 // ----- Matrix Configuration -----
45 static const uint8_t matrix_pinout[][MAX_ROW_SIZE + 1] = {
46
47
48 // SKM Typewriter PCB Matrix
49 // Note: Pins 50, 51, and 52 are connected together (LShift, RShift, and Lock)
50 // Board Pins: 13      5     12      6     11      9      8      7     10
51   { scanMode, pinC0, pinC7, pinC4, pinC2, pinC6, pinC5, pinC3, pinE1, pinC1, },
52   { pinE6,    71,    72,    73,    74,    75,    76,    80,    55,    53,    }, //  1 - White
53   { pinF7,    43,    81,    45,    41,    54,    44,    46,    58,    42,    }, //  2 - Red
54   { pinF4,    37,    82,    39,    35,    34,    38,    33,    36,    40,    }, //  3 - Pink
55   { pinF5,    31,    83,    25,    28,    27,    32,    26,    30,    29,    }, //  4 - Black
56 //{ pinXX,    0,     0,     0,     0,     0,     0,     0,     0,     0,     }, //  5 - Blue
57 //{ pinXX,    0,     0,     0,     0,     0,     0,     0,     0,     0,     }, //  6 - Red / Blue
58 //{ pinXX,    0,     0,     0,     0,     0,     0,     0,     0,     0,     }, //  7 - White / Green
59 //{ pinXX,    0,     0,     0,     0,     0,     0,     0,     0,     0,     }, //  8 - Grey / Pink
60 //{ pinXX,    0,     0,     0,     0,     0,     0,     0,     0,     0,     }, //  9 - Brown / Green
61 //{ pinXX,    0,     0,     0,     0,     0,     0,     0,     0,     0,     }, // 10 - Brown / Grey
62 //{ pinXX,    0,     0,     0,     0,     0,     0,     0,     0,     0,     }, // 11 - White / Grey
63 //{ pinXX,    0,     0,     0,     0,     0,     0,     0,     0,     0,     }, // 12 - Yellow / White
64 //{ pinXX,    0,     0,     0,     0,     0,     0,     0,     0,     0,     }, // 13 - Brown / Yellow
65   { pinF2,    0,     0,     0,     0,     0,     0,     0,     0,     0,     }, // 14 - Yellow
66   { pinF0,    23,    84,    19,    20,    64,    24,    57,    22,    21,    }, // 15 - Purple
67   { pinF1,    17,    85,    12,    14,    13,    11,    18,    16,    15,    }, // 16 - Brown
68   { pinF3,    62,    52,    49,    1,     47,    61,    48,    3,     2,     }, // 17 - Green
69   { pinF6,    4,     63,    6,     8,     7,     5,     56,    9,     10,    }, // 18 - Grey
70
71
72
73 };
74