aboutsummaryrefslogtreecommitdiff
path: root/keyboards/durgod
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2021-01-25 17:30:56 +0000
committerQMK Bot <hello@qmk.fm>2021-01-25 17:30:56 +0000
commit5680f793cf9bd3bc4495bbe1f03e180ab7178f50 (patch)
tree52750a33a41faf6a5aee81f19ded93d7e6861bde /keyboards/durgod
parent625f29368b7408db4375b412064dafa4dfa4bb35 (diff)
parent88ca4ec2cbbe004cb51f36311f7490537128bce0 (diff)
downloadqmk_firmware-5680f793cf9bd3bc4495bbe1f03e180ab7178f50.tar.gz
qmk_firmware-5680f793cf9bd3bc4495bbe1f03e180ab7178f50.zip
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'keyboards/durgod')
-rw-r--r--keyboards/durgod/k320/board.h23
-rw-r--r--keyboards/durgod/k320/bootloader_defs.h7
-rw-r--r--keyboards/durgod/k320/chconf.h714
-rw-r--r--keyboards/durgod/k320/config.h53
-rw-r--r--keyboards/durgod/k320/halconf.h525
-rw-r--r--keyboards/durgod/k320/info.json462
-rw-r--r--keyboards/durgod/k320/k320.c42
-rw-r--r--keyboards/durgod/k320/k320.h44
-rw-r--r--keyboards/durgod/k320/keymaps/default/keymap.c97
-rw-r--r--keyboards/durgod/k320/keymaps/default/readme.md14
-rw-r--r--keyboards/durgod/k320/keymaps/default_toggle_mac_windows/keymap.c373
-rw-r--r--keyboards/durgod/k320/keymaps/default_toggle_mac_windows/readme.md64
-rw-r--r--keyboards/durgod/k320/keymaps/kuenhlee/keymap.c154
-rw-r--r--keyboards/durgod/k320/keymaps/kuenhlee/readme.md38
-rw-r--r--keyboards/durgod/k320/keymaps/kuenhlee/rules.mk4
-rw-r--r--keyboards/durgod/k320/mcuconf.h176
-rw-r--r--keyboards/durgod/k320/readme.md60
-rw-r--r--keyboards/durgod/k320/rules.mk27
18 files changed, 2877 insertions, 0 deletions
diff --git a/keyboards/durgod/k320/board.h b/keyboards/durgod/k320/board.h
new file mode 100644
index 000000000..17d08b17f
--- /dev/null
+++ b/keyboards/durgod/k320/board.h
@@ -0,0 +1,23 @@
1/*
2Copyright 2021 Don Kjer
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#define STM32_HSECLK 12000000U
21#include_next <board.h>
22#undef STM32_HSE_BYPASS
23
diff --git a/keyboards/durgod/k320/bootloader_defs.h b/keyboards/durgod/k320/bootloader_defs.h
new file mode 100644
index 000000000..02c48c4e6
--- /dev/null
+++ b/keyboards/durgod/k320/bootloader_defs.h
@@ -0,0 +1,7 @@
1/* Address for jumping to bootloader on STM32 chips. */
2/* It is chip dependent, the correct number can be looked up here (page 175):
3 * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
4 * This also requires a patch to chibios:
5 * <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
6 */
7#define STM32_BOOTLOADER_ADDRESS 0x1FFFC800
diff --git a/keyboards/durgod/k320/chconf.h b/keyboards/durgod/k320/chconf.h
new file mode 100644
index 000000000..8ac3a97e0
--- /dev/null
+++ b/keyboards/durgod/k320/chconf.h
@@ -0,0 +1,714 @@
1/*
2 ChibiOS - Copyright (C) 2006..2018 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 rt/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#define _CHIBIOS_RT_CONF_VER_6_0_
33
34/*===========================================================================*/
35/**
36 * @name System timers settings
37 * @{
38 */
39/*===========================================================================*/
40
41/**
42 * @brief System time counter resolution.
43 * @note Allowed values are 16 or 32 bits.
44 */
45#if !defined(CH_CFG_ST_RESOLUTION)
46#define CH_CFG_ST_RESOLUTION 32
47#endif
48
49/**
50 * @brief System tick frequency.
51 * @details Frequency of the system timer that drives the system ticks. This
52 * setting also defines the system tick time unit.
53 */
54#if !defined(CH_CFG_ST_FREQUENCY)
55#define CH_CFG_ST_FREQUENCY 10000
56#endif
57
58/**
59 * @brief Time intervals data size.
60 * @note Allowed values are 16, 32 or 64 bits.
61 */
62#if !defined(CH_CFG_INTERVALS_SIZE)
63#define CH_CFG_INTERVALS_SIZE 32
64#endif
65
66/**
67 * @brief Time types data size.
68 * @note Allowed values are 16 or 32 bits.
69 */
70#if !defined(CH_CFG_TIME_TYPES_SIZE)
71#define CH_CFG_TIME_TYPES_SIZE 32
72#endif
73
74/**
75 * @brief Time delta constant for the tick-less mode.
76 * @note If this value is zero then the system uses the classic
77 * periodic tick. This value represents the minimum number
78 * of ticks that is safe to specify in a timeout directive.
79 * The value one is not valid, timeouts are rounded up to
80 * this value.
81 */
82#if !defined(CH_CFG_ST_TIMEDELTA)
83#define CH_CFG_ST_TIMEDELTA 0
84#endif
85
86/** @} */
87
88/*===========================================================================*/
89/**
90 * @name Kernel parameters and options
91 * @{
92 */
93/*===========================================================================*/
94
95/**
96 * @brief Round robin interval.
97 * @details This constant is the number of system ticks allowed for the
98 * threads before preemption occurs. Setting this value to zero
99 * disables the preemption for threads with equal priority and the
100 * round robin becomes cooperative. Note that higher priority
101 * threads can still preempt, the kernel is always preemptive.
102 * @note Disabling the round robin preemption makes the kernel more compact
103 * and generally faster.
104 * @note The round robin preemption is not supported in tickless mode and
105 * must be set to zero in that case.
106 */
107#if !defined(CH_CFG_TIME_QUANTUM)
108#define CH_CFG_TIME_QUANTUM 0
109#endif
110
111/**
112 * @brief Managed RAM size.
113 * @details Size of the RAM area to be managed by the OS. If set to zero
114 * then the whole available RAM is used. The core memory is made
115 * available to the heap allocator and/or can be used directly through
116 * the simplified core memory allocator.
117 *
118 * @note In order to let the OS manage the whole RAM the linker script must
119 * provide the @p __heap_base__ and @p __heap_end__ symbols.
120 * @note Requires @p CH_CFG_USE_MEMCORE.
121 */
122#if !defined(CH_CFG_MEMCORE_SIZE)
123#define CH_CFG_MEMCORE_SIZE 0
124#endif
125
126/**
127 * @brief Idle thread automatic spawn suppression.
128 * @details When this option is activated the function @p chSysInit()
129 * does not spawn the idle thread. The application @p main()
130 * function becomes the idle thread and must implement an
131 * infinite loop.
132 */
133#if !defined(CH_CFG_NO_IDLE_THREAD)
134#define CH_CFG_NO_IDLE_THREAD FALSE
135#endif
136
137/** @} */
138
139/*===========================================================================*/
140/**
141 * @name Performance options
142 * @{
143 */
144/*===========================================================================*/
145
146/**
147 * @brief OS optimization.
148 * @details If enabled then time efficient rather than space efficient code
149 * is used when two possible implementations exist.
150 *
151 * @note This is not related to the compiler optimization options.
152 * @note The default is @p TRUE.
153 */
154#if !defined(CH_CFG_OPTIMIZE_SPEED)
155#define CH_CFG_OPTIMIZE_SPEED FALSE
156#endif
157
158/** @} */
159
160/*===========================================================================*/
161/**
162 * @name Subsystem options
163 * @{
164 */
165/*===========================================================================*/
166
167/**
168 * @brief Time Measurement APIs.
169 * @details If enabled then the time measurement APIs are included in
170 * the kernel.
171 *
172 * @note The default is @p TRUE.
173 */
174#if !defined(CH_CFG_USE_TM)
175#define CH_CFG_USE_TM FALSE
176#endif
177
178/**
179 * @brief Threads registry APIs.
180 * @details If enabled then the registry APIs are included in the kernel.
181 *
182 * @note The default is @p TRUE.
183 */
184#if !defined(CH_CFG_USE_REGISTRY)
185#define CH_CFG_USE_REGISTRY TRUE
186#endif
187
188/**
189 * @brief Threads synchronization APIs.
190 * @details If enabled then the @p chThdWait() function is included in
191 * the kernel.
192 *
193 * @note The default is @p TRUE.
194 */
195#if !defined(CH_CFG_USE_WAITEXIT)
196#define CH_CFG_USE_WAITEXIT TRUE
197#endif
198
199/**
200 * @brief Semaphores APIs.
201 * @details If enabled then the Semaphores APIs are included in the kernel.
202 *
203 * @note The default is @p TRUE.
204 */
205#if !defined(CH_CFG_USE_SEMAPHORES)
206#define CH_CFG_USE_SEMAPHORES TRUE
207#endif
208
209/**
210 * @brief Semaphores queuing mode.
211 * @details If enabled then the threads are enqueued on semaphores by
212 * priority rather than in FIFO order.
213 *
214 * @note The default is @p FALSE. Enable this if you have special
215 * requirements.
216 * @note Requires @p CH_CFG_USE_SEMAPHORES.
217 */
218#if !defined(CH_CFG_USE_SEMAPHORES_PRIORITY)
219#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
220#endif
221
222/**
223 * @brief Mutexes APIs.
224 * @details If enabled then the mutexes APIs are included in the kernel.
225 *
226 * @note The default is @p TRUE.
227 */
228#if !defined(CH_CFG_USE_MUTEXES)
229#define CH_CFG_USE_MUTEXES TRUE
230#endif
231
232/**
233 * @brief Enables recursive behavior on mutexes.
234 * @note Recursive mutexes are heavier and have an increased
235 * memory footprint.
236 *
237 * @note The default is @p FALSE.
238 * @note Requires @p CH_CFG_USE_MUTEXES.
239 */
240#if !defined(CH_CFG_USE_MUTEXES_RECURSIVE)
241#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
242#endif
243
244/**
245 * @brief Conditional Variables APIs.
246 * @details If enabled then the conditional variables APIs are included
247 * in the kernel.
248 *
249 * @note The default is @p TRUE.
250 * @note Requires @p CH_CFG_USE_MUTEXES.
251 */
252#if !defined(CH_CFG_USE_CONDVARS)
253#define CH_CFG_USE_CONDVARS TRUE
254#endif
255
256/**
257 * @brief Conditional Variables APIs with timeout.
258 * @details If enabled then the conditional variables APIs with timeout
259 * specification are included in the kernel.
260 *
261 * @note The default is @p TRUE.
262 * @note Requires @p CH_CFG_USE_CONDVARS.
263 */
264#if !defined(CH_CFG_USE_CONDVARS_TIMEOUT)
265#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE
266#endif
267
268/**
269 * @brief Events Flags APIs.
270 * @details If enabled then the event flags APIs are included in the kernel.
271 *
272 * @note The default is @p TRUE.
273 */
274#if !defined(CH_CFG_USE_EVENTS)
275#define CH_CFG_USE_EVENTS TRUE
276#endif
277
278/**
279 * @brief Events Flags APIs with timeout.
280 * @details If enabled then the events APIs with timeout specification
281 * are included in the kernel.
282 *
283 * @note The default is @p TRUE.
284 * @note Requires @p CH_CFG_USE_EVENTS.
285 */
286#if !defined(CH_CFG_USE_EVENTS_TIMEOUT)
287#define CH_CFG_USE_EVENTS_TIMEOUT TRUE
288#endif
289
290/**
291 * @brief Synchronous Messages APIs.
292 * @details If enabled then the synchronous messages APIs are included
293 * in the kernel.
294 *
295 * @note The default is @p TRUE.
296 */
297#if !defined(CH_CFG_USE_MESSAGES)
298#define CH_CFG_USE_MESSAGES TRUE
299#endif
300
301/**
302 * @brief Synchronous Messages queuing mode.
303 * @details If enabled then messages are served by priority rather than in
304 * FIFO order.
305 *
306 * @note The default is @p FALSE. Enable this if you have special
307 * requirements.
308 * @note Requires @p CH_CFG_USE_MESSAGES.
309 */
310#if !defined(CH_CFG_USE_MESSAGES_PRIORITY)
311#define CH_CFG_USE_MESSAGES_PRIORITY FALSE
312#endif
313
314/**
315 * @brief Mailboxes APIs.
316 * @details If enabled then the asynchronous messages (mailboxes) APIs are
317 * included in the kernel.
318 *
319 * @note The default is @p TRUE.
320 * @note Requires @p CH_CFG_USE_SEMAPHORES.
321 */
322#if !defined(CH_CFG_USE_MAILBOXES)
323#define CH_CFG_USE_MAILBOXES TRUE
324#endif
325
326/**
327 * @brief Core Memory Manager APIs.
328 * @details If enabled then the core memory manager APIs are included
329 * in the kernel.
330 *
331 * @note The default is @p TRUE.
332 */
333#if !defined(CH_CFG_USE_MEMCORE)
334#define CH_CFG_USE_MEMCORE TRUE
335#endif
336
337/**
338 * @brief Heap Allocator APIs.
339 * @details If enabled then the memory heap allocator APIs are included
340 * in the kernel.
341 *
342 * @note The default is @p TRUE.
343 * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
344 * @p CH_CFG_USE_SEMAPHORES.
345 * @note Mutexes are recommended.
346 */
347#if !defined(CH_CFG_USE_HEAP)
348#define CH_CFG_USE_HEAP FALSE
349#endif
350
351/**
352 * @brief Memory Pools Allocator APIs.
353 * @details If enabled then the memory pools allocator APIs are included
354 * in the kernel.
355 *
356 * @note The default is @p TRUE.
357 */
358#if !defined(CH_CFG_USE_MEMPOOLS)
359#define CH_CFG_USE_MEMPOOLS FALSE
360#endif
361
362/**
363 * @brief Objects FIFOs APIs.
364 * @details If enabled then the objects FIFOs APIs are included
365 * in the kernel.
366 *
367 * @note The default is @p TRUE.
368 */
369#if !defined(CH_CFG_USE_OBJ_FIFOS)
370#define CH_CFG_USE_OBJ_FIFOS FALSE
371#endif
372
373/**
374 * @brief Pipes APIs.
375 * @details If enabled then the pipes APIs are included
376 * in the kernel.
377 *
378 * @note The default is @p TRUE.
379 */
380#if !defined(CH_CFG_USE_PIPES)
381#define CH_CFG_USE_PIPES FALSE
382#endif
383
384/**
385 * @brief Dynamic Threads APIs.
386 * @details If enabled then the dynamic threads creation APIs are included
387 * in the kernel.
388 *
389 * @note The default is @p TRUE.
390 * @note Requires @p CH_CFG_USE_WAITEXIT.
391 * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
392 */
393#if !defined(CH_CFG_USE_DYNAMIC)
394#define CH_CFG_USE_DYNAMIC FALSE
395#endif
396
397/** @} */
398
399/*===========================================================================*/
400/**
401 * @name Objects factory options
402 * @{
403 */
404/*===========================================================================*/
405
406/**
407 * @brief Objects Factory APIs.
408 * @details If enabled then the objects factory APIs are included in the
409 * kernel.
410 *
411 * @note The default is @p FALSE.
412 */
413#if !defined(CH_CFG_USE_FACTORY)
414#define CH_CFG_USE_FACTORY FALSE
415#endif
416
417/**
418 * @brief Maximum length for object names.
419 * @details If the specified length is zero then the name is stored by
420 * pointer but this could have unintended side effects.
421 */
422#if !defined(CH_CFG_FACTORY_MAX_NAMES_LENGTH)
423#define CH_CFG_FACTORY_MAX_NAMES_LENGTH 8
424#endif
425
426/**
427 * @brief Enables the registry of generic objects.
428 */
429#if !defined(CH_CFG_FACTORY_OBJECTS_REGISTRY)
430#define CH_CFG_FACTORY_OBJECTS_REGISTRY FALSE
431#endif
432
433/**
434 * @brief Enables factory for generic buffers.
435 */
436#if !defined(CH_CFG_FACTORY_GENERIC_BUFFERS)
437#define CH_CFG_FACTORY_GENERIC_BUFFERS FALSE
438#endif
439
440/**
441 * @brief Enables factory for semaphores.
442 */
443#if !defined(CH_CFG_FACTORY_SEMAPHORES)
444#define CH_CFG_FACTORY_SEMAPHORES FALSE
445#endif
446
447/**
448 * @brief Enables factory for mailboxes.
449 */
450#if !defined(CH_CFG_FACTORY_MAILBOXES)
451#define CH_CFG_FACTORY_MAILBOXES FALSE
452#endif
453
454/**
455 * @brief Enables factory for objects FIFOs.
456 */
457#if !defined(CH_CFG_FACTORY_OBJ_FIFOS)
458#define CH_CFG_FACTORY_OBJ_FIFOS FALSE
459#endif
460
461/**
462 * @brief Enables factory for Pipes.
463 */
464#if !defined(CH_CFG_FACTORY_PIPES) || defined(__DOXYGEN__)
465#define CH_CFG_FACTORY_PIPES FALSE
466#endif
467
468/** @} */
469
470/*===========================================================================*/
471/**
472 * @name Debug options
473 * @{
474 */
475/*===========================================================================*/
476
477/**
478 * @brief Debug option, kernel statistics.
479 *
480 * @note The default is @p FALSE.
481 */
482#if !defined(CH_DBG_STATISTICS)
483#define CH_DBG_STATISTICS FALSE
484#endif
485
486/**
487 * @brief Debug option, system state check.
488 * @details If enabled the correct call protocol for system APIs is checked
489 * at runtime.
490 *
491 * @note The default is @p FALSE.
492 */
493#if !defined(CH_DBG_SYSTEM_STATE_CHECK)
494#define CH_DBG_SYSTEM_STATE_CHECK FALSE
495#endif
496
497/**
498 * @brief Debug option, parameters checks.
499 * @details If enabled then the checks on the API functions input
500 * parameters are activated.
501 *
502 * @note The default is @p FALSE.
503 */
504#if !defined(CH_DBG_ENABLE_CHECKS)
505#define CH_DBG_ENABLE_CHECKS FALSE
506#endif
507
508/**
509 * @brief Debug option, consistency checks.
510 * @details If enabled then all the assertions in the kernel code are
511 * activated. This includes consistency checks inside the kernel,
512 * runtime anomalies and port-defined checks.
513 *
514 * @note The default is @p FALSE.
515 */
516#if !defined(CH_DBG_ENABLE_ASSERTS)
517#define CH_DBG_ENABLE_ASSERTS FALSE
518#endif
519
520/**
521 * @brief Debug option, trace buffer.
522 * @details If enabled then the trace buffer is activated.
523 *
524 * @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
525 */
526#if !defined(CH_DBG_TRACE_MASK)
527#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
528#endif
529
530/**
531 * @brief Trace buffer entries.
532 * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
533 * different from @p CH_DBG_TRACE_MASK_DISABLED.
534 */
535#if !defined(CH_DBG_TRACE_BUFFER_SIZE)
536#define CH_DBG_TRACE_BUFFER_SIZE 128
537#endif
538
539/**
540 * @brief Debug option, stack checks.
541 * @details If enabled then a runtime stack check is performed.
542 *
543 * @note The default is @p FALSE.
544 * @note The stack check is performed in a architecture/port dependent way.
545 * It may not be implemented or some ports.
546 * @note The default failure mode is to halt the system with the global
547 * @p panic_msg variable set to @p NULL.
548 */
549#if !defined(CH_DBG_ENABLE_STACK_CHECK)
550#define CH_DBG_ENABLE_STACK_CHECK FALSE
551#endif
552
553/**
554 * @brief Debug option, stacks initialization.
555 * @details If enabled then the threads working area is filled with a byte
556 * value when a thread is created. This can be useful for the
557 * runtime measurement of the used stack.
558 *
559 * @note The default is @p FALSE.
560 */
561#if !defined(CH_DBG_FILL_THREADS)
562#define CH_DBG_FILL_THREADS FALSE
563#endif
564
565/**
566 * @brief Debug option, threads profiling.
567 * @details If enabled then a field is added to the @p thread_t structure that
568 * counts the system ticks occurred while executing the thread.
569 *
570 * @note The default is @p FALSE.
571 * @note This debug option is not currently compatible with the
572 * tickless mode.
573 */
574#if !defined(CH_DBG_THREADS_PROFILING)
575#define CH_DBG_THREADS_PROFILING FALSE
576#endif
577
578/** @} */
579
580/*===========================================================================*/
581/**
582 * @name Kernel hooks
583 * @{
584 */
585/*===========================================================================*/
586
587/**
588 * @brief System structure extension.
589 * @details User fields added to the end of the @p ch_system_t structure.
590 */
591#define CH_CFG_SYSTEM_EXTRA_FIELDS \
592 /* Add threads custom fields here.*/
593
594/**
595 * @brief System initialization hook.
596 * @details User initialization code added to the @p chSysInit() function
597 * just before interrupts are enabled globally.
598 */
599#define CH_CFG_SYSTEM_INIT_HOOK() { \
600 /* Add threads initialization code here.*/ \
601}
602
603/**
604 * @brief Threads descriptor structure extension.
605 * @details User fields added to the end of the @p thread_t structure.
606 */
607#define CH_CFG_THREAD_EXTRA_FIELDS \
608 /* Add threads custom fields here.*/
609
610/**
611 * @brief Threads initialization hook.
612 * @details User initialization code added to the @p _thread_init() function.
613 *
614 * @note It is invoked from within @p _thread_init() and implicitly from all
615 * the threads creation APIs.
616 */
617#define CH_CFG_THREAD_INIT_HOOK(tp) { \
618 /* Add threads initialization code here.*/ \
619}
620
621/**
622 * @brief Threads finalization hook.
623 * @details User finalization code added to the @p chThdExit() API.
624 */
625#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
626 /* Add threads finalization code here.*/ \
627}
628
629/**
630 * @brief Context switch hook.
631 * @details This hook is invoked just before switching between threads.
632 */
633#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
634 /* Context switch code here.*/ \
635}
636
637/**
638 * @brief ISR enter hook.
639 */
640#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
641 /* IRQ prologue code here.*/ \
642}
643
644/**
645 * @brief ISR exit hook.
646 */
647#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
648 /* IRQ epilogue code here.*/ \
649}
650
651/**
652 * @brief Idle thread enter hook.
653 * @note This hook is invoked within a critical zone, no OS functions
654 * should be invoked from here.
655 * @note This macro can be used to activate a power saving mode.
656 */
657#define CH_CFG_IDLE_ENTER_HOOK() { \
658 /* Idle-enter code here.*/ \
659}
660
661/**
662 * @brief Idle thread leave hook.
663 * @note This hook is invoked within a critical zone, no OS functions
664 * should be invoked from here.
665 * @note This macro can be used to deactivate a power saving mode.
666 */
667#define CH_CFG_IDLE_LEAVE_HOOK() { \
668 /* Idle-leave code here.*/ \
669}
670
671/**
672 * @brief Idle Loop hook.
673 * @details This hook is continuously invoked by the idle thread loop.
674 */
675#define CH_CFG_IDLE_LOOP_HOOK() { \
676 /* Idle loop code here.*/ \
677}
678
679/**
680 * @brief System tick event hook.
681 * @details This hook is invoked in the system tick handler immediately
682 * after processing the virtual timers queue.
683 */
684#define CH_CFG_SYSTEM_TICK_HOOK() { \
685 /* System tick event code here.*/ \
686}
687
688/**
689 * @brief System halt hook.
690 * @details This hook is invoked in case to a system halting error before
691 * the system is halted.
692 */
693#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
694 /* System halt code here.*/ \
695}
696
697/**
698 * @brief Trace hook.
699 * @details This hook is invoked each time a new record is written in the
700 * trace buffer.
701 */
702#define CH_CFG_TRACE_HOOK(tep) { \
703 /* Trace code here.*/ \
704}
705
706/** @} */
707
708/*===========================================================================*/
709/* Port-specific settings (override port settings defaulted in chcore.h). */
710/*===========================================================================*/
711
712#endif /* CHCONF_H */
713
714/** @} */
diff --git a/keyboards/durgod/k320/config.h b/keyboards/durgod/k320/config.h
new file mode 100644
index 000000000..70438900e
--- /dev/null
+++ b/keyboards/durgod/k320/config.h
@@ -0,0 +1,53 @@
1/*
2Copyright 2021 kuenhlee and Don Kjer
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/* USB Device descriptor parameter */
23#define VENDOR_ID 0xD60D
24#define PRODUCT_ID 0x3200
25#define DEVICE_VER 0x0001
26#define MANUFACTURER Hoksi Technology
27#define PRODUCT DURGOD Taurus K320 (QMK)
28
29/* key matrix size */
30#define MATRIX_ROWS 7
31#define MATRIX_COLS 16
32
33#define MATRIX_ROW_PINS { A0, A1, A2, A3, A4, A5, A6 }
34#define MATRIX_COL_PINS { C4, C5, B0, B1, B2, B10, B11, B12, B13, B14, B15, C6, C7, C10, C11, C12 }
35
36/* COL2ROW, ROW2COL*/
37#define DIODE_DIRECTION ROW2COL
38
39/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
40#define DEBOUNCE 7
41
42/* Bootmagic Lite key configuration */
43#define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE
44#define BOOTMAGIC_LITE_ROW 0
45#define BOOTMAGIC_LITE_COLUMN 0
46
47/* LED indicator pins */
48#define LED_CAPS_LOCK_PIN C9
49#define LED_SCROLL_LOCK_PIN A8
50#define LED_WIN_LOCK_PIN A9
51#define LED_MR_LOCK_PIN A10
52#define LED_PIN_ON_STATE 0
53
diff --git a/keyboards/durgod/k320/halconf.h b/keyboards/durgod/k320/halconf.h
new file mode 100644
index 000000000..16f32117d
--- /dev/null
+++ b/keyboards/durgod/k320/halconf.h
@@ -0,0 +1,525 @@
1/*
2 ChibiOS - Copyright (C) 2006..2018 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#define _CHIBIOS_HAL_CONF_
32#define _CHIBIOS_HAL_CONF_VER_7_0_
33
34#include "mcuconf.h"
35
36/**
37 * @brief Enables the PAL subsystem.
38 */
39#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
40#define HAL_USE_PAL TRUE
41#endif
42
43/**
44 * @brief Enables the ADC subsystem.
45 */
46#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
47#define HAL_USE_ADC FALSE
48#endif
49
50/**
51 * @brief Enables the CAN subsystem.
52 */
53#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
54#define HAL_USE_CAN FALSE
55#endif
56
57/**
58 * @brief Enables the cryptographic subsystem.
59 */
60#if !defined(HAL_USE_CRY) || defined(__DOXYGEN__)
61#define HAL_USE_CRY FALSE
62#endif
63
64/**
65 * @brief Enables the DAC subsystem.
66 */
67#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
68#define HAL_USE_DAC FALSE
69#endif
70
71/**
72 * @brief Enables the GPT subsystem.
73 */
74#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
75#define HAL_USE_GPT FALSE
76#endif
77
78/**
79 * @brief Enables the I2C subsystem.
80 */
81#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
82#define HAL_USE_I2C FALSE
83#endif
84
85/**
86 * @brief Enables the I2S subsystem.
87 */
88#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
89#define HAL_USE_I2S FALSE
90#endif
91
92/**
93 * @brief Enables the ICU subsystem.
94 */
95#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
96#define HAL_USE_ICU FALSE
97#endif
98
99/**
100 * @brief Enables the MAC subsystem.
101 */
102#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
103#define HAL_USE_MAC FALSE
104#endif
105
106/**
107 * @brief Enables the MMC_SPI subsystem.
108 */
109#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
110#define HAL_USE_MMC_SPI FALSE
111#endif
112
113/**
114 * @brief Enables the PWM subsystem.
115 */
116#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
117#define HAL_USE_PWM FALSE
118#endif
119
120/**
121 * @brief Enables the RTC subsystem.
122 */
123#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
124#define HAL_USE_RTC FALSE
125#endif
126
127/**
128 * @brief Enables the SDC subsystem.
129 */
130#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
131#define HAL_USE_SDC FALSE
132#endif
133
134/**
135 * @brief Enables the SERIAL subsystem.
136 */
137#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
138#define HAL_USE_SERIAL FALSE
139#endif
140
141/**
142 * @brief Enables the SERIAL over USB subsystem.
143 */
144#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
145#define HAL_USE_SERIAL_USB FALSE
146#endif
147
148/**
149 * @brief Enables the SIO subsystem.
150 */
151#if !defined(HAL_USE_SIO) || defined(__DOXYGEN__)
152#define HAL_USE_SIO FALSE
153#endif
154
155/**
156 * @brief Enables the SPI subsystem.
157 */
158#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
159#define HAL_USE_SPI FALSE
160#endif
161
162/**
163 * @brief Enables the TRNG subsystem.
164 */
165#if !defined(HAL_USE_TRNG) || defined(__DOXYGEN__)
166#define HAL_USE_TRNG FALSE
167#endif
168
169/**
170 * @brief Enables the UART subsystem.
171 */
172#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
173#define HAL_USE_UART FALSE
174#endif
175
176/**
177 * @brief Enables the USB subsystem.
178 */
179#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
180#define HAL_USE_USB TRUE
181#endif
182
183/**
184 * @brief Enables the WDG subsystem.
185 */
186#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
187#define HAL_USE_WDG FALSE
188#endif
189
190/**
191 * @brief Enables the WSPI subsystem.
192 */
193#if !defined(HAL_USE_WSPI) || defined(__DOXYGEN__)
194#define HAL_USE_WSPI FALSE
195#endif
196
197/*===========================================================================*/
198/* PAL driver related settings. */
199/*===========================================================================*/
200
201/**
202 * @brief Enables synchronous APIs.
203 * @note Disabling this option saves both code and data space.
204 */
205#if !defined(PAL_USE_CALLBACKS) || defined(__DOXYGEN__)
206#define PAL_USE_CALLBACKS FALSE
207#endif
208
209/**
210 * @brief Enables synchronous APIs.
211 * @note Disabling this option saves both code and data space.
212 */
213#if !defined(PAL_USE_WAIT) || defined(__DOXYGEN__)
214#define PAL_USE_WAIT FALSE
215#endif
216
217/*===========================================================================*/
218/* ADC driver related settings. */
219/*===========================================================================*/
220
221/**
222 * @brief Enables synchronous APIs.
223 * @note Disabling this option saves both code and data space.
224 */
225#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
226#define ADC_USE_WAIT TRUE
227#endif
228
229/**
230 * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
231 * @note Disabling this option saves both code and data space.
232 */
233#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
234#define ADC_USE_MUTUAL_EXCLUSION TRUE
235#endif
236
237/*===========================================================================*/
238/* CAN driver related settings. */
239/*===========================================================================*/
240
241/**
242 * @brief Sleep mode related APIs inclusion switch.
243 */
244#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
245#define CAN_USE_SLEEP_MODE TRUE
246#endif
247
248/**
249 * @brief Enforces the driver to use direct callbacks rather than OSAL events.
250 */
251#if !defined(CAN_ENFORCE_USE_CALLBACKS) || defined(__DOXYGEN__)
252#define CAN_ENFORCE_USE_CALLBACKS FALSE
253#endif
254
255/*===========================================================================*/
256/* CRY driver related settings. */
257/*===========================================================================*/
258
259/**
260 * @brief Enables the SW fall-back of the cryptographic driver.
261 * @details When enabled, this option, activates a fall-back software
262 * implementation for algorithms not supported by the underlying
263 * hardware.
264 * @note Fall-back implementations may not be present for all algorithms.
265 */
266#if !defined(HAL_CRY_USE_FALLBACK) || defined(__DOXYGEN__)
267#define HAL_CRY_USE_FALLBACK FALSE
268#endif
269
270/**
271 * @brief Makes the driver forcibly use the fall-back implementations.
272 */
273#if !defined(HAL_CRY_ENFORCE_FALLBACK) || defined(__DOXYGEN__)
274#define HAL_CRY_ENFORCE_FALLBACK FALSE
275#endif
276
277/*===========================================================================*/
278/* DAC driver related settings. */
279/*===========================================================================*/
280
281/**
282 * @brief Enables synchronous APIs.
283 * @note Disabling this option saves both code and data space.
284 */
285#if !defined(DAC_USE_WAIT) || defined(__DOXYGEN__)
286#define DAC_USE_WAIT TRUE
287#endif
288
289/**
290 * @brief Enables the @p dacAcquireBus() and @p dacReleaseBus() APIs.
291 * @note Disabling this option saves both code and data space.
292 */
293#if !defined(DAC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
294#define DAC_USE_MUTUAL_EXCLUSION TRUE
295#endif
296
297/*===========================================================================*/
298/* I2C driver related settings. */
299/*===========================================================================*/
300
301/**
302 * @brief Enables the mutual exclusion APIs on the I2C bus.
303 */
304#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
305#define I2C_USE_MUTUAL_EXCLUSION TRUE
306#endif
307
308/*===========================================================================*/
309/* MAC driver related settings. */
310/*===========================================================================*/
311
312/**
313 * @brief Enables the zero-copy API.
314 */
315#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
316#define MAC_USE_ZERO_COPY FALSE
317#endif
318
319/**
320 * @brief Enables an event sources for incoming packets.
321 */
322#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
323#define MAC_USE_EVENTS TRUE
324#endif
325
326/*===========================================================================*/
327/* MMC_SPI driver related settings. */
328/*===========================================================================*/
329
330/**
331 * @brief Delays insertions.
332 * @details If enabled this options inserts delays into the MMC waiting
333 * routines releasing some extra CPU time for the threads with
334 * lower priority, this may slow down the driver a bit however.
335 * This option is recommended also if the SPI driver does not
336 * use a DMA channel and heavily loads the CPU.
337 */
338#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
339#define MMC_NICE_WAITING TRUE
340#endif
341
342/*===========================================================================*/
343/* SDC driver related settings. */
344/*===========================================================================*/
345
346/**
347 * @brief Number of initialization attempts before rejecting the card.
348 * @note Attempts are performed at 10mS intervals.
349 */
350#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
351#define SDC_INIT_RETRY 100
352#endif
353
354/**
355 * @brief Include support for MMC cards.
356 * @note MMC support is not yet implemented so this option must be kept
357 * at @p FALSE.
358 */
359#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
360#define SDC_MMC_SUPPORT FALSE
361#endif
362
363/**
364 * @brief Delays insertions.
365 * @details If enabled this options inserts delays into the MMC waiting
366 * routines releasing some extra CPU time for the threads with
367 * lower priority, this may slow down the driver a bit however.
368 */
369#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
370#define SDC_NICE_WAITING TRUE
371#endif
372
373/**
374 * @brief OCR initialization constant for V20 cards.
375 */
376#if !defined(SDC_INIT_OCR_V20) || defined(__DOXYGEN__)
377#define SDC_INIT_OCR_V20 0x50FF8000U
378#endif
379
380/**
381 * @brief OCR initialization constant for non-V20 cards.
382 */
383#if !defined(SDC_INIT_OCR) || defined(__DOXYGEN__)
384#define SDC_INIT_OCR 0x80100000U
385#endif
386
387/*===========================================================================*/
388/* SERIAL driver related settings. */
389/*===========================================================================*/
390
391/**
392 * @brief Default bit rate.
393 * @details Configuration parameter, this is the baud rate selected for the
394 * default configuration.
395 */
396#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
397#define SERIAL_DEFAULT_BITRATE 38400
398#endif
399
400/**
401 * @brief Serial buffers size.
402 * @details Configuration parameter, you can change the depth of the queue
403 * buffers depending on the requirements of your application.
404 * @note The default is 16 bytes for both the transmission and receive
405 * buffers.
406 */
407#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
408#define SERIAL_BUFFERS_SIZE 16
409#endif
410
411/*===========================================================================*/
412/* SERIAL_USB driver related setting. */
413/*===========================================================================*/
414
415/**
416 * @brief Serial over USB buffers size.
417 * @details Configuration parameter, the buffer size must be a multiple of
418 * the USB data endpoint maximum packet size.
419 * @note The default is 256 bytes for both the transmission and receive
420 * buffers.
421 */
422#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
423#define SERIAL_USB_BUFFERS_SIZE 1
424#endif
425
426/**
427 * @brief Serial over USB number of buffers.
428 * @note The default is 2 buffers.
429 */
430#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__)
431#define SERIAL_USB_BUFFERS_NUMBER 2
432#endif
433
434/*===========================================================================*/
435/* SPI driver related settings. */
436/*===========================================================================*/
437
438/**
439 * @brief Enables synchronous APIs.
440 * @note Disabling this option saves both code and data space.
441 */
442#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
443#define SPI_USE_WAIT TRUE
444#endif
445
446/**
447 * @brief Enables circular transfers APIs.
448 * @note Disabling this option saves both code and data space.
449 */
450#if !defined(SPI_USE_CIRCULAR) || defined(__DOXYGEN__)
451#define SPI_USE_CIRCULAR FALSE
452#endif
453
454
455/**
456 * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
457 * @note Disabling this option saves both code and data space.
458 */
459#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
460#define SPI_USE_MUTUAL_EXCLUSION TRUE
461#endif
462
463/**
464 * @brief Handling method for SPI CS line.
465 * @note Disabling this option saves both code and data space.
466 */
467#if !defined(SPI_SELECT_MODE) || defined(__DOXYGEN__)
468#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD
469#endif
470
471/*===========================================================================*/
472/* UART driver related settings. */
473/*===========================================================================*/
474
475/**
476 * @brief Enables synchronous APIs.
477 * @note Disabling this option saves both code and data space.
478 */
479#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__)
480#define UART_USE_WAIT FALSE
481#endif
482
483/**
484 * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs.
485 * @note Disabling this option saves both code and data space.
486 */
487#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
488#define UART_USE_MUTUAL_EXCLUSION FALSE
489#endif
490
491/*===========================================================================*/
492/* USB driver related settings. */
493/*===========================================================================*/
494
495/**
496 * @brief Enables synchronous APIs.
497 * @note Disabling this option saves both code and data space.
498 */
499#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
500#define USB_USE_WAIT TRUE
501#endif
502
503/*===========================================================================*/
504/* WSPI driver related settings. */
505/*===========================================================================*/
506
507/**
508 * @brief Enables synchronous APIs.
509 * @note Disabling this option saves both code and data space.
510 */
511#if !defined(WSPI_USE_WAIT) || defined(__DOXYGEN__)
512#define WSPI_USE_WAIT TRUE
513#endif
514
515/**
516 * @brief Enables the @p wspiAcquireBus() and @p wspiReleaseBus() APIs.
517 * @note Disabling this option saves both code and data space.
518 */
519#if !defined(WSPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
520#define WSPI_USE_MUTUAL_EXCLUSION TRUE
521#endif
522
523#endif /* HALCONF_H */
524
525/** @} */
diff --git a/keyboards/durgod/k320/info.json b/keyboards/durgod/k320/info.json
new file mode 100644
index 000000000..0f0c584e6
--- /dev/null
+++ b/keyboards/durgod/k320/info.json
@@ -0,0 +1,462 @@
1{
2 "keyboard_name": "DURGOD Taurus K320",
3 "url": "https://www.durgod.com/page9?product_id=47&_l=en",
4 "maintainer": "dkjer",
5 "width": 18.25,
6 "height": 6.5,
7 "layouts": {
8 "LAYOUT_tkl_ansi": {
9 "layout": [
10 {
11 "label": "Esc",
12 "x": 0,
13 "y": 0
14 },
15 {
16 "label": "F1",
17 "x": 2,
18 "y": 0
19 },
20 {
21 "label": "F2",
22 "x": 3,
23 "y": 0
24 },
25 {
26 "label": "F3",
27 "x": 4,
28 "y": 0
29 },
30 {
31 "label": "F4",
32 "x": 5,
33 "y": 0
34 },
35 {
36 "label": "F5",
37 "x": 6.5,
38 "y": 0
39 },
40 {
41 "label": "F6",
42 "x": 7.5,
43 "y": 0
44 },
45 {
46 "label": "F7",
47 "x": 8.5,
48 "y": 0
49 },
50 {
51 "label": "F8",
52 "x": 9.5,
53 "y": 0
54 },
55 {
56 "label": "F9",
57 "x": 11,
58 "y": 0
59 },
60 {
61 "label": "F10",
62 "x": 12,
63 "y": 0
64 },
65 {
66 "label": "F11",
67 "x": 13,
68 "y": 0
69 },
70 {
71 "label": "F12",
72 "x": 14,
73 "y": 0
74 },
75 {
76 "label": "PrtSc",
77 "x": 15.25,
78 "y": 0
79 },
80 {
81 "label": "Scroll Lock",
82 "x": 16.25,
83 "y": 0
84 },
85 {
86 "label": "Pause",
87 "x": 17.25,
88 "y": 0
89 },
90 {
91 "label": "~",
92 "x": 0,
93 "y": 1.5
94 },
95 {
96 "label": "!",
97 "x": 1,
98 "y": 1.5
99 },
100 {
101 "label": "@",
102 "x": 2,
103 "y": 1.5
104 },
105 {
106 "label": "#",
107 "x": 3,
108 "y": 1.5
109 },
110 {
111 "label": "$",
112 "x": 4,
113 "y": 1.5
114 },
115 {
116 "label": "%",
117 "x": 5,
118 "y": 1.5
119 },
120 {
121 "label": "^",
122 "x": 6,
123 "y": 1.5
124 },
125 {
126 "label": "&",
127 "x": 7,
128 "y": 1.5
129 },
130 {
131 "label": "*",
132 "x": 8,
133 "y": 1.5
134 },
135 {
136 "label": "(",
137 "x": 9,
138 "y": 1.5
139 },
140 {
141 "label": ")",
142 "x": 10,
143 "y": 1.5
144 },
145 {
146 "label": "_",
147 "x": 11,
148 "y": 1.5
149 },
150 {
151 "label": "+",
152 "x": 12,
153 "y": 1.5
154 },
155 {
156 "label": "Backspace",
157 "x": 13,
158 "y": 1.5,
159 "w": 2
160 },
161 {
162 "label": "Insert",
163 "x": 15.25,
164 "y": 1.5
165 },
166 {
167 "label": "Home",
168 "x": 16.25,
169 "y": 1.5
170 },
171 {
172 "label": "PgUp",
173 "x": 17.25,
174 "y": 1.5
175 },
176 {
177 "label": "Tab",
178 "x": 0,
179 "y": 2.5,
180 "w": 1.5
181 },
182 {
183 "label": "Q",
184 "x": 1.5,
185 "y": 2.5
186 },
187 {
188 "label": "W",
189 "x": 2.5,
190 "y": 2.5
191 },
192 {
193 "label": "E",
194 "x": 3.5,
195 "y": 2.5
196 },
197 {
198 "label": "R",
199 "x": 4.5,
200 "y": 2.5
201 },
202 {
203 "label": "T",
204 "x": 5.5,
205 "y": 2.5
206 },
207 {
208 "label": "Y",
209 "x": 6.5,
210 "y": 2.5
211 },
212 {
213 "label": "U",
214 "x": 7.5,
215 "y": 2.5
216 },
217 {
218 "label": "I",
219 "x": 8.5,
220 "y": 2.5
221 },
222 {
223 "label": "O",
224 "x": 9.5,
225 "y": 2.5
226 },
227 {
228 "label": "P",
229 "x": 10.5,
230 "y": 2.5
231 },
232 {
233 "label": "{",
234 "x": 11.5,
235 "y": 2.5
236 },
237 {
238 "label": "}",
239 "x": 12.5,
240 "y": 2.5
241 },
242 {
243 "label": "|",
244 "x": 13.5,
245 "y": 2.5,
246 "w": 1.5
247 },
248 {
249 "label": "Delete",
250 "x": 15.25,
251 "y": 2.5
252 },
253 {
254 "label": "End",
255 "x": 16.25,
256 "y": 2.5
257 },
258 {
259 "label": "PgDn",
260 "x": 17.25,
261 "y": 2.5
262 },
263 {
264 "label": "Caps Lock",
265 "x": 0,
266 "y": 3.5,
267 "w": 1.75
268 },
269 {
270 "label": "A",
271 "x": 1.75,
272 "y": 3.5
273 },
274 {
275 "label": "S",
276 "x": 2.75,
277 "y": 3.5
278 },
279 {
280 "label": "D",
281 "x": 3.75,
282 "y": 3.5
283 },
284 {
285 "label": "F",
286 "x": 4.75,
287 "y": 3.5
288 },
289 {
290 "label": "G",
291 "x": 5.75,
292 "y": 3.5
293 },
294 {
295 "label": "H",
296 "x": 6.75,
297 "y": 3.5
298 },
299 {
300 "label": "J",
301 "x": 7.75,
302 "y": 3.5
303 },
304 {
305 "label": "K",
306 "x": 8.75,
307 "y": 3.5
308 },
309 {
310 "label": "L",
311 "x": 9.75,
312 "y": 3.5
313 },
314 {
315 "label": ":",
316 "x": 10.75,
317 "y": 3.5
318 },
319 {
320 "label": "\"",
321 "x": 11.75,
322 "y": 3.5
323 },
324 {
325 "label": "Enter",
326 "x": 12.75,
327 "y": 3.5,
328 "w": 2.25
329 },
330 {
331 "label": "Shift",
332 "x": 0,
333 "y": 4.5,
334 "w": 2.25
335 },
336 {
337 "label": "Z",
338 "x": 2.25,
339 "y": 4.5
340 },
341 {
342 "label": "X",
343 "x": 3.25,
344 "y": 4.5
345 },
346 {
347 "label": "C",
348 "x": 4.25,
349 "y": 4.5
350 },
351 {
352 "label": "V",
353 "x": 5.25,
354 "y": 4.5
355 },
356 {
357 "label": "B",
358 "x": 6.25,
359 "y": 4.5
360 },
361 {
362 "label": "N",
363 "x": 7.25,
364 "y": 4.5
365 },
366 {
367 "label": "M",
368 "x": 8.25,
369 "y": 4.5
370 },
371 {
372 "label": "<",
373 "x": 9.25,
374 "y": 4.5
375 },
376 {
377 "label": ">",
378 "x": 10.25,
379 "y": 4.5
380 },
381 {
382 "label": "?",
383 "x": 11.25,
384 "y": 4.5
385 },
386 {
387 "label": "Shift",
388 "x": 12.25,
389 "y": 4.5,
390 "w": 2.75
391 },
392 {
393 "label": "\u2191",
394 "x": 16.25,
395 "y": 4.5
396 },
397 {
398 "label": "Ctrl",
399 "x": 0,
400 "y": 5.5,
401 "w": 1.25
402 },
403 {
404 "label": "Win",
405 "x": 1.25,
406 "y": 5.5,
407 "w": 1.25
408 },
409 {
410 "label": "Alt",
411 "x": 2.5,
412 "y": 5.5,
413 "w": 1.25
414 },
415 {
416 "x": 3.75,
417 "y": 5.5,
418 "w": 6.25
419 },
420 {
421 "label": "Alt",
422 "x": 10,
423 "y": 5.5,
424 "w": 1.25
425 },
426 {
427 "label": "Fn",
428 "x": 11.25,
429 "y": 5.5,
430 "w": 1.25
431 },
432 {
433 "label": "Menu",
434 "x": 12.5,
435 "y": 5.5,
436 "w": 1.25
437 },
438 {
439 "label": "Ctrl",
440 "x": 13.75,
441 "y": 5.5,
442 "w": 1.25
443 },
444 {
445 "label": "\u2190",
446 "x": 15.25,
447 "y": 5.5
448 },
449 {
450 "label": "\u2193",
451 "x": 16.25,
452 "y": 5.5
453 },
454 {
455 "label": "\u2192",
456 "x": 17.25,
457 "y": 5.5
458 }
459 ]
460 }
461 }
462}
diff --git a/keyboards/durgod/k320/k320.c b/keyboards/durgod/k320/k320.c
new file mode 100644
index 000000000..f5500ea83
--- /dev/null
+++ b/keyboards/durgod/k320/k320.c
@@ -0,0 +1,42 @@
1/* Copyright 2021 kuenhlee and Don Kjer
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 "k320.h"
18
19/* Private Functions */
20void off_all_leds(void) {
21 writePinHigh(LED_CAPS_LOCK_PIN);
22 writePinHigh(LED_SCROLL_LOCK_PIN);
23 writePinHigh(LED_WIN_LOCK_PIN);
24 writePinHigh(LED_MR_LOCK_PIN);
25}
26
27void on_all_leds(void) {
28 writePinLow(LED_CAPS_LOCK_PIN);
29 writePinLow(LED_SCROLL_LOCK_PIN);
30 writePinLow(LED_WIN_LOCK_PIN);
31 writePinLow(LED_MR_LOCK_PIN);
32}
33
34/* WinLock and MR LEDs are non-standard. Need to override led init */
35void led_init_ports(void) {
36 setPinOutput(LED_CAPS_LOCK_PIN);
37 setPinOutput(LED_SCROLL_LOCK_PIN);
38 setPinOutput(LED_WIN_LOCK_PIN);
39 setPinOutput(LED_MR_LOCK_PIN);
40 off_all_leds();
41}
42
diff --git a/keyboards/durgod/k320/k320.h b/keyboards/durgod/k320/k320.h
new file mode 100644
index 000000000..1f5b884a7
--- /dev/null
+++ b/keyboards/durgod/k320/k320.h
@@ -0,0 +1,44 @@
1/* Copyright 2021 kuenhlee and Don Kjer
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#pragma once
17
18#include "quantum.h"
19
20/* Function Prototype */
21void off_all_leds(void);
22void on_all_leds(void);
23
24
25#define XXX KC_NO
26
27// This a shortcut to help you visually see your layout.
28#define LAYOUT_tkl_ansi( \
29 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \
30 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, K1F, \
31 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, \
32 K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, K3F, \
33 K40, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4D, K4E, K4F, \
34 K50, K51, K52, K56, K5A, K5B, K5C, K5D, K5E, K5F, \
35 K6F \
36) { \
37 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \
38 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, XXX, K1E, K1F }, \
39 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F }, \
40 { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E, K3F }, \
41 { K40, XXX, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, XXX, K4D, K4E, K4F }, \
42 { K50, K51, K52, XXX, XXX, XXX, K56, XXX, XXX, XXX, K5A, K5B, K5C, K5D, K5E, K5F }, \
43 { XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, K6F } \
44}
diff --git a/keyboards/durgod/k320/keymaps/default/keymap.c b/keyboards/durgod/k320/keymaps/default/keymap.c
new file mode 100644
index 000000000..64b98acff
--- /dev/null
+++ b/keyboards/durgod/k320/keymaps/default/keymap.c
@@ -0,0 +1,97 @@
1/* Copyright 2021 kuenhlee and Don Kjer
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// Layer shorthand
19enum _layer {
20 _BASE,
21 _FUNC
22};
23
24static bool win_key_locked = false;
25
26// Defines the keycodes used by our macros in process_record_user
27enum custom_keycodes {
28 KC_TGUI = SAFE_RANGE // Toggle between GUI Lock or Unlock
29};
30
31const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
32 /* Keymap _BASE: Base Layer (Default Layer)
33 * ,-----------------------------------------------------------. ,--------------.
34 * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus|
35 * |-----------------------------------------------------------| |--------------|
36 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp|
37 * |-----------------------------------------------------------| |--------------|
38 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn|
39 * |-----------------------------------------------------------| `--------------'
40 * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |
41 * |-----------------------------------------------------------| ,----.
42 * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up |
43 * |-----------------------------------------------------------| ,-------------.
44 * |Ctrl|Gui |Alt | Space |Alt |Func |App |Ctrl| |Lft| Dn |Rig |
45 * `-----------------------------------------------------------' `-------------'
46 */
47 [_BASE] = LAYOUT_tkl_ansi( /* Base Layer */
48 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,
49 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_PGUP,
50 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_INS, KC_HOME,
51 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_DEL, KC_END, KC_PGDN,
52 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_ENT, KC_UP,
53 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FUNC),KC_APP, KC_RCTL, KC_LEFT, KC_DOWN,
54 KC_RGHT
55 ),
56 /* Keymap _FUNC: Function Layer
57 * ,-----------------------------------------------------------. ,--------------.
58 * | |Play|Stop|Prev|Next| |Mute|Vol+|Vol-| | | | | | | | | | |
59 * |-----------------------------------------------------------| |--------------|
60 * | | | | | | | | | | | | | | | | | | |
61 * |-----------------------------------------------------------| |--------------|
62 * | | | | | | | | | | | | | | | | | | |
63 * |-----------------------------------------------------------| `--------------'
64 * | | | | | | | | | | | | | |
65 * |-----------------------------------------------------------| ,----.
66 * | | | | | | | | | | | | | | |
67 * |-----------------------------------------------------------| ,-------------.
68 * | |Lock| | | |Func | | | | | | |
69 * `-----------------------------------------------------------' `-------------'
70 */
71 [_FUNC] = LAYOUT_tkl_ansi( /* Function Layer */
72 _______, KC_MPLY, KC_MSTP, KC_MRWD, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, _______, _______,
73 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
74 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
75 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
76 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
77 _______, KC_TGUI, _______, _______, _______, _______, _______, _______, _______, _______,
78 _______
79 )
80};
81
82bool process_record_user(uint16_t keycode, keyrecord_t *record) {
83 switch (keycode) {
84 case KC_TGUI:
85 if (!record->event.pressed) {
86 // Toggle GUI lock on key release
87 win_key_locked = !win_key_locked;
88 writePin(LED_WIN_LOCK_PIN, !win_key_locked);
89 }
90 break;
91 case KC_LGUI:
92 if (win_key_locked) { return false; }
93 break;
94 }
95 return true;
96}
97
diff --git a/keyboards/durgod/k320/keymaps/default/readme.md b/keyboards/durgod/k320/keymaps/default/readme.md
new file mode 100644
index 000000000..e26c79c8a
--- /dev/null
+++ b/keyboards/durgod/k320/keymaps/default/readme.md
@@ -0,0 +1,14 @@
1# The default keymap for Durgod Taurus K320.
2
3Layer 0 : Standard ANSI 87 Keys TKL layout (Windows)
4
5Layer 1 : Media control and Windows lock key
6- Reusing Durgod's Original Media Control for Fn + F1 ~ Fn + F7
7- Fn + Windows to toggle Windows lock key functionality
8
9## Windows key lock
10
11You can hold down Fn + Windows key to disable the Windows key while in locked mode.
12The 'Lock' LED indicates if the Windows key is locked.
13
14This is similar to the stock K320 Windows key lock functionality.
diff --git a/keyboards/durgod/k320/keymaps/default_toggle_mac_windows/keymap.c b/keyboards/durgod/k320/keymaps/default_toggle_mac_windows/keymap.c
new file mode 100644
index 000000000..7fcf52cfe
--- /dev/null
+++ b/keyboards/durgod/k320/keymaps/default_toggle_mac_windows/keymap.c
@@ -0,0 +1,373 @@
1/* Copyright 2021 kuenhlee and Don Kjer
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// Layer shorthand
19enum _layer {
20 _WBL,
21 _WFL,
22 _WSL,
23 _MBL,
24 _MFL,
25 _MSL
26};
27
28#ifndef DEFAULT_LAYOUT
29# define DEFAULT_LAYOUT _WBL // Change to _MBL to boot into Mac layout.
30#endif
31#ifndef ALT_LAYOUT
32# define ALT_LAYOUT _MBL // Layout to display 'MR' led when active.
33#endif
34
35static bool win_key_locked = false;
36static bool mac_media_locked = false;
37static bool win_appkey_pressed = false;
38static bool mac_fnkey_pressed = false;
39
40
41// Defines the keycodes used by our macros in process_record_user
42enum custom_keycodes {
43 KC_TGUI = SAFE_RANGE, // Toggle between GUI Lock or Unlock (Windows)
44 KC_TMED, // Toggle between Fx keys or Media keys (Mac)
45 KC_WFN, // Windows function key
46 KC_MFN, // Mac function key
47 MO_WSL, // Windows system key
48 MO_MSL, // Mac system key
49 DF_W2MBL, // Change layout from Windows to Mac
50 DF_M2WBL // Change layout from Mac to Windows
51};
52
53const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
54 /* Keymap _WBL: Windows Base Layer (Default Layer)
55 * ,-----------------------------------------------------------. ,--------------.
56 * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus|
57 * |-----------------------------------------------------------| |--------------|
58 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp|
59 * |-----------------------------------------------------------| |--------------|
60 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn|
61 * |-----------------------------------------------------------| `--------------'
62 * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |
63 * |-----------------------------------------------------------| ,----.
64 * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up |
65 * |-----------------------------------------------------------| ,-------------.
66 * |Ctrl|Gui |Alt | Space |Alt |Func |App|Ctrl | |Lft| Dn |Rig |
67 * `-----------------------------------------------------------' `-------------'
68 */
69 [_WBL] = LAYOUT_tkl_ansi( /* Windows Base Layer */
70 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,
71 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_PGUP,
72 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_INS, KC_HOME,
73 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_DEL, KC_END, KC_PGDN,
74 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_ENT, KC_UP,
75 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_WFN, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN,
76 KC_RGHT
77 ),
78 /* Keymap _WFL: Windows Function Layer
79 * ,-----------------------------------------------------------. ,--------------.
80 * | |Play|Stop|Prev|Next| |Mute|Vol+|Vol-| | | | | | | | | | |
81 * |-----------------------------------------------------------| |--------------|
82 * | | | | | | | | | | | | | | | | | | |
83 * |-----------------------------------------------------------| |--------------|
84 * | | | | | | | | | | | | | | | | | | |
85 * |-----------------------------------------------------------| `--------------'
86 * | | | | | | | | | | | | | |
87 * |-----------------------------------------------------------| ,----.
88 * | | | | | | | | | | | | | | |
89 * |-----------------------------------------------------------| ,-------------.
90 * | |Lock| | | |Func |Sys| | | | | |
91 * `-----------------------------------------------------------' `-------------'
92 */
93 [_WFL] = LAYOUT_tkl_ansi( /* Windows First Layer */
94 _______, KC_MPLY, KC_MSTP, KC_MRWD, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, _______, _______,
95 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
96 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
97 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
98 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
99 _______, KC_TGUI, _______, _______, _______, _______, MO_WSL, _______, _______, _______,
100 _______
101 ),
102 /* Keymap _WSL: Windows System Layer
103 * ,-----------------------------------------------------------. ,--------------.
104 * |Reset |Sleep| | |Power| | | | | | | | | |MAC| | |
105 * |-----------------------------------------------------------| |--------------|
106 * | | | | | | | | | | | | | | | | | | |
107 * |-----------------------------------------------------------| |--------------|
108 * | | | | | | | | | | | | | | | | | | |
109 * |-----------------------------------------------------------| `--------------'
110 * | | | | | | | | | | | | | |
111 * |-----------------------------------------------------------| ,----.
112 * | | | | | | | | | | | | | | |
113 * |-----------------------------------------------------------| ,-------------.
114 * | | | | | |Func |Sys| | | | | |
115 * `-----------------------------------------------------------' `-------------'
116 */
117 [_WSL] = LAYOUT_tkl_ansi( /* Windows Second / System Layer */
118 RESET, KC_SLEP, XXXXXXX, XXXXXXX, KC_PWR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DF_W2MBL, XXXXXXX, XXXXXXX, XXXXXXX,
119 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
120 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
121 XXXXXXX, XXXXXXX, XXXXXXX, DEBUG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
122 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
123 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX,
124 XXXXXXX
125 ),
126
127 /* Keymap _MBL: Mac Base Layer (Alternate Layout)
128 * ,-----------------------------------------------------------. ,--------------.
129 * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| | f13| f14| f15|
130 * |-----------------------------------------------------------| |--------------|
131 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp|
132 * |-----------------------------------------------------------| |--------------|
133 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn|
134 * |-----------------------------------------------------------| `--------------'
135 * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |
136 * |-----------------------------------------------------------| ,----.
137 * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up |
138 * |-----------------------------------------------------------| ,-------------.
139 * |Ctrl|Alt |Gui | Space |Gui |Alt|Func |Ctrl | |Lft| Dn |Rig |
140 * `-----------------------------------------------------------' `-------------'
141 */
142 [_MBL] = LAYOUT_tkl_ansi( /* Mac Base Layer */
143 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_F13, KC_F14, KC_F15,
144 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_PGUP,
145 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_INS, KC_HOME,
146 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_DEL, KC_END, KC_PGDN,
147 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_ENT, KC_UP,
148 KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_MFN, KC_RCTL, KC_LEFT, KC_DOWN,
149 KC_RGHT
150 ),
151 /* Keymap _MFL: Mac Function Layer
152 * ,-----------------------------------------------------------. ,--------------.
153 * | |Bri-|Bri+|MCon|LPad| | | |Prv|Ply| |Nxt|Mute|Vol-|Vol+| |TMed| | |
154 * |-----------------------------------------------------------| |--------------|
155 * | | | | | | | | | | | | | | | | | | |
156 * |-----------------------------------------------------------| |--------------|
157 * | | | | | | | | | | | | | | | | | | |
158 * |-----------------------------------------------------------| `--------------'
159 * | | | | | | | | | | | | | |
160 * |-----------------------------------------------------------| ,----.
161 * | | | | | | | | | | | | | | |
162 * |-----------------------------------------------------------| ,-------------.
163 * | | | | | |Sys|Func | | | | | |
164 * `-----------------------------------------------------------' `-------------'
165 */
166 [_MFL] = LAYOUT_tkl_ansi( /* Mac First Layer */
167 _______, KC_BRID, KC_BRIU, _______, _______, _______, _______, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, KC_TMED, _______, _______,
168 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
169 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
170 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
171 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
172 _______, _______, _______, _______, _______, MO_MSL, _______, _______, _______, _______,
173 _______
174 ),
175 /* Keymap _MSL: Mac System Layer
176 * ,-----------------------------------------------------------. ,--------------.
177 * |Reset | | | |Sleep| | | | | | | | | |WIN| | |
178 * |-----------------------------------------------------------| |--------------|
179 * | | | | | | | | | | | | | | | | | | |
180 * |-----------------------------------------------------------| |--------------|
181 * | | | | | | | | | | | | | | | | | | |
182 * |-----------------------------------------------------------| `--------------'
183 * | | | | | | | | | | | | | |
184 * |-----------------------------------------------------------| ,----.
185 * | | | | | | | | | | | | | | |
186 * |-----------------------------------------------------------| ,-------------.
187 * | | | | | |Sys|Func | | | | | |
188 * `-----------------------------------------------------------' `-------------'
189 */
190 [_MSL] = LAYOUT_tkl_ansi( /* Mac Second / System Layer */
191 RESET, XXXXXXX, XXXXXXX, XXXXXXX, KC_SLEP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DF_M2WBL, XXXXXXX, XXXXXXX, XXXXXXX,
192 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
193 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
194 XXXXXXX, XXXXXXX, XXXXXXX, DEBUG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
195 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
196 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX,
197 XXXXXXX
198 )
199};
200
201void unlock_win_key(void) {
202 win_key_locked = false;
203 mac_media_locked = false;
204 writePinHigh(LED_WIN_LOCK_PIN);
205}
206
207void toggle_lock_win_key(void) {
208 win_key_locked = !win_key_locked;
209 writePin(LED_WIN_LOCK_PIN, !win_key_locked);
210}
211
212void toggle_lock_media_key(void) {
213 mac_media_locked = !mac_media_locked;
214 writePin(LED_WIN_LOCK_PIN, !mac_media_locked);
215}
216
217#ifdef CONSOLE_ENABLE
218void dprint_global_layers(void) {
219 dprint("Global Layers:");
220 if (IS_LAYER_ON(_WFL)) { dprint(" _WFL"); }
221 if (IS_LAYER_ON(_WSL)) { dprint(" _WSL"); }
222 if (IS_LAYER_ON(_MFL)) { dprint(" _MFL"); }
223 if (IS_LAYER_ON(_MSL)) { dprint(" _MSL"); }
224 dprintf("\n");
225}
226
227void dprint_layers(layer_state_t state) {
228 dprint("Layers:");
229 if (IS_LAYER_ON_STATE(state, _WFL)) { dprint(" _WFL"); }
230 if (IS_LAYER_ON_STATE(state, _WSL)) { dprint(" _WSL"); }
231 if (IS_LAYER_ON_STATE(state, _MFL)) { dprint(" _MFL"); }
232 if (IS_LAYER_ON_STATE(state, _MSL)) { dprint(" _MSL"); }
233 dprintf("\n");
234}
235#endif
236
237layer_state_t default_layer_state_set_user(layer_state_t state) {
238#ifdef CONSOLE_ENABLE
239 dprintf("default_layer_state_set_user: 0x%x\n", state);
240 dprint_global_layers();
241#endif
242 // Disable windows key lock on default layer transition.
243 unlock_win_key();
244 win_appkey_pressed = false;
245 mac_fnkey_pressed = false;
246 writePin(LED_MR_LOCK_PIN, !IS_LAYER_ON_STATE(state, ALT_LAYOUT));
247 return state;
248}
249
250layer_state_t layer_state_set_user(layer_state_t state) {
251#ifdef CONSOLE_ENABLE
252 dprintf("layer_state_set_user: 0x%x\n", state);
253 dprint_layers(state);
254#endif
255 return state;
256}
257
258bool process_record_user(uint16_t keycode, keyrecord_t *record) {
259 switch (keycode) {
260 case KC_TGUI:
261 if (!record->event.pressed) {
262 // Toggle GUI lock on key release
263 toggle_lock_win_key();
264 }
265 break;
266 case KC_TMED:
267 // Only trigger when Fn key is also held down, to avoid accidental unlock.
268 if (!mac_fnkey_pressed) { return false; }
269 if (!record->event.pressed) {
270 // Toggle Media Lock on key release
271 toggle_lock_media_key();
272 }
273 break;
274 case KC_LGUI:
275 if (win_key_locked) { return false; }
276 break;
277 case KC_WFN:
278 // Like MO(_WFL), but also enables _WSL if KC_APP is already pressed down.
279 if (record->event.pressed) {
280 layer_on(_WFL);
281 if (win_appkey_pressed) {
282 // Also enable Secondary layer if App key is being held down.
283 win_appkey_pressed = false;
284 layer_on(_WSL);
285 }
286 } else {
287 if (IS_LAYER_ON(_WFL)) { layer_off(_WFL); }
288 if (IS_LAYER_ON(_MSL)) { layer_off(_MSL); }
289 }
290 break;
291 case KC_APP:
292 if (record->event.pressed) {
293 // Don't actually press down the app menu key
294 win_appkey_pressed = true;
295 } else {
296 if (IS_LAYER_ON(_WSL)) { layer_off(_WSL); }
297 if (IS_LAYER_ON(_MFL)) { layer_off(_MFL); }
298 if (win_appkey_pressed) {
299 win_appkey_pressed = false;
300 // Tap the KC_APP key on key release.
301 tap_code(KC_APP);
302 }
303 }
304 return false;
305 break;
306 case KC_MFN:
307 // Mac Fn key. Emit Fn keycode, and also transition layers similar to KC_WFN.
308 if (record->event.pressed) {
309 mac_fnkey_pressed = true;
310 layer_on(_MFL);
311 // Also enable Secondary layer if Right-Alt key is being held down.
312 if (get_mods() & MOD_BIT(KC_RALT)) {
313 layer_on(_MSL);
314 }
315 } else {
316 mac_fnkey_pressed = false;
317 if (!mac_media_locked) {
318 if (IS_LAYER_ON(_MFL)) { layer_off(_MFL); }
319 if (IS_LAYER_ON(_WSL)) { layer_off(_WSL); }
320 }
321 }
322 break;
323 case KC_RALT:
324 // Disable MSL/WFL layer on key-up.
325 if (!record->event.pressed) {
326 if (IS_LAYER_ON(_MSL)) { layer_off(_MSL); }
327 if (IS_LAYER_ON(_WFL)) { layer_off(_WFL); }
328 }
329 break;
330 case MO_WSL:
331 if (record->event.pressed) {
332 layer_on(_WSL);
333 } else {
334 if (IS_LAYER_ON(_WSL)) { layer_off(_WSL); }
335 if (IS_LAYER_ON(_MFL)) { layer_off(_MFL); }
336 }
337 break;
338 case MO_MSL:
339 if (record->event.pressed) {
340 layer_on(_MSL);
341 } else {
342 if (IS_LAYER_ON(_MSL)) { layer_off(_MSL); }
343 if (IS_LAYER_ON(_WFL)) { layer_off(_WFL); }
344 }
345 break;
346 case DF_W2MBL:
347 if (!record->event.pressed) {
348 // Switch base layer, but preserve first/secondary layers.
349 default_layer_set(1UL<<_MBL);
350 layer_state_set(1UL<<_MFL | 1UL<<_MSL);
351 }
352 break;
353 case DF_M2WBL:
354 if (!record->event.pressed) {
355 // Switch base layer, but preserve first/secondary layers.
356 default_layer_set(1UL<<_WBL);
357 layer_state_set(1UL<<_WFL | 1UL<<_WSL);
358 }
359 break;
360 case RESET:
361 if (record->event.pressed) {
362 // Flash LEDs to indicate bootloader mode is enabled.
363 on_all_leds();
364 }
365 break;
366 }
367 return true;
368}
369
370void keyboard_post_init_user(void) {
371 default_layer_set(1UL<<DEFAULT_LAYOUT);
372}
373
diff --git a/keyboards/durgod/k320/keymaps/default_toggle_mac_windows/readme.md b/keyboards/durgod/k320/keymaps/default_toggle_mac_windows/readme.md
new file mode 100644
index 000000000..821c8b26a
--- /dev/null
+++ b/keyboards/durgod/k320/keymaps/default_toggle_mac_windows/readme.md
@@ -0,0 +1,64 @@
1# A keymap for Durgod Taurus K320 that supports toggling between Mac and Windows
2
3Layer 0 : Standard ANSI 87 Keys TKL layout (Windows)
4
5Layer 1 : Media control and Windows lock key (Windows)
6- Reusing Durgod's Original Media Control for Fn + F1 ~ Fn + F7
7- Fn + Windows to toggle Windows lock key functionality
8
9Layer 2 : System layer (Windows)
10- Fn + Menu + Esc : Bootloader mode
11- Fn + Menu + F1 : System Sleep
12- Fn + Menu + F4 : Turning Off System
13- Fn + Menu + F12 : Switch to Mac layout
14
15Layer 3 : Mac 87 Keys TKL layout
16
17Layer 4 : Media control and Media lock key (Mac)
18 - Standard Mac Media keys for Fn + F1 ~ Fn + F12.
19 - Fn + F13 to toggle Media lock key functionality
20
21Layer 5 : System layer (Mac)
22- Fn + R-ALT + Esc : Bootloader mode
23- Fn + R-ALT + F4 : Shutdown/Sleep (Hold down on Mac)
24- Fn + R-ALT + F12 : Switch to Windows layout
25
26## Toggle between Mac and Windows layout
27
28You can switch between Mac and Windows layout by doing the following:
29- Hold down Fn + Menu (Windows Layout) or Fn + Right-Alt (Mac layout) (These are the same physical keys)
30- Press F12
31
32The 'M' led will be lit when you are using the alternate layout. By default Mac is the alternate layout.
33
34You can change the default & alternate layout by setting the following flags to either '_WBL'(Windows) or '_MBL' (Mac)
35- DEFAULT_LAYOUT (initial layout to use on boot)
36- ALT_LAYOUT (layout that will light the 'M' LED when active)
37
38For example, to configure Mac as the default layer, and Windows to be the alternate layout, compile with these flags:
39
40 make EXTRAFLAGS="-DDEFAULT_LAYOUT=_MBL -DALT_LAYOUT=_WBL" durgod/k320:default_toggle_mac_windows
41
42## Windows key lock
43
44In windows layout, you can hold down Fn + Windows key to disable the Windows key while in locked mode. The 'Lock' LED
45indicates if the Windows key is locked.
46
47This is similar to the stock K320 Windows key lock functionality.
48
49## Mac Media Lock
50
51To switch between Function row and Media row in Mac layout, press Fn + PrtSc. The 'Lock' LED indicator will be lit when in Media row mode.
52
53### Subsequent Flashing
54
55For repeating Flashing you have two options with this keymap:
561. Use BootMagic
57- BootMagic Lite has been enabled with Assigned "Esc" key
58- Unplug USB Cable
59- Holding Esc Button
60- Plug in USB Cable, Keyboard should be in ST-Bootloader state
612. Use key combination if using default keymap
62- Hold down Fn + Menu (Windows Layout) or Fn + Right-Alt (Mac layout) (These are the same physical keys)
63- Press Esc. Keyboard should go into booloader state.
64
diff --git a/keyboards/durgod/k320/keymaps/kuenhlee/keymap.c b/keyboards/durgod/k320/keymaps/kuenhlee/keymap.c
new file mode 100644
index 000000000..6a42210f8
--- /dev/null
+++ b/keyboards/durgod/k320/keymaps/kuenhlee/keymap.c
@@ -0,0 +1,154 @@
1/* Copyright 2021 kuenhlee
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// Layer shorthand
19#define _BL 0u
20#define _FL 1u // Multimedia Related, Virtual Desktop control
21#define _SL 2u // Just for System Related
22#define _UL 3u // Unicode Map
23
24#define KC_ADTP LGUI(LCTL(KC_D)) // Adding New Virtual Desktop
25#define KC_DDTP LGUI(LCTL(KC_F4)) // Deleting / Removing Current Virtual Desktop
26#define KC_NDTP LGUI(LCTL(KC_RGHT)) // Navigate to the Next Virtual Desktop
27#define KC_PDTP LGUI(LCTL(KC_LEFT)) // Navigate to the Previous Virtual Desktop
28#define KC_WINL LGUI(KC_LEFT) // Snap Windows to Left
29#define KC_WINR LGUI(KC_RGHT) // Snap Windows to Right
30#define KC_WINU LGUI(KC_UP) // Maximize the Window
31#define KC_WIND LGUI(KC_DOWN) // Minimize the desktop window
32#define KC_TASK LCTL(LSFT(KC_ESC)) // Launch Task Manager
33
34#define KC_FIND LCTL(LSFT(KC_F)) // Find In Files
35#define KC_STOP LCTL(LSFT(KC_HOME)) // Select from Cursor to Home
36#define KC_SEND LCTL(LSFT(KC_END)) // Select from Cursor to End
37
38// Defines the keycodes used by our macros in process_record_user
39enum custom_keycodes {
40 KC_TGUI = SAFE_RANGE // Toggle between GUI Lock or Unlock
41};
42
43// °±²³µ©ΩθΩ√∞∆≈≠→↓←↑≡■□●○∴«»÷≤≥Σ
44// Defines the Enumeration for Unicode Map
45enum unicode_names {
46 DEGR,
47 PONE,
48 POW2,
49 POW3,
50 MYU,
51 COPY,
52 THET,
53 OHM,
54 SQRT,
55 INFI,
56 DELT,
57 APPR,
58 NEQU,
59 RARR,
60 DARR,
61 LARR,
62 UARR,
63 SAME,
64 BSQR,
65 WSQR,
66 BDOT,
67 WDOT,
68 THFR,
69 DIV,
70 LTOE,
71 MTOE,
72 DLAR,
73 DRAR,
74 SUM,
75};
76
77const uint32_t PROGMEM unicode_map[] = {
78 [DEGR] = 0x00B0, // °
79 [PONE] = 0x00B1, // ±
80 [POW2] = 0x00B2, // ²
81 [POW3] = 0x00B3, // ³
82 [MYU] = 0x00B5, // µ
83 [COPY] = 0x00A9, // ©
84 [THET] = 0x03B8, // θ
85 [OHM] = 0x2126, // Ω
86 [SQRT] = 0x221A, // √
87 [INFI] = 0x221E, // ∞
88 [DELT] = 0x0394, // ∆
89 [APPR] = 0x2248, // ≈
90 [NEQU] = 0x2260, // ≠
91 [RARR] = 0x2192, // →
92 [DARR] = 0x2193, // ↓
93 [LARR] = 0x2190, // ←
94 [UARR] = 0x2191, // ↑
95 [SAME] = 0x2261, // ≡
96 [BSQR] = 0x25A0, // ■
97 [WSQR] = 0x25A1, // □
98 [BDOT] = 0x25CF, // ●
99 [WDOT] = 0x25CB, // ○
100 [THFR] = 0x2234, // ∴
101 [DIV] = 0x00F7, // ÷
102 [LTOE] = 0x2264, // ≤
103 [MTOE] = 0x2265, // ≥
104 [DLAR] = 0x00AB, // «
105 [DRAR] = 0x00BB, // »
106 [SUM] = 0x03A3 // Σ
107};
108
109
110const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
111 [_BL] = LAYOUT_tkl_ansi( /* Base Layer */
112 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,
113 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_PGUP,
114 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_INS, KC_HOME,
115 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_DEL, KC_END, KC_PGDN,
116 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_ENT, KC_UP,
117 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN,
118 KC_RGHT
119 ),
120
121 [_FL] = LAYOUT_tkl_ansi( /* First Layer */
122 KC_TRNS, KC_MPLY, KC_MSTP, KC_MRWD, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_CALC, XXXXXXX, XXXXXXX, XXXXXXX,
123 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PDTP,
124 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_TASK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MSEL, XXXXXXX, XXXXXXX, XXXXXXX, KC_ADTP, KC_STOP,
125 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_FIND, KC_WHOM, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DDTP, KC_SEND, KC_NDTP,
126 XXXXXXX, XXXXXXX, XXXXXXX, KC_MYCM, XXXXXXX, XXXXXXX, XXXXXXX, KC_MAIL, XXXXXXX, XXXXXXX, XXXXXXX, KC_MENU, XXXXXXX, KC_WINU,
127 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MO(_SL), KC_TRNS, MO(_UL), XXXXXXX, KC_WINL, KC_WIND,
128 KC_WINR
129 ),
130
131 [_SL] = LAYOUT_tkl_ansi( /* Second Layer */
132 XXXXXXX, KC_SLEP, XXXXXXX, XXXXXXX, KC_PWR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
133 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
134 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
135 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
136 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
137 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
138 XXXXXXX
139 ),
140
141 [_UL] = LAYOUT_tkl_ansi( /* Unicode Layer */
142 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
143 X(APPR), X(NEQU), X(POW2), X(POW3), XXXXXXX, XXXXXXX, X(BSQR), X(WSQR), X(INFI), X(BDOT), X(WDOT), XXXXXXX, X(PONE), XXXXXXX, XXXXXXX,
144 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, X(SUM), XXXXXXX, X(MYU), X(SAME), XXXXXXX, X(OHM), X(DLAR), X(DRAR), XXXXXXX, XXXXXXX, XXXXXXX,
145 XXXXXXX, XXXXXXX, X(SQRT), X(DELT), XXXXXXX, XXXXXXX, X(THFR), XXXXXXX, XXXXXXX, XXXXXXX, X(THET), X(DEGR), XXXXXXX, XXXXXXX, XXXXXXX,
146 XXXXXXX, XXXXXXX, XXXXXXX, X(COPY), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, X(LTOE), X(MTOE), X(DIV), XXXXXXX, XXXXXXX, X(UARR),
147 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_TRNS, KC_TRNS, XXXXXXX, X(LARR), X(DARR),
148 X(RARR)
149 )
150};
151
152void matrix_init_user(void) {
153 set_unicode_input_mode(UC_WINC);
154}
diff --git a/keyboards/durgod/k320/keymaps/kuenhlee/readme.md b/keyboards/durgod/k320/keymaps/kuenhlee/readme.md
new file mode 100644
index 000000000..60925e61c
--- /dev/null
+++ b/keyboards/durgod/k320/keymaps/kuenhlee/readme.md
@@ -0,0 +1,38 @@
1# The kuenhlee keymap for Durgod Taurus K320.
2
3Layer 0 : Standard ANSI 87 Keys TKL layout
4------------------------------------------
5
6Layer 1 : Media control and Key Modifier for Virtual Desktop navagation
7-----------------------------------------------------------------------
8- Reusing Durgod's Original Media Control for Fn + F1 ~ Fn + F7
9 - Fn + F12 Remapped to Launch Calculator
10 - Fn + M To Launch Media Player
11 - Fn + P To Mail Client
12 - Fn + G To Launch Web Browswer / Nagivate to Homepage
13 - Fn + C To Launch My Computer
14 - Fn + T Launch Task Manager
15 - Fn + F Find in Files ( Notepad ++ )
16
17- Windows's Virtual Desktop Navigation
18 - Fn + Ins To add New Virtual Desktop
19 - Fn + Del To Delete / Remove Current Virtual Desktop
20 - Fn + PgUp Navigate to the Next Virtual Desktop
21 - Fn + PgDn Navigate to the Previous Virtual Desktop
22
23- Windows ShortKeys
24 - Fn + Left Snap Windows to Left
25 - Fn + Right Snap Windows to Right
26 - Fn + Up Maximize the Window
27 - Fn + Down Minimize the desktop window
28 - Fn + Home Select from Cursor to Home
29 - Fn + End Select from Cursor to End
30
31Layer 2 : Mainly for Windows Sleep and Shutdown
32-----------------------------------------------
33- Fn + R-ALT + F1 : System Sleep
34- Fn + R-ALT + F4 : Turning Off System
35
36Layer Unicode : Mainly for Predefined Unicode code to work with WinCompose
37--------------------------------------------------------------------------
38- °±²³µ©ΩθΩ√∞∆≈≠→↓←↑≡■□●○∴«»÷≤≥Σ \ No newline at end of file
diff --git a/keyboards/durgod/k320/keymaps/kuenhlee/rules.mk b/keyboards/durgod/k320/keymaps/kuenhlee/rules.mk
new file mode 100644
index 000000000..b6a7e51c1
--- /dev/null
+++ b/keyboards/durgod/k320/keymaps/kuenhlee/rules.mk
@@ -0,0 +1,4 @@
1# Build Options
2# change yes to no to disable
3#
4UNICODEMAP_ENABLE = yes # Enable Unicode Map
diff --git a/keyboards/durgod/k320/mcuconf.h b/keyboards/durgod/k320/mcuconf.h
new file mode 100644
index 000000000..6d67aa96a
--- /dev/null
+++ b/keyboards/durgod/k320/mcuconf.h
@@ -0,0 +1,176 @@
1/*
2 ChibiOS - Copyright (C) 2006..2015 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 * STM32F0xx 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 * 3...0 Lowest...Highest.
29 *
30 * DMA priorities:
31 * 0...3 Lowest...Highest.
32 */
33
34#define STM32F0xx_MCUCONF
35// #define STM32F070xB
36
37/*
38 * HAL driver system settings.
39 */
40#define STM32_NO_INIT FALSE
41#define STM32_PVD_ENABLE FALSE
42#define STM32_PLS STM32_PLS_LEV0
43#define STM32_HSI_ENABLED TRUE
44#define STM32_HSI14_ENABLED TRUE
45#define STM32_HSI48_ENABLED FALSE
46#define STM32_LSI_ENABLED TRUE
47#define STM32_HSE_ENABLED TRUE
48#define STM32_LSE_ENABLED FALSE
49#define STM32_SW STM32_SW_PLL
50#define STM32_PLLSRC STM32_PLLSRC_HSE
51#define STM32_PREDIV_VALUE 1
52#define STM32_PLLMUL_VALUE 4
53#define STM32_HPRE STM32_HPRE_DIV1
54#define STM32_PPRE STM32_PPRE_DIV1
55#define STM32_ADCSW STM32_ADCSW_HSI14
56#define STM32_ADCPRE STM32_ADCPRE_DIV4
57#define STM32_MCOSEL STM32_MCOSEL_SYSCLK
58#define STM32_ADCPRE STM32_ADCPRE_DIV4
59#define STM32_ADCSW STM32_ADCSW_HSI14
60#define STM32_USBSW STM32_USBSW_PCLK
61#define STM32_CECSW STM32_CECSW_HSI
62#define STM32_I2C1SW STM32_I2C1SW_SYSCLK
63#define STM32_USART1SW STM32_USART1SW_PCLK
64#define STM32_RTCSEL STM32_RTCSEL_LSI
65
66/*
67 * ADC driver system settings.
68 */
69#define STM32_ADC_USE_ADC1 FALSE
70#define STM32_ADC_ADC1_DMA_PRIORITY 2
71#define STM32_ADC_IRQ_PRIORITY 2
72#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2
73
74/*
75 * EXT driver system settings.
76 */
77#define STM32_EXT_EXTI0_1_IRQ_PRIORITY 3
78#define STM32_EXT_EXTI2_3_IRQ_PRIORITY 3
79#define STM32_EXT_EXTI4_15_IRQ_PRIORITY 3
80#define STM32_EXT_EXTI16_IRQ_PRIORITY 3
81#define STM32_EXT_EXTI17_IRQ_PRIORITY 3
82
83/*
84 * GPT driver system settings.
85 */
86#define STM32_GPT_USE_TIM1 FALSE
87#define STM32_GPT_USE_TIM2 FALSE
88#define STM32_GPT_USE_TIM3 FALSE
89#define STM32_GPT_USE_TIM14 FALSE
90#define STM32_GPT_TIM1_IRQ_PRIORITY 2
91#define STM32_GPT_TIM2_IRQ_PRIORITY 2
92#define STM32_GPT_TIM3_IRQ_PRIORITY 2
93#define STM32_GPT_TIM14_IRQ_PRIORITY 2
94
95/*
96 * I2C driver system settings.
97 */
98#define STM32_I2C_USE_I2C1 TRUE
99#define STM32_I2C_USE_I2C2 FALSE
100#define STM32_I2C_BUSY_TIMEOUT 50
101#define STM32_I2C_I2C1_IRQ_PRIORITY 3
102#define STM32_I2C_I2C2_IRQ_PRIORITY 3
103#define STM32_I2C_USE_DMA TRUE
104#define STM32_I2C_I2C1_DMA_PRIORITY 1
105#define STM32_I2C_I2C2_DMA_PRIORITY 1
106#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
107#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
108#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure")
109
110/*
111 * ICU driver system settings.
112 */
113#define STM32_ICU_USE_TIM1 FALSE
114#define STM32_ICU_USE_TIM2 FALSE
115#define STM32_ICU_USE_TIM3 FALSE
116#define STM32_ICU_TIM1_IRQ_PRIORITY 3
117#define STM32_ICU_TIM2_IRQ_PRIORITY 3
118#define STM32_ICU_TIM3_IRQ_PRIORITY 3
119
120/*
121 * PWM driver system settings.
122 */
123#define STM32_PWM_USE_ADVANCED FALSE
124#define STM32_PWM_USE_TIM1 FALSE
125#define STM32_PWM_USE_TIM2 FALSE
126#define STM32_PWM_USE_TIM3 FALSE
127#define STM32_PWM_TIM1_IRQ_PRIORITY 3
128#define STM32_PWM_TIM2_IRQ_PRIORITY 3
129#define STM32_PWM_TIM3_IRQ_PRIORITY 3
130
131/*
132 * SERIAL driver system settings.
133 */
134#define STM32_SERIAL_USE_USART1 FALSE
135#define STM32_SERIAL_USE_USART2 FALSE
136#define STM32_SERIAL_USART1_PRIORITY 3
137#define STM32_SERIAL_USART2_PRIORITY 3
138
139/*
140 * SPI driver system settings.
141 */
142#define STM32_SPI_USE_SPI1 FALSE
143#define STM32_SPI_USE_SPI2 FALSE
144#define STM32_SPI_SPI1_DMA_PRIORITY 1
145#define STM32_SPI_SPI2_DMA_PRIORITY 1
146#define STM32_SPI_SPI1_IRQ_PRIORITY 2
147#define STM32_SPI_SPI2_IRQ_PRIORITY 2
148#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
149#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
150#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
151
152/*
153 * ST driver system settings.
154 */
155#define STM32_ST_IRQ_PRIORITY 2
156#define STM32_ST_USE_TIMER 3
157
158/*
159 * UART driver system settings.
160 */
161#define STM32_UART_USE_USART1 FALSE
162#define STM32_UART_USE_USART2 FALSE
163#define STM32_UART_USART1_IRQ_PRIORITY 3
164#define STM32_UART_USART2_IRQ_PRIORITY 3
165#define STM32_UART_USART1_DMA_PRIORITY 0
166#define STM32_UART_USART2_DMA_PRIORITY 0
167#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
168
169/*
170 * USB driver system settings.
171 */
172#define STM32_USB_USE_USB1 TRUE
173#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE
174#define STM32_USB_USB1_LP_IRQ_PRIORITY 3
175
176#endif /* _MCUCONF_H_ */
diff --git a/keyboards/durgod/k320/readme.md b/keyboards/durgod/k320/readme.md
new file mode 100644
index 000000000..839a2c74a
--- /dev/null
+++ b/keyboards/durgod/k320/readme.md
@@ -0,0 +1,60 @@
1# K320
2
3This is a standard fixed ANSI TKL from off the shelf Durgod Taurus K320 without Backlight.
4
5* Keyboard Maintainer: [dkjer](https://github.com/dkjer)
6* Hardware Supported: Durgod Taurus K320 board with STM32F070RBT6
7* Hardware Availability: https://www.durgod.com/page9?product_id=47&_l=en
8
9## Instructions
10
11### Build
12
13Make command example for this keyboard (after setting up your build environment):
14
15 make durgod/k320:default
16
17Flashing example for this keyboard:
18
19 make durgod/k320:default:flash
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).
22
23### Initial Flash
24
25For first Flashing from initial Stock's Firmware
26
271. Back up original Firmware Image:
28- Unplug
29- Short Boot0 to Vdd (See below)
30- Plug In USB
31- Make a Flash Image's Backup in case you wanted to restore the Keyboard to Stock's Image:
32 - Using DFUseDemo.exe from ST's STSW-STM32080: https://www.st.com/en/development-tools/stsw-stm32080.html
33 - Using dfu-util (thanks to [tylert](https://github.com/tylert) for instructions!):
34
35
36 dfu-util --list
37 dfu-util --alt 0 --dfuse-address 0x08000000 --upload ${OLD_STOCK_BIN}
38
392. Flash the QMK Firmware Image.
40- Put board into Bootloader mode, using the same method as when backing up the original Firmware (above)
41- Here are a few options for performing the initial Flash:
42 - Using [QMK Toolbox](https://github.com/qmk/qmk_toolbox)
43 - Using DFuseDemo.exe if STTub30 driver is used.
44 - Using dfu-util:
45
46
47 dfu-util --alt 0 --dfuse-address 0x08000000 --upload ${NEW_QMK_BIN}
48
49You can short Boot0 to Vdd by shorting R21 to C27 on the sides closest to the processor, as shown:
50
51<img src="https://i.imgur.com/hvDnw5a.jpg" width="520" height="693" alt="Shorting Boot0 to Vdd on K320">
52
53### Subsequent Flashing
54
55For repeating Flashing you can use BootMagic:
56- BootMagic Lite has been enabled with Assigned "Esc" key
57- Unplug USB Cable
58- Holding Esc Button
59- Plug in USB Cable, Keyboard should be in ST-Bootloader state
60
diff --git a/keyboards/durgod/k320/rules.mk b/keyboards/durgod/k320/rules.mk
new file mode 100644
index 000000000..3fb50bb8a
--- /dev/null
+++ b/keyboards/durgod/k320/rules.mk
@@ -0,0 +1,27 @@
1# MCU name
2# Actually F070, but close enough
3MCU = STM32F072
4
5BOARD = ST_NUCLEO64_F070RB
6
7# Do not put the microcontroller into power saving mode
8OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
9
10# Build Options
11# change yes to no to disable
12#
13BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
14MOUSEKEY_ENABLE = no # Mouse keys
15EXTRAKEY_ENABLE = yes # Audio control and System control
16CONSOLE_ENABLE = no # Console for debug
17COMMAND_ENABLE = no # Commands for debug and configuration
18# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
19SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
20# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
21NKRO_ENABLE = yes # USB Nkey Rollover
22BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
23RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
24BLUETOOTH_ENABLE = no # Enable Bluetooth
25AUDIO_ENABLE = no # Audio output
26
27LAYOUTS = tkl_ansi