Mercurial > louis > kiibohd-controller
annotate Scan/HeathZenith/matrix.h @ 341:66eccdd9ced5
Code cleanup
- Changing header file ifndef define to pragma once's
- Removed duplicate output_com.h's
author | Jacob Alexander <haata@kiibohd.com> |
---|---|
date | Sun, 14 Jun 2015 13:56:56 -0700 |
parents | ab4515606277 |
children |
rev | line source |
---|---|
341 | 1 /* Copyright (C) 2011,2015 by Jacob Alexander |
308 | 2 * |
31
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
3 * Permission is hereby granted, free of charge, to any person obtaining a copy |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
4 * of this software and associated documentation files (the "Software"), to deal |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
5 * in the Software without restriction, including without limitation the rights |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
7 * copies of the Software, and to permit persons to whom the Software is |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
8 * furnished to do so, subject to the following conditions: |
308 | 9 * |
31
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
10 * The above copyright notice and this permission notice shall be included in |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
11 * all copies or substantial portions of the Software. |
308 | 12 * |
31
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
19 * THE SOFTWARE. |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
20 */ |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
21 |
341 | 22 #pragma once |
31
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
23 |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
24 // ----- Includes ----- |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
25 |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
26 // Compiler Includes |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
27 #include <stdint.h> |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
28 |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
29 |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
30 |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
31 // ----- Scan Mode Setting (See matrix_scan.h for more details) ----- |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
32 #define scanMode scanDual |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
33 |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
34 |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
35 |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
36 // ----- Key Settings ----- |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
37 |
69
87658fa6091b
Updating AVR abstraction to be compatible with ARM, nearly ready for ARM files
Jacob Alexander <triplehaata@gmail.com>
parents:
36
diff
changeset
|
38 #define KEYBOARD_KEYS 63 // # of keys |
31
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
39 #define MAX_ROW_SIZE 12 // # of keys in the largest row |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
40 #define MAX_COL_SIZE 9 // # of keys in the largest column |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
41 |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
42 |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
43 |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
44 // ----- Matrix Configuration ----- |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
45 static const uint8_t matrix_pinout[][MAX_ROW_SIZE + 1] = { |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
46 |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
47 |
36
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
31
diff
changeset
|
48 // Bread-board debug pinout |
31
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
49 // Note: Pins 49 and 60 are connected together, by row AND column, why? dunno...(shift) |
36
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
31
diff
changeset
|
50 { scanMode, pinC6, pinC5, pinC4, pinC3, pinC2, pinE1, pinC0, pinC1, pinD7, pinE0, pinD6, pinC7 }, |
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
31
diff
changeset
|
51 { pinF3, 1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 0, 0 }, |
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
31
diff
changeset
|
52 { pinE7, 16, 15, 14, 13, 12, 11, 10, 9, 0, 0, 0, 0 }, |
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
31
diff
changeset
|
53 { pinB4, 17, 18, 19, 20, 21, 22, 23, 24, 0, 0, 0, 0 }, |
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
31
diff
changeset
|
54 { pinB0, 32, 31, 30, 29, 28, 27, 26, 25, 0, 0, 0, 0 }, |
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
31
diff
changeset
|
55 { pinB2, 35, 36, 37, 38, 39, 40, 41, 42, 0, 0, 0, 0 }, |
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
31
diff
changeset
|
56 { pinB1, 47, 61, 46, 45, 44, 43, 58, 0, 0, 0, 0, 0 }, |
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
31
diff
changeset
|
57 { pinB5, 50, 51, 52, 53, 54, 55, 56, 57, 0, 0, 0, 0 }, |
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
31
diff
changeset
|
58 { pinE6, 62, 63, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0 }, |
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
31
diff
changeset
|
59 { pinB6, 0, 0, 0, 0, 0, 0, 0, 0, 33, 34, 48, 49 }, |
31
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
60 |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
61 |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
62 |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
63 }; |
a004d4015fbb
Making sub-modules of matrix for HeathZenith and BudKeypad
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
64 |