annotate Scan/MD1_1/matrix.h @ 407:b7411ae25432

Initial code for MD1_1 - IC60 /w Single color LEDs - Requires a different matrix configuration so it's incompatible with the old IC60 layout
author Jacob Alexander <haata@kiibohd.com>
date Sat, 06 Feb 2016 18:06:37 -0800
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
407
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
1 /* Copyright (C) 2014-2016 by Jacob Alexander
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
2 *
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
4 * of this software and associated documentation files (the "Software"), to deal
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
5 * in the Software without restriction, including without limitation the rights
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
7 * copies of the Software, and to permit persons to whom the Software is
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
8 * furnished to do so, subject to the following conditions:
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
9 *
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
10 * The above copyright notice and this permission notice shall be included in
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
11 * all copies or substantial portions of the Software.
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
12 *
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
19 * THE SOFTWARE.
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
20 */
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
21
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
22 #pragma once
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
23
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
24 // ----- Includes -----
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
25
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
26 // Project Includes
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
27 #include <matrix_setup.h>
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
28
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
29
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
30
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
31 // ----- Matrix Definition -----
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
32
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
33 // Freescale ARM MK20's support GPIO PTA, PTB, PTC, PTD and PTE 0..31
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
34 // Not all chips have access to all of these pins (most don't have 160 pins :P)
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
35 //
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
36 // NOTE:
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
37 // Before using a pin, make sure it supports being a GPIO *and* doesn't have a default pull-up/pull-down
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
38 // Checking this is completely on the ownness of the user
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
39
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
40 // MD1
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
41 //
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
42 // Columns (Strobe)
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
43 // PTB0..3,16,17
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
44 // PTC4,5
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
45 // PTD0
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
46 //
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
47 // Rows (Sense)
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
48 // PTD1..7
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
49
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
50 // Define Rows (Sense) and Columns (Strobes)
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
51 GPIO_Pin Matrix_cols[] = { gpio(C,0), gpio(C,1), gpio(C,2), gpio(C,3), gpio(C,4), gpio(C,5), gpio(C,6), gpio(C,7), gpio(D,0) };
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
52 GPIO_Pin Matrix_rows[] = { gpio(D,1), gpio(D,2), gpio(D,3), gpio(D,4), gpio(D,5), gpio(D,6), gpio(D,7) };
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
53
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
54 // Define type of scan matrix
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
55 Config Matrix_type = Config_Pulldown;
b7411ae25432 Initial code for MD1_1
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
56