aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorØyvind Wilhelmsen <46304257+oeywil@users.noreply.github.com>2019-12-17 23:06:48 +0100
committerfauxpark <fauxpark@gmail.com>2019-12-18 09:06:48 +1100
commit67054fc3806953feb34adbf9a272fcfcaace6d0f (patch)
tree2b1277d1b2ed4b9359877d53c03e4176f2c01e21
parent4ebecc424e7f4beeb6985faf0ed9199823fa648f (diff)
downloadqmk_firmware-67054fc3806953feb34adbf9a272fcfcaace6d0f.tar.gz
qmk_firmware-67054fc3806953feb34adbf9a272fcfcaace6d0f.zip
Ported J80 to QMK (#7488)
* ported J80 to QMK * added default ISO layout * removed optional override functions * set bootmagic to lite * removed comment * added tkl_ansi and tkl_iso layouts * updated vendor and device name * set ANSI layout as default and split iso to separate folder * removed empty file * Update keyboards/J80/info.json Added comma Co-Authored-By: fauxpark <fauxpark@gmail.com> * Update keyboards/J80/keymaps/default/keymap.c Removed backslash Co-Authored-By: fauxpark <fauxpark@gmail.com> * Update keyboards/J80/keymaps/default/keymap.c Removed backslash. Co-Authored-By: fauxpark <fauxpark@gmail.com> * removed comments and backslash, fixed JSON formatting * Rename J80.h to j80.h * Rename keyboards/J80 to keyboards/j80 * renamed folder to lowercase * added key definition for reset key * added define for KC_NO to underscores * Added backlight and lock LED support * Fixed BACKLIGHT_PIN * Fixed typo * Added define for bootmagic lite and description in readme * Update keyboards/j80/info.json Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/j80/readme.md Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/j80/readme.md Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/j80/info.json Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/j80/info.json Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/j80/info.json Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/j80/info.json Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/j80/j80.h Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/j80/j80.h Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/j80/keymaps/default/keymap.c Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> * Apply suggestions from code review Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> * Added full right shift layouts
-rw-r--r--keyboards/j80/config.h55
-rw-r--r--keyboards/j80/info.json397
-rw-r--r--keyboards/j80/j80.c26
-rw-r--r--keyboards/j80/j80.h115
-rw-r--r--keyboards/j80/keymaps/default/keymap.c59
-rw-r--r--keyboards/j80/keymaps/default/readme.md1
-rw-r--r--keyboards/j80/keymaps/default_iso/keymap.c59
-rw-r--r--keyboards/j80/keymaps/default_iso/readme.md1
-rw-r--r--keyboards/j80/readme.md21
-rw-r--r--keyboards/j80/rules.mk25
-rw-r--r--keyboards/j80/usbconfig.h373
11 files changed, 1132 insertions, 0 deletions
diff --git a/keyboards/j80/config.h b/keyboards/j80/config.h
new file mode 100644
index 000000000..3a5328ac4
--- /dev/null
+++ b/keyboards/j80/config.h
@@ -0,0 +1,55 @@
1/*
2Copyright 2019 JER
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 0x20A0
23#define PRODUCT_ID 0x422D
24#define DEVICE_VER 0x0001
25#define MANUFACTURER JER
26#define PRODUCT J80
27
28#define MATRIX_ROWS 7
29#define MATRIX_COLS 14
30
31#define MATRIX_ROW_PINS { B1, B2, B3, B5, B6, B7, B0 }
32#define MATRIX_COL_PINS { A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, A0 }
33#define UNUSED_PINS { B4, C1, C0, D0, D1, D2, D3, D4, D5, D6, D7 }
34
35#define DIODE_DIRECTION COL2ROW
36#define DEBOUNCE 5
37
38#define BACKLIGHT_LEVELS 3
39#define BACKLIGHT_PIN D4
40
41#define NO_UART 1
42
43/* disable these deprecated features by default */
44#ifndef LINK_TIME_OPTIMIZATION_ENABLE
45 #define NO_ACTION_MACRO
46 #define NO_ACTION_FUNCTION
47#endif
48
49/* key combination for magic key command */
50/* defined by default; to change, uncomment and set to the combination you want */
51// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT)
52
53/* Bootmagic Lite key configuration */
54#define BOOTMAGIC_LITE_ROW 0
55#define BOOTMAGIC_LITE_COLUMN 0
diff --git a/keyboards/j80/info.json b/keyboards/j80/info.json
new file mode 100644
index 000000000..b31b443ed
--- /dev/null
+++ b/keyboards/j80/info.json
@@ -0,0 +1,397 @@
1{
2 "keyboard_name": "J80",
3 "url": "",
4 "maintainer": "oeywil",
5 "width": 18.25,
6 "height": 6.25,
7 "layouts": {
8 "LAYOUT_tkl_ansi": {
9 "layout": [
10 {"x":0, "y":0},
11 {"x":2, "y":0},
12 {"x":3, "y":0},
13 {"x":4, "y":0},
14 {"x":5, "y":0},
15 {"x":6.5, "y":0},
16 {"x":7.5, "y":0},
17 {"x":8.5, "y":0},
18 {"x":9.5, "y":0},
19 {"x":11, "y":0},
20 {"x":12, "y":0},
21 {"x":13, "y":0},
22 {"x":14, "y":0},
23 {"x":15.25, "y":0},
24 {"x":16.25, "y":0},
25 {"x":17.25, "y":0},
26
27 {"x":0, "y":1.25},
28 {"x":1, "y":1.25},
29 {"x":2, "y":1.25},
30 {"x":3, "y":1.25},
31 {"x":4, "y":1.25},
32 {"x":5, "y":1.25},
33 {"x":6, "y":1.25},
34 {"x":7, "y":1.25},
35 {"x":8, "y":1.25},
36 {"x":9, "y":1.25},
37 {"x":10, "y":1.25},
38 {"x":11, "y":1.25},
39 {"x":12, "y":1.25},
40 {"x":13, "y":1.25, "w":2},
41 {"x":15.25, "y":1.25},
42 {"x":16.25, "y":1.25},
43 {"x":17.25, "y":1.25},
44
45 {"x":0, "y":2.25, "w":1.5},
46 {"x":1.5, "y":2.25},
47 {"x":2.5, "y":2.25},
48 {"x":3.5, "y":2.25},
49 {"x":4.5, "y":2.25},
50 {"x":5.5, "y":2.25},
51 {"x":6.5, "y":2.25},
52 {"x":7.5, "y":2.25},
53 {"x":8.5, "y":2.25},
54 {"x":9.5, "y":2.25},
55 {"x":10.5, "y":2.25},
56 {"x":11.5, "y":2.25},
57 {"x":12.5, "y":2.25},
58 {"x":13.5, "y":2.25, "w":1.5},
59 {"x":15.25, "y":2.25},
60 {"x":16.25, "y":2.25},
61 {"x":17.25, "y":2.25},
62
63 {"x":0, "y":3.25, "w":1.75},
64 {"x":1.75, "y":3.25},
65 {"x":2.75, "y":3.25},
66 {"x":3.75, "y":3.25},
67 {"x":4.75, "y":3.25},
68 {"x":5.75, "y":3.25},
69 {"x":6.75, "y":3.25},
70 {"x":7.75, "y":3.25},
71 {"x":8.75, "y":3.25},
72 {"x":9.75, "y":3.25},
73 {"x":10.75, "y":3.25},
74 {"x":11.75, "y":3.25},
75 {"x":12.75, "y":3.25, "w":2.25},
76
77 {"x":0, "y":4.25, "w":2.25},
78 {"x":2.25, "y":4.25},
79 {"x":3.25, "y":4.25},
80 {"x":4.25, "y":4.25},
81 {"x":5.25, "y":4.25},
82 {"x":6.25, "y":4.25},
83 {"x":7.25, "y":4.25},
84 {"x":8.25, "y":4.25},
85 {"x":9.25, "y":4.25},
86 {"x":10.25, "y":4.25},
87 {"x":11.25, "y":4.25},
88 {"x":12.25, "y":4.25, "w":2.75},
89 {"x":16.25, "y":4.25},
90
91 {"x":0, "y":5.25, "w":1.25},
92 {"x":1.25, "y":5.25, "w":1.25},
93 {"x":2.5, "y":5.25, "w":1.25},
94 {"x":3.75, "y":5.25, "w":6.25},
95 {"x":10, "y":5.25, "w":1.25},
96 {"x":11.25, "y":5.25, "w":1.25},
97 {"x":12.5, "y":5.25, "w":1.25},
98 {"x":13.75, "y":5.25, "w":1.25},
99 {"x":15.25, "y":5.25},
100 {"x":16.25, "y":5.25},
101 {"x":17.25, "y":5.25}
102 ]
103 },
104 "LAYOUT_tkl_ansi_split_rshift": {
105 "layout": [
106 {"x":0, "y":0},
107 {"x":2, "y":0},
108 {"x":3, "y":0},
109 {"x":4, "y":0},
110 {"x":5, "y":0},
111 {"x":6.5, "y":0},
112 {"x":7.5, "y":0},
113 {"x":8.5, "y":0},
114 {"x":9.5, "y":0},
115 {"x":11, "y":0},
116 {"x":12, "y":0},
117 {"x":13, "y":0},
118 {"x":14, "y":0},
119 {"x":15.25, "y":0},
120 {"x":16.25, "y":0},
121 {"x":17.25, "y":0},
122
123 {"x":0, "y":1.25},
124 {"x":1, "y":1.25},
125 {"x":2, "y":1.25},
126 {"x":3, "y":1.25},
127 {"x":4, "y":1.25},
128 {"x":5, "y":1.25},
129 {"x":6, "y":1.25},
130 {"x":7, "y":1.25},
131 {"x":8, "y":1.25},
132 {"x":9, "y":1.25},
133 {"x":10, "y":1.25},
134 {"x":11, "y":1.25},
135 {"x":12, "y":1.25},
136 {"x":13, "y":1.25, "w":2},
137 {"x":15.25, "y":1.25},
138 {"x":16.25, "y":1.25},
139 {"x":17.25, "y":1.25},
140
141 {"x":0, "y":2.25, "w":1.5},
142 {"x":1.5, "y":2.25},
143 {"x":2.5, "y":2.25},
144 {"x":3.5, "y":2.25},
145 {"x":4.5, "y":2.25},
146 {"x":5.5, "y":2.25},
147 {"x":6.5, "y":2.25},
148 {"x":7.5, "y":2.25},
149 {"x":8.5, "y":2.25},
150 {"x":9.5, "y":2.25},
151 {"x":10.5, "y":2.25},
152 {"x":11.5, "y":2.25},
153 {"x":12.5, "y":2.25},
154 {"x":13.5, "y":2.25, "w":1.5},
155 {"x":15.25, "y":2.25},
156 {"x":16.25, "y":2.25},
157 {"x":17.25, "y":2.25},
158
159 {"x":0, "y":3.25, "w":1.75},
160 {"x":1.75, "y":3.25},
161 {"x":2.75, "y":3.25},
162 {"x":3.75, "y":3.25},
163 {"x":4.75, "y":3.25},
164 {"x":5.75, "y":3.25},
165 {"x":6.75, "y":3.25},
166 {"x":7.75, "y":3.25},
167 {"x":8.75, "y":3.25},
168 {"x":9.75, "y":3.25},
169 {"x":10.75, "y":3.25},
170 {"x":11.75, "y":3.25},
171 {"x":12.75, "y":3.25, "w":2.25},
172
173 {"x":0, "y":4.25, "w":2.25},
174 {"x":2.25, "y":4.25},
175 {"x":3.25, "y":4.25},
176 {"x":4.25, "y":4.25},
177 {"x":5.25, "y":4.25},
178 {"x":6.25, "y":4.25},
179 {"x":7.25, "y":4.25},
180 {"x":8.25, "y":4.25},
181 {"x":9.25, "y":4.25},
182 {"x":10.25, "y":4.25},
183 {"x":11.25, "y":4.25},
184 {"x":12.25, "y":4.25, "w":1.75},
185 {"x":14, "y":4.25},
186 {"x":16.25, "y":4.25},
187
188 {"x":0, "y":5.25, "w":1.25},
189 {"x":1.25, "y":5.25, "w":1.25},
190 {"x":2.5, "y":5.25, "w":1.25},
191 {"x":3.75, "y":5.25, "w":6.25},
192 {"x":10, "y":5.25, "w":1.25},
193 {"x":11.25, "y":5.25, "w":1.25},
194 {"x":12.5, "y":5.25, "w":1.25},
195 {"x":13.75, "y":5.25, "w":1.25},
196 {"x":15.25, "y":5.25},
197 {"x":16.25, "y":5.25},
198 {"x":17.25, "y":5.25}
199 ]
200 },
201 "LAYOUT_tkl_iso": {
202 "layout": [
203 {"x":0, "y":0},
204 {"x":2, "y":0},
205 {"x":3, "y":0},
206 {"x":4, "y":0},
207 {"x":5, "y":0},
208 {"x":6.5, "y":0},
209 {"x":7.5, "y":0},
210 {"x":8.5, "y":0},
211 {"x":9.5, "y":0},
212 {"x":11, "y":0},
213 {"x":12, "y":0},
214 {"x":13, "y":0},
215 {"x":14, "y":0},
216 {"x":15.25, "y":0},
217 {"x":16.25, "y":0},
218 {"x":17.25, "y":0},
219
220 {"x":0, "y":1.25},
221 {"x":1, "y":1.25},
222 {"x":2, "y":1.25},
223 {"x":3, "y":1.25},
224 {"x":4, "y":1.25},
225 {"x":5, "y":1.25},
226 {"x":6, "y":1.25},
227 {"x":7, "y":1.25},
228 {"x":8, "y":1.25},
229 {"x":9, "y":1.25},
230 {"x":10, "y":1.25},
231 {"x":11, "y":1.25},
232 {"x":12, "y":1.25},
233 {"x":13, "y":1.25, "w":2},
234 {"x":15.25, "y":1.25},
235 {"x":16.25, "y":1.25},
236 {"x":17.25, "y":1.25},
237
238 {"x":0, "y":2.25, "w":1.5},
239 {"x":1.5, "y":2.25},
240 {"x":2.5, "y":2.25},
241 {"x":3.5, "y":2.25},
242 {"x":4.5, "y":2.25},
243 {"x":5.5, "y":2.25},
244 {"x":6.5, "y":2.25},
245 {"x":7.5, "y":2.25},
246 {"x":8.5, "y":2.25},
247 {"x":9.5, "y":2.25},
248 {"x":10.5, "y":2.25},
249 {"x":11.5, "y":2.25},
250 {"x":12.5, "y":2.25},
251 {"x":15.25, "y":2.25},
252 {"x":16.25, "y":2.25},
253 {"x":17.25, "y":2.25},
254
255 {"x":0, "y":3.25, "w":1.75},
256 {"x":1.75, "y":3.25},
257 {"x":2.75, "y":3.25},
258 {"x":3.75, "y":3.25},
259 {"x":4.75, "y":3.25},
260 {"x":5.75, "y":3.25},
261 {"x":6.75, "y":3.25},
262 {"x":7.75, "y":3.25},
263 {"x":8.75, "y":3.25},
264 {"x":9.75, "y":3.25},
265 {"x":10.75, "y":3.25},
266 {"x":11.75, "y":3.25},
267 {"x":12.75, "y":3.25},
268 {"x":13.75, "y":2.25, "w":1.25, "h":2},
269
270 {"x":0, "y":4.25, "w":1.25},
271 {"x":1.25, "y":4.25},
272 {"x":2.25, "y":4.25},
273 {"x":3.25, "y":4.25},
274 {"x":4.25, "y":4.25},
275 {"x":5.25, "y":4.25},
276 {"x":6.25, "y":4.25},
277 {"x":7.25, "y":4.25},
278 {"x":8.25, "y":4.25},
279 {"x":9.25, "y":4.25},
280 {"x":10.25, "y":4.25},
281 {"x":11.25, "y":4.25},
282 {"x":12.25, "y":4.25, "w":2.75},
283 {"x":16.25, "y":4.25},
284
285 {"x":0, "y":5.25, "w":1.25},
286 {"x":1.25, "y":5.25, "w":1.25},
287 {"x":2.5, "y":5.25, "w":1.25},
288 {"x":3.75, "y":5.25, "w":6.25},
289 {"x":10, "y":5.25, "w":1.25},
290 {"x":11.25, "y":5.25, "w":1.25},
291 {"x":12.5, "y":5.25, "w":1.25},
292 {"x":13.75, "y":5.25, "w":1.25},
293 {"x":15.25, "y":5.25},
294 {"x":16.25, "y":5.25},
295 {"x":17.25, "y":5.25}
296 ]
297 },
298 "LAYOUT_tkl_iso_split_rshift": {
299 "layout": [
300 {"x":0, "y":0},
301 {"x":2, "y":0},
302 {"x":3, "y":0},
303 {"x":4, "y":0},
304 {"x":5, "y":0},
305 {"x":6.5, "y":0},
306 {"x":7.5, "y":0},
307 {"x":8.5, "y":0},
308 {"x":9.5, "y":0},
309 {"x":11, "y":0},
310 {"x":12, "y":0},
311 {"x":13, "y":0},
312 {"x":14, "y":0},
313 {"x":15.25, "y":0},
314 {"x":16.25, "y":0},
315 {"x":17.25, "y":0},
316
317 {"x":0, "y":1.25},
318 {"x":1, "y":1.25},
319 {"x":2, "y":1.25},
320 {"x":3, "y":1.25},
321 {"x":4, "y":1.25},
322 {"x":5, "y":1.25},
323 {"x":6, "y":1.25},
324 {"x":7, "y":1.25},
325 {"x":8, "y":1.25},
326 {"x":9, "y":1.25},
327 {"x":10, "y":1.25},
328 {"x":11, "y":1.25},
329 {"x":12, "y":1.25},
330 {"x":13, "y":1.25, "w":2},
331 {"x":15.25, "y":1.25},
332 {"x":16.25, "y":1.25},
333 {"x":17.25, "y":1.25},
334
335 {"x":0, "y":2.25, "w":1.5},
336 {"x":1.5, "y":2.25},
337 {"x":2.5, "y":2.25},
338 {"x":3.5, "y":2.25},
339 {"x":4.5, "y":2.25},
340 {"x":5.5, "y":2.25},
341 {"x":6.5, "y":2.25},
342 {"x":7.5, "y":2.25},
343 {"x":8.5, "y":2.25},
344 {"x":9.5, "y":2.25},
345 {"x":10.5, "y":2.25},
346 {"x":11.5, "y":2.25},
347 {"x":12.5, "y":2.25},
348 {"x":15.25, "y":2.25},
349 {"x":16.25, "y":2.25},
350 {"x":17.25, "y":2.25},
351
352 {"x":0, "y":3.25, "w":1.75},
353 {"x":1.75, "y":3.25},
354 {"x":2.75, "y":3.25},
355 {"x":3.75, "y":3.25},
356 {"x":4.75, "y":3.25},
357 {"x":5.75, "y":3.25},
358 {"x":6.75, "y":3.25},
359 {"x":7.75, "y":3.25},
360 {"x":8.75, "y":3.25},
361 {"x":9.75, "y":3.25},
362 {"x":10.75, "y":3.25},
363 {"x":11.75, "y":3.25},
364 {"x":12.75, "y":3.25},
365 {"x":13.75, "y":2.25, "w":1.25, "h":2},
366
367 {"x":0, "y":4.25, "w":1.25},
368 {"x":1.25, "y":4.25},
369 {"x":2.25, "y":4.25},
370 {"x":3.25, "y":4.25},
371 {"x":4.25, "y":4.25},
372 {"x":5.25, "y":4.25},
373 {"x":6.25, "y":4.25},
374 {"x":7.25, "y":4.25},
375 {"x":8.25, "y":4.25},
376 {"x":9.25, "y":4.25},
377 {"x":10.25, "y":4.25},
378 {"x":11.25, "y":4.25},
379 {"x":12.25, "y":4.25, "w":1.75},
380 {"x":14, "y":4.25},
381 {"x":16.25, "y":4.25},
382
383 {"x":0, "y":5.25, "w":1.25},
384 {"x":1.25, "y":5.25, "w":1.25},
385 {"x":2.5, "y":5.25, "w":1.25},
386 {"x":3.75, "y":5.25, "w":6.25},
387 {"x":10, "y":5.25, "w":1.25},
388 {"x":11.25, "y":5.25, "w":1.25},
389 {"x":12.5, "y":5.25, "w":1.25},
390 {"x":13.75, "y":5.25, "w":1.25},
391 {"x":15.25, "y":5.25},
392 {"x":16.25, "y":5.25},
393 {"x":17.25, "y":5.25}
394 ]
395 }
396 }
397}
diff --git a/keyboards/j80/j80.c b/keyboards/j80/j80.c
new file mode 100644
index 000000000..4ac0200a2
--- /dev/null
+++ b/keyboards/j80/j80.c
@@ -0,0 +1,26 @@
1/* Copyright 2019 JER
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#include "j80.h"
18
19bool led_update_kb(led_t led_state) {
20 if (led_update_user(led_state)) {
21 writePin(D1, led_state.caps_lock);
22 writePin(D0, led_state.num_lock);
23 writePin(D6, led_state.scroll_lock);
24 }
25 return true;
26}
diff --git a/keyboards/j80/j80.h b/keyboards/j80/j80.h
new file mode 100644
index 000000000..a528c70c7
--- /dev/null
+++ b/keyboards/j80/j80.h
@@ -0,0 +1,115 @@
1/* Copyright 2019 JER
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#include "quantum.h"
20
21#define ____ KC_NO
22
23/* This is a shortcut to help you visually see your layout.
24 *
25 * The first section contains all of the arguments representing the physical
26 * layout of the board and position of the keys.
27 *
28 * The second converts the arguments into a two-dimensional array which
29 * represents the switch matrix.
30 */
31
32 #define LAYOUT_all( \
33 k00, k02, k03, k04, k05, k07, k08, k09, k0A, k0B, k0D, k0C, k01, k61, k62, k6D, \
34 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1D, k1C, k66, k65, k64, \
35 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2D, k2C, k6C, k68, k67, \
36 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3D, \
37 k40, k3C, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4D, k4C, \
38 k50, k51, k52, k54, k58, k59, k5A, k5B, k5D, k5C, k57 \
39 ){ \
40 { k00, k01, k02, k03, k04, k05, ____, k07, k08, k09, k0A, k0B, k0C, k0D }, \
41 { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D }, \
42 { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D }, \
43 { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D }, \
44 { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D }, \
45 { k50, k51, k52, ____, k54, ____, ____, k57, k58, k59, k5A, k5B, k5C, k5D }, \
46 { ____, k61, k62, ____, k64, k65, k66, k67, k68, ____, ____, ____, k6C, k6D }, \
47 }
48
49 #define LAYOUT_tkl_iso( \
50 k00, k02, k03, k04, k05, k07, k08, k09, k0A, k0B, k0D, k0C, k01, k61, k62, k6D, \
51 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1D, k1C, k66, k65, k64, \
52 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2D, k6C, k68, k67, \
53 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k2C, k3D, \
54 k40, k3C, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, \
55 k50, k51, k52, k54, k58, k59, k5A, k5B, k5D, k5C, k57 \
56 ){ \
57 { k00, k01, k02, k03, k04, k05, ____, k07, k08, k09, k0A, k0B, k0C, k0D }, \
58 { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D }, \
59 { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D }, \
60 { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D }, \
61 { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, ____ }, \
62 { k50, k51, k52, ____, k54, ____, ____, k57, k58, k59, k5A, k5B, k5C, k5D }, \
63 { ____, k61, k62, ____, k64, k65, k66, k67, k68, ____, ____, ____, k6C, k6D }, \
64 }
65
66#define LAYOUT_tkl_iso_split_rshift( \
67 k00, k02, k03, k04, k05, k07, k08, k09, k0A, k0B, k0D, k0C, k01, k61, k62, k6D, \
68 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1D, k1C, k66, k65, k64, \
69 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2D, k6C, k68, k67, \
70 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k2C, k3D, \
71 k40, k3C, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4D, k4C, \
72 k50, k51, k52, k54, k58, k59, k5A, k5B, k5D, k5C, k57 \
73){ \
74 { k00, k01, k02, k03, k04, k05, ____, k07, k08, k09, k0A, k0B, k0C, k0D }, \
75 { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D }, \
76 { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D }, \
77 { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D }, \
78 { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D }, \
79 { k50, k51, k52, ____, k54, ____, ____, k57, k58, k59, k5A, k5B, k5C, k5D }, \
80 { ____, k61, k62, ____, k64, k65, k66, k67, k68, ____, ____, ____, k6C, k6D }, \
81}
82
83#define LAYOUT_tkl_ansi( \
84 k00, k02, k03, k04, k05, k07, k08, k09, k0A, k0B, k0D, k0C, k01, k61, k62, k6D, \
85 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1D, k1C, k66, k65, k64, \
86 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2D, k2C, k6C, k68, k67, \
87 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3D, \
88 k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, \
89 k50, k51, k52, k54, k58, k59, k5A, k5B, k5D, k5C, k57 \
90){ \
91 { k00, k01, k02, k03, k04, k05, ____, k07, k08, k09, k0A, k0B, k0C, k0D }, \
92 { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D }, \
93 { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D }, \
94 { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, ____, k3D }, \
95 { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, ____ }, \
96 { k50, k51, k52, ____, k54, ____, ____, k57, k58, k59, k5A, k5B, k5C, k5D }, \
97 { ____, k61, k62, ____, k64, k65, k66, k67, k68, ____, ____, ____, k6C, k6D }, \
98}
99
100#define LAYOUT_tkl_ansi_split_rshift( \
101 k00, k02, k03, k04, k05, k07, k08, k09, k0A, k0B, k0D, k0C, k01, k61, k62, k6D, \
102 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1D, k1C, k66, k65, k64, \
103 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2D, k2C, k6C, k68, k67, \
104 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3D, \
105 k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4D, k4C, \
106 k50, k51, k52, k54, k58, k59, k5A, k5B, k5D, k5C, k57 \
107){ \
108 { k00, k01, k02, k03, k04, k05, ____, k07, k08, k09, k0A, k0B, k0C, k0D }, \
109 { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D }, \
110 { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D }, \
111 { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, ____, k3D }, \
112 { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D }, \
113 { k50, k51, k52, ____, k54, ____, ____, k57, k58, k59, k5A, k5B, k5C, k5D }, \
114 { ____, k61, k62, ____, k64, k65, k66, k67, k68, ____, ____, ____, k6C, k6D }, \
115}
diff --git a/keyboards/j80/keymaps/default/keymap.c b/keyboards/j80/keymaps/default/keymap.c
new file mode 100644
index 000000000..6926da8ea
--- /dev/null
+++ b/keyboards/j80/keymaps/default/keymap.c
@@ -0,0 +1,59 @@
1/* Copyright 2019 JER
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// Defines names for use in layer keycodes and the keymap
19enum layer_names {
20 _BASE,
21 _FN
22};
23
24// Defines the keycodes used by our macros in process_record_user
25enum custom_keycodes {
26 QMKBEST = SAFE_RANGE
27};
28
29const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
30[_BASE] = LAYOUT_tkl_ansi_split_rshift(
31 KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS,
32 KC_GRV, 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_INS, KC_HOME, KC_PGUP,
33 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_DEL, KC_END, KC_PGDN,
34 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,
35 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN), KC_UP,
36 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
37
38[_FN] = LAYOUT_tkl_ansi_split_rshift(
39 RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
40 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
41 KC_TRNS, QMKBEST, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
42 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
43 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
44 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
45};
46
47bool process_record_user(uint16_t keycode, keyrecord_t *record) {
48 switch (keycode) {
49 case QMKBEST:
50 if (record->event.pressed) {
51 // when keycode QMKBEST is pressed
52 SEND_STRING("QMK is the best thing ever!");
53 } else {
54 // when keycode QMKBEST is released
55 }
56 break;
57 }
58 return true;
59}
diff --git a/keyboards/j80/keymaps/default/readme.md b/keyboards/j80/keymaps/default/readme.md
new file mode 100644
index 000000000..21ad7d5ab
--- /dev/null
+++ b/keyboards/j80/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default keymap for J80
diff --git a/keyboards/j80/keymaps/default_iso/keymap.c b/keyboards/j80/keymaps/default_iso/keymap.c
new file mode 100644
index 000000000..4253454f7
--- /dev/null
+++ b/keyboards/j80/keymaps/default_iso/keymap.c
@@ -0,0 +1,59 @@
1/* Copyright 2019 JER
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// Defines names for use in layer keycodes and the keymap
19enum layer_names {
20 _BASE,
21 _FN
22};
23
24// Defines the keycodes used by our macros in process_record_user
25enum custom_keycodes {
26 QMKBEST = SAFE_RANGE
27};
28
29const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
30[_BASE] = LAYOUT_tkl_iso_split_rshift(
31 KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS,
32 KC_GRV, 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_INS, KC_HOME, KC_PGUP,
33 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_DEL, KC_END, KC_PGDN,
34 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_BSLS, KC_ENT,
35 KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN), KC_UP,
36 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
37
38[_FN] = LAYOUT_tkl_iso_split_rshift(
39 RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
40 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
41 KC_TRNS, QMKBEST, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
42 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
43 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
44 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
45};
46
47bool process_record_user(uint16_t keycode, keyrecord_t *record) {
48 switch (keycode) {
49 case QMKBEST:
50 if (record->event.pressed) {
51 // when keycode QMKBEST is pressed
52 SEND_STRING("QMK is the best thing ever!");
53 } else {
54 // when keycode QMKBEST is released
55 }
56 break;
57 }
58 return true;
59}
diff --git a/keyboards/j80/keymaps/default_iso/readme.md b/keyboards/j80/keymaps/default_iso/readme.md
new file mode 100644
index 000000000..db7bdb415
--- /dev/null
+++ b/keyboards/j80/keymaps/default_iso/readme.md
@@ -0,0 +1 @@
# The default ISO keymap for J80
diff --git a/keyboards/j80/readme.md b/keyboards/j80/readme.md
new file mode 100644
index 000000000..44ed46fe4
--- /dev/null
+++ b/keyboards/j80/readme.md
@@ -0,0 +1,21 @@
1# J80
2
3JER PLANT - J80 (JER-A06) Round 2
4The J80 is a OG Cherry style(no plate) custom 80% kit.
5It is characterized by the fact that the hoisting PCB has no steel plate and can fully reflect the elasticity of the linear shaft. Tested by the buyer, its feel and typing sound are different from other custom keyboards and are satisfactory. It has a simple and elegant original cherry-like shape, the author's original intention is to start from the touching feel, let everyone have a comfortable tapping experience. The light stick module in the upper right corner is detachable, it could be switches (3 keys) or the light stick module. When using light stick module, PrtScr Scrolllock and Pause are achieved by pressing FN+ Insert / Home / Page Up.
6
7* Keyboard Maintainer: [oeywil](https://github.com/oeywil)
8* Hardware Supported: J80 PCB (atmega32a)
9* Hardware Availability: [J80 R2 GB](https://geekhack.org/index.php?topic=101401.0)
10
11Make example for this keyboard (after setting up your build environment):
12
13 make j80:default
14
15Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](https://docs.qmk.fm/#/flashing_bootloadhid))
16
17 make j80:default:flash
18
19**Reset Key**: Hold down the key located at *TOP RIGHT*, commonly programmed as *PAUSE* while plugging in the keyboard. The key definition for the reset key is k6D. Bootmagic Lite is enabled so holding down Escape while plugging in the keyboard will also jump to bootloader, after QMK is flashed.
20
21See 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/j80/rules.mk b/keyboards/j80/rules.mk
new file mode 100644
index 000000000..1ceafc9c0
--- /dev/null
+++ b/keyboards/j80/rules.mk
@@ -0,0 +1,25 @@
1# MCU name
2MCU = atmega32a
3
4# Bootloader selection
5# Teensy halfkay
6# Pro Micro caterina
7# Atmel DFU atmel-dfu
8# LUFA DFU lufa-dfu
9# QMK DFU qmk-dfu
10# ATmega32A bootloadHID
11# ATmega328P USBasp
12BOOTLOADER = bootloadHID
13
14# Build Options
15# change yes to no to disable
16#
17BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
18MOUSEKEY_ENABLE = no # Mouse keys
19EXTRAKEY_ENABLE = yes # Audio control and System control
20CONSOLE_ENABLE = yes # Console for debug
21COMMAND_ENABLE = yes # Commands for debug and configuration
22BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
23RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
24
25OPT_DEFS = -DDEBUG_LEVEL=0
diff --git a/keyboards/j80/usbconfig.h b/keyboards/j80/usbconfig.h
new file mode 100644
index 000000000..0c377f4b7
--- /dev/null
+++ b/keyboards/j80/usbconfig.h
@@ -0,0 +1,373 @@
1#pragma once
2
3#include "config.h"
4
5/*
6General Description:
7This file is an example configuration (with inline documentation) for the USB
8driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is
9also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may
10wire the lines to any other port, as long as D+ is also wired to INT0 (or any
11other hardware interrupt, as long as it is the highest level interrupt, see
12section at the end of this file).
13*/
14
15/* ---------------------------- Hardware Config ---------------------------- */
16
17#define USB_CFG_IOPORTNAME D
18/* This is the port where the USB bus is connected. When you configure it to
19 * "B", the registers PORTB, PINB and DDRB will be used.
20 */
21#define USB_CFG_DMINUS_BIT 3
22/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.
23 * This may be any bit in the port.
24 */
25#define USB_CFG_DPLUS_BIT 2
26/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.
27 * This may be any bit in the port. Please note that D+ must also be connected
28 * to interrupt pin INT0! [You can also use other interrupts, see section
29 * "Optional MCU Description" below, or you can connect D- to the interrupt, as
30 * it is required if you use the USB_COUNT_SOF feature. If you use D- for the
31 * interrupt, the USB interrupt will also be triggered at Start-Of-Frame
32 * markers every millisecond.]
33 */
34#define USB_CFG_CLOCK_KHZ (F_CPU / 1000)
35/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000,
36 * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code
37 * require no crystal, they tolerate +/- 1% deviation from the nominal
38 * frequency. All other rates require a precision of 2000 ppm and thus a
39 * crystal!
40 * Since F_CPU should be defined to your actual clock rate anyway, you should
41 * not need to modify this setting.
42 */
43#define USB_CFG_CHECK_CRC 0
44/* Define this to 1 if you want that the driver checks integrity of incoming
45 * data packets (CRC checks). CRC checks cost quite a bit of code size and are
46 * currently only available for 18 MHz crystal clock. You must choose
47 * USB_CFG_CLOCK_KHZ = 18000 if you enable this option.
48 */
49
50/* ----------------------- Optional Hardware Config ------------------------ */
51
52/* #define USB_CFG_PULLUP_IOPORTNAME D */
53/* If you connect the 1.5k pullup resistor from D- to a port pin instead of
54 * V+, you can connect and disconnect the device from firmware by calling
55 * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h).
56 * This constant defines the port on which the pullup resistor is connected.
57 */
58/* #define USB_CFG_PULLUP_BIT 4 */
59/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined
60 * above) where the 1.5k pullup resistor is connected. See description
61 * above for details.
62 */
63
64/* --------------------------- Functional Range ---------------------------- */
65
66#define USB_CFG_HAVE_INTRIN_ENDPOINT 1
67/* Define this to 1 if you want to compile a version with two endpoints: The
68 * default control endpoint 0 and an interrupt-in endpoint (any other endpoint
69 * number).
70 */
71#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1
72/* Define this to 1 if you want to compile a version with three endpoints: The
73 * default control endpoint 0, an interrupt-in endpoint 3 (or the number
74 * configured below) and a catch-all default interrupt-in endpoint as above.
75 * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature.
76 */
77#define USB_CFG_EP3_NUMBER 3
78/* If the so-called endpoint 3 is used, it can now be configured to any other
79 * endpoint number (except 0) with this macro. Default if undefined is 3.
80 */
81/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */
82/* The above macro defines the startup condition for data toggling on the
83 * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1.
84 * Since the token is toggled BEFORE sending any data, the first packet is
85 * sent with the oposite value of this configuration!
86 */
87#define USB_CFG_IMPLEMENT_HALT 0
88/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature
89 * for endpoint 1 (interrupt endpoint). Although you may not need this feature,
90 * it is required by the standard. We have made it a config option because it
91 * bloats the code considerably.
92 */
93#define USB_CFG_SUPPRESS_INTR_CODE 0
94/* Define this to 1 if you want to declare interrupt-in endpoints, but don't
95 * want to send any data over them. If this macro is defined to 1, functions
96 * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if
97 * you need the interrupt-in endpoints in order to comply to an interface
98 * (e.g. HID), but never want to send any data. This option saves a couple
99 * of bytes in flash memory and the transmit buffers in RAM.
100 */
101#define USB_CFG_IS_SELF_POWERED 0
102/* Define this to 1 if the device has its own power supply. Set it to 0 if the
103 * device is powered from the USB bus.
104 */
105#define USB_CFG_IMPLEMENT_FN_WRITE 1
106/* Set this to 1 if you want usbFunctionWrite() to be called for control-out
107 * transfers. Set it to 0 if you don't need it and want to save a couple of
108 * bytes.
109 */
110#define USB_CFG_IMPLEMENT_FN_READ 0
111/* Set this to 1 if you need to send control replies which are generated
112 * "on the fly" when usbFunctionRead() is called. If you only want to send
113 * data from a static buffer, set it to 0 and return the data from
114 * usbFunctionSetup(). This saves a couple of bytes.
115 */
116#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0
117/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints.
118 * You must implement the function usbFunctionWriteOut() which receives all
119 * interrupt/bulk data sent to any endpoint other than 0. The endpoint number
120 * can be found in 'usbRxToken'.
121 */
122#define USB_CFG_HAVE_FLOWCONTROL 0
123/* Define this to 1 if you want flowcontrol over USB data. See the definition
124 * of the macros usbDisableAllRequests() and usbEnableAllRequests() in
125 * usbdrv.h.
126 */
127#define USB_CFG_DRIVER_FLASH_PAGE 0
128/* If the device has more than 64 kBytes of flash, define this to the 64 k page
129 * where the driver's constants (descriptors) are located. Or in other words:
130 * Define this to 1 for boot loaders on the ATMega128.
131 */
132#define USB_CFG_LONG_TRANSFERS 0
133/* Define this to 1 if you want to send/receive blocks of more than 254 bytes
134 * in a single control-in or control-out transfer. Note that the capability
135 * for long transfers increases the driver size.
136 */
137/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */
138/* This macro is a hook if you want to do unconventional things. If it is
139 * defined, it's inserted at the beginning of received message processing.
140 * If you eat the received message and don't want default processing to
141 * proceed, do a return after doing your things. One possible application
142 * (besides debugging) is to flash a status LED on each packet.
143 */
144/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */
145/* This macro is a hook if you need to know when an USB RESET occurs. It has
146 * one parameter which distinguishes between the start of RESET state and its
147 * end.
148 */
149/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */
150/* This macro (if defined) is executed when a USB SET_ADDRESS request was
151 * received.
152 */
153#define USB_COUNT_SOF 1
154/* define this macro to 1 if you need the global variable "usbSofCount" which
155 * counts SOF packets. This feature requires that the hardware interrupt is
156 * connected to D- instead of D+.
157 */
158/* #ifdef __ASSEMBLER__
159 * macro myAssemblerMacro
160 * in YL, TCNT0
161 * sts timer0Snapshot, YL
162 * endm
163 * #endif
164 * #define USB_SOF_HOOK myAssemblerMacro
165 * This macro (if defined) is executed in the assembler module when a
166 * Start Of Frame condition is detected. It is recommended to define it to
167 * the name of an assembler macro which is defined here as well so that more
168 * than one assembler instruction can be used. The macro may use the register
169 * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages
170 * immediately after an SOF pulse may be lost and must be retried by the host.
171 * What can you do with this hook? Since the SOF signal occurs exactly every
172 * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in
173 * designs running on the internal RC oscillator.
174 * Please note that Start Of Frame detection works only if D- is wired to the
175 * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES!
176 */
177#define USB_CFG_CHECK_DATA_TOGGLING 0
178/* define this macro to 1 if you want to filter out duplicate data packets
179 * sent by the host. Duplicates occur only as a consequence of communication
180 * errors, when the host does not receive an ACK. Please note that you need to
181 * implement the filtering yourself in usbFunctionWriteOut() and
182 * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable
183 * for each control- and out-endpoint to check for duplicate packets.
184 */
185#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0
186/* define this macro to 1 if you want the function usbMeasureFrameLength()
187 * compiled in. This function can be used to calibrate the AVR's RC oscillator.
188 */
189#define USB_USE_FAST_CRC 0
190/* The assembler module has two implementations for the CRC algorithm. One is
191 * faster, the other is smaller. This CRC routine is only used for transmitted
192 * messages where timing is not critical. The faster routine needs 31 cycles
193 * per byte while the smaller one needs 61 to 69 cycles. The faster routine
194 * may be worth the 32 bytes bigger code size if you transmit lots of data and
195 * run the AVR close to its limit.
196 */
197
198/* -------------------------- Device Description --------------------------- */
199
200#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF)
201/* USB vendor ID for the device, low byte first. If you have registered your
202 * own Vendor ID, define it here. Otherwise you may use one of obdev's free
203 * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules!
204 * *** IMPORTANT NOTE ***
205 * This template uses obdev's shared VID/PID pair for Vendor Class devices
206 * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand
207 * the implications!
208 */
209#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF)
210/* This is the ID of the product, low byte first. It is interpreted in the
211 * scope of the vendor ID. If you have registered your own VID with usb.org
212 * or if you have licensed a PID from somebody else, define it here. Otherwise
213 * you may use one of obdev's free shared VID/PID pairs. See the file
214 * USB-IDs-for-free.txt for details!
215 * *** IMPORTANT NOTE ***
216 * This template uses obdev's shared VID/PID pair for Vendor Class devices
217 * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand
218 * the implications!
219 */
220#define USB_CFG_DEVICE_VERSION (DEVICE_VER & 0xFF), ((DEVICE_VER >> 8) & 0xFF)
221/* Version number of the device: Minor number first, then major number.
222 */
223#define USB_CFG_VENDOR_NAME 'J', 'E', 'R'
224#define USB_CFG_VENDOR_NAME_LEN 3
225/* These two values define the vendor name returned by the USB device. The name
226 * must be given as a list of characters under single quotes. The characters
227 * are interpreted as Unicode (UTF-16) entities.
228 * If you don't want a vendor name string, undefine these macros.
229 * ALWAYS define a vendor name containing your Internet domain name if you use
230 * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for
231 * details.
232 */
233#define USB_CFG_DEVICE_NAME 'J', '8', '0'
234#define USB_CFG_DEVICE_NAME_LEN 3
235/* Same as above for the device name. If you don't want a device name, undefine
236 * the macros. See the file USB-IDs-for-free.txt before you assign a name if
237 * you use a shared VID/PID.
238 */
239/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */
240/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */
241/* Same as above for the serial number. If you don't want a serial number,
242 * undefine the macros.
243 * It may be useful to provide the serial number through other means than at
244 * compile time. See the section about descriptor properties below for how
245 * to fine tune control over USB descriptors such as the string descriptor
246 * for the serial number.
247 */
248#define USB_CFG_DEVICE_CLASS 0
249#define USB_CFG_DEVICE_SUBCLASS 0
250/* See USB specification if you want to conform to an existing device class.
251 * Class 0xff is "vendor specific".
252 */
253#define USB_CFG_INTERFACE_CLASS 3 /* HID */
254#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */
255#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */
256/* See USB specification if you want to conform to an existing device class or
257 * protocol. The following classes must be set at interface level:
258 * HID class is 3, no subclass and protocol required (but may be useful!)
259 * CDC class is 2, use subclass 2 and protocol 1 for ACM
260 */
261#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0
262/* Define this to the length of the HID report descriptor, if you implement
263 * an HID device. Otherwise don't define it or define it to 0.
264 * If you use this define, you must add a PROGMEM character array named
265 * "usbHidReportDescriptor" to your code which contains the report descriptor.
266 * Don't forget to keep the array and this define in sync!
267 */
268
269/* #define USB_PUBLIC static */
270/* Use the define above if you #include usbdrv.c instead of linking against it.
271 * This technique saves a couple of bytes in flash memory.
272 */
273
274/* ------------------- Fine Control over USB Descriptors ------------------- */
275/* If you don't want to use the driver's default USB descriptors, you can
276 * provide our own. These can be provided as (1) fixed length static data in
277 * flash memory, (2) fixed length static data in RAM or (3) dynamically at
278 * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more
279 * information about this function.
280 * Descriptor handling is configured through the descriptor's properties. If
281 * no properties are defined or if they are 0, the default descriptor is used.
282 * Possible properties are:
283 * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched
284 * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is
285 * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if
286 * you want RAM pointers.
287 * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found
288 * in static memory is in RAM, not in flash memory.
289 * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash),
290 * the driver must know the descriptor's length. The descriptor itself is
291 * found at the address of a well known identifier (see below).
292 * List of static descriptor names (must be declared PROGMEM if in flash):
293 * char usbDescriptorDevice[];
294 * char usbDescriptorConfiguration[];
295 * char usbDescriptorHidReport[];
296 * char usbDescriptorString0[];
297 * int usbDescriptorStringVendor[];
298 * int usbDescriptorStringDevice[];
299 * int usbDescriptorStringSerialNumber[];
300 * Other descriptors can't be provided statically, they must be provided
301 * dynamically at runtime.
302 *
303 * Descriptor properties are or-ed or added together, e.g.:
304 * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18))
305 *
306 * The following descriptors are defined:
307 * USB_CFG_DESCR_PROPS_DEVICE
308 * USB_CFG_DESCR_PROPS_CONFIGURATION
309 * USB_CFG_DESCR_PROPS_STRINGS
310 * USB_CFG_DESCR_PROPS_STRING_0
311 * USB_CFG_DESCR_PROPS_STRING_VENDOR
312 * USB_CFG_DESCR_PROPS_STRING_PRODUCT
313 * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER
314 * USB_CFG_DESCR_PROPS_HID
315 * USB_CFG_DESCR_PROPS_HID_REPORT
316 * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver)
317 *
318 * Note about string descriptors: String descriptors are not just strings, they
319 * are Unicode strings prefixed with a 2 byte header. Example:
320 * int serialNumberDescriptor[] = {
321 * USB_STRING_DESCRIPTOR_HEADER(6),
322 * 'S', 'e', 'r', 'i', 'a', 'l'
323 * };
324 */
325
326#define USB_CFG_DESCR_PROPS_DEVICE 0
327#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC
328//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0
329#define USB_CFG_DESCR_PROPS_STRINGS 0
330#define USB_CFG_DESCR_PROPS_STRING_0 0
331#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0
332#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0
333#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0
334#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC
335//#define USB_CFG_DESCR_PROPS_HID 0
336#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC
337//#define USB_CFG_DESCR_PROPS_HID_REPORT 0
338#define USB_CFG_DESCR_PROPS_UNKNOWN 0
339
340#define usbMsgPtr_t unsigned short
341/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to
342 * a scalar type here because gcc generates slightly shorter code for scalar
343 * arithmetics than for pointer arithmetics. Remove this define for backward
344 * type compatibility or define it to an 8 bit type if you use data in RAM only
345 * and all RAM is below 256 bytes (tiny memory model in IAR CC).
346 */
347
348/* ----------------------- Optional MCU Description ------------------------ */
349
350/* The following configurations have working defaults in usbdrv.h. You
351 * usually don't need to set them explicitly. Only if you want to run
352 * the driver on a device which is not yet supported or with a compiler
353 * which is not fully supported (such as IAR C) or if you use a differnt
354 * interrupt than INT0, you may have to define some of these.
355 */
356/* #define USB_INTR_CFG MCUCR */
357/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */
358/* #define USB_INTR_CFG_CLR 0 */
359/* #define USB_INTR_ENABLE GIMSK */
360/* #define USB_INTR_ENABLE_BIT INT0 */
361/* #define USB_INTR_PENDING GIFR */
362/* #define USB_INTR_PENDING_BIT INTF0 */
363/* #define USB_INTR_VECTOR INT0_vect */
364
365/* Set INT1 for D- falling edge to count SOF */
366/* #define USB_INTR_CFG EICRA */
367#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10))
368/* #define USB_INTR_CFG_CLR 0 */
369/* #define USB_INTR_ENABLE EIMSK */
370#define USB_INTR_ENABLE_BIT INT1
371/* #define USB_INTR_PENDING EIFR */
372#define USB_INTR_PENDING_BIT INTF1
373#define USB_INTR_VECTOR INT1_vect