aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskullydazed <skullydazed@users.noreply.github.com>2019-02-23 17:25:25 -0800
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2019-02-23 17:25:25 -0800
commit0f62383be57d2e3dacc79a76973295c73e805038 (patch)
treeed61dd8da62da9198c0a8268e2235a15f7014e46
parent539a6fc8255b5a9f0173dca0b9b6bd94c12a51f4 (diff)
downloadqmk_firmware-0f62383be57d2e3dacc79a76973295c73e805038.tar.gz
qmk_firmware-0f62383be57d2e3dacc79a76973295c73e805038.zip
Clueboard 66% Hotswap Support (#5204)
* Initial Clueboard 66% arm support * Fix LAYOUT_66_ansi * wip * Bring this branch up to date with led_matrix * Get Clueboard 66% hotswap working with led_matrix * stm32 cleanup * Fix compiling for clueboard 66% hotswap prototype * Reduce the size of the prototype firmware
-rw-r--r--keyboards/clueboard/66_hotswap/66_hotswap.h4
-rw-r--r--keyboards/clueboard/66_hotswap/config.h1
-rw-r--r--keyboards/clueboard/66_hotswap/gen1/chconf.h520
-rw-r--r--keyboards/clueboard/66_hotswap/gen1/config.h158
-rw-r--r--keyboards/clueboard/66_hotswap/gen1/gen1.c227
-rw-r--r--keyboards/clueboard/66_hotswap/gen1/gen1.h104
-rw-r--r--keyboards/clueboard/66_hotswap/gen1/halconf.h388
-rw-r--r--keyboards/clueboard/66_hotswap/gen1/info.json11
-rw-r--r--keyboards/clueboard/66_hotswap/gen1/led.c21
-rw-r--r--keyboards/clueboard/66_hotswap/gen1/matrix.c160
-rw-r--r--keyboards/clueboard/66_hotswap/gen1/mcuconf.h257
-rw-r--r--keyboards/clueboard/66_hotswap/gen1/rules.mk70
-rw-r--r--keyboards/clueboard/66_hotswap/keymaps/default/keymap.c93
-rw-r--r--keyboards/clueboard/66_hotswap/prototype/config.h55
-rw-r--r--keyboards/clueboard/66_hotswap/prototype/prototype.c63
-rw-r--r--keyboards/clueboard/66_hotswap/prototype/prototype.h86
-rw-r--r--keyboards/clueboard/66_hotswap/prototype/rules.mk24
17 files changed, 2099 insertions, 143 deletions
diff --git a/keyboards/clueboard/66_hotswap/66_hotswap.h b/keyboards/clueboard/66_hotswap/66_hotswap.h
index 9367c2633..a1ea44841 100644
--- a/keyboards/clueboard/66_hotswap/66_hotswap.h
+++ b/keyboards/clueboard/66_hotswap/66_hotswap.h
@@ -3,3 +3,7 @@
3#ifdef KEYBOARD_clueboard_66_hotswap_gen1 3#ifdef KEYBOARD_clueboard_66_hotswap_gen1
4 #include "gen1.h" 4 #include "gen1.h"
5#endif 5#endif
6
7#ifdef KEYBOARD_clueboard_66_hotswap_prototype
8 #include "prototype.h"
9#endif
diff --git a/keyboards/clueboard/66_hotswap/config.h b/keyboards/clueboard/66_hotswap/config.h
index 88adb5737..2c265c947 100644
--- a/keyboards/clueboard/66_hotswap/config.h
+++ b/keyboards/clueboard/66_hotswap/config.h
@@ -16,7 +16,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17 17
18#pragma once 18#pragma once
19
20#include "config_common.h" 19#include "config_common.h"
21 20
22/* USB Device descriptor parameter */ 21/* USB Device descriptor parameter */
diff --git a/keyboards/clueboard/66_hotswap/gen1/chconf.h b/keyboards/clueboard/66_hotswap/gen1/chconf.h
new file mode 100644
index 000000000..1d9f12ff1
--- /dev/null
+++ b/keyboards/clueboard/66_hotswap/gen1/chconf.h
@@ -0,0 +1,520 @@
1/*
2 ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file templates/chconf.h
19 * @brief Configuration file template.
20 * @details A copy of this file must be placed in each project directory, it
21 * contains the application specific kernel settings.
22 *
23 * @addtogroup config
24 * @details Kernel related settings and hooks.
25 * @{
26 */
27
28#ifndef CHCONF_H
29#define CHCONF_H
30
31#define _CHIBIOS_RT_CONF_
32
33/*===========================================================================*/
34/**
35 * @name System timers settings
36 * @{
37 */
38/*===========================================================================*/
39
40/**
41 * @brief System time counter resolution.
42 * @note Allowed values are 16 or 32 bits.
43 */
44#define CH_CFG_ST_RESOLUTION 32
45
46/**
47 * @brief System tick frequency.
48 * @details Frequency of the system timer that drives the system ticks. This
49 * setting also defines the system tick time unit.
50 */
51#define CH_CFG_ST_FREQUENCY 100000
52
53/**
54 * @brief Time delta constant for the tick-less mode.
55 * @note If this value is zero then the system uses the classic
56 * periodic tick. This value represents the minimum number
57 * of ticks that is safe to specify in a timeout directive.
58 * The value one is not valid, timeouts are rounded up to
59 * this value.
60 */
61#define CH_CFG_ST_TIMEDELTA 2
62
63/** @} */
64
65/*===========================================================================*/
66/**
67 * @name Kernel parameters and options
68 * @{
69 */
70/*===========================================================================*/
71
72/**
73 * @brief Round robin interval.
74 * @details This constant is the number of system ticks allowed for the
75 * threads before preemption occurs. Setting this value to zero
76 * disables the preemption for threads with equal priority and the
77 * round robin becomes cooperative. Note that higher priority
78 * threads can still preempt, the kernel is always preemptive.
79 * @note Disabling the round robin preemption makes the kernel more compact
80 * and generally faster.
81 * @note The round robin preemption is not supported in tickless mode and
82 * must be set to zero in that case.
83 */
84#define CH_CFG_TIME_QUANTUM 0
85
86/**
87 * @brief Managed RAM size.
88 * @details Size of the RAM area to be managed by the OS. If set to zero
89 * then the whole available RAM is used. The core memory is made
90 * available to the heap allocator and/or can be used directly through
91 * the simplified core memory allocator.
92 *
93 * @note In order to let the OS manage the whole RAM the linker script must
94 * provide the @p __heap_base__ and @p __heap_end__ symbols.
95 * @note Requires @p CH_CFG_USE_MEMCORE.
96 */
97#define CH_CFG_MEMCORE_SIZE 0
98
99/**
100 * @brief Idle thread automatic spawn suppression.
101 * @details When this option is activated the function @p chSysInit()
102 * does not spawn the idle thread. The application @p main()
103 * function becomes the idle thread and must implement an
104 * infinite loop.
105 */
106#define CH_CFG_NO_IDLE_THREAD FALSE
107
108/** @} */
109
110/*===========================================================================*/
111/**
112 * @name Performance options
113 * @{
114 */
115/*===========================================================================*/
116
117/**
118 * @brief OS optimization.
119 * @details If enabled then time efficient rather than space efficient code
120 * is used when two possible implementations exist.
121 *
122 * @note This is not related to the compiler optimization options.
123 * @note The default is @p TRUE.
124 */
125#define CH_CFG_OPTIMIZE_SPEED TRUE
126
127/** @} */
128
129/*===========================================================================*/
130/**
131 * @name Subsystem options
132 * @{
133 */
134/*===========================================================================*/
135
136/**
137 * @brief Time Measurement APIs.
138 * @details If enabled then the time measurement APIs are included in
139 * the kernel.
140 *
141 * @note The default is @p TRUE.
142 */
143#define CH_CFG_USE_TM TRUE
144
145/**
146 * @brief Threads registry APIs.
147 * @details If enabled then the registry APIs are included in the kernel.
148 *
149 * @note The default is @p TRUE.
150 */
151#define CH_CFG_USE_REGISTRY TRUE
152
153/**
154 * @brief Threads synchronization APIs.
155 * @details If enabled then the @p chThdWait() function is included in
156 * the kernel.
157 *
158 * @note The default is @p TRUE.
159 */
160#define CH_CFG_USE_WAITEXIT TRUE
161
162/**
163 * @brief Semaphores APIs.
164 * @details If enabled then the Semaphores APIs are included in the kernel.
165 *
166 * @note The default is @p TRUE.
167 */
168#define CH_CFG_USE_SEMAPHORES TRUE
169
170/**
171 * @brief Semaphores queuing mode.
172 * @details If enabled then the threads are enqueued on semaphores by
173 * priority rather than in FIFO order.
174 *
175 * @note The default is @p FALSE. Enable this if you have special
176 * requirements.
177 * @note Requires @p CH_CFG_USE_SEMAPHORES.
178 */
179#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
180
181/**
182 * @brief Mutexes APIs.
183 * @details If enabled then the mutexes APIs are included in the kernel.
184 *
185 * @note The default is @p TRUE.
186 */
187#define CH_CFG_USE_MUTEXES TRUE
188
189/**
190 * @brief Enables recursive behavior on mutexes.
191 * @note Recursive mutexes are heavier and have an increased
192 * memory footprint.
193 *
194 * @note The default is @p FALSE.
195 * @note Requires @p CH_CFG_USE_MUTEXES.
196 */
197#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
198
199/**
200 * @brief Conditional Variables APIs.
201 * @details If enabled then the conditional variables APIs are included
202 * in the kernel.
203 *
204 * @note The default is @p TRUE.
205 * @note Requires @p CH_CFG_USE_MUTEXES.
206 */
207#define CH_CFG_USE_CONDVARS TRUE
208
209/**
210 * @brief Conditional Variables APIs with timeout.
211 * @details If enabled then the conditional variables APIs with timeout
212 * specification are included in the kernel.
213 *
214 * @note The default is @p TRUE.
215 * @note Requires @p CH_CFG_USE_CONDVARS.
216 */
217#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE
218
219/**
220 * @brief Events Flags APIs.
221 * @details If enabled then the event flags APIs are included in the kernel.
222 *
223 * @note The default is @p TRUE.
224 */
225#define CH_CFG_USE_EVENTS TRUE
226
227/**
228 * @brief Events Flags APIs with timeout.
229 * @details If enabled then the events APIs with timeout specification
230 * are included in the kernel.
231 *
232 * @note The default is @p TRUE.
233 * @note Requires @p CH_CFG_USE_EVENTS.
234 */
235#define CH_CFG_USE_EVENTS_TIMEOUT TRUE
236
237/**
238 * @brief Synchronous Messages APIs.
239 * @details If enabled then the synchronous messages APIs are included
240 * in the kernel.
241 *
242 * @note The default is @p TRUE.
243 */
244#define CH_CFG_USE_MESSAGES TRUE
245
246/**
247 * @brief Synchronous Messages queuing mode.
248 * @details If enabled then messages are served by priority rather than in
249 * FIFO order.
250 *
251 * @note The default is @p FALSE. Enable this if you have special
252 * requirements.
253 * @note Requires @p CH_CFG_USE_MESSAGES.
254 */
255#define CH_CFG_USE_MESSAGES_PRIORITY TRUE
256
257/**
258 * @brief Mailboxes APIs.
259 * @details If enabled then the asynchronous messages (mailboxes) APIs are
260 * included in the kernel.
261 *
262 * @note The default is @p TRUE.
263 * @note Requires @p CH_CFG_USE_SEMAPHORES.
264 */
265#define CH_CFG_USE_MAILBOXES TRUE
266
267/**
268 * @brief Core Memory Manager APIs.
269 * @details If enabled then the core memory manager APIs are included
270 * in the kernel.
271 *
272 * @note The default is @p TRUE.
273 */
274#define CH_CFG_USE_MEMCORE TRUE
275
276/**
277 * @brief Heap Allocator APIs.
278 * @details If enabled then the memory heap allocator APIs are included
279 * in the kernel.
280 *
281 * @note The default is @p TRUE.
282 * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
283 * @p CH_CFG_USE_SEMAPHORES.
284 * @note Mutexes are recommended.
285 */
286#define CH_CFG_USE_HEAP TRUE
287
288/**
289 * @brief Memory Pools Allocator APIs.
290 * @details If enabled then the memory pools allocator APIs are included
291 * in the kernel.
292 *
293 * @note The default is @p TRUE.
294 */
295#define CH_CFG_USE_MEMPOOLS TRUE
296
297/**
298 * @brief Dynamic Threads APIs.
299 * @details If enabled then the dynamic threads creation APIs are included
300 * in the kernel.
301 *
302 * @note The default is @p TRUE.
303 * @note Requires @p CH_CFG_USE_WAITEXIT.
304 * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
305 */
306#define CH_CFG_USE_DYNAMIC TRUE
307
308/** @} */
309
310/*===========================================================================*/
311/**
312 * @name Debug options
313 * @{
314 */
315/*===========================================================================*/
316
317/**
318 * @brief Debug option, kernel statistics.
319 *
320 * @note The default is @p FALSE.
321 */
322#define CH_DBG_STATISTICS FALSE
323
324/**
325 * @brief Debug option, system state check.
326 * @details If enabled the correct call protocol for system APIs is checked
327 * at runtime.
328 *
329 * @note The default is @p FALSE.
330 */
331#define CH_DBG_SYSTEM_STATE_CHECK FALSE
332
333/**
334 * @brief Debug option, parameters checks.
335 * @details If enabled then the checks on the API functions input
336 * parameters are activated.
337 *
338 * @note The default is @p FALSE.
339 */
340#define CH_DBG_ENABLE_CHECKS FALSE
341
342/**
343 * @brief Debug option, consistency checks.
344 * @details If enabled then all the assertions in the kernel code are
345 * activated. This includes consistency checks inside the kernel,
346 * runtime anomalies and port-defined checks.
347 *
348 * @note The default is @p FALSE.
349 */
350#define CH_DBG_ENABLE_ASSERTS FALSE
351
352/**
353 * @brief Debug option, trace buffer.
354 * @details If enabled then the trace buffer is activated.
355 *
356 * @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
357 */
358#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
359
360/**
361 * @brief Trace buffer entries.
362 * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
363 * different from @p CH_DBG_TRACE_MASK_DISABLED.
364 */
365#define CH_DBG_TRACE_BUFFER_SIZE 128
366
367/**
368 * @brief Debug option, stack checks.
369 * @details If enabled then a runtime stack check is performed.
370 *
371 * @note The default is @p FALSE.
372 * @note The stack check is performed in a architecture/port dependent way.
373 * It may not be implemented or some ports.
374 * @note The default failure mode is to halt the system with the global
375 * @p panic_msg variable set to @p NULL.
376 */
377#define CH_DBG_ENABLE_STACK_CHECK TRUE
378
379/**
380 * @brief Debug option, stacks initialization.
381 * @details If enabled then the threads working area is filled with a byte
382 * value when a thread is created. This can be useful for the
383 * runtime measurement of the used stack.
384 *
385 * @note The default is @p FALSE.
386 */
387#define CH_DBG_FILL_THREADS FALSE
388
389/**
390 * @brief Debug option, threads profiling.
391 * @details If enabled then a field is added to the @p thread_t structure that
392 * counts the system ticks occurred while executing the thread.
393 *
394 * @note The default is @p FALSE.
395 * @note This debug option is not currently compatible with the
396 * tickless mode.
397 */
398#define CH_DBG_THREADS_PROFILING FALSE
399
400/** @} */
401
402/*===========================================================================*/
403/**
404 * @name Kernel hooks
405 * @{
406 */
407/*===========================================================================*/
408
409/**
410 * @brief Threads descriptor structure extension.
411 * @details User fields added to the end of the @p thread_t structure.
412 */
413#define CH_CFG_THREAD_EXTRA_FIELDS \
414 /* Add threads custom fields here.*/
415
416/**
417 * @brief Threads initialization hook.
418 * @details User initialization code added to the @p chThdInit() API.
419 *
420 * @note It is invoked from within @p chThdInit() and implicitly from all
421 * the threads creation APIs.
422 */
423#define CH_CFG_THREAD_INIT_HOOK(tp) { \
424 /* Add threads initialization code here.*/ \
425}
426
427/**
428 * @brief Threads finalization hook.
429 * @details User finalization code added to the @p chThdExit() API.
430 */
431#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
432 /* Add threads finalization code here.*/ \
433}
434
435/**
436 * @brief Context switch hook.
437 * @details This hook is invoked just before switching between threads.
438 */
439#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
440 /* Context switch code here.*/ \
441}
442
443/**
444 * @brief ISR enter hook.
445 */
446#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
447 /* IRQ prologue code here.*/ \
448}
449
450/**
451 * @brief ISR exit hook.
452 */
453#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
454 /* IRQ epilogue code here.*/ \
455}
456
457/**
458 * @brief Idle thread enter hook.
459 * @note This hook is invoked within a critical zone, no OS functions
460 * should be invoked from here.
461 * @note This macro can be used to activate a power saving mode.
462 */
463#define CH_CFG_IDLE_ENTER_HOOK() { \
464 /* Idle-enter code here.*/ \
465}
466
467/**
468 * @brief Idle thread leave hook.
469 * @note This hook is invoked within a critical zone, no OS functions
470 * should be invoked from here.
471 * @note This macro can be used to deactivate a power saving mode.
472 */
473#define CH_CFG_IDLE_LEAVE_HOOK() { \
474 /* Idle-leave code here.*/ \
475}
476
477/**
478 * @brief Idle Loop hook.
479 * @details This hook is continuously invoked by the idle thread loop.
480 */
481#define CH_CFG_IDLE_LOOP_HOOK() { \
482 /* Idle loop code here.*/ \
483}
484
485/**
486 * @brief System tick event hook.
487 * @details This hook is invoked in the system tick handler immediately
488 * after processing the virtual timers queue.
489 */
490#define CH_CFG_SYSTEM_TICK_HOOK() { \
491 /* System tick event code here.*/ \
492}
493
494/**
495 * @brief System halt hook.
496 * @details This hook is invoked in case to a system halting error before
497 * the system is halted.
498 */
499#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
500 /* System halt code here.*/ \
501}
502
503/**
504 * @brief Trace hook.
505 * @details This hook is invoked each time a new record is written in the
506 * trace buffer.
507 */
508#define CH_CFG_TRACE_HOOK(tep) { \
509 /* Trace code here.*/ \
510}
511
512/** @} */
513
514/*===========================================================================*/
515/* Port-specific settings (override port settings defaulted in chcore.h). */
516/*===========================================================================*/
517
518#endif /* CHCONF_H */
519
520/** @} */
diff --git a/keyboards/clueboard/66_hotswap/gen1/config.h b/keyboards/clueboard/66_hotswap/gen1/config.h
index d5d36d4a1..6b0cfb60b 100644
--- a/keyboards/clueboard/66_hotswap/gen1/config.h
+++ b/keyboards/clueboard/66_hotswap/gen1/config.h
@@ -1,44 +1,146 @@
1#pragma once 1/*
2 * Copyright 2017 skully <skullydazed@gmail.com>
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 */
2 17
18#pragma once
3#include "config_common.h" 19#include "config_common.h"
4 20
5#define PRODUCT_ID 0x2390 21/* USB Device descriptor parameter */
22#define VENDOR_ID 0xC1ED
23#define PRODUCT_ID 0x2391
6#define DEVICE_VER 0x0001 24#define DEVICE_VER 0x0001
25#define MANUFACTURER Clueboard
26
27/* Address for jumping to bootloader on STM32 chips. */
28/* It is chip dependent, the correct number can be looked up here:
29 * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
30 * This also requires a patch to chibios:
31 * <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
32 */
33#define STM32_BOOTLOADER_ADDRESS 0x1FFFD800
7 34
8/* key matrix size */ 35/* key matrix size */
9#define MATRIX_ROWS 10 36#define MATRIX_ROWS 10
10#define MATRIX_COLS 8 37#define MATRIX_COLS 8
11 38
12/* ROWS: Top to bottom, COLS: Left to right 39/*
40 * Keyboard Matrix Assignments
41 *
42 * Change this to how you wired your keyboard
43 * COLS: AVR pins used for columns, left to right
44 * ROWS: AVR pins used for rows, top to bottom
45 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
46 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
47 *
13*/ 48*/
14#define MATRIX_ROW_PINS { B2, C7, C6, B6, B5, B0, B3, D5, D3, D2 } 49#define MATRIX_ROW_PINS { B11, A6, A3, A2, A1, B5, B6, C15, C14, C13 }
15#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, E6, B1 } 50#define MATRIX_COL_PINS { B10, B2, B1, B0, A7, B4, B3, B7 }
16#define UNUSED_PINS 51#define UNUSED_PINS { A0, A8, A15, B12, B13, B14, B15 }
52#define DIODE_DIRECTION COL2ROW
53
54/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
55#define DEBOUNCE 6
17 56
18/* Speaker configuration 57/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
58//#define LOCKING_SUPPORT_ENABLE
59/* Locking resynchronize hack */
60//#define LOCKING_RESYNC_ENABLE
61
62/*
63 * Force NKRO
64 *
65 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
66 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
67 * makefile for this to work.)
68 *
69 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
70 * until the next keyboard reset.
71 *
72 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
73 * fully operational during normal computer usage.
74 *
75 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
76 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
77 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
78 * power-up.
79 *
19 */ 80 */
20#define B7_AUDIO 81//#define FORCE_NKRO
21#define NO_MUSIC_MODE 82
22#define AUDIO_CLICKY 83/* key combination for magic key command */
84#define IS_COMMAND() ( \
85 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
86)
23 87
24/* Backlight configuration 88/*
89 * Feature disable options
90 * These options are also useful to firmware size reduction.
25 */ 91 */
26#define BACKLIGHT_LEVELS 1
27 92
28/* Underlight configuration 93/* disable debug print */
94//#define NO_DEBUG
95
96/* disable print */
97//#define NO_PRINT
98
99/* disable action features */
100//#define NO_ACTION_LAYER
101//#define NO_ACTION_TAPPING
102//#define NO_ACTION_ONESHOT
103//#define NO_ACTION_MACRO
104//#define NO_ACTION_FUNCTION
105
106/*
107 * MIDI options
29 */ 108 */
30#define RGB_DI_PIN D7 109
31#define RGBLED_NUM 26 // Number of LEDs 110/* Prevent use of disabled MIDI features in the keymap */
32#define RGBLIGHT_HUE_STEP 32 111//#define MIDI_ENABLE_STRICT 1
33#define RGBLIGHT_SAT_STEP 17 112
34#define RGBLIGHT_VAL_STEP 17 113/* enable basic MIDI features:
35 114 - MIDI notes can be sent when in Music mode is on
36#define RGBLIGHT_ANIMATIONS 115*/
37#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 116//#define MIDI_BASIC
38#define RGBLIGHT_EFFECT_BREATHE_MAX 200 117
39#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 666*2 118/* enable advanced MIDI features:
40#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1 119 - MIDI notes can be added to the keymap
41#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 4 // How many LEDs wide to light up 120 - Octave shift and transpose
42#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 16 // The led to start at 121 - Virtual sustain, portamento, and modulation wheel
43#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 8 // How many LEDs to travel 122 - etc.
44#define RGBLIGHT_EFFECT_SNAKE_LENGTH 4 // How many LEDs wide to light up 123*/
124//#define MIDI_ADVANCED
125
126/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
127//#define MIDI_TONE_KEYCODE_OCTAVES 1
128
129 /* Backlight configuration
130 */
131#define BACKLIGHT_LEVELS 10
132
133// This is a 7-bit address, that gets left-shifted and bit 0
134// set to 0 for write, 1 for read (as per I2C protocol)
135// The address will vary depending on your wiring:
136// 0b1110100 AD <-> GND
137// 0b1110111 AD <-> VCC
138// 0b1110101 AD <-> SCL
139// 0b1110110 AD <-> SDA
140#define LED_DRIVER_ADDR_1 0b1110100
141#define I2C1_BANK GPIOB
142#define I2C1_SCL 8
143#define I2C1_SDA 9
144
145#define LED_DRIVER_COUNT 1
146#define LED_DRIVER_LED_COUNT 71
diff --git a/keyboards/clueboard/66_hotswap/gen1/gen1.c b/keyboards/clueboard/66_hotswap/gen1/gen1.c
index 01f74bc50..c70f22375 100644
--- a/keyboards/clueboard/66_hotswap/gen1/gen1.c
+++ b/keyboards/clueboard/66_hotswap/gen1/gen1.c
@@ -1,63 +1,186 @@
1/* Copyright 2017 Clueboard <info@clueboard.co>
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 */
1#include "gen1.h" 16#include "gen1.h"
2#include <avr/io.h> 17#include "is31fl3731-simple.h"
3#include "backlight.h"
4#include "print.h"
5 18
6void matrix_init_kb(void) { 19void matrix_init_kb(void) {
7 // put your keyboard start-up code here
8 // runs once when the firmware starts up
9 matrix_init_user();
10 led_init_ports();
11
12 // JTAG disable for PORT F. write JTD bit twice within four cycles.
13 MCUCR |= (1<<JTD);
14 MCUCR |= (1<<JTD);
15} 20}
16 21
17
18void matrix_scan_kb(void) { 22void matrix_scan_kb(void) {
19 matrix_scan_user();
20} 23}
21 24
22void backlight_init_ports(void) { 25#ifdef LED_MATRIX_ENABLE
23 print("init_backlight_pin()\n"); 26const is31_led g_is31_leds[LED_DRIVER_LED_COUNT] = {
24 // Set our LED pins as output 27/* Refer to IS31 manual for these locations
25 DDRD |= (1<<0); // Esc 28 * driver
26 DDRD |= (1<<4); // Page Up 29 * | LED address
27 DDRD |= (1<<1); // Arrows 30 * | | */
28 31 {0, C1_1}, // k00 KC_GESC
29 // Set our LED pins low 32 {0, C1_2}, // k01 KC_1
30 PORTD &= ~(1<<0); // Esc 33 {0, C1_3}, // k02 KC_2
31 PORTD &= ~(1<<4); // Page Up 34 {0, C1_4}, // k03 KC_3
32 PORTD &= ~(1<<1); // Arrows 35 {0, C1_5}, // k04 KC_4
33} 36 {0, C1_6}, // k05 KC_5
37 {0, C1_7}, // k06 KC_6
38 {0, C1_8}, // k07 KC_7
39 {0, C1_9}, // k50 KC_8
40 {0, C1_10}, // k51 KC_9
41 {0, C1_11}, // k52 KC_0
42 {0, C1_12}, // k53 KC_MINS
43 {0, C1_13}, // k54 KC_EQL
44 {0, C1_14}, // k55 KC_BSPC
45 {0, C1_15}, // k57 KC_PGUP
46 {0, C2_1}, // k10 KC_TAB
47 {0, C2_2}, // k11 KC_Q
48 {0, C2_3}, // k12 KC_W
49 {0, C2_4}, // k13 KC_E
50 {0, C2_5}, // k14 KC_R
51 {0, C2_6}, // k15 KC_T
52 {0, C2_7}, // k16 KC_Y
53 {0, C2_8}, // k17 KC_U
54 {0, C2_9}, // k60 KC_I
55 {0, C2_10}, // k61 KC_O
56 {0, C2_11}, // k62 KC_P
57 {0, C2_12}, // k63 KC_LBRC
58 {0, C2_13}, // k64 KC_RBRC
59 {0, C2_14}, // k65 KC_BSLS
60 {0, C2_15}, // k67 KC_PGDN
61 {0, C3_1}, // k20 KC_CAPS
62 {0, C3_2}, // k21 KC_A
63 {0, C3_3}, // k22 KC_S
64 {0, C3_4}, // k23 KC_D
65 {0, C3_5}, // k24 KC_F
66 {0, C3_6}, // k25 KC_G
67 {0, C3_7}, // k26 KC_H
68 {0, C3_8}, // k27 KC_J
69 {0, C3_9}, // k70 KC_K
70 {0, C3_10}, // k71 KC_L
71 {0, C3_11}, // k72 KC_SCLN
72 {0, C3_12}, // k73 KC_QUOT
73 {0, C3_14}, // k75 KC_ENT
74 {0, C4_1}, // k30 KC_LSFT
75 {0, C4_3}, // k32 KC_Z
76 {0, C4_4}, // k33 KC_X
77 {0, C4_5}, // k34 KC_C
78 {0, C4_6}, // k35 KC_V
79 {0, C4_7}, // k36 KC_B
80 {0, C4_8}, // k37 KC_N
81 {0, C4_9}, // k80 KC_M
82 {0, C4_10}, // k81 KC_COMM
83 {0, C4_11}, // k82 KC_DOT
84 {0, C4_12}, // k83 KC_SLSH
85 {0, C4_13}, // k85 KC_RSFT
86 {0, C4_14}, // k86 KC_UP
87 {0, C5_1}, // k40 KC_LCTL
88 {0, C5_2}, // k41 KC_LGUI
89 {0, C5_3}, // k42 KC_LALT
90 {0, C5_4}, // Unassociated between LALT and SPACE_2.75
91 {0, C5_5}, // k45 KC_SPC SPACE_2.75
92 {0, C5_6}, // k45 KC_SPC SPACE_6.75
93 {0, C5_7}, // k46 KC_SPC SPACE_2.25
94 {0, C5_8}, // Unassociated between SPACE_2.25 and SPACE_1.25
95 {0, C5_9}, // k90 KC_RGUI
96 {0, C5_10}, // k92 KC_RALT
97 {0, C5_11}, // k93 MO(_FL)
98 {0, C5_12}, // k94 KC_RCTL
99 {0, C5_13}, // k95 KC_LEFT
100 {0, C5_14}, // k96 KC_DOWN
101 {0, C5_15} // k97 KC_RGHT
102};
34 103
35void backlight_set(uint8_t level) { 104const led_matrix g_leds[LED_DRIVER_LED_COUNT] = {
36 if ( level == 0 ) {
37 // Turn off light
38 PORTD |= (1<<0); // Esc
39 PORTD |= (1<<4); // Page Up
40 PORTD |= (1<<1); // Arrows
41 } else {
42 // Turn on light
43 PORTD &= ~(1<<0); // Esc
44 PORTD &= ~(1<<4); // Page Up
45 PORTD &= ~(1<<1); // Arrows
46 }
47}
48 105
49void led_init_ports() { 106 /*{row | col << 4}
50 // * Set our LED pins as output 107 | LED_ROW_COL(row, col)
51 DDRB |= (1<<4); 108 | | modifier
52} 109 | | | */
110 {{0|(1<<4)}, {0, 0}, 1}, // k00 KC_GESC
111 {{0|(2<<4)}, {14.45, 0}, 0}, // k01 KC_1
112 {{0|(3<<4)}, {28.9, 0}, 0}, // k02 KC_2
113 {{0|(4<<4)}, {43.35, 0}, 0}, // k03 KC_3
114 {{0|(5<<4)}, {57.8, 0}, 0}, // k04 KC_4
115 {{0|(6<<4)}, {72.25, 0}, 0}, // k05 KC_5
116 {{0|(7<<4)}, {86.7, 0}, 0}, // k06 KC_6
117 {{0|(8<<4)}, {101.2, 0}, 0}, // k07 KC_7
118 {{0|(9<<4)}, {115.6, 0}, 0}, // k50 KC_8
119 {{0|(10<<4)}, {130, 0}, 0}, // k51 KC_9
120 {{0|(11<<4)}, {144.5, 0}, 0}, // k52 KC_0
121 {{0|(12<<4)}, {159, 0}, 0}, // k53 KC_MINS
122 {{0|(13<<4)}, {173.4, 0}, 0}, // k54 KC_EQL
123 {{0|(14<<4)}, {195.1, 0}, 1}, // k55 KC_BSPC
124 {{0|(15<<4)}, {224, 0}, 1}, // k57 KC_PGUP
53 125
54void led_set_kb(uint8_t usb_led) { 126 {{1|(0<<4)}, {3.6125, 16}, 1}, // k10 KC_TAB
55 DDRB |= (1<<4); 127 {{1|(1<<4)}, {21.675, 16}, 0}, // k11 KC_Q
56 if (usb_led & (1<<USB_LED_CAPS_LOCK)) { 128 {{1|(2<<4)}, {36.125, 16}, 0}, // k12 KC_W
57 // Turn capslock on 129 {{1|(3<<4)}, {50.575, 16}, 0}, // k13 KC_E
58 PORTB |= (1<<4); 130 {{1|(4<<4)}, {65.025, 16}, 0}, // k14 KC_R
59 } else { 131 {{1|(5<<4)}, {79.475, 16}, 0}, // k15 KC_T
60 // Turn capslock off 132 {{1|(6<<4)}, {93.925, 16}, 0}, // k16 KC_Y
61 PORTB &= ~(1<<4); 133 {{1|(7<<4)}, {108.375, 16}, 0}, // k17 KC_U
62 } 134 {{1|(8<<4)}, {122.825, 16}, 0}, // k60 KC_I
63} 135 {{1|(9<<4)}, {137.275, 16}, 0}, // k61 KC_O
136 {{1|(10<<4)}, {151.725, 16}, 0}, // k62 KC_P
137 {{1|(11<<4)}, {166.175, 16}, 0}, // k63 KC_LBRC
138 {{1|(12<<4)}, {180.625, 16}, 0}, // k64 KC_RBRC
139 {{1|(13<<4)}, {198.6875, 16}, 1}, // k65 KC_BSLS
140 {{1|(14<<4)}, {224, 16}, 1}, // k67 KC_PGDN
141
142 {{2|(0<<4)}, {5.41875, 32}, 1}, // k20 KC_CAPS
143 {{2|(1<<4)}, {25.2875, 32}, 0}, // k21 KC_A
144 {{2|(2<<4)}, {39.7375, 32}, 0}, // k22 KC_S
145 {{2|(3<<4)}, {54.1875, 32}, 0}, // k23 KC_D
146 {{2|(4<<4)}, {68.6375, 32}, 0}, // k24 KC_F
147 {{2|(5<<4)}, {83.0875, 32}, 0}, // k25 KC_G
148 {{2|(6<<4)}, {97.5375, 32}, 0}, // k26 KC_H
149 {{2|(7<<4)}, {111.9875, 32}, 0}, // k27 KC_J
150 {{2|(8<<4)}, {126.4375, 32}, 0}, // k70 KC_K
151 {{2|(9<<4)}, {140.8875, 32}, 0}, // k71 KC_L
152 {{2|(10<<4)}, {155.3375, 32}, 0}, // k72 KC_SCLN
153 {{2|(11<<4)}, {169.7875, 32}, 0}, // k73 KC_QUOT
154 {{2|(12<<4)}, {184.2375, 32}, 1}, // k75 KC_ENT
155
156 {{3|(0<<4)}, {16.25625, 48}, 1}, // k30 KC_LSFT
157 {{3|(1<<4)}, {32.5125, 48}, 0}, // k32 KC_Z
158 {{3|(2<<4)}, {46.9625, 48}, 0}, // k33 KC_X
159 {{3|(3<<4)}, {61.4125, 48}, 0}, // k34 KC_C
160 {{3|(4<<4)}, {75.8625, 48}, 0}, // k35 KC_V
161 {{3|(5<<4)}, {90.3125, 48}, 0}, // k36 KC_B
162 {{3|(6<<4)}, {104.7625, 48}, 0}, // k37 KC_N
163 {{3|(7<<4)}, {119.2125, 48}, 0}, // k80 KC_M
164 {{3|(8<<4)}, {133.6625, 48}, 0}, // k81 KC_COMM
165 {{3|(9<<4)}, {148.1125, 48}, 0}, // k82 KC_DOT
166 {{3|(10<<4)}, {162.5625, 48}, 0}, // k83 KC_SLSH
167 {{3|(11<<4)}, {187.85, 48}, 1}, // k85 KC_RSFT
168 {{3|(12<<4)}, {209.525, 48}, 1}, // k86 KC_UP
169
170 {{4|(0<<4)}, {9.03125, 64}, 1}, // k40 KC_LCTL
171 {{4|(1<<4)}, {27.09375, 64}, 1}, // k41 KC_LGUI
172 {{4|(2<<4)}, {45.15625, 64}, 1}, // k42 KC_LALT
173 {{4|(3<<4)}, {59.45, 64}, 1}, // Unassociated between LALT and SPACE_2.75
174 {{4|(4<<4)}, {73.9, 64}, 1}, // k45 KC_SPC SPACE_2.75
175 {{4|(5<<4)}, {88.35, 64}, 1}, // k45 KC_SPC SPACE_6.25
176 {{4|(6<<4)}, {102.8, 64}, 1}, // k46 KC_SPC SPACE_2.25
177 {{4|(7<<4)}, {117.40625, 64}, 1}, // Unassociated between SPACE_2.25 and SPACE_2.75
178 {{4|(8<<4)}, {135.46875, 64}, 1}, // k90 KC_RGUI
179 {{4|(9<<4)}, {153.53125, 64}, 1}, // k92 KC_RALT
180 {{4|(10<<4)}, {167.98125, 64}, 1}, // k93 MO(_FL)
181 {{4|(11<<4)}, {186.04375, 64}, 1}, // k94 KC_RCTL
182 {{4|(12<<4)}, {195.075, 64}, 1}, // k95 KC_LEFT
183 {{4|(13<<4)}, {209.525, 64}, 1}, // k96 KC_DOWN
184 {{4|(14<<4)}, {224, 64}, 1} // k97 KC_RGHT
185};
186#endif
diff --git a/keyboards/clueboard/66_hotswap/gen1/gen1.h b/keyboards/clueboard/66_hotswap/gen1/gen1.h
index e71994f9c..05adf4983 100644
--- a/keyboards/clueboard/66_hotswap/gen1/gen1.h
+++ b/keyboards/clueboard/66_hotswap/gen1/gen1.h
@@ -1,67 +1,89 @@
1/* Copyright 2017 Clueboard <info@clueboard.co>
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 */
1#pragma once 16#pragma once
2#include "quantum.h" 17#include "quantum.h"
3 18
19/*
20 * These are shortcuts to help you work with the various layout options. If your
21 * keymap works with one of the LAYOUT_...() macros you are encouraged to use that
22 * and to contribute your keymap to the corresponding layout in
23 * `qmk_firmware/layouts/community`.
24 */
25
4/* Clueboard matrix layout 26/* Clueboard matrix layout
5 * ,-----------------------------------------------------------. ,---. 27 * ,-----------------------------------------------------------. ,---.
6 * | 00| 01| 02| 03| 04| 05| 06| 07| 50| 51| 52| 53| 54| 56| | 57| 28 * | 00| 01| 02| 03| 04| 05| 06| 07| 50| 51| 52| 53| 54| 56 | | 57|
7 * |-----------------------------------------------------------| |---| 29 * |-----------------------------------------------------------| |---|
8 * | 10| 11| 12| 13| 14| 15| 16| 17| 60| 61| 62| 63| 64| 65| | 67| 30 * | 10| 11| 12| 13| 14| 15| 16| 17| 60| 61| 62| 63| 64| 65| | 67|
9 * |-----------------------------------------------------------| `---' 31 * |-----------------------------------------------------------| `---'
10 * | 20| 21| 22| 23| 24| 25| 26| 27| 70| 71| 72| 73| 75| 32 * | 20| 21| 22| 23| 24| 25| 26| 27| 70| 71| 72| 73| 75|
11 * |-------------------------------------------------------------. 33 * |--------------------------------------------------------------.
12 * | 30| 32| 33| 34| 35| 36| 37| 80| 81| 82| 83| 85| 86| 34 * | 30 | 32| 33| 34| 35| 36| 37| 80| 81| 82| 83| 85 |86|
13 * |-----------------------------------------------------------------. 35 * |------------------------------------------------------------------.
14 * | 40| 41| 42| 45| 46| 90| 92| 93| 94| 95| 96| 97| 36 * | 40| 41| 42| 45| 46| 90| 92| 93| 94| 95|96| 97|
15 * `-----------------------------------------------------------------' 37 * `------------------------------------------------------------------'
16 * ,-----------------------------------------------------------. ,---. 38 * ,-----------------------------------------------------------. ,---.
17 * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |Ins| 39 * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |Ins|
18 * |-----------------------------------------------------------| |---| 40 * |-----------------------------------------------------------| |---|
19 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del| 41 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|
20 * |-----------------------------------------------------------| `---' 42 * |-----------------------------------------------------------| `---'
21 * |Caps | A| S| D| F| G| H| J| k| L| ;| '|Enter | 43 * |Caps | A| S| D| F| G| H| J| k| L| ;| '|Enter |
22 * |-------------------------------------------------------------. 44 * |--------------------------------------------------------------.
23 * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Up | 45 * |Shift | Z| X| C| V| B| N| M| ,| .| /| Shift| Up|
24 * |-----------------------------------------------------------------. 46 * |------------------------------------------------------------------.
25 * |Ctrl|Alt |Gui | Space| Space|Gui |Alt |Fn |Ctrl|Lft|Dwn|Rgt| 47 * |Ctrl|Alt|Gui | Space| Space|Gui |Alt |Fn |Ctrl|Left|Down|Rgt|
26 * `-----------------------------------------------------------------' 48 * `------------------------------------------------------------------'
27 */ 49 */
28// The first section contains all of the arguments 50// The first section contains all of the arguments
29// The second converts the arguments into a two-dimensional array 51// The second converts the arguments into a two-dimensional array
30 52
31#define LAYOUT( \ 53#define LAYOUT( \
32 k00, k01, k02, k03, k04, k05, k06, k07, k50, k51, k52, k53, k54, k56, k57, \ 54 k00, k01, k02, k03, k04, k05, k06, k07, k50, k51, k52, k53, k54, k55, k57, \
33 k10, k11, k12, k13, k14, k15, k16, k17, k60, k61, k62, k63, k64, k65, k67, \ 55 k10, k11, k12, k13, k14, k15, k16, k17, k60, k61, k62, k63, k64, k65, k67, \
34 k20, k21, k22, k23, k24, k25, k26, k27, k70, k71, k72, k73, k75, \ 56 k20, k21, k22, k23, k24, k25, k26, k27, k70, k71, k72, k73, k75, \
35 k30, k32, k33, k34, k35, k36, k37, k80, k81, k82, k83, k85, k86, \ 57 k30, k32, k33, k34, k35, k36, k37, k80, k81, k82, k83, k85, k86, \
36 k40, k41, k42, k45, k46, k90, k92, k93, k94, k95, k96, k97 \ 58 k40, k41, k42, k45, k46, k90, k92, k93, k94, k95, k96, k97 \
37) { \ 59) { \
38 { k00, k01, k02, k03, k04, k05, k06, k07 }, \ 60 { k00, k01, k02, k03, k04, k05, k06, k07 }, \
39 { k10, k11, k12, k13, k14, k15, k16, k17 }, \ 61 { k10, k11, k12, k13, k14, k15, k16, k17 }, \
40 { k20, k21, k22, k23, k24, k25, k26, k27 }, \ 62 { k20, k21, k22, k23, k24, k25, k26, k27 }, \
41 { k30, KC_NO, k32, k33, k34, k35, k36, k37 }, \ 63 { k30, KC_NO, k32, k33, k34, k35, k36, k37 }, \
42 { k40, k41, k42, KC_NO, KC_NO, k45, k46, KC_NO }, \ 64 { k40, k41, k42, KC_NO, KC_NO, k45, k46, KC_NO }, \
43 { k50, k51, k52, k53, k54, KC_NO, k56, k57 }, \ 65 { k50, k51, k52, k53, k54, k55, KC_NO, k57 }, \
44 { k60, k61, k62, k63, k64, k65, KC_NO, k67 }, \ 66 { k60, k61, k62, k63, k64, k65, KC_NO, k67 }, \
45 { k70, k71, k72, k73, KC_NO, k75, KC_NO, KC_NO }, \ 67 { k70, k71, k72, k73, KC_NO, k75, KC_NO, KC_NO }, \
46 { k80, k81, k82, k83, KC_NO, k85, k86, KC_NO }, \ 68 { k80, k81, k82, k83, KC_NO, k85, k86, KC_NO }, \
47 { k90, KC_NO, k92, k93, k94, k95, k96, k97 } \ 69 { k90, KC_NO, k92, k93, k94, k95, k96, k97 } \
48} 70}
49 71
50#define LAYOUT_66_ansi( \ 72#define LAYOUT_66_ansi( \
51 k00, k01, k02, k03, k04, k05, k06, k07, k50, k51, k52, k53, k54, k56, k57, \ 73 k00, k01, k02, k03, k04, k05, k06, k07, k50, k51, k52, k53, k54, k55, k57, \
52 k10, k11, k12, k13, k14, k15, k16, k17, k60, k61, k62, k63, k64, k65, k67, \ 74 k10, k11, k12, k13, k14, k15, k16, k17, k60, k61, k62, k63, k64, k65, k67, \
53 k20, k21, k22, k23, k24, k25, k26, k27, k70, k71, k72, k73, k75, \ 75 k20, k21, k22, k23, k24, k25, k26, k27, k70, k71, k72, k73, k75, \
54 k30, k32, k33, k34, k35, k36, k37, k80, k81, k82, k83, k85, k86, \ 76 k30, k32, k33, k34, k35, k36, k37, k80, k81, k82, k83, k85, k86, \
55 k40, k41, k42, k46, k92, k93, k94, k95, k96, k97 \ 77 k40, k41, k42, k46, k92, k93, k94, k95, k96, k97 \
56) { \ 78) { \
57 { k00, k01, k02, k03, k04, k05, k06, k07 }, \ 79 { k00, k01, k02, k03, k04, k05, k06, k07 }, \
58 { k10, k11, k12, k13, k14, k15, k16, k17 }, \ 80 { k10, k11, k12, k13, k14, k15, k16, k17 }, \
59 { k20, k21, k22, k23, k24, k25, k26, k27 }, \ 81 { k20, k21, k22, k23, k24, k25, k26, k27 }, \
60 { k30, KC_NO, k32, k33, k34, k35, k36, k37 }, \ 82 { k30, KC_NO, k32, k33, k34, k35, k36, k37 }, \
61 { k40, k41, k42, KC_NO, KC_NO, KC_NO, k46, KC_NO }, \ 83 { k40, k41, k42, KC_NO, KC_NO, KC_NO, k46, KC_NO }, \
62 { k50, k51, k52, k53, k54, KC_NO, k56, k57 }, \ 84 { k50, k51, k52, k53, k54, k55, KC_NO, k57 }, \
63 { k60, k61, k62, k63, k64, k65, KC_NO, k67 }, \ 85 { k60, k61, k62, k63, k64, k65, KC_NO, k67 }, \
64 { k70, k71, k72, k73, KC_NO, k75, KC_NO, KC_NO }, \ 86 { k70, k71, k72, k73, KC_NO, k75, KC_NO, KC_NO }, \
65 { k80, k81, k82, k83, KC_NO, k85, k86, KC_NO }, \ 87 { k80, k81, k82, k83, KC_NO, k85, k86, KC_NO }, \
66 { KC_NO, KC_NO, k92, k93, k94, k95, k96, k97 } \ 88 { KC_NO, KC_NO, k92, k93, k94, k95, k96, k97 } \
67} 89}
diff --git a/keyboards/clueboard/66_hotswap/gen1/halconf.h b/keyboards/clueboard/66_hotswap/gen1/halconf.h
new file mode 100644
index 000000000..eda293c49
--- /dev/null
+++ b/keyboards/clueboard/66_hotswap/gen1/halconf.h
@@ -0,0 +1,388 @@
1/*
2 ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file templates/halconf.h
19 * @brief HAL configuration header.
20 * @details HAL configuration file, this file allows to enable or disable the
21 * various device drivers from your application. You may also use
22 * this file in order to override the device drivers default settings.
23 *
24 * @addtogroup HAL_CONF
25 * @{
26 */
27
28#ifndef HALCONF_H
29#define HALCONF_H
30
31#include "mcuconf.h"
32
33/**
34 * @brief Enables the PAL subsystem.
35 */
36#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
37#define HAL_USE_PAL TRUE
38#endif
39
40/**
41 * @brief Enables the ADC subsystem.
42 */
43#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
44#define HAL_USE_ADC FALSE
45#endif
46
47/**
48 * @brief Enables the CAN subsystem.
49 */
50#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
51#define HAL_USE_CAN FALSE
52#endif
53
54/**
55 * @brief Enables the DAC subsystem.
56 */
57#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
58#define HAL_USE_DAC TRUE
59#endif
60
61/**
62 * @brief Enables the EXT subsystem.
63 */
64#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
65#define HAL_USE_EXT FALSE
66#endif
67
68/**
69 * @brief Enables the GPT subsystem.
70 */
71#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
72#define HAL_USE_GPT TRUE
73#endif
74
75/**
76 * @brief Enables the I2C subsystem.
77 */
78#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
79#define HAL_USE_I2C TRUE
80#endif
81
82/**
83 * @brief Enables the I2S subsystem.
84 */
85#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
86#define HAL_USE_I2S FALSE
87#endif
88
89/**
90 * @brief Enables the ICU subsystem.
91 */
92#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
93#define HAL_USE_ICU FALSE
94#endif
95
96/**
97 * @brief Enables the MAC subsystem.
98 */
99#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
100#define HAL_USE_MAC FALSE
101#endif
102
103/**
104 * @brief Enables the MMC_SPI subsystem.
105 */
106#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
107#define HAL_USE_MMC_SPI FALSE
108#endif
109
110/**
111 * @brief Enables the PWM subsystem.
112 */
113#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
114#define HAL_USE_PWM FALSE
115#endif
116
117/**
118 * @brief Enables the QSPI subsystem.
119 */
120#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__)
121#define HAL_USE_QSPI FALSE
122#endif
123
124/**
125 * @brief Enables the RTC subsystem.
126 */
127#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
128#define HAL_USE_RTC FALSE
129#endif
130
131/**
132 * @brief Enables the SDC subsystem.
133 */
134#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
135#define HAL_USE_SDC FALSE
136#endif
137
138/**
139 * @brief Enables the SERIAL subsystem.
140 */
141#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
142#define HAL_USE_SERIAL FALSE
143#endif
144
145/**
146 * @brief Enables the SERIAL over USB subsystem.
147 */
148#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
149#define HAL_USE_SERIAL_USB FALSE
150#endif
151
152/**
153 * @brief Enables the SPI subsystem.
154 */
155#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
156#define HAL_USE_SPI FALSE
157#endif
158
159/**
160 * @brief Enables the UART subsystem.
161 */
162#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
163#define HAL_USE_UART FALSE
164#endif
165
166/**
167 * @brief Enables the USB subsystem.
168 */
169#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
170#define HAL_USE_USB TRUE
171#endif
172
173/**
174 * @brief Enables the WDG subsystem.
175 */
176#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
177#define HAL_USE_WDG FALSE
178#endif
179
180/*===========================================================================*/
181/* ADC driver related settings. */
182/*===========================================================================*/
183
184/**
185 * @brief Enables synchronous APIs.
186 * @note Disabling this option saves both code and data space.
187 */
188#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
189#define ADC_USE_WAIT TRUE
190#endif
191
192/**
193 * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
194 * @note Disabling this option saves both code and data space.
195 */
196#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
197#define ADC_USE_MUTUAL_EXCLUSION TRUE
198#endif
199
200/*===========================================================================*/
201/* CAN driver related settings. */
202/*===========================================================================*/
203
204/**
205 * @brief Sleep mode related APIs inclusion switch.
206 */
207#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
208#define CAN_USE_SLEEP_MODE TRUE
209#endif
210
211/*===========================================================================*/
212/* I2C driver related settings. */
213/*===========================================================================*/
214
215/**
216 * @brief Enables the mutual exclusion APIs on the I2C bus.
217 */
218#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
219#define I2C_USE_MUTUAL_EXCLUSION TRUE
220#endif
221
222/*===========================================================================*/
223/* MAC driver related settings. */
224/*===========================================================================*/
225
226/**
227 * @brief Enables an event sources for incoming packets.
228 */
229#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
230#define MAC_USE_ZERO_COPY FALSE
231#endif
232
233/**
234 * @brief Enables an event sources for incoming packets.
235 */
236#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
237#define MAC_USE_EVENTS TRUE
238#endif
239
240/*===========================================================================*/
241/* MMC_SPI driver related settings. */
242/*===========================================================================*/
243
244/**
245 * @brief Delays insertions.
246 * @details If enabled this options inserts delays into the MMC waiting
247 * routines releasing some extra CPU time for the threads with
248 * lower priority, this may slow down the driver a bit however.
249 * This option is recommended also if the SPI driver does not
250 * use a DMA channel and heavily loads the CPU.
251 */
252#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
253#define MMC_NICE_WAITING TRUE
254#endif
255
256/*===========================================================================*/
257/* SDC driver related settings. */
258/*===========================================================================*/
259
260/**
261 * @brief Number of initialization attempts before rejecting the card.
262 * @note Attempts are performed at 10mS intervals.
263 */
264#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
265#define SDC_INIT_RETRY 100
266#endif
267
268/**
269 * @brief Include support for MMC cards.
270 * @note MMC support is not yet implemented so this option must be kept
271 * at @p FALSE.
272 */
273#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
274#define SDC_MMC_SUPPORT FALSE
275#endif
276
277/**
278 * @brief Delays insertions.
279 * @details If enabled this options inserts delays into the MMC waiting
280 * routines releasing some extra CPU time for the threads with
281 * lower priority, this may slow down the driver a bit however.
282 */
283#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
284#define SDC_NICE_WAITING TRUE
285#endif
286
287/*===========================================================================*/
288/* SERIAL driver related settings. */
289/*===========================================================================*/
290
291/**
292 * @brief Default bit rate.
293 * @details Configuration parameter, this is the baud rate selected for the
294 * default configuration.
295 */
296#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
297#define SERIAL_DEFAULT_BITRATE 38400
298#endif
299
300/**
301 * @brief Serial buffers size.
302 * @details Configuration parameter, you can change the depth of the queue
303 * buffers depending on the requirements of your application.
304 * @note The default is 16 bytes for both the transmission and receive
305 * buffers.
306 */
307#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
308#define SERIAL_BUFFERS_SIZE 16
309#endif
310
311/*===========================================================================*/
312/* SERIAL_USB driver related setting. */
313/*===========================================================================*/
314
315/**
316 * @brief Serial over USB buffers size.
317 * @details Configuration parameter, the buffer size must be a multiple of
318 * the USB data endpoint maximum packet size.
319 * @note The default is 256 bytes for both the transmission and receive
320 * buffers.
321 */
322#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
323#define SERIAL_USB_BUFFERS_SIZE 1
324#endif
325
326/**
327 * @brief Serial over USB number of buffers.
328 * @note The default is 2 buffers.
329 */
330#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__)
331#define SERIAL_USB_BUFFERS_NUMBER 2
332#endif
333
334/*===========================================================================*/
335/* SPI driver related settings. */
336/*===========================================================================*/
337
338/**
339 * @brief Enables synchronous APIs.
340 * @note Disabling this option saves both code and data space.
341 */
342#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
343#define SPI_USE_WAIT TRUE
344#endif
345
346/**
347 * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
348 * @note Disabling this option saves both code and data space.
349 */
350#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
351#define SPI_USE_MUTUAL_EXCLUSION TRUE
352#endif
353
354/*===========================================================================*/
355/* UART driver related settings. */
356/*===========================================================================*/
357
358/**
359 * @brief Enables synchronous APIs.
360 * @note Disabling this option saves both code and data space.
361 */
362#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__)
363#define UART_USE_WAIT FALSE
364#endif
365
366/**
367 * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs.
368 * @note Disabling this option saves both code and data space.
369 */
370#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
371#define UART_USE_MUTUAL_EXCLUSION FALSE
372#endif
373
374/*===========================================================================*/
375/* USB driver related settings. */
376/*===========================================================================*/
377
378/**
379 * @brief Enables synchronous APIs.
380 * @note Disabling this option saves both code and data space.
381 */
382#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
383#define USB_USE_WAIT TRUE
384#endif
385
386#endif /* HALCONF_H */
387
388/** @} */
diff --git a/keyboards/clueboard/66_hotswap/gen1/info.json b/keyboards/clueboard/66_hotswap/gen1/info.json
new file mode 100644
index 000000000..bab110f3d
--- /dev/null
+++ b/keyboards/clueboard/66_hotswap/gen1/info.json
@@ -0,0 +1,11 @@
1{
2 "layouts": {
3 "LAYOUT": {
4 "layout": [{"x": 0, "y": 0, "w": 1, "label": "GRAVE"}, {"x": 1, "y": 0, "w": 1, "label": "1"}, {"x": 2, "y": 0, "w": 1, "label": "2"}, {"x": 3, "y": 0, "w": 1, "label": "3"}, {"x": 4, "y": 0, "w": 1, "label": "4"}, {"x": 5, "y": 0, "w": 1, "label": "5"}, {"x": 6, "y": 0, "w": 1, "label": "6"}, {"x": 7, "y": 0, "w": 1, "label": "7"}, {"x": 8, "y": 0, "w": 1, "label": "8"}, {"x": 9, "y": 0, "w": 1, "label": "9"}, {"x": 10, "y": 0, "w": 1, "label": "0"}, {"x": 11, "y": 0, "w": 1, "label": "DASH"}, {"x": 12, "y": 0, "w": 1, "label": "EQUALSIGN"}, {"x": 13, "y": 0, "w": 1, "label": "YEN"}, {"x": 14, "y": 0, "w": 1, "label": "BACKSPACE"}, {"x": 15.5, "y": 0, "w": 1, "label": "PAGEUP"}, {"x": 0, "y": 1, "w": 1.5, "label": "TAB"}, {"x": 1.5, "y": 1, "w": 1, "label": "Q"}, {"x": 2.5, "y": 1, "w": 1, "label": "W"}, {"x": 3.5, "y": 1, "w": 1, "label": "E"}, {"x": 4.5, "y": 1, "w": 1, "label": "R"}, {"x": 5.5, "y": 1, "w": 1, "label": "T"}, {"x": 6.5, "y": 1, "w": 1, "label": "Y"}, {"x": 7.5, "y": 1, "w": 1, "label": "U"}, {"x": 8.5, "y": 1, "w": 1, "label": "I"}, {"x": 9.5, "y": 1, "w": 1, "label": "O"}, {"x": 10.5, "y": 1, "w": 1, "label": "P"}, {"x": 11.5, "y": 1, "w": 1, "label": "LBRACKET"}, {"x": 12.5, "y": 1, "w": 1, "label": "RBRACKET"}, {"x": 13.5, "y": 1, "w": 1.5, "label": "BACKSLASH"}, {"x": 15.5, "y": 1, "w": 1, "label": "PAGEDOWN"}, {"x": 0, "y": 2, "w": 1.75, "label": "CAPSLOCK"}, {"x": 1.75, "y": 2, "w": 1, "label": "A"}, {"x": 2.75, "y": 2, "w": 1, "label": "S"}, {"x": 3.75, "y": 2, "w": 1, "label": "D"}, {"x": 4.75, "y": 2, "w": 1, "label": "F"}, {"x": 5.75, "y": 2, "w": 1, "label": "G"}, {"x": 6.75, "y": 2, "w": 1, "label": "H"}, {"x": 7.75, "y": 2, "w": 1, "label": "J"}, {"x": 8.75, "y": 2, "w": 1, "label": "K"}, {"x": 9.75, "y": 2, "w": 1, "label": "L"}, {"x": 10.75, "y": 2, "w": 1, "label": "SEMICOLON"}, {"x": 11.75, "y": 2, "w": 1, "label": "QUOTE"}, {"x": 13.75, "y": 2, "w": 1.25, "label": "ENTER"}, {"x": 0, "y": 3, "w": 1.25, "label": "LSHIFT"}, {"x": 2.25, "y": 3, "w": 1, "label": "Z"}, {"x": 3.25, "y": 3, "w": 1, "label": "X"}, {"x": 4.25, "y": 3, "w": 1, "label": "C"}, {"x": 5.25, "y": 3, "w": 1, "label": "V"}, {"x": 6.25, "y": 3, "w": 1, "label": "B"}, {"x": 7.25, "y": 3, "w": 1, "label": "N"}, {"x": 8.25, "y": 3, "w": 1, "label": "M"}, {"x": 9.25, "y": 3, "w": 1, "label": "COMMA"}, {"x": 10.25, "y": 3, "w": 1, "label": "PERIOD"}, {"x": 11.25, "y": 3, "w": 1, "label": "SLASH"}, {"x": 13.25, "y": 3, "w": 1.25, "label": "RSHIFT"}, {"x": 14.5, "y": 3, "w": 1, "label": "UP"}, {"x": 0, "y": 4, "w": 1.25, "label": "LCTRL"}, {"x": 1.25, "y": 4, "w": 1, "label": "LALT"}, {"x": 2.25, "y": 4, "w": 1.25, "label": "LCMD"}, {"x": 3.5, "y": 4, "w": 1.25, "label": "MUHENKAN"}, {"x": 4.75, "y": 4, "w": 2, "label": "SPACE1"}, {"x": 6.75, "y": 4, "w": 2, "label": "SPACE2"}, {"x": 8.75, "y": 4, "w": 1.25, "label": "HENKAN"}, {"x": 10, "y": 4, "w": 1.25, "label": "RCMD"}, {"x": 11.25, "y": 4, "w": 1, "label": "RCTRL"}, {"x": 12.25, "y": 4, "w": 1.25, "label": "FN"}, {"x": 13.5, "y": 4, "w": 1, "label": "LEFT"}, {"x": 14.5, "y": 4, "w": 1, "label": "DOWN"}, {"x": 15.5, "y": 4, "w": 1, "label": "RIGHT"}]
5 },
6
7 "LAYOUT_66_ansi": {
8 "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.5, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.25}, {"x":14.5, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4}, {"label":"Menu", "x":12.25, "y":4, "w":1.25}, {"x":13.5, "y":4}, {"x":14.5, "y":4}, {"x":15.5, "y":4}]
9 }
10 }
11}
diff --git a/keyboards/clueboard/66_hotswap/gen1/led.c b/keyboards/clueboard/66_hotswap/gen1/led.c
new file mode 100644
index 000000000..efbf53202
--- /dev/null
+++ b/keyboards/clueboard/66_hotswap/gen1/led.c
@@ -0,0 +1,21 @@
1/*
2 * Copyright 2017 skully <skullydazed@gmail.com>
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
18#include "hal.h"
19#include "backlight.h"
20#include "led.h"
21#include "printf.h"
diff --git a/keyboards/clueboard/66_hotswap/gen1/matrix.c b/keyboards/clueboard/66_hotswap/gen1/matrix.c
new file mode 100644
index 000000000..c3e59b564
--- /dev/null
+++ b/keyboards/clueboard/66_hotswap/gen1/matrix.c
@@ -0,0 +1,160 @@
1#include <stdint.h>
2#include <stdbool.h>
3#include <string.h>
4#include "hal.h"
5#include "timer.h"
6#include "wait.h"
7#include "printf.h"
8#include "backlight.h"
9#include "matrix.h"
10#include "action.h"
11#include "keycode.h"
12#include <string.h>
13
14/*
15 * #define MATRIX_ROW_PINS { PB11, PA6, PA3, PA2, PA1, PB5, PB6, PC15, PC14, PC13 }
16 * #define MATRIX_COL_PINS { PB10, PB2, PB1, PB0, PA7, PB4, PB3, PB7 }
17 */
18/* matrix state(1:on, 0:off) */
19static matrix_row_t matrix[MATRIX_ROWS];
20static matrix_row_t matrix_debouncing[MATRIX_COLS];
21static bool debouncing = false;
22static uint16_t debouncing_time = 0;
23
24__attribute__ ((weak))
25void matrix_init_user(void) {}
26
27__attribute__ ((weak))
28void matrix_scan_user(void) {}
29
30__attribute__ ((weak))
31void matrix_init_kb(void) {
32 matrix_init_user();
33}
34
35__attribute__ ((weak))
36void matrix_scan_kb(void) {
37 matrix_scan_user();
38}
39
40void matrix_init(void) {
41 printf("matrix init\n");
42 //debug_matrix = true;
43
44 // actual matrix setup
45 palSetPadMode(GPIOB, 10, PAL_MODE_OUTPUT_PUSHPULL);
46 palSetPadMode(GPIOB, 2, PAL_MODE_OUTPUT_PUSHPULL);
47 palSetPadMode(GPIOB, 1, PAL_MODE_OUTPUT_PUSHPULL);
48 palSetPadMode(GPIOB, 0, PAL_MODE_OUTPUT_PUSHPULL);
49 palSetPadMode(GPIOA, 7, PAL_MODE_OUTPUT_PUSHPULL);
50 palSetPadMode(GPIOB, 4, PAL_MODE_OUTPUT_PUSHPULL);
51 palSetPadMode(GPIOB, 3, PAL_MODE_OUTPUT_PUSHPULL);
52 palSetPadMode(GPIOB, 7, PAL_MODE_OUTPUT_PUSHPULL);
53
54 palSetPadMode(GPIOB, 11, PAL_MODE_INPUT_PULLDOWN);
55 palSetPadMode(GPIOA, 6, PAL_MODE_INPUT_PULLDOWN);
56 palSetPadMode(GPIOA, 3, PAL_MODE_INPUT_PULLDOWN);
57 palSetPadMode(GPIOA, 2, PAL_MODE_INPUT_PULLDOWN);
58 palSetPadMode(GPIOA, 1, PAL_MODE_INPUT_PULLDOWN);
59 palSetPadMode(GPIOB, 5, PAL_MODE_INPUT_PULLDOWN);
60 palSetPadMode(GPIOB, 6, PAL_MODE_INPUT_PULLDOWN);
61 palSetPadMode(GPIOC, 15, PAL_MODE_INPUT_PULLDOWN);
62 palSetPadMode(GPIOC, 14, PAL_MODE_INPUT_PULLDOWN);
63 palSetPadMode(GPIOC, 13, PAL_MODE_INPUT_PULLDOWN);
64
65 memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t));
66 memset(matrix_debouncing, 0, MATRIX_COLS * sizeof(matrix_row_t));
67
68 matrix_init_quantum();
69}
70
71uint8_t matrix_scan(void) {
72 // actual matrix
73 for (int col = 0; col < MATRIX_COLS; col++) {
74 matrix_row_t data = 0;
75
76 // strobe col { PB10, PB2, PB1, PB0, PA7, PB4, PB3, PB7 }
77 switch (col) {
78 case 0: palSetPad(GPIOB, 10); break;
79 case 1: palSetPad(GPIOB, 2); break;
80 case 2: palSetPad(GPIOB, 1); break;
81 case 3: palSetPad(GPIOB, 0); break;
82 case 4: palSetPad(GPIOA, 7); break;
83 case 5: palSetPad(GPIOB, 4); break;
84 case 6: palSetPad(GPIOB, 3); break;
85 case 7: palSetPad(GPIOB, 7); break;
86 }
87
88 // need wait to settle pin state
89 wait_us(20);
90
91 // read row data { PB11, PA6, PA3, PA2, PA1, PB5, PB6, PC15, PC14, PC13 }
92 data = (
93 (palReadPad(GPIOB, 11) << 0 ) |
94 (palReadPad(GPIOA, 6) << 1 ) |
95 (palReadPad(GPIOA, 3) << 2 ) |
96 (palReadPad(GPIOA, 2) << 3 ) |
97 (palReadPad(GPIOA, 1) << 4 ) |
98 (palReadPad(GPIOB, 5) << 5 ) |
99 (palReadPad(GPIOB, 6) << 6 ) |
100 (palReadPad(GPIOC, 15) << 7 ) |
101 (palReadPad(GPIOC, 14) << 8 ) |
102 (palReadPad(GPIOC, 13) << 9 )
103 );
104
105 // unstrobe col { B11, B10, B2, B1, A7, B0 }
106 switch (col) {
107 case 0: palClearPad(GPIOB, 10); break;
108 case 1: palClearPad(GPIOB, 2); break;
109 case 2: palClearPad(GPIOB, 1); break;
110 case 3: palClearPad(GPIOB, 0); break;
111 case 4: palClearPad(GPIOA, 7); break;
112 case 5: palClearPad(GPIOB, 4); break;
113 case 6: palClearPad(GPIOB, 3); break;
114 case 7: palClearPad(GPIOB, 7); break;
115 }
116
117 if (matrix_debouncing[col] != data) {
118 matrix_debouncing[col] = data;
119 debouncing = true;
120 debouncing_time = timer_read();
121 }
122 }
123
124 if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) {
125 for (int row = 0; row < MATRIX_ROWS; row++) {
126 matrix[row] = 0;
127 for (int col = 0; col < MATRIX_COLS; col++) {
128 matrix[row] |= ((matrix_debouncing[col] & (1 << row) ? 1 : 0) << col);
129 }
130 }
131 debouncing = false;
132 }
133
134 matrix_scan_quantum();
135
136 return 1;
137}
138
139bool matrix_is_on(uint8_t row, uint8_t col) {
140 return (matrix[row] & (1<<col));
141}
142
143matrix_row_t matrix_get_row(uint16_t row) {
144 return matrix[row];
145}
146
147void matrix_print(void) {
148 printf("\nr/c 01234567\n");
149 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
150 printf("%X0: ", row);
151 matrix_row_t data = matrix_get_row(row);
152 for (int col = 0; col < MATRIX_COLS; col++) {
153 if (data & (1<<col))
154 printf("1");
155 else
156 printf("0");
157 }
158 printf("\n");
159 }
160}
diff --git a/keyboards/clueboard/66_hotswap/gen1/mcuconf.h b/keyboards/clueboard/66_hotswap/gen1/mcuconf.h
new file mode 100644
index 000000000..226da48d5
--- /dev/null
+++ b/keyboards/clueboard/66_hotswap/gen1/mcuconf.h
@@ -0,0 +1,257 @@
1/*
2 ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17#ifndef MCUCONF_H
18#define MCUCONF_H
19
20/*
21 * STM32F3xx drivers configuration.
22 * The following settings override the default settings present in
23 * the various device driver implementation headers.
24 * Note that the settings for each driver only have effect if the whole
25 * driver is enabled in halconf.h.
26 *
27 * IRQ priorities:
28 * 15...0 Lowest...Highest.
29 *
30 * DMA priorities:
31 * 0...3 Lowest...Highest.
32 */
33
34#define STM32F3xx_MCUCONF
35
36/*
37 * HAL driver system settings.
38 */
39#define STM32_NO_INIT FALSE
40#define STM32_PVD_ENABLE FALSE
41#define STM32_PLS STM32_PLS_LEV0
42#define STM32_HSI_ENABLED TRUE
43#define STM32_LSI_ENABLED TRUE
44#define STM32_HSE_ENABLED TRUE
45#define STM32_LSE_ENABLED FALSE
46#define STM32_SW STM32_SW_PLL
47#define STM32_PLLSRC STM32_PLLSRC_HSE
48#define STM32_PREDIV_VALUE 1
49#define STM32_PLLMUL_VALUE 9
50#define STM32_HPRE STM32_HPRE_DIV1
51#define STM32_PPRE1 STM32_PPRE1_DIV2
52#define STM32_PPRE2 STM32_PPRE2_DIV2
53#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
54#define STM32_ADC12PRES STM32_ADC12PRES_DIV1
55#define STM32_ADC34PRES STM32_ADC34PRES_DIV1
56#define STM32_USART1SW STM32_USART1SW_PCLK
57#define STM32_USART2SW STM32_USART2SW_PCLK
58#define STM32_USART3SW STM32_USART3SW_PCLK
59#define STM32_UART4SW STM32_UART4SW_PCLK
60#define STM32_UART5SW STM32_UART5SW_PCLK
61#define STM32_I2C1SW STM32_I2C1SW_SYSCLK
62#define STM32_I2C2SW STM32_I2C2SW_SYSCLK
63#define STM32_TIM1SW STM32_TIM1SW_PCLK2
64#define STM32_TIM8SW STM32_TIM8SW_PCLK2
65#define STM32_RTCSEL STM32_RTCSEL_LSI
66#define STM32_USB_CLOCK_REQUIRED TRUE
67#define STM32_USBPRE STM32_USBPRE_DIV1P5
68
69#undef STM32_HSE_BYPASS
70// #error "oh no"
71// #endif
72
73/*
74 * ADC driver system settings.
75 */
76#define STM32_ADC_DUAL_MODE FALSE
77#define STM32_ADC_COMPACT_SAMPLES FALSE
78#define STM32_ADC_USE_ADC1 FALSE
79#define STM32_ADC_USE_ADC2 FALSE
80#define STM32_ADC_USE_ADC3 FALSE
81#define STM32_ADC_USE_ADC4 FALSE
82#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1)
83#define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 1)
84#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 5)
85#define STM32_ADC_ADC4_DMA_STREAM STM32_DMA_STREAM_ID(2, 2)
86#define STM32_ADC_ADC1_DMA_PRIORITY 2
87#define STM32_ADC_ADC2_DMA_PRIORITY 2
88#define STM32_ADC_ADC3_DMA_PRIORITY 2
89#define STM32_ADC_ADC4_DMA_PRIORITY 2
90#define STM32_ADC_ADC12_IRQ_PRIORITY 5
91#define STM32_ADC_ADC3_IRQ_PRIORITY 5
92#define STM32_ADC_ADC4_IRQ_PRIORITY 5
93#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 5
94#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 5
95#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 5
96#define STM32_ADC_ADC4_DMA_IRQ_PRIORITY 5
97#define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1
98#define STM32_ADC_ADC34_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1
99
100/*
101 * CAN driver system settings.
102 */
103#define STM32_CAN_USE_CAN1 FALSE
104#define STM32_CAN_CAN1_IRQ_PRIORITY 11
105
106/*
107 * DAC driver system settings.
108 */
109#define STM32_DAC_DUAL_MODE FALSE
110#define STM32_DAC_USE_DAC1_CH1 TRUE
111#define STM32_DAC_USE_DAC1_CH2 TRUE
112#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10
113#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10
114#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2
115#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2
116
117/*
118 * EXT driver system settings.
119 */
120#define STM32_EXT_EXTI0_IRQ_PRIORITY 6
121#define STM32_EXT_EXTI1_IRQ_PRIORITY 6
122#define STM32_EXT_EXTI2_IRQ_PRIORITY 6
123#define STM32_EXT_EXTI3_IRQ_PRIORITY 6
124#define STM32_EXT_EXTI4_IRQ_PRIORITY 6
125#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6
126#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6
127#define STM32_EXT_EXTI16_IRQ_PRIORITY 6
128#define STM32_EXT_EXTI17_IRQ_PRIORITY 6
129#define STM32_EXT_EXTI18_IRQ_PRIORITY 6
130#define STM32_EXT_EXTI19_IRQ_PRIORITY 6
131#define STM32_EXT_EXTI20_IRQ_PRIORITY 6
132#define STM32_EXT_EXTI21_22_29_IRQ_PRIORITY 6
133#define STM32_EXT_EXTI30_32_IRQ_PRIORITY 6
134#define STM32_EXT_EXTI33_IRQ_PRIORITY 6
135
136/*
137 * GPT driver system settings.
138 */
139#define STM32_GPT_USE_TIM1 FALSE
140#define STM32_GPT_USE_TIM2 FALSE
141#define STM32_GPT_USE_TIM3 FALSE
142#define STM32_GPT_USE_TIM4 FALSE
143#define STM32_GPT_USE_TIM6 TRUE
144#define STM32_GPT_USE_TIM7 TRUE
145#define STM32_GPT_USE_TIM8 TRUE
146#define STM32_GPT_TIM1_IRQ_PRIORITY 7
147#define STM32_GPT_TIM2_IRQ_PRIORITY 7
148#define STM32_GPT_TIM3_IRQ_PRIORITY 7
149#define STM32_GPT_TIM4_IRQ_PRIORITY 7
150#define STM32_GPT_TIM6_IRQ_PRIORITY 7
151#define STM32_GPT_TIM7_IRQ_PRIORITY 7
152#define STM32_GPT_TIM8_IRQ_PRIORITY 7
153
154/*
155 * I2C driver system settings.
156 */
157#define STM32_I2C_USE_I2C1 TRUE
158#define STM32_I2C_USE_I2C2 FALSE
159#define STM32_I2C_BUSY_TIMEOUT 50
160#define STM32_I2C_I2C1_IRQ_PRIORITY 10
161#define STM32_I2C_I2C2_IRQ_PRIORITY 10
162#define STM32_I2C_USE_DMA TRUE
163#define STM32_I2C_I2C1_DMA_PRIORITY 1
164#define STM32_I2C_I2C2_DMA_PRIORITY 1
165#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure")
166
167/*
168 * ICU driver system settings.
169 */
170#define STM32_ICU_USE_TIM1 FALSE
171#define STM32_ICU_USE_TIM2 FALSE
172#define STM32_ICU_USE_TIM3 FALSE
173#define STM32_ICU_USE_TIM4 FALSE
174#define STM32_ICU_USE_TIM8 FALSE
175#define STM32_ICU_TIM1_IRQ_PRIORITY 7
176#define STM32_ICU_TIM2_IRQ_PRIORITY 7
177#define STM32_ICU_TIM3_IRQ_PRIORITY 7
178#define STM32_ICU_TIM4_IRQ_PRIORITY 7
179#define STM32_ICU_TIM8_IRQ_PRIORITY 7
180
181/*
182 * PWM driver system settings.
183 */
184#define STM32_PWM_USE_ADVANCED FALSE
185#define STM32_PWM_USE_TIM1 FALSE
186#define STM32_PWM_USE_TIM2 FALSE
187#define STM32_PWM_USE_TIM3 FALSE
188#define STM32_PWM_USE_TIM4 FALSE
189#define STM32_PWM_USE_TIM8 FALSE
190#define STM32_PWM_TIM1_IRQ_PRIORITY 7
191#define STM32_PWM_TIM2_IRQ_PRIORITY 7
192#define STM32_PWM_TIM3_IRQ_PRIORITY 7
193#define STM32_PWM_TIM4_IRQ_PRIORITY 7
194#define STM32_PWM_TIM8_IRQ_PRIORITY 7
195
196/*
197 * SERIAL driver system settings.
198 */
199#define STM32_SERIAL_USE_USART1 FALSE
200#define STM32_SERIAL_USE_USART2 FALSE
201#define STM32_SERIAL_USE_USART3 FALSE
202#define STM32_SERIAL_USE_UART4 FALSE
203#define STM32_SERIAL_USE_UART5 FALSE
204#define STM32_SERIAL_USART1_PRIORITY 12
205#define STM32_SERIAL_USART2_PRIORITY 12
206#define STM32_SERIAL_USART3_PRIORITY 12
207#define STM32_SERIAL_UART4_PRIORITY 12
208#define STM32_SERIAL_UART5_PRIORITY 12
209
210/*
211 * SPI driver system settings.
212 */
213#define STM32_SPI_USE_SPI1 FALSE
214#define STM32_SPI_USE_SPI2 FALSE
215#define STM32_SPI_USE_SPI3 FALSE
216#define STM32_SPI_SPI1_DMA_PRIORITY 1
217#define STM32_SPI_SPI2_DMA_PRIORITY 1
218#define STM32_SPI_SPI3_DMA_PRIORITY 1
219#define STM32_SPI_SPI1_IRQ_PRIORITY 10
220#define STM32_SPI_SPI2_IRQ_PRIORITY 10
221#define STM32_SPI_SPI3_IRQ_PRIORITY 10
222#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
223
224/*
225 * ST driver system settings.
226 */
227#define STM32_ST_IRQ_PRIORITY 8
228#define STM32_ST_USE_TIMER 2
229
230/*
231 * UART driver system settings.
232 */
233#define STM32_UART_USE_USART1 FALSE
234#define STM32_UART_USE_USART2 FALSE
235#define STM32_UART_USE_USART3 FALSE
236#define STM32_UART_USART1_IRQ_PRIORITY 12
237#define STM32_UART_USART2_IRQ_PRIORITY 12
238#define STM32_UART_USART3_IRQ_PRIORITY 12
239#define STM32_UART_USART1_DMA_PRIORITY 0
240#define STM32_UART_USART2_DMA_PRIORITY 0
241#define STM32_UART_USART3_DMA_PRIORITY 0
242#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
243
244/*
245 * USB driver system settings.
246 */
247#define STM32_USB_USE_USB1 TRUE
248#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE
249#define STM32_USB_USB1_HP_IRQ_PRIORITY 13
250#define STM32_USB_USB1_LP_IRQ_PRIORITY 14
251
252/*
253 * WDG driver system settings.
254 */
255#define STM32_WDG_USE_IWDG FALSE
256
257#endif /* MCUCONF_H */
diff --git a/keyboards/clueboard/66_hotswap/gen1/rules.mk b/keyboards/clueboard/66_hotswap/gen1/rules.mk
index 887592b37..6b1ee92c1 100644
--- a/keyboards/clueboard/66_hotswap/gen1/rules.mk
+++ b/keyboards/clueboard/66_hotswap/gen1/rules.mk
@@ -1,24 +1,58 @@
1EXTRAFLAGS += -flto 1# project specific files
2LAYOUTS = 66_ansi 2SRC = led.c
3MCU = atmega32u4 3LAYOUTS += 66_ansi
4F_CPU = 16000000 4
5ARCH = AVR8 5## chip/board settings
6F_USB = $(F_CPU) 6# - the next two should match the directories in
7OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT 7# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
8OPT_DEFS += -DBOOTLOADER_SIZE=4096 8MCU_FAMILY = STM32
9MCU_SERIES = STM32F3xx
10
11# Linker script to use
12# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
13# or <this_dir>/ld/
14MCU_LDSCRIPT = STM32F303xC
15
16# Startup code to use
17# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
18MCU_STARTUP = stm32f3xx
19
20# Board: it should exist either in <chibios>/os/hal/boards/
21# or <this_dir>/boards
22BOARD = GENERIC_STM32_F303XC
23
24# Cortex version
25MCU = cortex-m4
26
27# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
28ARMV = 7
29
30USE_FPU = yes
31
32# Vector table for application
33# 0x00000000-0x00001000 area is occupied by bootlaoder.*/
34# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB
35# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000
36OPT_DEFS =
37
38# Options to pass to dfu-util when flashing
39DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave
40
41# LED Configuration
42LED_MATRIX_ENABLE = IS31FL3731
9 43
10# Build Options 44# Build Options
11# comment out to disable the options. 45# comment out to disable the options.
12# 46#
13BACKLIGHT_ENABLE = yes 47BACKLIGHT_ENABLE = yes
14BOOTMAGIC_ENABLE = no 48BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
15MOUSEKEY_ENABLE = no 49## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
16EXTRAKEY_ENABLE = yes 50MOUSEKEY_ENABLE = yes # Mouse keys
17CONSOLE_ENABLE = yes 51EXTRAKEY_ENABLE = yes # Audio control and System control
18COMMAND_ENABLE = no 52CONSOLE_ENABLE = yes # Console for debug
19NKRO_ENABLE = yes 53COMMAND_ENABLE = yes # Commands for debug and configuration
54#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
55NKRO_ENABLE = yes # USB Nkey Rollover
56#CUSTOM_MATRIX = yes # Custom matrix file
20AUDIO_ENABLE = yes 57AUDIO_ENABLE = yes
21RGBLIGHT_ENABLE = yes 58# SERIAL_LINK_ENABLE = yes
22MIDI_ENABLE = no
23UNICODE_ENABLE = no
24BLUETOOTH_ENABLE = no
diff --git a/keyboards/clueboard/66_hotswap/keymaps/default/keymap.c b/keyboards/clueboard/66_hotswap/keymaps/default/keymap.c
index 94f2ec0c4..6451cf037 100644
--- a/keyboards/clueboard/66_hotswap/keymaps/default/keymap.c
+++ b/keyboards/clueboard/66_hotswap/keymaps/default/keymap.c
@@ -6,6 +6,30 @@
6#define _FL 1 6#define _FL 1
7#define _CL 2 7#define _CL 2
8 8
9enum custom_keycodes {
10 S_BSKTC = SAFE_RANGE,
11 S_ODEJY,
12 S_RCKBY,
13 S_DOEDR,
14 S_SCALE,
15 S_ONEUP,
16 S_COIN,
17 S_SONIC,
18 S_ZELDA
19};
20
21#ifdef AUDIO_ENABLE
22 float song_basketcase[][2] = SONG(BASKET_CASE);
23 float song_ode_to_joy[][2] = SONG(ODE_TO_JOY);
24 float song_rock_a_bye_baby[][2] = SONG(ROCK_A_BYE_BABY);
25 float song_doe_a_deer[][2] = SONG(DOE_A_DEER);
26 float song_scale[][2] = SONG(MUSIC_SCALE_SOUND);
27 float song_coin[][2] = SONG(COIN_SOUND);
28 float song_one_up[][2] = SONG(ONE_UP_SOUND);
29 float song_sonic_ring[][2] = SONG(SONIC_RING);
30 float song_zelda_puzzle[][2] = SONG(ZELDA_PUZZLE);
31#endif
32
9const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 33const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
10 /* Keymap _BL: Base Layer (Default Layer) 34 /* Keymap _BL: Base Layer (Default Layer)
11 */ 35 */
@@ -28,9 +52,72 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
28 /* Keymap _CL: Control layer 52 /* Keymap _CL: Control layer
29 */ 53 */
30[_CL] = LAYOUT( 54[_CL] = LAYOUT(
31 BL_STEP,RGB_M_P,RGB_M_B,RGB_M_R,RGB_M_SW,RGB_M_SN,RGB_M_K,RGB_M_X,RGB_M_G,_______,_______,_______,_______, RGB_TOG, RGB_VAI, \ 55 BL_STEP,S_ONEUP,S_SCALE,RGB_M_R,RGB_M_SW,RGB_M_SN,RGB_M_K,RGB_M_X,RGB_M_G,_______,_______,_______,_______, BL_TOGG, BL_INC, \
32 _______,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_VAD, \ 56 _______,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, BL_DEC, \
33 _______,_______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ 57 _______,_______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \
34 _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, RGB_SAI, \ 58 _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, RGB_SAI, \
35 _______,_______,_______, RGB_MOD,RGB_MOD, _______,_______,MO(_FL),_______,RGB_HUD,RGB_SAD,RGB_HUI), 59 _______,_______,_______, BL_BRTG,BL_BRTG, _______,_______,MO(_FL),_______,RGB_HUD,RGB_SAD,RGB_HUI),
36}; 60};
61
62
63bool process_record_user(uint16_t keycode, keyrecord_t *record) {
64 switch (keycode) {
65 #ifdef AUDIO_ENABLE
66 case S_BSKTC:
67 if (record->event.pressed) {
68 stop_all_notes();
69 PLAY_SONG(song_basketcase);
70 }
71 return false;
72 case S_ODEJY:
73 if (record->event.pressed) {
74 stop_all_notes();
75 PLAY_SONG(song_ode_to_joy);
76 }
77 return false;
78 case S_RCKBY:
79 if (record->event.pressed) {
80 stop_all_notes();
81 PLAY_SONG(song_rock_a_bye_baby);
82 }
83 return false;
84 case S_DOEDR:
85 if (record->event.pressed) {
86 stop_all_notes();
87 PLAY_SONG(song_doe_a_deer);
88 }
89 return false;
90 case S_SCALE:
91 if (record->event.pressed) {
92 stop_all_notes();
93 PLAY_SONG(song_scale);
94 }
95 return false;
96 case S_ONEUP:
97 if (record->event.pressed) {
98 stop_all_notes();
99 PLAY_SONG(song_one_up);
100 }
101 return false;
102 case S_COIN:
103 if (record->event.pressed) {
104 stop_all_notes();
105 PLAY_SONG(song_coin);
106 }
107 return false;
108 case S_SONIC:
109 if (record->event.pressed) {
110 stop_all_notes();
111 PLAY_SONG(song_sonic_ring);
112 }
113 return false;
114 case S_ZELDA:
115 if (record->event.pressed) {
116 stop_all_notes();
117 PLAY_SONG(song_zelda_puzzle);
118 }
119 return false;
120 #endif
121 }
122 return true;
123}
diff --git a/keyboards/clueboard/66_hotswap/prototype/config.h b/keyboards/clueboard/66_hotswap/prototype/config.h
new file mode 100644
index 000000000..7679d08e5
--- /dev/null
+++ b/keyboards/clueboard/66_hotswap/prototype/config.h
@@ -0,0 +1,55 @@
1#pragma once
2#include "config_common.h"
3
4#define PRODUCT_ID 0x2390
5#define DEVICE_VER 0x0001
6
7/* key matrix size */
8#define MATRIX_ROWS 10
9#define MATRIX_COLS 8
10
11// ROWS: Top to bottom, COLS: Left to right
12/* Row pin configuration
13* row: 0 1 2 3 4 5 6 7 8 9
14* pin: B2 C7 C6 B6 B5 B0 B3 D5 D3 D2
15*/
16
17#define MATRIX_ROW_PINS { B2, C7, C6, B6, B5, B0, B3, D5, D3, D2 }
18/* Column pin configuration
19 * col: 0 1 2 3 4 5 6 7
20 * pin: F0 F1 F4 F5 F6 F7 E6 B1
21 */
22#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, E6, B1 }
23#define UNUSED_PINS
24
25/* Speaker configuration
26 */
27#define B7_AUDIO
28#define NO_MUSIC_MODE
29#define AUDIO_CLICKY
30
31/* Space savings
32 */
33#define NO_ACTION_TAPPING
34
35/* Backlight configuration
36 */
37#define BACKLIGHT_LEVELS 1
38
39/* Underlight configuration
40 */
41#define RGB_DI_PIN D7
42#define RGBLED_NUM 26 // Number of LEDs
43#define RGBLIGHT_HUE_STEP 32
44#define RGBLIGHT_SAT_STEP 17
45#define RGBLIGHT_VAL_STEP 17
46
47#define RGBLIGHT_ANIMATIONS
48#define RGBLIGHT_EFFECT_BREATHE_CENTER 1
49#define RGBLIGHT_EFFECT_BREATHE_MAX 200
50#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 666*2
51#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1
52#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 4 // How many LEDs wide to light up
53#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 16 // The led to start at
54#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 8 // How many LEDs to travel
55#define RGBLIGHT_EFFECT_SNAKE_LENGTH 4 // How many LEDs wide to light up
diff --git a/keyboards/clueboard/66_hotswap/prototype/prototype.c b/keyboards/clueboard/66_hotswap/prototype/prototype.c
new file mode 100644
index 000000000..991d4b8fa
--- /dev/null
+++ b/keyboards/clueboard/66_hotswap/prototype/prototype.c
@@ -0,0 +1,63 @@
1#include "prototype.h"
2#include <avr/io.h>
3#include "backlight.h"
4#include "print.h"
5
6void matrix_init_kb(void) {
7 // put your keyboard start-up code here
8 // runs once when the firmware starts up
9 matrix_init_user();
10 led_init_ports();
11
12 // JTAG disable for PORT F. write JTD bit twice within four cycles.
13 MCUCR |= (1<<JTD);
14 MCUCR |= (1<<JTD);
15}
16
17
18void matrix_scan_kb(void) {
19 matrix_scan_user();
20}
21
22void backlight_init_ports(void) {
23 print("init_backlight_pin()\n");
24 // Set our LED pins as output
25 DDRD |= (1<<0); // Esc
26 DDRD |= (1<<4); // Page Up
27 DDRD |= (1<<1); // Arrows
28
29 // Set our LED pins low
30 PORTD &= ~(1<<0); // Esc
31 PORTD &= ~(1<<4); // Page Up
32 PORTD &= ~(1<<1); // Arrows
33}
34
35void backlight_set(uint8_t level) {
36 if ( level == 0 ) {
37 // Turn off light
38 PORTD |= (1<<0); // Esc
39 PORTD |= (1<<4); // Page Up
40 PORTD |= (1<<1); // Arrows
41 } else {
42 // Turn on light
43 PORTD &= ~(1<<0); // Esc
44 PORTD &= ~(1<<4); // Page Up
45 PORTD &= ~(1<<1); // Arrows
46 }
47}
48
49void led_init_ports() {
50 // * Set our LED pins as output
51 DDRB |= (1<<4);
52}
53
54void led_set_kb(uint8_t usb_led) {
55 DDRB |= (1<<4);
56 if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
57 // Turn capslock on
58 PORTB |= (1<<4);
59 } else {
60 // Turn capslock off
61 PORTB &= ~(1<<4);
62 }
63}
diff --git a/keyboards/clueboard/66_hotswap/prototype/prototype.h b/keyboards/clueboard/66_hotswap/prototype/prototype.h
new file mode 100644
index 000000000..b1d483b40
--- /dev/null
+++ b/keyboards/clueboard/66_hotswap/prototype/prototype.h
@@ -0,0 +1,86 @@
1#pragma once
2#include "quantum.h"
3
4/* Clueboard matrix layout
5 * ,-----------------------------------------------------------. ,---.
6 * | 00| 01| 02| 03| 04| 05| 06| 07| 50| 51| 52| 53| 54| 56 | | 57|
7 * |-----------------------------------------------------------| |---|
8 * | 10| 11| 12| 13| 14| 15| 16| 17| 60| 61| 62| 63| 64| 65| | 67|
9 * |-----------------------------------------------------------| `---'
10 * | 20| 21| 22| 23| 24| 25| 26| 27| 70| 71| 72| 73| 74| 75|
11 * |------------------------------------------------------------.
12 * | 30| 31| 32| 33| 34| 35| 36| 37| 80| 81| 82| 83| 84| 85|86|
13 * |------------------------------------------------------------------.
14 * | 40| 41| 42| 43| 45| 46| 90| 92| 93| 94| 95| 96| 97|
15 * `------------------------------------------------------------------'
16 * ,-----------------------------------------------------------. ,---.
17 * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |Ins|
18 * |-----------------------------------------------------------| |---|
19 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|
20 * |-----------------------------------------------------------| `---'
21 * |Caps | A| S| D| F| G| H| J| k| L| ;| '|Enter |
22 * |--------------------------------------------------------------.
23 * |Shift| \| Z| X| C| V| B| N| M| ,| .| /| \|Shift| Up|
24 * |------------------------------------------------------------------.
25 * |Ctrl|Alt|Gui | Space| Space|Gui |Alt |Fn |Ctrl|Left|Down|Rgt|
26 * `------------------------------------------------------------------'
27 */
28// The first section contains all of the arguments
29// The second converts the arguments into a two-dimensional array
30
31#define LAYOUT_all( \
32 k00, k01, k02, k03, k04, k05, k06, k07, k50, k51, k52, k53, k54, k56, k57, \
33 k10, k11, k12, k13, k14, k15, k16, k17, k60, k61, k62, k63, k64, k65, k67, \
34 k20, k21, k22, k23, k24, k25, k26, k27, k70, k71, k72, k73, k75, \
35 k30, k31, k32, k33, k34, k35, k36, k37, k80, k81, k82, k83, k84, k85, k86, \
36 k40, k41, k42, k45, k46, k90, k92, k93, k94, k95, k96, k97 \
37) { \
38 { k00, k01, k02, k03, k04, k05, k06, k07 }, \
39 { k10, k11, k12, k13, k14, k15, k16, k17 }, \
40 { k20, k21, k22, k23, k24, k25, k26, k27 }, \
41 { k30, k31, k32, k33, k34, k35, k36, k37 }, \
42 { k40, k41, k42, KC_NO, KC_NO, k45, k46, KC_NO }, \
43 { k50, k51, k52, k53, k54, KC_NO, k56, k57 }, \
44 { k60, k61, k62, k63, k64, k65, KC_NO, k67 }, \
45 { k70, k71, k72, k73, KC_NO, k75, KC_NO, KC_NO }, \
46 { k80, k81, k82, k83, k84, k85, k86, KC_NO }, \
47 { k90, KC_NO, k92, k93, k94, k95, k96, k97 } \
48}
49
50#define LAYOUT( \
51 k00, k01, k02, k03, k04, k05, k06, k07, k50, k51, k52, k53, k54, k56, k57, \
52 k10, k11, k12, k13, k14, k15, k16, k17, k60, k61, k62, k63, k64, k65, k67, \
53 k20, k21, k22, k23, k24, k25, k26, k27, k70, k71, k72, k73, k75, \
54 k30, k32, k33, k34, k35, k36, k37, k80, k81, k82, k83, k85, k86, \
55 k40, k41, k42, k45, k46, k90, k92, k93, k94, k95, k96, k97 \
56) { \
57 { k00, k01, k02, k03, k04, k05, k06, k07 }, \
58 { k10, k11, k12, k13, k14, k15, k16, k17 }, \
59 { k20, k21, k22, k23, k24, k25, k26, k27 }, \
60 { k30, KC_NO, k32, k33, k34, k35, k36, k37 }, \
61 { k40, k41, k42, KC_NO, KC_NO, k45, k46, KC_NO }, \
62 { k50, k51, k52, k53, k54, KC_NO, k56, k57 }, \
63 { k60, k61, k62, k63, k64, k65, KC_NO, k67 }, \
64 { k70, k71, k72, k73, KC_NO, k75, KC_NO, KC_NO }, \
65 { k80, k81, k82, k83, KC_NO, k85, k86, KC_NO }, \
66 { k90, KC_NO, k92, k93, k94, k95, k96, k97 } \
67}
68
69#define LAYOUT_66_ansi( \
70 k00, k01, k02, k03, k04, k05, k06, k07, k50, k51, k52, k53, k54, k56, k57, \
71 k10, k11, k12, k13, k14, k15, k16, k17, k60, k61, k62, k63, k64, k65, k67, \
72 k20, k21, k22, k23, k24, k25, k26, k27, k70, k71, k72, k73, k75, \
73 k30, k32, k33, k34, k35, k36, k37, k80, k81, k82, k83, k85, k86, \
74 k40, k41, k42, k46, k92, k93, k94, k95, k96, k97 \
75) { \
76 { k00, k01, k02, k03, k04, k05, k06, k07 }, \
77 { k10, k11, k12, k13, k14, k15, k16, k17 }, \
78 { k20, k21, k22, k23, k24, k25, k26, k27 }, \
79 { k30, KC_NO, k32, k33, k34, k35, k36, k37 }, \
80 { k40, k41, k42, KC_NO, KC_NO, KC_NO, k46, KC_NO }, \
81 { k50, k51, k52, k53, k54, KC_NO, k56, k57 }, \
82 { k60, k61, k62, k63, k64, k65, KC_NO, k67 }, \
83 { k70, k71, k72, k73, KC_NO, k75, KC_NO, KC_NO }, \
84 { k80, k81, k82, k83, KC_NO, k85, k86, KC_NO }, \
85 { KC_NO, KC_NO, k92, k93, k94, k95, k96, k97 } \
86}
diff --git a/keyboards/clueboard/66_hotswap/prototype/rules.mk b/keyboards/clueboard/66_hotswap/prototype/rules.mk
new file mode 100644
index 000000000..887592b37
--- /dev/null
+++ b/keyboards/clueboard/66_hotswap/prototype/rules.mk
@@ -0,0 +1,24 @@
1EXTRAFLAGS += -flto
2LAYOUTS = 66_ansi
3MCU = atmega32u4
4F_CPU = 16000000
5ARCH = AVR8
6F_USB = $(F_CPU)
7OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
8OPT_DEFS += -DBOOTLOADER_SIZE=4096
9
10# Build Options
11# comment out to disable the options.
12#
13BACKLIGHT_ENABLE = yes
14BOOTMAGIC_ENABLE = no
15MOUSEKEY_ENABLE = no
16EXTRAKEY_ENABLE = yes
17CONSOLE_ENABLE = yes
18COMMAND_ENABLE = no
19NKRO_ENABLE = yes
20AUDIO_ENABLE = yes
21RGBLIGHT_ENABLE = yes
22MIDI_ENABLE = no
23UNICODE_ENABLE = no
24BLUETOOTH_ENABLE = no