aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaleb Elwert <belak@coded.io>2017-01-03 23:41:52 -0800
committerKaleb Elwert <belak@coded.io>2017-01-03 23:41:52 -0800
commit8377d5fdc57ab0a4f1757d9f787592ede1b94cfe (patch)
tree592977342bf2e36d73742c5334a7c4d8da308050
parent847377fb43356cc1d3dff20ff1d5030a833cca41 (diff)
downloadqmk_firmware-8377d5fdc57ab0a4f1757d9f787592ede1b94cfe.tar.gz
qmk_firmware-8377d5fdc57ab0a4f1757d9f787592ede1b94cfe.zip
Initial whitefox support
-rw-r--r--keyboards/whitefox/Makefile3
-rw-r--r--keyboards/whitefox/bootloader_defs.h1
-rw-r--r--keyboards/whitefox/chconf.h524
-rw-r--r--keyboards/whitefox/config.h78
-rw-r--r--keyboards/whitefox/halconf.h353
-rw-r--r--keyboards/whitefox/keymaps/default/keymap.c51
-rw-r--r--keyboards/whitefox/keymaps/matt3o/keymap.c92
-rw-r--r--keyboards/whitefox/led.c24
-rw-r--r--keyboards/whitefox/matrix.c132
-rw-r--r--keyboards/whitefox/mcuconf.h66
-rw-r--r--keyboards/whitefox/rules.mk68
-rw-r--r--keyboards/whitefox/whitefox.c17
-rw-r--r--keyboards/whitefox/whitefox.h54
13 files changed, 1463 insertions, 0 deletions
diff --git a/keyboards/whitefox/Makefile b/keyboards/whitefox/Makefile
new file mode 100644
index 000000000..4e2a6f00f
--- /dev/null
+++ b/keyboards/whitefox/Makefile
@@ -0,0 +1,3 @@
1ifndef MAKEFILE_INCLUDED
2 include ../../Makefile
3endif \ No newline at end of file
diff --git a/keyboards/whitefox/bootloader_defs.h b/keyboards/whitefox/bootloader_defs.h
new file mode 100644
index 000000000..c67153be6
--- /dev/null
+++ b/keyboards/whitefox/bootloader_defs.h
@@ -0,0 +1 @@
#define KIIBOHD_BOOTLOADER
diff --git a/keyboards/whitefox/chconf.h b/keyboards/whitefox/chconf.h
new file mode 100644
index 000000000..43c845739
--- /dev/null
+++ b/keyboards/whitefox/chconf.h
@@ -0,0 +1,524 @@
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/**
18 * @file templates/chconf.h
19 * @brief Configuration file template.
20 * @details A copy of this file must be placed in each project directory, it
21 * contains the application specific kernel settings.
22 *
23 * @addtogroup config
24 * @details Kernel related settings and hooks.
25 * @{
26 */
27
28#ifndef CHCONF_H
29#define CHCONF_H
30
31#define _CHIBIOS_RT_CONF_
32
33/*===========================================================================*/
34/**
35 * @name System timers settings
36 * @{
37 */
38/*===========================================================================*/
39
40/**
41 * @brief System time counter resolution.
42 * @note Allowed values are 16 or 32 bits.
43 */
44#define CH_CFG_ST_RESOLUTION 32
45
46/**
47 * @brief System tick frequency.
48 * @details Frequency of the system timer that drives the system ticks. This
49 * setting also defines the system tick time unit.
50 */
51#define CH_CFG_ST_FREQUENCY 1000
52
53/**
54 * @brief Time delta constant for the tick-less mode.
55 * @note If this value is zero then the system uses the classic
56 * periodic tick. This value represents the minimum number
57 * of ticks that is safe to specify in a timeout directive.
58 * The value one is not valid, timeouts are rounded up to
59 * this value.
60 */
61#define CH_CFG_ST_TIMEDELTA 0
62
63/** @} */
64
65/*===========================================================================*/
66/**
67 * @name Kernel parameters and options
68 * @{
69 */
70/*===========================================================================*/
71
72/**
73 * @brief Round robin interval.
74 * @details This constant is the number of system ticks allowed for the
75 * threads before preemption occurs. Setting this value to zero
76 * disables the preemption for threads with equal priority and the
77 * round robin becomes cooperative. Note that higher priority
78 * threads can still preempt, the kernel is always preemptive.
79 * @note Disabling the round robin preemption makes the kernel more compact
80 * and generally faster.
81 * @note The round robin preemption is not supported in tickless mode and
82 * must be set to zero in that case.
83 */
84#define CH_CFG_TIME_QUANTUM 20
85
86/**
87 * @brief Managed RAM size.
88 * @details Size of the RAM area to be managed by the OS. If set to zero
89 * then the whole available RAM is used. The core memory is made
90 * available to the heap allocator and/or can be used directly through
91 * the simplified core memory allocator.
92 *
93 * @note In order to let the OS manage the whole RAM the linker script must
94 * provide the @p __heap_base__ and @p __heap_end__ symbols.
95 * @note Requires @p CH_CFG_USE_MEMCORE.
96 */
97#define CH_CFG_MEMCORE_SIZE 0
98
99/**
100 * @brief Idle thread automatic spawn suppression.
101 * @details When this option is activated the function @p chSysInit()
102 * does not spawn the idle thread. The application @p main()
103 * function becomes the idle thread and must implement an
104 * infinite loop.
105 */
106#define CH_CFG_NO_IDLE_THREAD FALSE
107
108/* Use __WFI in the idle thread for waiting. Does lower the power
109 * consumption. */
110#define CORTEX_ENABLE_WFI_IDLE TRUE
111
112/** @} */
113
114/*===========================================================================*/
115/**
116 * @name Performance options
117 * @{
118 */
119/*===========================================================================*/
120
121/**
122 * @brief OS optimization.
123 * @details If enabled then time efficient rather than space efficient code
124 * is used when two possible implementations exist.
125 *
126 * @note This is not related to the compiler optimization options.
127 * @note The default is @p TRUE.
128 */
129#define CH_CFG_OPTIMIZE_SPEED TRUE
130
131/** @} */
132
133/*===========================================================================*/
134/**
135 * @name Subsystem options
136 * @{
137 */
138/*===========================================================================*/
139
140/**
141 * @brief Time Measurement APIs.
142 * @details If enabled then the time measurement APIs are included in
143 * the kernel.
144 *
145 * @note The default is @p TRUE.
146 */
147#define CH_CFG_USE_TM FALSE
148
149/**
150 * @brief Threads registry APIs.
151 * @details If enabled then the registry APIs are included in the kernel.
152 *
153 * @note The default is @p TRUE.
154 */
155#define CH_CFG_USE_REGISTRY TRUE
156
157/**
158 * @brief Threads synchronization APIs.
159 * @details If enabled then the @p chThdWait() function is included in
160 * the kernel.
161 *
162 * @note The default is @p TRUE.
163 */
164#define CH_CFG_USE_WAITEXIT TRUE
165
166/**
167 * @brief Semaphores APIs.
168 * @details If enabled then the Semaphores APIs are included in the kernel.
169 *
170 * @note The default is @p TRUE.
171 */
172#define CH_CFG_USE_SEMAPHORES TRUE
173
174/**
175 * @brief Semaphores queuing mode.
176 * @details If enabled then the threads are enqueued on semaphores by
177 * priority rather than in FIFO order.
178 *
179 * @note The default is @p FALSE. Enable this if you have special
180 * requirements.
181 * @note Requires @p CH_CFG_USE_SEMAPHORES.
182 */
183#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
184
185/**
186 * @brief Mutexes APIs.
187 * @details If enabled then the mutexes APIs are included in the kernel.
188 *
189 * @note The default is @p TRUE.
190 */
191#define CH_CFG_USE_MUTEXES TRUE
192
193/**
194 * @brief Enables recursive behavior on mutexes.
195 * @note Recursive mutexes are heavier and have an increased
196 * memory footprint.
197 *
198 * @note The default is @p FALSE.
199 * @note Requires @p CH_CFG_USE_MUTEXES.
200 */
201#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
202
203/**
204 * @brief Conditional Variables APIs.
205 * @details If enabled then the conditional variables APIs are included
206 * in the kernel.
207 *
208 * @note The default is @p TRUE.
209 * @note Requires @p CH_CFG_USE_MUTEXES.
210 */
211#define CH_CFG_USE_CONDVARS TRUE
212
213/**
214 * @brief Conditional Variables APIs with timeout.
215 * @details If enabled then the conditional variables APIs with timeout
216 * specification are included in the kernel.
217 *
218 * @note The default is @p TRUE.
219 * @note Requires @p CH_CFG_USE_CONDVARS.
220 */
221#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE
222
223/**
224 * @brief Events Flags APIs.
225 * @details If enabled then the event flags APIs are included in the kernel.
226 *
227 * @note The default is @p TRUE.
228 */
229#define CH_CFG_USE_EVENTS TRUE
230
231/**
232 * @brief Events Flags APIs with timeout.
233 * @details If enabled then the events APIs with timeout specification
234 * are included in the kernel.
235 *
236 * @note The default is @p TRUE.
237 * @note Requires @p CH_CFG_USE_EVENTS.
238 */
239#define CH_CFG_USE_EVENTS_TIMEOUT TRUE
240
241/**
242 * @brief Synchronous Messages APIs.
243 * @details If enabled then the synchronous messages APIs are included
244 * in the kernel.
245 *
246 * @note The default is @p TRUE.
247 */
248#define CH_CFG_USE_MESSAGES TRUE
249
250/**
251 * @brief Synchronous Messages queuing mode.
252 * @details If enabled then messages are served by priority rather than in
253 * FIFO order.
254 *
255 * @note The default is @p FALSE. Enable this if you have special
256 * requirements.
257 * @note Requires @p CH_CFG_USE_MESSAGES.
258 */
259#define CH_CFG_USE_MESSAGES_PRIORITY FALSE
260
261/**
262 * @brief Mailboxes APIs.
263 * @details If enabled then the asynchronous messages (mailboxes) APIs are
264 * included in the kernel.
265 *
266 * @note The default is @p TRUE.
267 * @note Requires @p CH_CFG_USE_SEMAPHORES.
268 */
269#define CH_CFG_USE_MAILBOXES TRUE
270
271/**
272 * @brief Core Memory Manager APIs.
273 * @details If enabled then the core memory manager APIs are included
274 * in the kernel.
275 *
276 * @note The default is @p TRUE.
277 */
278#define CH_CFG_USE_MEMCORE TRUE
279
280/**
281 * @brief Heap Allocator APIs.
282 * @details If enabled then the memory heap allocator APIs are included
283 * in the kernel.
284 *
285 * @note The default is @p TRUE.
286 * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
287 * @p CH_CFG_USE_SEMAPHORES.
288 * @note Mutexes are recommended.
289 */
290#define CH_CFG_USE_HEAP TRUE
291
292/**
293 * @brief Memory Pools Allocator APIs.
294 * @details If enabled then the memory pools allocator APIs are included
295 * in the kernel.
296 *
297 * @note The default is @p TRUE.
298 */
299#define CH_CFG_USE_MEMPOOLS TRUE
300
301/**
302 * @brief Dynamic Threads APIs.
303 * @details If enabled then the dynamic threads creation APIs are included
304 * in the kernel.
305 *
306 * @note The default is @p TRUE.
307 * @note Requires @p CH_CFG_USE_WAITEXIT.
308 * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
309 */
310#define CH_CFG_USE_DYNAMIC TRUE
311
312/** @} */
313
314/*===========================================================================*/
315/**
316 * @name Debug options
317 * @{
318 */
319/*===========================================================================*/
320
321/**
322 * @brief Debug option, kernel statistics.
323 *
324 * @note The default is @p FALSE.
325 */
326#define CH_DBG_STATISTICS FALSE
327
328/**
329 * @brief Debug option, system state check.
330 * @details If enabled the correct call protocol for system APIs is checked
331 * at runtime.
332 *
333 * @note The default is @p FALSE.
334 */
335#define CH_DBG_SYSTEM_STATE_CHECK FALSE
336
337/**
338 * @brief Debug option, parameters checks.
339 * @details If enabled then the checks on the API functions input
340 * parameters are activated.
341 *
342 * @note The default is @p FALSE.
343 */
344#define CH_DBG_ENABLE_CHECKS FALSE
345
346/**
347 * @brief Debug option, consistency checks.
348 * @details If enabled then all the assertions in the kernel code are
349 * activated. This includes consistency checks inside the kernel,
350 * runtime anomalies and port-defined checks.
351 *
352 * @note The default is @p FALSE.
353 */
354#define CH_DBG_ENABLE_ASSERTS FALSE
355
356/**
357 * @brief Debug option, trace buffer.
358 * @details If enabled then the trace buffer is activated.
359 *
360 * @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
361 */
362#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
363
364/**
365 * @brief Trace buffer entries.
366 * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
367 * different from @p CH_DBG_TRACE_MASK_DISABLED.
368 */
369#define CH_DBG_TRACE_BUFFER_SIZE 128
370
371/**
372 * @brief Debug option, stack checks.
373 * @details If enabled then a runtime stack check is performed.
374 *
375 * @note The default is @p FALSE.
376 * @note The stack check is performed in a architecture/port dependent way.
377 * It may not be implemented or some ports.
378 * @note The default failure mode is to halt the system with the global
379 * @p panic_msg variable set to @p NULL.
380 */
381#define CH_DBG_ENABLE_STACK_CHECK FALSE
382
383/**
384 * @brief Debug option, stacks initialization.
385 * @details If enabled then the threads working area is filled with a byte
386 * value when a thread is created. This can be useful for the
387 * runtime measurement of the used stack.
388 *
389 * @note The default is @p FALSE.
390 */
391#define CH_DBG_FILL_THREADS FALSE
392
393/**
394 * @brief Debug option, threads profiling.
395 * @details If enabled then a field is added to the @p thread_t structure that
396 * counts the system ticks occurred while executing the thread.
397 *
398 * @note The default is @p FALSE.
399 * @note This debug option is not currently compatible with the
400 * tickless mode.
401 */
402#define CH_DBG_THREADS_PROFILING FALSE
403
404/** @} */
405
406/*===========================================================================*/
407/**
408 * @name Kernel hooks
409 * @{
410 */
411/*===========================================================================*/
412
413/**
414 * @brief Threads descriptor structure extension.
415 * @details User fields added to the end of the @p thread_t structure.
416 */
417#define CH_CFG_THREAD_EXTRA_FIELDS \
418 /* Add threads custom fields here.*/
419
420/**
421 * @brief Threads initialization hook.
422 * @details User initialization code added to the @p chThdInit() API.
423 *
424 * @note It is invoked from within @p chThdInit() and implicitly from all
425 * the threads creation APIs.
426 */
427#define CH_CFG_THREAD_INIT_HOOK(tp) { \
428 /* Add threads initialization code here.*/ \
429}
430
431/**
432 * @brief Threads finalization hook.
433 * @details User finalization code added to the @p chThdExit() API.
434 */
435#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
436 /* Add threads finalization code here.*/ \
437}
438
439/**
440 * @brief Context switch hook.
441 * @details This hook is invoked just before switching between threads.
442 */
443#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
444 /* Context switch code here.*/ \
445}
446
447/**
448 * @brief ISR enter hook.
449 */
450#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
451 /* IRQ prologue code here.*/ \
452}
453
454/**
455 * @brief ISR exit hook.
456 */
457#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
458 /* IRQ epilogue code here.*/ \
459}
460
461/**
462 * @brief Idle thread enter hook.
463 * @note This hook is invoked within a critical zone, no OS functions
464 * should be invoked from here.
465 * @note This macro can be used to activate a power saving mode.
466 */
467#define CH_CFG_IDLE_ENTER_HOOK() { \
468 /* Idle-enter code here.*/ \
469}
470
471/**
472 * @brief Idle thread leave hook.
473 * @note This hook is invoked within a critical zone, no OS functions
474 * should be invoked from here.
475 * @note This macro can be used to deactivate a power saving mode.
476 */
477#define CH_CFG_IDLE_LEAVE_HOOK() { \
478 /* Idle-leave code here.*/ \
479}
480
481/**
482 * @brief Idle Loop hook.
483 * @details This hook is continuously invoked by the idle thread loop.
484 */
485#define CH_CFG_IDLE_LOOP_HOOK() { \
486 /* Idle loop code here.*/ \
487}
488
489/**
490 * @brief System tick event hook.
491 * @details This hook is invoked in the system tick handler immediately
492 * after processing the virtual timers queue.
493 */
494#define CH_CFG_SYSTEM_TICK_HOOK() { \
495 /* System tick event code here.*/ \
496}
497
498/**
499 * @brief System halt hook.
500 * @details This hook is invoked in case to a system halting error before
501 * the system is halted.
502 */
503#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
504 /* System halt code here.*/ \
505}
506
507/**
508 * @brief Trace hook.
509 * @details This hook is invoked each time a new record is written in the
510 * trace buffer.
511 */
512#define CH_CFG_TRACE_HOOK(tep) { \
513 /* Trace code here.*/ \
514}
515
516/** @} */
517
518/*===========================================================================*/
519/* Port-specific settings (override port settings defaulted in chcore.h). */
520/*===========================================================================*/
521
522#endif /* CHCONF_H */
523
524/** @} */
diff --git a/keyboards/whitefox/config.h b/keyboards/whitefox/config.h
new file mode 100644
index 000000000..b7116341f
--- /dev/null
+++ b/keyboards/whitefox/config.h
@@ -0,0 +1,78 @@
1/*
2Copyright 2015 Jun Wako <wakojun@gmail.com>
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#ifndef CONFIG_H
19#define CONFIG_H
20
21#define PREVENT_STUCK_MODIFIERS
22
23/* USB Device descriptor parameter */
24#define VENDOR_ID 0xFEED
25#define PRODUCT_ID 0x0F0F
26#define DEVICE_VER 0x0001
27/* in python2: list(u"whatever".encode('utf-16-le')) */
28/* at most 32 characters or the ugly hack in usb_main.c borks */
29#define MANUFACTURER "Input Club"
30#define USBSTR_MANUFACTURER 'I', '\x00', 'n', '\x00', 'p', '\x00', 'u', '\x00', 't', '\x00', ' ', '\x00', 'C', '\x00', 'l', '\x00', 'u', '\x00', 'b', '\x00'
31#define PRODUCT "WhiteFox/QMK"
32#define USBSTR_PRODUCT 'W', '\x00', 'h', '\x00', 'i', '\x00', 't', '\x00', 'e', '\x00', 'F', '\x00', 'o', '\x00', 'x', '\x00', ' ', '\x00'
33
34/* key matrix size */
35#define MATRIX_ROWS 9
36#define MATRIX_COLS 8
37
38/* define if matrix has ghost */
39//#define MATRIX_HAS_GHOST
40
41/* Set 0 if debouncing isn't needed */
42#define DEBOUNCE 6
43
44/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
45//#define LOCKING_SUPPORT_ENABLE
46/* Locking resynchronize hack */
47//#define LOCKING_RESYNC_ENABLE
48
49/* key combination for command */
50#define IS_COMMAND() ( \
51 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
52)
53
54/* Keymap for Infinity prototype */
55//#define INFINITY_PROTOTYPE
56
57/* Keymap for Infinity 1.1a (first revision with LED support) */
58//#define INFINITY_LED
59
60/*
61 * Feature disable options
62 * These options are also useful to firmware size reduction.
63 */
64
65/* disable debug print */
66//#define NO_DEBUG
67
68/* disable print */
69//#define NO_PRINT
70
71/* disable action features */
72//#define NO_ACTION_LAYER
73//#define NO_ACTION_TAPPING
74//#define NO_ACTION_ONESHOT
75//#define NO_ACTION_MACRO
76//#define NO_ACTION_FUNCTION
77
78#endif
diff --git a/keyboards/whitefox/halconf.h b/keyboards/whitefox/halconf.h
new file mode 100644
index 000000000..46b37a4f4
--- /dev/null
+++ b/keyboards/whitefox/halconf.h
@@ -0,0 +1,353 @@
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/**
18 * @file templates/halconf.h
19 * @brief HAL configuration header.
20 * @details HAL configuration file, this file allows to enable or disable the
21 * various device drivers from your application. You may also use
22 * this file in order to override the device drivers default settings.
23 *
24 * @addtogroup HAL_CONF
25 * @{
26 */
27
28#ifndef _HALCONF_H_
29#define _HALCONF_H_
30
31#include "mcuconf.h"
32
33/**
34 * @brief Enables the PAL subsystem.
35 */
36#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
37#define HAL_USE_PAL TRUE
38#endif
39
40/**
41 * @brief Enables the ADC subsystem.
42 */
43#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
44#define HAL_USE_ADC FALSE
45#endif
46
47/**
48 * @brief Enables the CAN subsystem.
49 */
50#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
51#define HAL_USE_CAN FALSE
52#endif
53
54/**
55 * @brief Enables the DAC subsystem.
56 */
57#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
58#define HAL_USE_DAC FALSE
59#endif
60
61/**
62 * @brief Enables the EXT subsystem.
63 */
64#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
65#define HAL_USE_EXT FALSE
66#endif
67
68/**
69 * @brief Enables the GPT subsystem.
70 */
71#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
72#define HAL_USE_GPT FALSE
73#endif
74
75/**
76 * @brief Enables the I2C subsystem.
77 */
78#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
79#define HAL_USE_I2C FALSE
80#endif
81
82/**
83 * @brief Enables the I2S subsystem.
84 */
85#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
86#define HAL_USE_I2S FALSE
87#endif
88
89/**
90 * @brief Enables the ICU subsystem.
91 */
92#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
93#define HAL_USE_ICU FALSE
94#endif
95
96/**
97 * @brief Enables the MAC subsystem.
98 */
99#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
100#define HAL_USE_MAC FALSE
101#endif
102
103/**
104 * @brief Enables the MMC_SPI subsystem.
105 */
106#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
107#define HAL_USE_MMC_SPI FALSE
108#endif
109
110/**
111 * @brief Enables the PWM subsystem.
112 */
113#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
114#define HAL_USE_PWM FALSE
115#endif
116
117/**
118 * @brief Enables the RTC subsystem.
119 */
120#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
121#define HAL_USE_RTC FALSE
122#endif
123
124/**
125 * @brief Enables the SDC subsystem.
126 */
127#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
128#define HAL_USE_SDC FALSE
129#endif
130
131/**
132 * @brief Enables the SERIAL subsystem.
133 */
134#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
135#define HAL_USE_SERIAL FALSE
136#endif
137
138/**
139 * @brief Enables the SERIAL over USB subsystem.
140 */
141#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
142#define HAL_USE_SERIAL_USB TRUE
143#endif
144
145/**
146 * @brief Enables the SPI subsystem.
147 */
148#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
149#define HAL_USE_SPI FALSE
150#endif
151
152/**
153 * @brief Enables the UART subsystem.
154 */
155#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
156#define HAL_USE_UART FALSE
157#endif
158
159/**
160 * @brief Enables the USB subsystem.
161 */
162#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
163#define HAL_USE_USB TRUE
164#endif
165
166/**
167 * @brief Enables the WDG subsystem.
168 */
169#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
170#define HAL_USE_WDG FALSE
171#endif
172
173/*===========================================================================*/
174/* ADC driver related settings. */
175/*===========================================================================*/
176
177/**
178 * @brief Enables synchronous APIs.
179 * @note Disabling this option saves both code and data space.
180 */
181#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
182#define ADC_USE_WAIT TRUE
183#endif
184
185/**
186 * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
187 * @note Disabling this option saves both code and data space.
188 */
189#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
190#define ADC_USE_MUTUAL_EXCLUSION TRUE
191#endif
192
193/*===========================================================================*/
194/* CAN driver related settings. */
195/*===========================================================================*/
196
197/**
198 * @brief Sleep mode related APIs inclusion switch.
199 */
200#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
201#define CAN_USE_SLEEP_MODE TRUE
202#endif
203
204/*===========================================================================*/
205/* I2C driver related settings. */
206/*===========================================================================*/
207
208/**
209 * @brief Enables the mutual exclusion APIs on the I2C bus.
210 */
211#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
212#define I2C_USE_MUTUAL_EXCLUSION TRUE
213#endif
214
215/*===========================================================================*/
216/* MAC driver related settings. */
217/*===========================================================================*/
218
219/**
220 * @brief Enables an event sources for incoming packets.
221 */
222#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
223#define MAC_USE_ZERO_COPY FALSE
224#endif
225
226/**
227 * @brief Enables an event sources for incoming packets.
228 */
229#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
230#define MAC_USE_EVENTS TRUE
231#endif
232
233/*===========================================================================*/
234/* MMC_SPI driver related settings. */
235/*===========================================================================*/
236
237/**
238 * @brief Delays insertions.
239 * @details If enabled this options inserts delays into the MMC waiting
240 * routines releasing some extra CPU time for the threads with
241 * lower priority, this may slow down the driver a bit however.
242 * This option is recommended also if the SPI driver does not
243 * use a DMA channel and heavily loads the CPU.
244 */
245#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
246#define MMC_NICE_WAITING TRUE
247#endif
248
249/*===========================================================================*/
250/* SDC driver related settings. */
251/*===========================================================================*/
252
253/**
254 * @brief Number of initialization attempts before rejecting the card.
255 * @note Attempts are performed at 10mS intervals.
256 */
257#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
258#define SDC_INIT_RETRY 100
259#endif
260
261/**
262 * @brief Include support for MMC cards.
263 * @note MMC support is not yet implemented so this option must be kept
264 * at @p FALSE.
265 */
266#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
267#define SDC_MMC_SUPPORT FALSE
268#endif
269
270/**
271 * @brief Delays insertions.
272 * @details If enabled this options inserts delays into the MMC waiting
273 * routines releasing some extra CPU time for the threads with
274 * lower priority, this may slow down the driver a bit however.
275 */
276#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
277#define SDC_NICE_WAITING TRUE
278#endif
279
280/*===========================================================================*/
281/* SERIAL driver related settings. */
282/*===========================================================================*/
283
284/**
285 * @brief Default bit rate.
286 * @details Configuration parameter, this is the baud rate selected for the
287 * default configuration.
288 */
289#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
290#define SERIAL_DEFAULT_BITRATE 38400
291#endif
292
293/**
294 * @brief Serial buffers size.
295 * @details Configuration parameter, you can change the depth of the queue
296 * buffers depending on the requirements of your application.
297 * @note The default is 64 bytes for both the transmission and receive
298 * buffers.
299 */
300#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
301#define SERIAL_BUFFERS_SIZE 16
302#endif
303
304/*===========================================================================*/
305/* SERIAL_USB driver related setting. */
306/*===========================================================================*/
307
308/**
309 * @brief Serial over USB buffers size.
310 * @details Configuration parameter, the buffer size must be a multiple of
311 * the USB data endpoint maximum packet size.
312 * @note The default is 64 bytes for both the transmission and receive
313 * buffers.
314 */
315#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
316#define SERIAL_USB_BUFFERS_SIZE 256
317#endif
318
319/*===========================================================================*/
320/* SPI driver related settings. */
321/*===========================================================================*/
322
323/**
324 * @brief Enables synchronous APIs.
325 * @note Disabling this option saves both code and data space.
326 */
327#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
328#define SPI_USE_WAIT TRUE
329#endif
330
331/**
332 * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
333 * @note Disabling this option saves both code and data space.
334 */
335#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
336#define SPI_USE_MUTUAL_EXCLUSION TRUE
337#endif
338
339/*===========================================================================*/
340/* USB driver related settings. */
341/*===========================================================================*/
342
343/**
344 * @brief Enables synchronous APIs.
345 * @note Disabling this option saves both code and data space.
346 */
347#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
348#define USB_USE_WAIT TRUE
349#endif
350
351#endif /* _HALCONF_H_ */
352
353/** @} */
diff --git a/keyboards/whitefox/keymaps/default/keymap.c b/keyboards/whitefox/keymaps/default/keymap.c
new file mode 100644
index 000000000..426b226a0
--- /dev/null
+++ b/keyboards/whitefox/keymaps/default/keymap.c
@@ -0,0 +1,51 @@
1/*
2Copyright 2015 Jun Wako <wakojun@gmail.com>
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#include "whitefox.h"
18
19const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
20 /* Layer 0: Default Layer
21 * ,---------------------------------------------------------------.
22 * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `|Ins|
23 * |---------------------------------------------------------------|
24 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Backs|Del|
25 * |---------------------------------------------------------------|
26 * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Enter |PgU|
27 * |---------------------------------------------------------------|
28 * |Shif| | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgD|
29 * |---------------------------------------------------------------|
30 * |Ctrl|Gui |Alt | Space |Fn0 |Alt |Gui | |Lef|Dow|Rig|
31 * `---------------------------------------------------------------'
32 */
33 [0] = KEYMAP( \
34 ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS,GRV, INS, \
35 TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, DEL, \
36 CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NUHS,ENT, PGUP,\
37 LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT, UP, PGDN,\
38 LCTL,LGUI,LALT, SPC, RALT,FN0, RCTL, LEFT,DOWN,RGHT \
39 ),
40 [1] = KEYMAP( \
41 TRNS,F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,TRNS,MUTE,\
42 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS, TRNS,\
43 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, VOLU,\
44 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, PGUP,VOLD,\
45 TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS, HOME,PGDN,END \
46 ),
47};
48
49const uint16_t fn_actions[] = {
50 [0] = ACTION_LAYER_MOMENTARY(1),
51};
diff --git a/keyboards/whitefox/keymaps/matt3o/keymap.c b/keyboards/whitefox/keymaps/matt3o/keymap.c
new file mode 100644
index 000000000..ecadcd284
--- /dev/null
+++ b/keyboards/whitefox/keymaps/matt3o/keymap.c
@@ -0,0 +1,92 @@
1/*
2Copyright 2015 Jun Wako <wakojun@gmail.com>
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#include "whitefox.h"
18
19const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
20 /* Layer 0: Default Layer
21 * ,---------------------------------------------------------------.
22 * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `|Ins|
23 * |---------------------------------------------------------------|
24 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Backs|Del|
25 * |---------------------------------------------------------------|
26 * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Enter |PgU|
27 * |---------------------------------------------------------------|
28 * |Shif| | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgD|
29 * |---------------------------------------------------------------|
30 * |Ctrl|Gui |Alt | Space |Fn0 |Alt |Gui | |Lef|Dow|Rig|
31 * `---------------------------------------------------------------'
32 */
33 [0] = KEYMAP( \
34 ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS,GRV, MUTE,\
35 TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, DEL, \
36 FN0, A, S, D, F, G, H, J, K, L, SCLN,QUOT,NUHS,ENT, PGUP,\
37 LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT, UP, PGDN,\
38 LCTL,LGUI,LALT, SPC, RALT,FN1, RCTL, LEFT,DOWN,RGHT \
39 ),
40 [1] = KEYMAP( \
41 TRNS,F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,TRNS,TRNS,\
42 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,DEL , INS ,\
43 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, VOLU,\
44 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, PGUP,VOLD,\
45 TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS, HOME,PGDN,END \
46 ),
47 [2] = KEYMAP( \
48 SLEP,P1, P2, P3, P4, P5, P6, P7, P8, P9, P0, TRNS,TRNS,TRNS,TRNS,FN2, \
49 TRNS,TRNS,FN5 ,FN6 ,TRNS,FN7 ,TRNS,TRNS,TRNS,TRNS,PSCR,TRNS,TRNS,TRNS, FN3, \
50 CAPS,TRNS,TRNS,TRNS,FN4 ,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,\
51 TRNS,TRNS,TRNS,TRNS,CALC,TRNS,TRNS,TRNS,MAIL,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,\
52 TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS \
53 ),
54};
55
56/* Give numbers some descriptive names */
57#define ACTION_LEDS_ALL 1
58#define ACTION_LEDS_GAME 2
59
60const uint16_t fn_actions[] = {
61 [0] = ACTION_LAYER_MOMENTARY(1),
62 [1] = ACTION_LAYER_MOMENTARY(2),
63 [2] = ACTION_FUNCTION(ACTION_LEDS_ALL),
64 [3] = ACTION_FUNCTION(ACTION_LEDS_GAME),
65
66 [4] = ACTION_USAGE_CONSUMER(0x1B4),
67 [5] = ACTION_USAGE_CONSUMER(0x196),
68 [6] = ACTION_USAGE_CONSUMER(0x1A6),
69 [7] = ACTION_USAGE_CONSUMER(0x1A0),
70
71};
72
73/* custom action function */
74void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
75 /*
76 (void)opt;
77 switch(id) {
78 case ACTION_LEDS_ALL:
79 if(record->event.pressed) {
80 // signal the LED controller thread
81 chMBPost(&led_mailbox, LED_MSG_GAME_TOGGLE, TIME_IMMEDIATE);
82 }
83 break;
84 case ACTION_LEDS_GAME:
85 if(record->event.pressed) {
86 // signal the LED controller thread
87 chMBPost(&led_mailbox, LED_MSG_ALL_TOGGLE, TIME_IMMEDIATE);
88 }
89 break;
90 }
91 */
92}
diff --git a/keyboards/whitefox/led.c b/keyboards/whitefox/led.c
new file mode 100644
index 000000000..aed66c7c0
--- /dev/null
+++ b/keyboards/whitefox/led.c
@@ -0,0 +1,24 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
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#include "hal.h"
19
20#include "led.h"
21
22
23void led_set(uint8_t usb_led) {
24}
diff --git a/keyboards/whitefox/matrix.c b/keyboards/whitefox/matrix.c
new file mode 100644
index 000000000..ce35bca28
--- /dev/null
+++ b/keyboards/whitefox/matrix.c
@@ -0,0 +1,132 @@
1#include <stdint.h>
2#include <stdbool.h>
3#include <string.h>
4#include "hal.h"
5#include "timer.h"
6#include "wait.h"
7#include "print.h"
8#include "matrix.h"
9
10
11/*
12 * Matt3o's WhiteFox
13 * Column pins are input with internal pull-down. Row pins are output and strobe with high.
14 * Key is high or 1 when it turns on.
15 *
16 * col: { PTD0, PTD1, PTD4, PTD5, PTD6, PTD7, PTC1, PTC2 }
17 * row: { PTB2, PTB3, PTB18, PTB19, PTC0, PTC8, PTC9, PTC10, PTC11 }
18 */
19/* matrix state(1:on, 0:off) */
20static matrix_row_t matrix[MATRIX_ROWS];
21static matrix_row_t matrix_debouncing[MATRIX_ROWS];
22static bool debouncing = false;
23static uint16_t debouncing_time = 0;
24
25
26void matrix_init(void)
27{
28//debug_matrix = true;
29 /* Column(sense) */
30 palSetPadMode(GPIOD, 0, PAL_MODE_INPUT_PULLDOWN);
31 palSetPadMode(GPIOD, 1, PAL_MODE_INPUT_PULLDOWN);
32 palSetPadMode(GPIOD, 4, PAL_MODE_INPUT_PULLDOWN);
33 palSetPadMode(GPIOD, 5, PAL_MODE_INPUT_PULLDOWN);
34 palSetPadMode(GPIOD, 6, PAL_MODE_INPUT_PULLDOWN);
35 palSetPadMode(GPIOD, 7, PAL_MODE_INPUT_PULLDOWN);
36 palSetPadMode(GPIOC, 1, PAL_MODE_INPUT_PULLDOWN);
37 palSetPadMode(GPIOC, 2, PAL_MODE_INPUT_PULLDOWN);
38
39 /* Row(strobe) */
40 palSetPadMode(GPIOB, 2, PAL_MODE_OUTPUT_PUSHPULL);
41 palSetPadMode(GPIOB, 3, PAL_MODE_OUTPUT_PUSHPULL);
42 palSetPadMode(GPIOB, 18, PAL_MODE_OUTPUT_PUSHPULL);
43 palSetPadMode(GPIOB, 19, PAL_MODE_OUTPUT_PUSHPULL);
44 palSetPadMode(GPIOC, 0, PAL_MODE_OUTPUT_PUSHPULL);
45 palSetPadMode(GPIOC, 8, PAL_MODE_OUTPUT_PUSHPULL);
46 palSetPadMode(GPIOC, 9, PAL_MODE_OUTPUT_PUSHPULL);
47 palSetPadMode(GPIOC, 10, PAL_MODE_OUTPUT_PUSHPULL);
48 palSetPadMode(GPIOC, 11, PAL_MODE_OUTPUT_PUSHPULL);
49
50 memset(matrix, 0, MATRIX_ROWS);
51 memset(matrix_debouncing, 0, MATRIX_ROWS);
52}
53
54uint8_t matrix_scan(void)
55{
56 for (int row = 0; row < MATRIX_ROWS; row++) {
57 matrix_row_t data = 0;
58
59 // strobe row
60 switch (row) {
61 case 0: palSetPad(GPIOB, 2); break;
62 case 1: palSetPad(GPIOB, 3); break;
63 case 2: palSetPad(GPIOB, 18); break;
64 case 3: palSetPad(GPIOB, 19); break;
65 case 4: palSetPad(GPIOC, 0); break;
66 case 5: palSetPad(GPIOC, 8); break;
67 case 6: palSetPad(GPIOC, 9); break;
68 case 7: palSetPad(GPIOC, 10); break;
69 case 8: palSetPad(GPIOC, 11); break;
70 }
71
72 wait_us(1); // need wait to settle pin state
73
74 // read col data: { PTD0, PTD1, PTD4, PTD5, PTD6, PTD7, PTC1, PTC2 }
75 data = ((palReadPort(GPIOC) & 0x06UL) << 5) |
76 ((palReadPort(GPIOD) & 0xF0UL) >> 2) |
77 (palReadPort(GPIOD) & 0x03UL);
78
79 // un-strobe row
80 switch (row) {
81 case 0: palClearPad(GPIOB, 2); break;
82 case 1: palClearPad(GPIOB, 3); break;
83 case 2: palClearPad(GPIOB, 18); break;
84 case 3: palClearPad(GPIOB, 19); break;
85 case 4: palClearPad(GPIOC, 0); break;
86 case 5: palClearPad(GPIOC, 8); break;
87 case 6: palClearPad(GPIOC, 9); break;
88 case 7: palClearPad(GPIOC, 10); break;
89 case 8: palClearPad(GPIOC, 11); break;
90 }
91
92 if (matrix_debouncing[row] != data) {
93 matrix_debouncing[row] = data;
94 debouncing = true;
95 debouncing_time = timer_read();
96 }
97 }
98
99 if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) {
100 for (int row = 0; row < MATRIX_ROWS; row++) {
101 matrix[row] = matrix_debouncing[row];
102 }
103 debouncing = false;
104 }
105 return 1;
106}
107
108bool matrix_is_on(uint8_t row, uint8_t col)
109{
110 return (matrix[row] & (1<<col));
111}
112
113matrix_row_t matrix_get_row(uint8_t row)
114{
115 return matrix[row];
116}
117
118void matrix_print(void)
119{
120 xprintf("\nr/c 01234567\n");
121 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
122 xprintf("%X0: ", row);
123 matrix_row_t data = matrix_get_row(row);
124 for (int col = 0; col < MATRIX_COLS; col++) {
125 if (data & (1<<col))
126 xprintf("1");
127 else
128 xprintf("0");
129 }
130 xprintf("\n");
131 }
132}
diff --git a/keyboards/whitefox/mcuconf.h b/keyboards/whitefox/mcuconf.h
new file mode 100644
index 000000000..ab1f7d724
--- /dev/null
+++ b/keyboards/whitefox/mcuconf.h
@@ -0,0 +1,66 @@
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#define K20x_MCUCONF
21
22/*
23 * HAL driver system settings.
24 */
25
26/* Select the MCU clocking mode below by enabling the appropriate block. */
27
28#define KINETIS_NO_INIT FALSE
29
30/* PEE mode - 48MHz system clock driven by external crystal. */
31#define KINETIS_MCG_MODE KINETIS_MCG_MODE_PEE
32#define KINETIS_PLLCLK_FREQUENCY 96000000UL
33#define KINETIS_SYSCLK_FREQUENCY 48000000UL
34#define KINETIS_XTAL_FREQUENCY 16000000UL
35
36#if 0
37/* FEI mode - 48 MHz with internal 32.768 kHz crystal */
38#define KINETIS_MCG_MODE KINETIS_MCG_MODE_FEI
39#define KINETIS_MCG_FLL_DMX32 1 /* Fine-tune for 32.768 kHz */
40#define KINETIS_MCG_FLL_DRS 1 /* 1464x FLL factor */
41#define KINETIS_SYSCLK_FREQUENCY 47972352UL /* 32.768 kHz * 1464 (~48 MHz) */
42#define KINETIS_CLKDIV1_OUTDIV1 1
43#define KINETIS_CLKDIV1_OUTDIV2 1
44#define KINETIS_CLKDIV1_OUTDIV4 2
45#define KINETIS_BUSCLK_FREQUENCY KINETIS_SYSCLK_FREQUENCY
46#define KINETIS_FLASHCLK_FREQUENCY KINETIS_SYSCLK_FREQUENCY/2
47#endif
48
49/*
50 * SERIAL driver system settings.
51 */
52#define KINETIS_SERIAL_USE_UART0 TRUE
53
54/*
55 * USB driver settings
56 */
57#define KINETIS_USB_USE_USB0 TRUE
58#define KINETIS_USB_USB0_IRQ_PRIORITY 5
59
60/*
61 * I2C driver settings
62 */
63#define KINETIS_I2C_USE_I2C0 TRUE
64#define KINETIS_I2C_I2C0_PRIORITY 4
65
66#endif /* _MCUCONF_H_ */
diff --git a/keyboards/whitefox/rules.mk b/keyboards/whitefox/rules.mk
new file mode 100644
index 000000000..18b690f49
--- /dev/null
+++ b/keyboards/whitefox/rules.mk
@@ -0,0 +1,68 @@
1# project specific files
2SRC = matrix.c \
3 led.c
4
5## chip/board settings
6# - the next two should match the directories in
7# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
8# - For Teensies, FAMILY = KINETIS and SERIES is either
9# KL2x (LC) or K20x (3.0,3.1,3.2).
10# - For Infinity KB, SERIES = K20x
11MCU_FAMILY = KINETIS
12MCU_SERIES = K20x
13
14# Linker script to use
15# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
16# or <this_dir>/ld/
17# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
18# - LDSCRIPT =
19# - MKL26Z64 for Teensy LC
20# - MK20DX128 for Teensy 3.0
21# - MK20DX256 for Teensy 3.1 and 3.2
22# - MK20DX128BLDR4 for Infinity with Kiibohd bootloader
23# - MK20DX256BLDR8 for Infinity ErgoDox with Kiibohd bootloader
24MCU_LDSCRIPT = MK20DX256BLDR8
25
26# Startup code to use
27# - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
28# - STARTUP =
29# - kl2x for Teensy LC
30# - k20x5 for Teensy 3.0 and Infinity KB
31# - k20x7 for Teensy 3.1 and 3.2
32MCU_STARTUP = k20x7
33
34# Board: it should exist either in <chibios>/os/hal/boards/
35# or <this_dir>/boards
36# - BOARD =
37# - PJRC_TEENSY_LC for Teensy LC
38# - PJRC_TEENSY_3 for Teensy 3.0
39# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
40# - MCHCK_K20 for Infinity KB
41BOARD = PJRC_TEENSY_3_1
42
43# Cortex version
44# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
45MCU = cortex-m4
46
47# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
48# I.e. 6 for Teensy LC; 7 for Teensy 3.x
49ARMV = 7
50
51# Vector table for application
52# 0x00000000-0x00001000 area is occupied by bootlaoder.*/
53# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB
54#OPT_DEFS = -DCORTEX_VTOR_INIT=0x00001000
55OPT_DEFS =
56
57# Build Options
58# comment out to disable the options.
59#
60BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration
61## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
62MOUSEKEY_ENABLE ?= yes # Mouse keys
63EXTRAKEY_ENABLE ?= yes # Audio control and System control
64#CONSOLE_ENABLE ?= yes # Console for debug
65COMMAND_ENABLE ?= yes # Commands for debug and configuration
66#SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
67NKRO_ENABLE ?= yes # USB Nkey Rollover
68CUSTOM_MATRIX ?= yes # Custom matrix file
diff --git a/keyboards/whitefox/whitefox.c b/keyboards/whitefox/whitefox.c
new file mode 100644
index 000000000..d35bf8338
--- /dev/null
+++ b/keyboards/whitefox/whitefox.c
@@ -0,0 +1,17 @@
1/*
2Copyright 2012,2013 Jun Wako <wakojun@gmail.com>
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#include "whitefox.h"
diff --git a/keyboards/whitefox/whitefox.h b/keyboards/whitefox/whitefox.h
new file mode 100644
index 000000000..0ffcdca01
--- /dev/null
+++ b/keyboards/whitefox/whitefox.h
@@ -0,0 +1,54 @@
1/*
2Copyright 2014 Jun Wako <wakojun@gmail.com>
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#ifndef WHITEFOX_H
18#define WHITEFOX_H
19
20#include "quantum.h"
21
22/* WhiteFox
23 * ,---------------------------------------------------------------.
24 * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `|Ins|
25 * |---------------------------------------------------------------|
26 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Backs|Del|
27 * |---------------------------------------------------------------|
28 * |CapsL | A| S| D| F| G| H| J| K| L| ;| '|Enter |PgU|
29 * |---------------------------------------------------------------|
30 * |Shif| | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgD|
31 * |---------------------------------------------------------------|
32 * |Ctrl|Gui |Alt | Space |App |Alt |Gui | |Lef|Dow|Rig|
33 * `---------------------------------------------------------------'
34 */
35
36#define KEYMAP( \
37 K00, K10, K20, K30, K40, K50, K60, K70, K80, K01, K11, K21, K31, K41, K51, K61, \
38 K71, K81, K02, K12, K22, K32, K42, K52, K62, K72, K82, K03, K13, K23, K33, \
39 K43, K53, K63, K73, K83, K04, K14, K24, K34, K44, K54, K64, K74, K84, K05, \
40 K15, K25, K35, K45, K55, K65, K75, K85, K06, K16, K26, K36, K46, K56, K66, \
41 K76, K86, K07, K17, K27, K37, K47, K57, K67, K77 \
42) { \
43 { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \
44 { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \
45 { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \
46 { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, \
47 { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, \
48 { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \
49 { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \
50 { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \
51 { KC_##K80, KC_##K81, KC_##K82, KC_##K83, KC_##K84, KC_##K85, KC_##K86, KC_NO } \
52}
53
54#endif