summaryrefslogtreecommitdiff
path: root/keyboards/p3d
diff options
context:
space:
mode:
authorMatthew Dias <matthewdias@me.com>2022-03-13 01:36:12 -0600
committerGitHub <noreply@github.com>2022-03-12 23:36:12 -0800
commit20424fd37f84cbe08740539a48b6bb4839e0a179 (patch)
tree3236d40a5df923b13568355d7e17621caffcd207 /keyboards/p3d
parent86b123141bea2e3f831a57eb115368cbbbdb2da1 (diff)
[Keyboard] Add Glitch (#16444)
Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'keyboards/p3d')
-rw-r--r--keyboards/p3d/glitch/config.h84
-rw-r--r--keyboards/p3d/glitch/glitch.c58
-rw-r--r--keyboards/p3d/glitch/glitch.h40
-rw-r--r--keyboards/p3d/glitch/info.json300
-rw-r--r--keyboards/p3d/glitch/keymaps/default/keymap.c29
-rw-r--r--keyboards/p3d/glitch/keymaps/default/readme.md1
-rw-r--r--keyboards/p3d/glitch/readme.md24
-rw-r--r--keyboards/p3d/glitch/rules.mk20
8 files changed, 556 insertions, 0 deletions
diff --git a/keyboards/p3d/glitch/config.h b/keyboards/p3d/glitch/config.h
new file mode 100644
index 0000000000..e7f78123d9
--- /dev/null
+++ b/keyboards/p3d/glitch/config.h
@@ -0,0 +1,84 @@
1/*
2Copyright 2021 Matthew Dias
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#pragma once
19
20#include "config_common.h"
21
22#define VENDOR_ID 0x7033
23#define PRODUCT_ID 0x3568
24#define DEVICE_VER 0x0001
25#define MANUFACTURER P3D Store
26#define PRODUCT Glitch
27
28/* key matrix size */
29#define MATRIX_ROWS 10
30#define MATRIX_COLS 8
31
32/*
33 * Keyboard Matrix Assignments
34 *
35 * Change this to how you wired your keyboard
36 * COLS: AVR pins used for columns, left to right
37 * ROWS: AVR pins used for rows, top to bottom
38 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
39 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
40 *
41 */
42
43/* A Custom matrix.c is used to poll the port expander C6 shows that the pins are hardwired there */
44#define MATRIX_ROW_PINS { D5, D6, B6, D7, C7, B4, B5, D3, D4, C6 }
45#define MATRIX_COL_PINS { B2, D2, B3, B7, F5, F4, F1, F0 }
46#define UNUSED_PINS
47
48#define RGB_DI_PIN B1
49#define RGBLED_NUM 25
50#define RGBLIGHT_EFFECT_BREATHING
51#define RGBLIGHT_EFFECT_RAINBOW_MOOD
52#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
53#define RGBLIGHT_EFFECT_SNAKE
54#define RGBLIGHT_EFFECT_KNIGHT
55#define RGBLIGHT_EFFECT_CHRISTMAS
56#define RGBLIGHT_EFFECT_STATIC_GRADIENT
57#define RGBLIGHT_EFFECT_RGB_TEST
58#define RGBLIGHT_EFFECT_ALTERNATING
59#define RGBLIGHT_EFFECT_TWINKLE
60
61#define ENCODERS_PAD_A { F6 }
62#define ENCODERS_PAD_B { F7 }
63#define ENCODER_RESOLUTION 2
64
65/* COL2ROW, ROW2COL*/
66#define DIODE_DIRECTION COL2ROW
67
68#define USB_MAX_POWER_CONSUMPTION 400
69
70/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
71#define LOCKING_SUPPORT_ENABLE
72/* Locking resynchronize hack */
73#define LOCKING_RESYNC_ENABLE
74
75/*
76 * Feature disable options
77 * These options are also useful to firmware size reduction.
78 */
79
80/* disable debug print */
81//#define NO_DEBUG
82
83/* disable print */
84//#define NO_PRINT
diff --git a/keyboards/p3d/glitch/glitch.c b/keyboards/p3d/glitch/glitch.c
new file mode 100644
index 0000000000..a62f578994
--- /dev/null
+++ b/keyboards/p3d/glitch/glitch.c
@@ -0,0 +1,58 @@
1/* Copyright 2021 Matthew Dias
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include "glitch.h"
17
18#ifdef ENCODER_ENABLE
19bool encoder_update_kb(uint8_t index, bool clockwise) {
20 if (!encoder_update_user(index, clockwise)) {
21 return false;
22 }
23 if (clockwise) {
24 // tap_code(RGB_MOD);
25 rgblight_step();
26 } else {
27 // tap_code(RGB_RMOD);
28 rgblight_step_reverse();
29 }
30
31 return false;
32}
33#endif
34
35#ifdef OLED_ENABLE
36bool oled_task_kb(void) {
37 if (!oled_task_user()) {
38 return false;
39 }
40 // Host Keyboard Layer Status
41 oled_write_P(PSTR("Layer: "), false);
42
43 switch (get_highest_layer(layer_state)) {
44 case 0:
45 oled_write_P(PSTR("Default\n"), false);
46 break;
47 default:
48 oled_write_P(PSTR("Undefined\n"), false);
49 }
50
51 // Host Keyboard LED Status
52 led_t led_state = host_keyboard_led_state();
53 oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
54 oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
55 oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
56
57 return false;
58}
diff --git a/keyboards/p3d/glitch/glitch.h b/keyboards/p3d/glitch/glitch.h
new file mode 100644
index 0000000000..4b4f77396b
--- /dev/null
+++ b/keyboards/p3d/glitch/glitch.h
@@ -0,0 +1,40 @@
1/* Copyright 2021 Matthew Dias
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19#define XXX KC_NO
20
21#include "quantum.h"
22
23#define LAYOUT_all( \
24 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \
25 K10, K11, K12, K13, K14, K15, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, \
26 K20, K21, K22, K23, K24, K25, K27, K28, K29, K2A, K2B, K2C, K2E, K2F, \
27 K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, \
28 K40, K41, K43, K45, K47, K49, K4B, K4C, K4D, K4E, K4F \
29) { \
30 { K00, K02, K04, K06, K08, K0A, K0C, K0E }, \
31 { K01, K03, K05, K07, K09, K0B, K0D, K0F }, \
32 { K10, K12, K14, XXX, K18, K1A, K1C, K1E }, \
33 { K11, K13, K15, K17, K19, K1B, K1D, K1F }, \
34 { K20, K22, K24, XXX, K28, K2A, K2C, K2E }, \
35 { K21, K23, K25, K27, K29, K2B, XXX, K2F }, \
36 { K30, K32, K34, K36, K38, K3A, K3C, K3E }, \
37 { XXX, K33, K35, K37, K39, K3B, K3D, K3F }, \
38 { K40, XXX, XXX, XXX, XXX, XXX, K4C, K4E }, \
39 { K41, K43, K45, K47, K49, K4B, K4D, K4F } \
40}
diff --git a/keyboards/p3d/glitch/info.json b/keyboards/p3d/glitch/info.json
new file mode 100644
index 0000000000..6445e200f8
--- /dev/null
+++ b/keyboards/p3d/glitch/info.json
@@ -0,0 +1,300 @@
1{
2 "keyboard_name": "Glitch",
3 "url": "https://p3dstore.com/products/p3d-glitch-group-buy",
4 "maintainer": "matthewdias",
5 "layouts": {
6 "LAYOUT_all": {
7 "layout": [{
8 "x": 19.1,
9 "y": 0.1
10 }, {
11 "label": "ESC",
12 "x": 0.5,
13 "y": 0.5
14 }, {
15 "label": "1",
16 "x": 1.5,
17 "y": 0.5
18 }, {
19 "label": "_",
20 "x": 14.5,
21 "y": 0.6
22 }, {
23 "label": "+",
24 "x": 15.5,
25 "y": 0.6
26 }, {
27 "label": "Back",
28 "x": 16.5,
29 "y": 0.6
30 }, {
31 "label": "Del",
32 "x": 17.5,
33 "y": 0.6
34 }, {
35 "label": "2",
36 "x": 3.25,
37 "y": 1.0
38 }, {
39 "label": "3",
40 "x": 4.25,
41 "y": 1.0
42 }, {
43 "label": "4",
44 "x": 5.25,
45 "y": 1.0
46 }, {
47 "label": "5",
48 "x": 6.25,
49 "y": 1.0
50 }, {
51 "label": "6",
52 "x": 7.25,
53 "y": 1.0
54 }, {
55 "label": "7",
56 "x": 10,
57 "y": 1.0
58 }, {
59 "label": "8",
60 "x": 11,
61 "y": 1.0
62 }, {
63 "label": "9",
64 "x": 12,
65 "y": 1.0
66 }, {
67 "label": "0",
68 "x": 13,
69 "y": 1.0
70 }, {
71 "label": "TAB",
72 "x": 0.15,
73 "y": 1.5,
74 "w": 1.5
75 }, {
76 "label": "Q",
77 "x": 1.65,
78 "y": 1.5
79 }, {
80 "label": "P",
81 "x": 14.35,
82 "y": 1.6
83 }, {
84 "label": "[",
85 "x": 15.35,
86 "y": 1.6
87 }, {
88 "label": "]",
89 "x": 16.35,
90 "y": 1.6
91 }, {
92 "label": "\\",
93 "x": 17.35,
94 "y": 1.6,
95 "w": 1.5
96 }, {
97 "x": 19.1,
98 "y": 1.6
99 }, {
100 "label": "W",
101 "x": 3.75,
102 "y": 2.0
103 }, {
104 "label": "E",
105 "x": 4.75,
106 "y": 2.0
107 }, {
108 "label": "R",
109 "x": 5.75,
110 "y": 2.0
111 }, {
112 "label": "T",
113 "x": 6.75,
114 "y": 2.0
115 }, {
116 "label": "Y",
117 "x": 9.5,
118 "y": 2.0
119 }, {
120 "label": "U",
121 "x": 10.5,
122 "y": 2.0
123 }, {
124 "label": "I",
125 "x": 11.5,
126 "y": 2.0
127 }, {
128 "label": "O",
129 "x": 12.5,
130 "y": 2.0
131 }, {
132 "label": "CAPS",
133 "x": 0.15,
134 "y": 2.5,
135 "w": 1.75
136 }, {
137 "label": "A",
138 "x": 1.9,
139 "y": 2.5
140 }, {
141 "label": ";",
142 "x": 14.6,
143 "y": 2.6
144 }, {
145 "label": "'",
146 "x": 15.6,
147 "y": 2.6
148 }, {
149 "label": "ENTER",
150 "x": 16.6,
151 "y": 2.6,
152 "w": 2.25
153 }, {
154 "x": 19.1,
155 "y": 2.6
156 }, {
157 "label": "S",
158 "x": 4,
159 "y": 3.0
160 }, {
161 "label": "D",
162 "x": 5,
163 "y": 3.0
164 }, {
165 "label": "F",
166 "x": 6,
167 "y": 3.0
168 }, {
169 "label": "G",
170 "x": 7,
171 "y": 3.0
172 }, {
173 "label": "H",
174 "x": 9.75,
175 "y": 3.0
176 }, {
177 "label": "J",
178 "x": 10.75,
179 "y": 3.0
180 }, {
181 "label": "K",
182 "x": 11.75,
183 "y": 3.0
184 }, {
185 "label": "L",
186 "x": 12.75,
187 "y": 3.0
188 }, {
189 "label": "SHIFT",
190 "x": 0,
191 "y": 3.5,
192 "w": 2.25
193 }, {
194 "label": "Z",
195 "x": 2.25,
196 "y": 3.5
197 }, {
198 "label": ".",
199 "x": 14.25,
200 "y": 3.6
201 }, {
202 "label": "?",
203 "x": 15.25,
204 "y": 3.6
205 }, {
206 "label": "SHIFT",
207 "x": 16.25,
208 "y": 3.6,
209 "w": 1.75
210 }, {
211 "x": 19.5,
212 "y": 3.6
213 }, {
214 "label": "UP",
215 "x": 18.25,
216 "y": 3.85
217 }, {
218 "label": "X",
219 "x": 4.5,
220 "y": 4.0
221 }, {
222 "label": "C",
223 "x": 5.5,
224 "y": 4.0
225 }, {
226 "label": "V",
227 "x": 6.5,
228 "y": 4.0
229 }, {
230 "label": "B",
231 "x": 7.5,
232 "y": 4.0
233 }, {
234 "label": "BEE",
235 "x": 9.25,
236 "y": 4.0
237 }, {
238 "label": "N",
239 "x": 10.25,
240 "y": 4.0
241 }, {
242 "label": "M",
243 "x": 11.25,
244 "y": 4.0
245 }, {
246 "label": ",",
247 "x": 12.25,
248 "y": 4.0
249 }, {
250 "label": "CTRL",
251 "x": 0,
252 "y": 4.5,
253 "w": 1.25
254 }, {
255 "label": "WIN",
256 "x": 1.25,
257 "y": 4.5,
258 "w": 1.25
259 }, {
260 "label": "WIN",
261 "x": 15,
262 "y": 4.6
263 }, {
264 "label": "CTRL",
265 "x": 16,
266 "y": 4.6
267 }, {
268 "label": "LEFT",
269 "x": 17.25,
270 "y": 4.85
271 }, {
272 "label": "DOWN",
273 "x": 18.25,
274 "y": 4.85
275 }, {
276 "label": "RIGHT",
277 "x": 19.25,
278 "y": 4.85
279 }, {
280 "x": 4.75,
281 "y": 5.0,
282 "w": 2.75
283 }, {
284 "label": "ALT",
285 "x": 7.5,
286 "y": 5.0,
287 "w": 1.25
288 }, {
289 "label": "ALT",
290 "x": 9.5,
291 "y": 5.0,
292 "w": 1.25
293 }, {
294 "x": 10.75,
295 "y": 5.0,
296 "w": 2.25
297 }]
298 }
299 }
300}
diff --git a/keyboards/p3d/glitch/keymaps/default/keymap.c b/keyboards/p3d/glitch/keymaps/default/keymap.c
new file mode 100644
index 0000000000..43aa53c9f1
--- /dev/null
+++ b/keyboards/p3d/glitch/keymaps/default/keymap.c
@@ -0,0 +1,29 @@
1/* Copyright 2021 Matthew Dias
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18//This is the ANSI version of the PCB
19
20const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
21[0] = LAYOUT_all(
22 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_MUTE,
23 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP,
24 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN,
25 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END,
26 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
27)
28};
29
diff --git a/keyboards/p3d/glitch/keymaps/default/readme.md b/keyboards/p3d/glitch/keymaps/default/readme.md
new file mode 100644
index 0000000000..8661c4b95f
--- /dev/null
+++ b/keyboards/p3d/glitch/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default keymap for Glitch
diff --git a/keyboards/p3d/glitch/readme.md b/keyboards/p3d/glitch/readme.md
new file mode 100644
index 0000000000..b29dc6e930
--- /dev/null
+++ b/keyboards/p3d/glitch/readme.md
@@ -0,0 +1,24 @@
1# Glitch
2
3Hotswap RGB Alice-style with OLED and Rotary Knob
4
5- Keyboard Maintainer: matthewdias
6- Hardware Supported: Glitch PCB
7- Hardware Availability: https://p3dstore.com
8
9Make example for this keyboard (after setting up your build environment):
10
11 make p3d/glitch:default
12
13Flashing example for this keyboard:
14
15 make p3d/glitch:default:flash
16
17## Bootloader
18
19Enter the bootloader in one of 2 ways:
20
21* **Bootmagic reset**: Hold down the top left and plug in the keyboard
22* **Physical reset button**: Briefly press the button on the top of the PCB
23
24See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/p3d/glitch/rules.mk b/keyboards/p3d/glitch/rules.mk
new file mode 100644
index 0000000000..7ec8d5c09a
--- /dev/null
+++ b/keyboards/p3d/glitch/rules.mk
@@ -0,0 +1,20 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5BOOTLOADER = atmel-dfu
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
11MOUSEKEY_ENABLE = yes # Mouse keys
12EXTRAKEY_ENABLE = yes # Audio control and System control
13CONSOLE_ENABLE = no # Console for debug
14COMMAND_ENABLE = no # Commands for debug and configuration
15NKRO_ENABLE = no # Enable N-Key Rollover
16BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
17RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
18AUDIO_ENABLE = no # Audio output
19ENCODER_ENABLE = yes
20OLED_ENABLE = yes