]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/cospad/cospad.h
[Keyboard] fixed pins for numpad_5x4 layout (#6311)
[qmk_firmware.git] / keyboards / cospad / cospad.h
1
2 /* Copyright 2019
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 #pragma once
18
19 #include "quantum.h"
20 #define ___ KC_NO
21
22 /* This a shortcut to help you visually see your layout.
23  *
24  * The first section contains all of the arguments representing the physical
25  * layout of the board and position of the keys.
26  *
27  * The second converts the arguments into a two-dimensional array which
28  * represents the switch matrix.
29  */
30
31 /* COSPAD ortho matrix layout
32    * ,-------------------.
33    * | 00 | 01 | 02 | 03 |
34    * |----|----|----|----|
35    * | 10 | 11 | 12 | 13 |
36    * |----|----|----|----|
37    * | 20 | 21 | 22 | 23 |
38    * |----|----|----|----|
39    * | 30 | 31 | 32 | 33 |
40    * |----|----|----|----|
41    * | 40 | 41 | 42 | 43 |
42    * |----|----|----|----|
43    * | 50 | 51 | 52 | 53 |
44    * `-------------------'
45  */
46 #define LAYOUT_ortho_6x4( \
47         k00, k01, k02, k03, \
48         k10, k11, k12, k13, \
49         k20, k21, k22, k23, \
50         k30, k31, k32, k33, \
51         k40, k41, k42, k43, \
52         k50, k51, k52, k53  \
53 ) \
54 { \
55         {k00, k01, k02, k03}, \
56         {k10, k11, k12, k13}, \
57         {k20, k21, k22, k23}, \
58         {k30, k31, k32, k33}, \
59         {k40, k41, k42, k43}, \
60         {k50, k51, k52, k53}  \
61 }
62
63 /* COSPAD gamepad matrix layout
64    * ,-------------------.
65    * | 00 | 01 | 02 | 03 |
66    * |----|----|----|----|
67    * | 10 | 11 | 12 | 13 |
68    * |----|----|----|----|
69    * | 20 | 21 | 22 |    |
70    * |----|----|----| 23 |
71    * | 30 | 31 | 32 |    |
72    * |----|----|----|----|
73    * | 40 | 41 | 42 | 43 |
74    * |----|----|----|----|
75    * | 50 | 51 | 52 | 53 |
76    * `-------------------'
77  */
78 #define LAYOUT_gamepad_6x4( \
79         k00, k01, k02, k03, \
80         k10, k11, k12, k13, \
81         k20, k21, k22,      \
82         k30, k31, k32, k23, \
83         k40, k41, k42, k43, \
84         k50, k51, k52, k53  \
85 ) \
86 { \
87         {k00, k01, k02, k03},   \
88         {k10, k11, k12, k13},   \
89         {k20, k21, k22, k23},   \
90         {k30, k31, k32, ___}, \
91         {k40, k41, k42, k43},   \
92         {k50, k51, k52, k53}    \
93 }
94
95 /* COSPAD numpad matrix layout
96    * ,-------------------.
97    * | 00 | 01 | 02 | 03 |
98    * |----|----|----|----|
99    * | 10 | 11 | 12 | 13 |
100    * |----|----|----|----|
101    * | 20 | 21 | 22 |    |
102    * |----|----|----| 23 |
103    * | 30 | 31 | 32 |    |
104    * |----|----|----|----|
105    * | 40 | 41 | 42 |    |
106    * |----|----|----| 43 |
107    * |    50   | 52 |    |
108    * `-------------------'
109  */
110 #define LAYOUT_numpad_6x4( \
111         k00, k01, k02, k03,  \
112         k10, k11, k12, k13,  \
113         k20, k21, k22,       \
114         k30, k31, k32, k23,  \
115         k40, k41, k42,       \
116         k50,      k52, k43   \
117 ) \
118 { \
119         {k00, k01, k02, k03},   \
120         {k10, k11, k12, k13},   \
121         {k20, k21, k22, k23},   \
122         {k30, k31, k32, ___}, \
123         {k40, k41, k42, k43},   \
124         {k50, ___, k52, ___}  \
125 }
126
127 // Add backwards compatibility for existing keymaps
128 #define cospad_bl_led_on   backlight_enable
129 #define cospad_bl_led_off  backlight_disable
130 #define cospad_bl_led_togg backlight_toggle