aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/handwired/pill60/blackpill_f401/config.h24
-rw-r--r--keyboards/handwired/pill60/blackpill_f401/halconf.h21
-rw-r--r--keyboards/handwired/pill60/blackpill_f401/mcuconf.h24
-rw-r--r--keyboards/handwired/pill60/blackpill_f401/rules.mk14
-rw-r--r--keyboards/handwired/pill60/blackpill_f411/config.h25
-rw-r--r--keyboards/handwired/pill60/blackpill_f411/halconf.h21
-rw-r--r--keyboards/handwired/pill60/blackpill_f411/mcuconf.h24
-rw-r--r--keyboards/handwired/pill60/blackpill_f411/rules.mk14
-rw-r--r--keyboards/handwired/pill60/bluepill/chconf.h711
-rw-r--r--keyboards/handwired/pill60/bluepill/config.h24
-rw-r--r--keyboards/handwired/pill60/bluepill/halconf.h525
-rw-r--r--keyboards/handwired/pill60/bluepill/mcuconf.h209
-rw-r--r--keyboards/handwired/pill60/bluepill/rules.mk8
-rw-r--r--keyboards/handwired/pill60/config.h53
-rw-r--r--keyboards/handwired/pill60/info.json82
-rw-r--r--keyboards/handwired/pill60/keymaps/default/keymap.c87
-rw-r--r--keyboards/handwired/pill60/keymaps/default/readme.md6
-rw-r--r--keyboards/handwired/pill60/pill60.c16
-rw-r--r--keyboards/handwired/pill60/pill60.h42
-rw-r--r--keyboards/handwired/pill60/readme.md25
-rw-r--r--keyboards/handwired/pill60/rules.mk21
21 files changed, 1976 insertions, 0 deletions
diff --git a/keyboards/handwired/pill60/blackpill_f401/config.h b/keyboards/handwired/pill60/blackpill_f401/config.h
new file mode 100644
index 000000000..d56ba94ea
--- /dev/null
+++ b/keyboards/handwired/pill60/blackpill_f401/config.h
@@ -0,0 +1,24 @@
1/* Copyright 2019
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19#define MATRIX_COL_PINS \
20 { A8, B2, B1, B15, A10, A0, A1, A2, A3, A4, A5, A6, A7, B0 }
21#define MATRIX_ROW_PINS \
22 { B4, B3, A15, B13, B5 }
23#define UNUSED_PINS \
24 { A9, A11, A12, C13, C14, C15, B10 }
diff --git a/keyboards/handwired/pill60/blackpill_f401/halconf.h b/keyboards/handwired/pill60/blackpill_f401/halconf.h
new file mode 100644
index 000000000..f1230634b
--- /dev/null
+++ b/keyboards/handwired/pill60/blackpill_f401/halconf.h
@@ -0,0 +1,21 @@
1/* Copyright 2020 Nick Brassel (tzarc)
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 3 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 <https://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#define HAL_USE_I2C TRUE
19#define HAL_USE_PWM TRUE
20
21#include_next "halconf.h" \ No newline at end of file
diff --git a/keyboards/handwired/pill60/blackpill_f401/mcuconf.h b/keyboards/handwired/pill60/blackpill_f401/mcuconf.h
new file mode 100644
index 000000000..a8b0a5660
--- /dev/null
+++ b/keyboards/handwired/pill60/blackpill_f401/mcuconf.h
@@ -0,0 +1,24 @@
1/* Copyright 2020 Nick Brassel (tzarc)
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 3 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 <https://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#include_next "mcuconf.h"
19
20#undef STM32_I2C_USE_I2C1
21#define STM32_I2C_USE_I2C1 TRUE
22
23#undef STM32_PWM_USE_TIM5
24#define STM32_PWM_USE_TIM5 TRUE \ No newline at end of file
diff --git a/keyboards/handwired/pill60/blackpill_f401/rules.mk b/keyboards/handwired/pill60/blackpill_f401/rules.mk
new file mode 100644
index 000000000..8c514309d
--- /dev/null
+++ b/keyboards/handwired/pill60/blackpill_f401/rules.mk
@@ -0,0 +1,14 @@
1# MCU name
2MCU = STM32F401
3
4# Address of the bootloader in system memory
5STM32_BOOTLOADER_ADDRESS = 0x1FFF0000
6
7# Options to pass to dfu-util when flashing
8DFU_ARGS = -d 0483:DF11 -a 0 -s 0x08000000:leave
9DFU_SUFFIX_ARGS = -v 0483 -p DF11
10
11# Build Options
12# change yes to no to disable
13#
14KEYBOARD_SHARED_EP = yes
diff --git a/keyboards/handwired/pill60/blackpill_f411/config.h b/keyboards/handwired/pill60/blackpill_f411/config.h
new file mode 100644
index 000000000..b106c2d29
--- /dev/null
+++ b/keyboards/handwired/pill60/blackpill_f411/config.h
@@ -0,0 +1,25 @@
1/* Copyright 2019
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19#define MATRIX_COL_PINS \
20 { A8, B2, B1, B15, A10, A0, A1, A2, A3, A4, A5, A6, A7, B0 }
21#define MATRIX_ROW_PINS \
22 { B4, B3, A15, B13, B5 }
23#define UNUSED_PINS \
24 { A9, A11, A12, C13, C14, C15, B10 }
25
diff --git a/keyboards/handwired/pill60/blackpill_f411/halconf.h b/keyboards/handwired/pill60/blackpill_f411/halconf.h
new file mode 100644
index 000000000..f1230634b
--- /dev/null
+++ b/keyboards/handwired/pill60/blackpill_f411/halconf.h
@@ -0,0 +1,21 @@
1/* Copyright 2020 Nick Brassel (tzarc)
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 3 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 <https://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#define HAL_USE_I2C TRUE
19#define HAL_USE_PWM TRUE
20
21#include_next "halconf.h" \ No newline at end of file
diff --git a/keyboards/handwired/pill60/blackpill_f411/mcuconf.h b/keyboards/handwired/pill60/blackpill_f411/mcuconf.h
new file mode 100644
index 000000000..a8b0a5660
--- /dev/null
+++ b/keyboards/handwired/pill60/blackpill_f411/mcuconf.h
@@ -0,0 +1,24 @@
1/* Copyright 2020 Nick Brassel (tzarc)
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 3 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 <https://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#include_next "mcuconf.h"
19
20#undef STM32_I2C_USE_I2C1
21#define STM32_I2C_USE_I2C1 TRUE
22
23#undef STM32_PWM_USE_TIM5
24#define STM32_PWM_USE_TIM5 TRUE \ No newline at end of file
diff --git a/keyboards/handwired/pill60/blackpill_f411/rules.mk b/keyboards/handwired/pill60/blackpill_f411/rules.mk
new file mode 100644
index 000000000..84dd584e8
--- /dev/null
+++ b/keyboards/handwired/pill60/blackpill_f411/rules.mk
@@ -0,0 +1,14 @@
1# MCU name
2MCU = STM32F411
3
4# Address of the bootloader in system memory
5STM32_BOOTLOADER_ADDRESS = 0x1FFF0000
6
7# Options to pass to dfu-util when flashing
8DFU_ARGS = -d 0483:DF11 -a 0 -s 0x08000000:leave
9DFU_SUFFIX_ARGS = -v 0483 -p DF11
10
11# Build Options
12# change yes to no to disable
13#
14KEYBOARD_SHARED_EP = yes
diff --git a/keyboards/handwired/pill60/bluepill/chconf.h b/keyboards/handwired/pill60/bluepill/chconf.h
new file mode 100644
index 000000000..d8442f1b1
--- /dev/null
+++ b/keyboards/handwired/pill60/bluepill/chconf.h
@@ -0,0 +1,711 @@
1/*
2 ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
6 http://www.apache.org/licenses/LICENSE-2.0
7 Unless required by applicable law or agreed to in writing, software
8 distributed under the License is distributed on an "AS IS" BASIS,
9 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 See the License for the specific language governing permissions and
11 limitations under the License.
12*/
13
14/**
15 * @file rt/templates/chconf.h
16 * @brief Configuration file template.
17 * @details A copy of this file must be placed in each project directory, it
18 * contains the application specific kernel settings.
19 *
20 * @addtogroup config
21 * @details Kernel related settings and hooks.
22 * @{
23 */
24
25#ifndef CHCONF_H
26#define CHCONF_H
27
28#define _CHIBIOS_RT_CONF_
29#define _CHIBIOS_RT_CONF_VER_6_0_
30
31/*===========================================================================*/
32/**
33 * @name System timers settings
34 * @{
35 */
36/*===========================================================================*/
37
38/**
39 * @brief System time counter resolution.
40 * @note Allowed values are 16 or 32 bits.
41 */
42#if !defined(CH_CFG_ST_RESOLUTION)
43#define CH_CFG_ST_RESOLUTION 32
44#endif
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#if !defined(CH_CFG_ST_FREQUENCY)
52#define CH_CFG_ST_FREQUENCY 100000
53#endif
54
55/**
56 * @brief Time intervals data size.
57 * @note Allowed values are 16, 32 or 64 bits.
58 */
59#if !defined(CH_CFG_INTERVALS_SIZE)
60#define CH_CFG_INTERVALS_SIZE 32
61#endif
62
63/**
64 * @brief Time types data size.
65 * @note Allowed values are 16 or 32 bits.
66 */
67#if !defined(CH_CFG_TIME_TYPES_SIZE)
68#define CH_CFG_TIME_TYPES_SIZE 32
69#endif
70
71/**
72 * @brief Time delta constant for the tick-less mode.
73 * @note If this value is zero then the system uses the classic
74 * periodic tick. This value represents the minimum number
75 * of ticks that is safe to specify in a timeout directive.
76 * The value one is not valid, timeouts are rounded up to
77 * this value.
78 */
79#if !defined(CH_CFG_ST_TIMEDELTA)
80#define CH_CFG_ST_TIMEDELTA 0
81#endif
82
83/** @} */
84
85/*===========================================================================*/
86/**
87 * @name Kernel parameters and options
88 * @{
89 */
90/*===========================================================================*/
91
92/**
93 * @brief Round robin interval.
94 * @details This constant is the number of system ticks allowed for the
95 * threads before preemption occurs. Setting this value to zero
96 * disables the preemption for threads with equal priority and the
97 * round robin becomes cooperative. Note that higher priority
98 * threads can still preempt, the kernel is always preemptive.
99 * @note Disabling the round robin preemption makes the kernel more compact
100 * and generally faster.
101 * @note The round robin preemption is not supported in tickless mode and
102 * must be set to zero in that case.
103 */
104#if !defined(CH_CFG_TIME_QUANTUM)
105#define CH_CFG_TIME_QUANTUM 0
106#endif
107
108/**
109 * @brief Managed RAM size.
110 * @details Size of the RAM area to be managed by the OS. If set to zero
111 * then the whole available RAM is used. The core memory is made
112 * available to the heap allocator and/or can be used directly through
113 * the simplified core memory allocator.
114 *
115 * @note In order to let the OS manage the whole RAM the linker script must
116 * provide the @p __heap_base__ and @p __heap_end__ symbols.
117 * @note Requires @p CH_CFG_USE_MEMCORE.
118 */
119#if !defined(CH_CFG_MEMCORE_SIZE)
120#define CH_CFG_MEMCORE_SIZE 0
121#endif
122
123/**
124 * @brief Idle thread automatic spawn suppression.
125 * @details When this option is activated the function @p chSysInit()
126 * does not spawn the idle thread. The application @p main()
127 * function becomes the idle thread and must implement an
128 * infinite loop.
129 */
130#if !defined(CH_CFG_NO_IDLE_THREAD)
131#define CH_CFG_NO_IDLE_THREAD FALSE
132#endif
133
134/** @} */
135
136/*===========================================================================*/
137/**
138 * @name Performance options
139 * @{
140 */
141/*===========================================================================*/
142
143/**
144 * @brief OS optimization.
145 * @details If enabled then time efficient rather than space efficient code
146 * is used when two possible implementations exist.
147 *
148 * @note This is not related to the compiler optimization options.
149 * @note The default is @p TRUE.
150 */
151#if !defined(CH_CFG_OPTIMIZE_SPEED)
152#define CH_CFG_OPTIMIZE_SPEED TRUE
153#endif
154
155/** @} */
156
157/*===========================================================================*/
158/**
159 * @name Subsystem options
160 * @{
161 */
162/*===========================================================================*/
163
164/**
165 * @brief Time Measurement APIs.
166 * @details If enabled then the time measurement APIs are included in
167 * the kernel.
168 *
169 * @note The default is @p TRUE.
170 */
171#if !defined(CH_CFG_USE_TM)
172#define CH_CFG_USE_TM FALSE
173#endif
174
175/**
176 * @brief Threads registry APIs.
177 * @details If enabled then the registry APIs are included in the kernel.
178 *
179 * @note The default is @p TRUE.
180 */
181#if !defined(CH_CFG_USE_REGISTRY)
182#define CH_CFG_USE_REGISTRY TRUE
183#endif
184
185/**
186 * @brief Threads synchronization APIs.
187 * @details If enabled then the @p chThdWait() function is included in
188 * the kernel.
189 *
190 * @note The default is @p TRUE.
191 */
192#if !defined(CH_CFG_USE_WAITEXIT)
193#define CH_CFG_USE_WAITEXIT TRUE
194#endif
195
196/**
197 * @brief Semaphores APIs.
198 * @details If enabled then the Semaphores APIs are included in the kernel.
199 *
200 * @note The default is @p TRUE.
201 */
202#if !defined(CH_CFG_USE_SEMAPHORES)
203#define CH_CFG_USE_SEMAPHORES TRUE
204#endif
205
206/**
207 * @brief Semaphores queuing mode.
208 * @details If enabled then the threads are enqueued on semaphores by
209 * priority rather than in FIFO order.
210 *
211 * @note The default is @p FALSE. Enable this if you have special
212 * requirements.
213 * @note Requires @p CH_CFG_USE_SEMAPHORES.
214 */
215#if !defined(CH_CFG_USE_SEMAPHORES_PRIORITY)
216#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
217#endif
218
219/**
220 * @brief Mutexes APIs.
221 * @details If enabled then the mutexes APIs are included in the kernel.
222 *
223 * @note The default is @p TRUE.
224 */
225#if !defined(CH_CFG_USE_MUTEXES)
226#define CH_CFG_USE_MUTEXES TRUE
227#endif
228
229/**
230 * @brief Enables recursive behavior on mutexes.
231 * @note Recursive mutexes are heavier and have an increased
232 * memory footprint.
233 *
234 * @note The default is @p FALSE.
235 * @note Requires @p CH_CFG_USE_MUTEXES.
236 */
237#if !defined(CH_CFG_USE_MUTEXES_RECURSIVE)
238#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
239#endif
240
241/**
242 * @brief Conditional Variables APIs.
243 * @details If enabled then the conditional variables APIs are included
244 * in the kernel.
245 *
246 * @note The default is @p TRUE.
247 * @note Requires @p CH_CFG_USE_MUTEXES.
248 */
249#if !defined(CH_CFG_USE_CONDVARS)
250#define CH_CFG_USE_CONDVARS TRUE
251#endif
252
253/**
254 * @brief Conditional Variables APIs with timeout.
255 * @details If enabled then the conditional variables APIs with timeout
256 * specification are included in the kernel.
257 *
258 * @note The default is @p TRUE.
259 * @note Requires @p CH_CFG_USE_CONDVARS.
260 */
261#if !defined(CH_CFG_USE_CONDVARS_TIMEOUT)
262#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE
263#endif
264
265/**
266 * @brief Events Flags APIs.
267 * @details If enabled then the event flags APIs are included in the kernel.
268 *
269 * @note The default is @p TRUE.
270 */
271#if !defined(CH_CFG_USE_EVENTS)
272#define CH_CFG_USE_EVENTS TRUE
273#endif
274
275/**
276 * @brief Events Flags APIs with timeout.
277 * @details If enabled then the events APIs with timeout specification
278 * are included in the kernel.
279 *
280 * @note The default is @p TRUE.
281 * @note Requires @p CH_CFG_USE_EVENTS.
282 */
283#if !defined(CH_CFG_USE_EVENTS_TIMEOUT)
284#define CH_CFG_USE_EVENTS_TIMEOUT TRUE
285#endif
286
287/**
288 * @brief Synchronous Messages APIs.
289 * @details If enabled then the synchronous messages APIs are included
290 * in the kernel.
291 *
292 * @note The default is @p TRUE.
293 */
294#if !defined(CH_CFG_USE_MESSAGES)
295#define CH_CFG_USE_MESSAGES TRUE
296#endif
297
298/**
299 * @brief Synchronous Messages queuing mode.
300 * @details If enabled then messages are served by priority rather than in
301 * FIFO order.
302 *
303 * @note The default is @p FALSE. Enable this if you have special
304 * requirements.
305 * @note Requires @p CH_CFG_USE_MESSAGES.
306 */
307#if !defined(CH_CFG_USE_MESSAGES_PRIORITY)
308#define CH_CFG_USE_MESSAGES_PRIORITY FALSE
309#endif
310
311/**
312 * @brief Mailboxes APIs.
313 * @details If enabled then the asynchronous messages (mailboxes) APIs are
314 * included in the kernel.
315 *
316 * @note The default is @p TRUE.
317 * @note Requires @p CH_CFG_USE_SEMAPHORES.
318 */
319#if !defined(CH_CFG_USE_MAILBOXES)
320#define CH_CFG_USE_MAILBOXES TRUE
321#endif
322
323/**
324 * @brief Core Memory Manager APIs.
325 * @details If enabled then the core memory manager APIs are included
326 * in the kernel.
327 *
328 * @note The default is @p TRUE.
329 */
330#if !defined(CH_CFG_USE_MEMCORE)
331#define CH_CFG_USE_MEMCORE TRUE
332#endif
333
334/**
335 * @brief Heap Allocator APIs.
336 * @details If enabled then the memory heap allocator APIs are included
337 * in the kernel.
338 *
339 * @note The default is @p TRUE.
340 * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
341 * @p CH_CFG_USE_SEMAPHORES.
342 * @note Mutexes are recommended.
343 */
344#if !defined(CH_CFG_USE_HEAP)
345#define CH_CFG_USE_HEAP TRUE
346#endif
347
348/**
349 * @brief Memory Pools Allocator APIs.
350 * @details If enabled then the memory pools allocator APIs are included
351 * in the kernel.
352 *
353 * @note The default is @p TRUE.
354 */
355#if !defined(CH_CFG_USE_MEMPOOLS)
356#define CH_CFG_USE_MEMPOOLS FALSE
357#endif
358
359/**
360 * @brief Objects FIFOs APIs.
361 * @details If enabled then the objects FIFOs APIs are included
362 * in the kernel.
363 *
364 * @note The default is @p TRUE.
365 */
366#if !defined(CH_CFG_USE_OBJ_FIFOS)
367#define CH_CFG_USE_OBJ_FIFOS FALSE
368#endif
369
370/**
371 * @brief Pipes APIs.
372 * @details If enabled then the pipes APIs are included
373 * in the kernel.
374 *
375 * @note The default is @p TRUE.
376 */
377#if !defined(CH_CFG_USE_PIPES)
378#define CH_CFG_USE_PIPES FALSE
379#endif
380
381/**
382 * @brief Dynamic Threads APIs.
383 * @details If enabled then the dynamic threads creation APIs are included
384 * in the kernel.
385 *
386 * @note The default is @p TRUE.
387 * @note Requires @p CH_CFG_USE_WAITEXIT.
388 * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
389 */
390#if !defined(CH_CFG_USE_DYNAMIC)
391#define CH_CFG_USE_DYNAMIC FALSE
392#endif
393
394/** @} */
395
396/*===========================================================================*/
397/**
398 * @name Objects factory options
399 * @{
400 */
401/*===========================================================================*/
402
403/**
404 * @brief Objects Factory APIs.
405 * @details If enabled then the objects factory APIs are included in the
406 * kernel.
407 *
408 * @note The default is @p FALSE.
409 */
410#if !defined(CH_CFG_USE_FACTORY)
411#define CH_CFG_USE_FACTORY FALSE
412#endif
413
414/**
415 * @brief Maximum length for object names.
416 * @details If the specified length is zero then the name is stored by
417 * pointer but this could have unintended side effects.
418 */
419#if !defined(CH_CFG_FACTORY_MAX_NAMES_LENGTH)
420#define CH_CFG_FACTORY_MAX_NAMES_LENGTH 8
421#endif
422
423/**
424 * @brief Enables the registry of generic objects.
425 */
426#if !defined(CH_CFG_FACTORY_OBJECTS_REGISTRY)
427#define CH_CFG_FACTORY_OBJECTS_REGISTRY FALSE
428#endif
429
430/**
431 * @brief Enables factory for generic buffers.
432 */
433#if !defined(CH_CFG_FACTORY_GENERIC_BUFFERS)
434#define CH_CFG_FACTORY_GENERIC_BUFFERS FALSE
435#endif
436
437/**
438 * @brief Enables factory for semaphores.
439 */
440#if !defined(CH_CFG_FACTORY_SEMAPHORES)
441#define CH_CFG_FACTORY_SEMAPHORES FALSE
442#endif
443
444/**
445 * @brief Enables factory for mailboxes.
446 */
447#if !defined(CH_CFG_FACTORY_MAILBOXES)
448#define CH_CFG_FACTORY_MAILBOXES FALSE
449#endif
450
451/**
452 * @brief Enables factory for objects FIFOs.
453 */
454#if !defined(CH_CFG_FACTORY_OBJ_FIFOS)
455#define CH_CFG_FACTORY_OBJ_FIFOS FALSE
456#endif
457
458/**
459 * @brief Enables factory for Pipes.
460 */
461#if !defined(CH_CFG_FACTORY_PIPES) || defined(__DOXYGEN__)
462#define CH_CFG_FACTORY_PIPES FALSE
463#endif
464
465/** @} */
466
467/*===========================================================================*/
468/**
469 * @name Debug options
470 * @{
471 */
472/*===========================================================================*/
473
474/**
475 * @brief Debug option, kernel statistics.
476 *
477 * @note The default is @p FALSE.
478 */
479#if !defined(CH_DBG_STATISTICS)
480#define CH_DBG_STATISTICS FALSE
481#endif
482
483/**
484 * @brief Debug option, system state check.
485 * @details If enabled the correct call protocol for system APIs is checked
486 * at runtime.
487 *
488 * @note The default is @p FALSE.
489 */
490#if !defined(CH_DBG_SYSTEM_STATE_CHECK)
491#define CH_DBG_SYSTEM_STATE_CHECK FALSE
492#endif
493
494/**
495 * @brief Debug option, parameters checks.
496 * @details If enabled then the checks on the API functions input
497 * parameters are activated.
498 *
499 * @note The default is @p FALSE.
500 */
501#if !defined(CH_DBG_ENABLE_CHECKS)
502#define CH_DBG_ENABLE_CHECKS FALSE
503#endif
504
505/**
506 * @brief Debug option, consistency checks.
507 * @details If enabled then all the assertions in the kernel code are
508 * activated. This includes consistency checks inside the kernel,
509 * runtime anomalies and port-defined checks.
510 *
511 * @note The default is @p FALSE.
512 */
513#if !defined(CH_DBG_ENABLE_ASSERTS)
514#define CH_DBG_ENABLE_ASSERTS FALSE
515#endif
516
517/**
518 * @brief Debug option, trace buffer.
519 * @details If enabled then the trace buffer is activated.
520 *
521 * @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
522 */
523#if !defined(CH_DBG_TRACE_MASK)
524#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
525#endif
526
527/**
528 * @brief Trace buffer entries.
529 * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
530 * different from @p CH_DBG_TRACE_MASK_DISABLED.
531 */
532#if !defined(CH_DBG_TRACE_BUFFER_SIZE)
533#define CH_DBG_TRACE_BUFFER_SIZE 128
534#endif
535
536/**
537 * @brief Debug option, stack checks.
538 * @details If enabled then a runtime stack check is performed.
539 *
540 * @note The default is @p FALSE.
541 * @note The stack check is performed in a architecture/port dependent way.
542 * It may not be implemented or some ports.
543 * @note The default failure mode is to halt the system with the global
544 * @p panic_msg variable set to @p NULL.
545 */
546#if !defined(CH_DBG_ENABLE_STACK_CHECK)
547#define CH_DBG_ENABLE_STACK_CHECK FALSE
548#endif
549
550/**
551 * @brief Debug option, stacks initialization.
552 * @details If enabled then the threads working area is filled with a byte
553 * value when a thread is created. This can be useful for the
554 * runtime measurement of the used stack.
555 *
556 * @note The default is @p FALSE.
557 */
558#if !defined(CH_DBG_FILL_THREADS)
559#define CH_DBG_FILL_THREADS FALSE
560#endif
561
562/**
563 * @brief Debug option, threads profiling.
564 * @details If enabled then a field is added to the @p thread_t structure that
565 * counts the system ticks occurred while executing the thread.
566 *
567 * @note The default is @p FALSE.
568 * @note This debug option is not currently compatible with the
569 * tickless mode.
570 */
571#if !defined(CH_DBG_THREADS_PROFILING)
572#define CH_DBG_THREADS_PROFILING FALSE
573#endif
574
575/** @} */
576
577/*===========================================================================*/
578/**
579 * @name Kernel hooks
580 * @{
581 */
582/*===========================================================================*/
583
584/**
585 * @brief System structure extension.
586 * @details User fields added to the end of the @p ch_system_t structure.
587 */
588#define CH_CFG_SYSTEM_EXTRA_FIELDS \
589 /* Add threads custom fields here.*/
590
591/**
592 * @brief System initialization hook.
593 * @details User initialization code added to the @p chSysInit() function
594 * just before interrupts are enabled globally.
595 */
596#define CH_CFG_SYSTEM_INIT_HOOK() { \
597 /* Add threads initialization code here.*/ \
598}
599
600/**
601 * @brief Threads descriptor structure extension.
602 * @details User fields added to the end of the @p thread_t structure.
603 */
604#define CH_CFG_THREAD_EXTRA_FIELDS \
605 /* Add threads custom fields here.*/
606
607/**
608 * @brief Threads initialization hook.
609 * @details User initialization code added to the @p _thread_init() function.
610 *
611 * @note It is invoked from within @p _thread_init() and implicitly from all
612 * the threads creation APIs.
613 */
614#define CH_CFG_THREAD_INIT_HOOK(tp) { \
615 /* Add threads initialization code here.*/ \
616}
617
618/**
619 * @brief Threads finalization hook.
620 * @details User finalization code added to the @p chThdExit() API.
621 */
622#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
623 /* Add threads finalization code here.*/ \
624}
625
626/**
627 * @brief Context switch hook.
628 * @details This hook is invoked just before switching between threads.
629 */
630#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
631 /* Context switch code here.*/ \
632}
633
634/**
635 * @brief ISR enter hook.
636 */
637#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
638 /* IRQ prologue code here.*/ \
639}
640
641/**
642 * @brief ISR exit hook.
643 */
644#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
645 /* IRQ epilogue code here.*/ \
646}
647
648/**
649 * @brief Idle thread enter hook.
650 * @note This hook is invoked within a critical zone, no OS functions
651 * should be invoked from here.
652 * @note This macro can be used to activate a power saving mode.
653 */
654#define CH_CFG_IDLE_ENTER_HOOK() { \
655 /* Idle-enter code here.*/ \
656}
657
658/**
659 * @brief Idle thread leave hook.
660 * @note This hook is invoked within a critical zone, no OS functions
661 * should be invoked from here.
662 * @note This macro can be used to deactivate a power saving mode.
663 */
664#define CH_CFG_IDLE_LEAVE_HOOK() { \
665 /* Idle-leave code here.*/ \
666}
667
668/**
669 * @brief Idle Loop hook.
670 * @details This hook is continuously invoked by the idle thread loop.
671 */
672#define CH_CFG_IDLE_LOOP_HOOK() { \
673 /* Idle loop code here.*/ \
674}
675
676/**
677 * @brief System tick event hook.
678 * @details This hook is invoked in the system tick handler immediately
679 * after processing the virtual timers queue.
680 */
681#define CH_CFG_SYSTEM_TICK_HOOK() { \
682 /* System tick event code here.*/ \
683}
684
685/**
686 * @brief System halt hook.
687 * @details This hook is invoked in case to a system halting error before
688 * the system is halted.
689 */
690#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
691 /* System halt code here.*/ \
692}
693
694/**
695 * @brief Trace hook.
696 * @details This hook is invoked each time a new record is written in the
697 * trace buffer.
698 */
699#define CH_CFG_TRACE_HOOK(tep) { \
700 /* Trace code here.*/ \
701}
702
703/** @} */
704
705/*===========================================================================*/
706/* Port-specific settings (override port settings defaulted in chcore.h). */
707/*===========================================================================*/
708
709#endif /* CHCONF_H */
710
711/** @} */ \ No newline at end of file
diff --git a/keyboards/handwired/pill60/bluepill/config.h b/keyboards/handwired/pill60/bluepill/config.h
new file mode 100644
index 000000000..f68f518b9
--- /dev/null
+++ b/keyboards/handwired/pill60/bluepill/config.h
@@ -0,0 +1,24 @@
1/* Copyright 2019
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19#define MATRIX_COL_PINS \
20 { A8, B11, B10, B15, A10, A1, A2, A3, A4, A5, A6, A7, B0, B1 }
21#define MATRIX_ROW_PINS \
22 { B4, B3, A15, B13, B5 }
23#define UNUSED_PINS \
24 { A0, A9, A11, A12, C13, C14, C15 }
diff --git a/keyboards/handwired/pill60/bluepill/halconf.h b/keyboards/handwired/pill60/bluepill/halconf.h
new file mode 100644
index 000000000..a40616675
--- /dev/null
+++ b/keyboards/handwired/pill60/bluepill/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 TRUE
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 TRUE
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/handwired/pill60/bluepill/mcuconf.h b/keyboards/handwired/pill60/bluepill/mcuconf.h
new file mode 100644
index 000000000..841b68992
--- /dev/null
+++ b/keyboards/handwired/pill60/bluepill/mcuconf.h
@@ -0,0 +1,209 @@
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 STM32F103_MCUCONF
21
22/*
23 * STM32F103 drivers configuration.
24 * The following settings override the default settings present in
25 * the various device driver implementation headers.
26 * Note that the settings for each driver only have effect if the whole
27 * driver is enabled in halconf.h.
28 *
29 * IRQ priorities:
30 * 15...0 Lowest...Highest.
31 *
32 * DMA priorities:
33 * 0...3 Lowest...Highest.
34 */
35
36/*
37 * HAL driver system settings.
38 */
39#define STM32_NO_INIT FALSE
40#define STM32_HSI_ENABLED TRUE
41#define STM32_LSI_ENABLED FALSE
42#define STM32_HSE_ENABLED TRUE
43#define STM32_LSE_ENABLED FALSE
44#define STM32_SW STM32_SW_PLL
45#define STM32_PLLSRC STM32_PLLSRC_HSE
46#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1
47#define STM32_PLLMUL_VALUE 9
48#define STM32_HPRE STM32_HPRE_DIV1
49#define STM32_PPRE1 STM32_PPRE1_DIV2
50#define STM32_PPRE2 STM32_PPRE2_DIV2
51#define STM32_ADCPRE STM32_ADCPRE_DIV4
52#define STM32_USB_CLOCK_REQUIRED TRUE
53#define STM32_USBPRE STM32_USBPRE_DIV1P5
54#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
55#define STM32_RTCSEL STM32_RTCSEL_HSEDIV
56#define STM32_PVD_ENABLE FALSE
57#define STM32_PLS STM32_PLS_LEV0
58
59/*
60 * ADC driver system settings.
61 */
62#define STM32_ADC_USE_ADC1 FALSE
63#define STM32_ADC_ADC1_DMA_PRIORITY 2
64#define STM32_ADC_ADC1_IRQ_PRIORITY 6
65
66/*
67 * CAN driver system settings.
68 */
69#define STM32_CAN_USE_CAN1 FALSE
70#define STM32_CAN_CAN1_IRQ_PRIORITY 11
71
72/*
73 * EXT driver system settings.
74 */
75#define STM32_EXT_EXTI0_IRQ_PRIORITY 6
76#define STM32_EXT_EXTI1_IRQ_PRIORITY 6
77#define STM32_EXT_EXTI2_IRQ_PRIORITY 6
78#define STM32_EXT_EXTI3_IRQ_PRIORITY 6
79#define STM32_EXT_EXTI4_IRQ_PRIORITY 6
80#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6
81#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6
82#define STM32_EXT_EXTI16_IRQ_PRIORITY 6
83#define STM32_EXT_EXTI17_IRQ_PRIORITY 6
84#define STM32_EXT_EXTI18_IRQ_PRIORITY 6
85#define STM32_EXT_EXTI19_IRQ_PRIORITY 6
86
87/*
88 * GPT driver system settings.
89 */
90#define STM32_GPT_USE_TIM1 FALSE
91#define STM32_GPT_USE_TIM2 FALSE
92#define STM32_GPT_USE_TIM3 FALSE
93#define STM32_GPT_USE_TIM4 FALSE
94#define STM32_GPT_USE_TIM5 FALSE
95#define STM32_GPT_USE_TIM8 FALSE
96#define STM32_GPT_TIM1_IRQ_PRIORITY 7
97#define STM32_GPT_TIM2_IRQ_PRIORITY 7
98#define STM32_GPT_TIM3_IRQ_PRIORITY 7
99#define STM32_GPT_TIM4_IRQ_PRIORITY 7
100#define STM32_GPT_TIM5_IRQ_PRIORITY 7
101#define STM32_GPT_TIM8_IRQ_PRIORITY 7
102
103/*
104 * I2C driver system settings.
105 */
106#define STM32_I2C_USE_I2C1 TRUE
107#define STM32_I2C_USE_I2C2 FALSE
108#define STM32_I2C_BUSY_TIMEOUT 50
109#define STM32_I2C_I2C1_IRQ_PRIORITY 5
110#define STM32_I2C_I2C2_IRQ_PRIORITY 5
111#define STM32_I2C_I2C1_DMA_PRIORITY 3
112#define STM32_I2C_I2C2_DMA_PRIORITY 3
113#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure")
114
115/*
116 * ICU driver system settings.
117 */
118#define STM32_ICU_USE_TIM1 FALSE
119#define STM32_ICU_USE_TIM2 FALSE
120#define STM32_ICU_USE_TIM3 FALSE
121#define STM32_ICU_USE_TIM4 FALSE
122#define STM32_ICU_USE_TIM5 FALSE
123#define STM32_ICU_USE_TIM8 FALSE
124#define STM32_ICU_TIM1_IRQ_PRIORITY 7
125#define STM32_ICU_TIM2_IRQ_PRIORITY 7
126#define STM32_ICU_TIM3_IRQ_PRIORITY 7
127#define STM32_ICU_TIM4_IRQ_PRIORITY 7
128#define STM32_ICU_TIM5_IRQ_PRIORITY 7
129#define STM32_ICU_TIM8_IRQ_PRIORITY 7
130
131/*
132 * PWM driver system settings.
133 */
134#define STM32_PWM_USE_ADVANCED FALSE
135#define STM32_PWM_USE_TIM1 FALSE
136#define STM32_PWM_USE_TIM2 TRUE
137#define STM32_PWM_USE_TIM3 FALSE
138#define STM32_PWM_USE_TIM4 FALSE
139#define STM32_PWM_USE_TIM5 FALSE
140#define STM32_PWM_USE_TIM8 FALSE
141#define STM32_PWM_TIM1_IRQ_PRIORITY 7
142#define STM32_PWM_TIM2_IRQ_PRIORITY 7
143#define STM32_PWM_TIM3_IRQ_PRIORITY 7
144#define STM32_PWM_TIM4_IRQ_PRIORITY 7
145#define STM32_PWM_TIM5_IRQ_PRIORITY 7
146#define STM32_PWM_TIM8_IRQ_PRIORITY 7
147
148/*
149 * RTC driver system settings.
150 */
151#define STM32_RTC_IRQ_PRIORITY 15
152
153/*
154 * SERIAL driver system settings.
155 */
156#define STM32_SERIAL_USE_USART1 FALSE
157#define STM32_SERIAL_USE_USART2 FALSE
158#define STM32_SERIAL_USE_USART3 FALSE
159#define STM32_SERIAL_USE_UART4 FALSE
160#define STM32_SERIAL_USE_UART5 FALSE
161#define STM32_SERIAL_USART1_PRIORITY 12
162#define STM32_SERIAL_USART2_PRIORITY 12
163#define STM32_SERIAL_USART3_PRIORITY 12
164#define STM32_SERIAL_UART4_PRIORITY 12
165#define STM32_SERIAL_UART5_PRIORITY 12
166
167/*
168 * SPI driver system settings.
169 */
170#define STM32_SPI_USE_SPI1 FALSE
171#define STM32_SPI_USE_SPI2 FALSE
172#define STM32_SPI_USE_SPI3 FALSE
173#define STM32_SPI_SPI1_DMA_PRIORITY 1
174#define STM32_SPI_SPI2_DMA_PRIORITY 1
175#define STM32_SPI_SPI3_DMA_PRIORITY 1
176#define STM32_SPI_SPI1_IRQ_PRIORITY 10
177#define STM32_SPI_SPI2_IRQ_PRIORITY 10
178#define STM32_SPI_SPI3_IRQ_PRIORITY 10
179#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
180
181/*
182 * ST driver system settings.
183 */
184#define STM32_ST_IRQ_PRIORITY 8
185#define STM32_ST_USE_TIMER 2
186
187/*
188 * UART driver system settings.
189 */
190#define STM32_UART_USE_USART1 FALSE
191#define STM32_UART_USE_USART2 FALSE
192#define STM32_UART_USE_USART3 FALSE
193#define STM32_UART_USART1_IRQ_PRIORITY 12
194#define STM32_UART_USART2_IRQ_PRIORITY 12
195#define STM32_UART_USART3_IRQ_PRIORITY 12
196#define STM32_UART_USART1_DMA_PRIORITY 0
197#define STM32_UART_USART2_DMA_PRIORITY 0
198#define STM32_UART_USART3_DMA_PRIORITY 0
199#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
200
201/*
202 * USB driver system settings.
203 */
204#define STM32_USB_USE_USB1 TRUE
205#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE
206#define STM32_USB_USB1_HP_IRQ_PRIORITY 13
207#define STM32_USB_USB1_LP_IRQ_PRIORITY 14
208
209#endif /* _MCUCONF_H_ */
diff --git a/keyboards/handwired/pill60/bluepill/rules.mk b/keyboards/handwired/pill60/bluepill/rules.mk
new file mode 100644
index 000000000..019b1130d
--- /dev/null
+++ b/keyboards/handwired/pill60/bluepill/rules.mk
@@ -0,0 +1,8 @@
1# MCU name
2MCU = STM32F103
3
4# Bootloader selection
5BOOTLOADER = stm32duino
6
7# Enter lower-power sleep mode when on the ChibiOS idle thread
8OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE
diff --git a/keyboards/handwired/pill60/config.h b/keyboards/handwired/pill60/config.h
new file mode 100644
index 000000000..d9940c77c
--- /dev/null
+++ b/keyboards/handwired/pill60/config.h
@@ -0,0 +1,53 @@
1 /* Copyright 2020 Imam Rafii
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 "config_common.h"
19
20#define VENDOR_ID 0x4454
21#define PRODUCT_ID 0x5444
22#define DEVICE_VER 0x0001
23
24#define MANUFACTURER "IktaS"
25#define PRODUCT "Pill60"
26
27#define MATRIX_ROWS 5
28#define MATRIX_COLS 14
29#define DIODE_DIRECTION COL2ROW
30
31/* Set 0 if debouncing isn't needed */
32#define DEBOUNCE 1
33
34/* Backlighting include */
35#define BACKLIGHT_PIN B14
36#define BACKLIGHT_PWM_DRIVER PWMD5
37#define BACKLIGHT_PWM_CHANNEL 1
38#define BACKLIGHT_LEVELS 5
39#define BREATHING_PERIOD 6
40
41/* Encoder */
42#define ENCODERS_PAD_A \
43 { B9 }
44#define ENCODERS_PAD_B \
45 { B8 }
46#define ENCODER_RESOLUTION 2
47
48/* OLED */
49#define I2C_DRIVER I2CD1
50#define I2C1_SCL_BANK GPIOB
51#define I2C1_SDA_BANK GPIOB
52#define I2C1_SCL 6
53#define I2C1_SDA 7
diff --git a/keyboards/handwired/pill60/info.json b/keyboards/handwired/pill60/info.json
new file mode 100644
index 000000000..bb44c9eb9
--- /dev/null
+++ b/keyboards/handwired/pill60/info.json
@@ -0,0 +1,82 @@
1{
2 "keyboard_name": "Pill60",
3 "url": "https://github.com/IktaS/Pill60",
4 "maintainer": "IktaS <imamrafiiia@gmail.com>",
5 "width": 15,
6 "height": 5,
7 "layouts": {
8 "layout_default": {
9 "layout": [
10 {"label": "Encoder", "x": 0, "y": 0},
11
12 {"label": "Esc", "x": 0, "y": 1},
13 {"label": "1","x": 1, "y": 1},
14 {"label": "2","x": 2, "y": 1},
15 {"label": "3","x": 3, "y": 1},
16 {"label": "4","x": 4, "y": 1},
17 {"label": "5","x": 5, "y": 1},
18 {"label": "6","x": 6, "y": 1},
19 {"label": "7","x": 7, "y": 1},
20 {"label": "8","x": 8, "y": 1},
21 {"label": "9","x": 9, "y": 1},
22 {"label": "0","x": 10, "y": 1},
23 {"label": "-","x": 11, "y": 1},
24 {"label": "=","x": 12, "y": 1},
25 {"label": "Backspace","x": 13, "y": 1},
26 {"label": "Delete","x": 14, "y": 1},
27
28 {"label": "Tab","x": 0, "y": 2, "w": 1.5},
29 {"label": "Q","x": 1.5, "y": 2},
30 {"label": "W","x": 2.5, "y": 2},
31 {"label": "E","x": 3.5, "y": 2},
32 {"label": "R","x": 4.5, "y": 2},
33 {"label": "T","x": 5.5, "y": 2},
34 {"label": "Y","x": 6.5, "y": 2},
35 {"label": "U","x": 7.5, "y": 2},
36 {"label": "I","x": 8.5, "y": 2},
37 {"label": "O","x": 9.5, "y": 2},
38 {"label": "P","x": 10.5, "y": 2},
39 {"label": "[","x": 11.5, "y": 2},
40 {"label": "]","x": 12.5, "y": 2},
41 {"label": "\\","x": 13.5, "y": 2, "w": 1.5},
42
43 {"label": "Caps","x": 0, "y": 3, "w": 1.75},
44 {"label": "A","x": 1.75, "y": 3},
45 {"label": "S","x": 2.75, "y": 3},
46 {"label": "D","x": 3.75, "y": 3},
47 {"label": "F","x": 4.75, "y": 3},
48 {"label": "G","x": 5.75, "y": 3},
49 {"label": "H","x": 6.75, "y": 3},
50 {"label": "J","x": 7.75, "y": 3},
51 {"label": "K","x": 8.75, "y": 3},
52 {"label": "L","x": 9.75, "y": 3},
53 {"label": ";","x": 10.75, "y": 3},
54 {"label": "'","x": 11.75, "y": 3},
55 {"label": "Enter","x": 12.75, "y": 3, "w": 2.25},
56
57 {"label": "L Shift","x": 0, "y": 4, "w": 2.25},
58 {"label": "Z","x": 2.25, "y": 4},
59 {"label": "X","x": 3.25, "y": 4},
60 {"label": "C","x": 4.25, "y": 4},
61 {"label": "V","x": 5.25, "y": 4},
62 {"label": "B","x": 6.25, "y": 4},
63 {"label": "N","x": 7.25, "y": 4},
64 {"label": "M","x": 8.25, "y": 4},
65 {"label": ",","x": 9.25, "y": 4},
66 {"label": ".","x": 10.25, "y": 4},
67 {"label": "/","x": 11.25, "y": 4},
68 {"label": "R Shift","x": 12.25, "y": 4, "w": 1.75},
69 {"label": "FN","x": 14, "y": 4},
70
71 {"label": "L CTRL","x": 0, "y": 5, "w": 1.25},
72 {"label": "L GUI","x": 1.25, "y": 5, "w": 1.25},
73 {"label": "L ALT","x": 2.5, "y": 5, "w": 1.25},
74 {"label": "Space","x": 3.75, "y": 5, "w": 6.25},
75 {"label": "R ALT","x": 10, "y": 5, "w": 1.25},
76 {"label": "R GUI","x": 11.25, "y": 5, "w": 1.25},
77 {"label": "R MENU","x": 12.5, "y": 5, "w": 1.25},
78 {"label": "R CTRL","x": 13.75, "y": 5, "w": 1.25}
79 ]
80 }
81 }
82}
diff --git a/keyboards/handwired/pill60/keymaps/default/keymap.c b/keyboards/handwired/pill60/keymaps/default/keymap.c
new file mode 100644
index 000000000..6edcb0c2c
--- /dev/null
+++ b/keyboards/handwired/pill60/keymaps/default/keymap.c
@@ -0,0 +1,87 @@
1 /* Copyright 2020 Imam Rafii
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
18enum layers {
19 _BL,
20 _FL
21};
22
23
24
25const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
26 [_BL] = LAYOUT(
27 KC_F1,
28 KC_GESC, 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_BSLS, KC_DEL,
29 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_BSPC,
30 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
31 KC_RSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, MO(_FL),
32 MO(_FL), KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL
33 ),
34 [_FL] = LAYOUT(
35 KC_TRNS,
36 KC_GRV, 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_INS,
37 KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS,
38 KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS,
39 KC_TRNS, KC_HOME, XXXXXXX, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, XXXXXXX, KC_END, KC_TRNS, KC_TRNS,
40 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
41 ),
42};
43
44#ifdef OLED_DRIVER_ENABLE
45
46static void render_oled(void) {
47 oled_write_P(PSTR("Ikta's Pill60"), false);
48 oled_write_P(PSTR("\n\n"), false);
49 led_t led_usb_state = host_keyboard_led_state();
50 oled_write_ln_P(PSTR("CPSLK"), led_usb_state.caps_lock);
51 oled_write_P(PSTR(" "), false);
52 switch (get_highest_layer(layer_state)) {
53 case _BL:
54 oled_write_P(PSTR("Base"), false);
55 break;
56 case _FL:
57 oled_write_P(PSTR("Function"), false);
58 break;
59 default:
60 oled_write_ln_P(PSTR("Base"), false);
61 }
62 oled_write_P(PSTR(" "), false);
63}
64
65oled_rotation_t oled_init_user(oled_rotation_t rotation) {
66 return rotation;
67}
68
69void oled_task_user(void) {
70 render_oled();
71}
72
73#endif
74
75#ifdef ENCODER_ENABLE
76
77void encoder_update_user(uint8_t index, bool clockwise) {
78 if (index == 0) { /* First encoder */
79 if (clockwise) {
80 tap_code(KC_A);
81 } else {
82 tap_code(KC_B);
83 }
84 }
85}
86
87#endif
diff --git a/keyboards/handwired/pill60/keymaps/default/readme.md b/keyboards/handwired/pill60/keymaps/default/readme.md
new file mode 100644
index 000000000..b1c3f1d79
--- /dev/null
+++ b/keyboards/handwired/pill60/keymaps/default/readme.md
@@ -0,0 +1,6 @@
1![Pill60 Layout Image](https://i.imgur.com/LIW18XJ.png)
2
3# Default Pill 60 Layout
4
5This is the default layout that comes flashed on every 60% board. For the most
6part it's a straightforward and easy to follow layout. Except the backspace is split, and right shift is split. \ No newline at end of file
diff --git a/keyboards/handwired/pill60/pill60.c b/keyboards/handwired/pill60/pill60.c
new file mode 100644
index 000000000..928685a92
--- /dev/null
+++ b/keyboards/handwired/pill60/pill60.c
@@ -0,0 +1,16 @@
1 /* Copyright 2020 Imam Rafii
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 "pill60.h" \ No newline at end of file
diff --git a/keyboards/handwired/pill60/pill60.h b/keyboards/handwired/pill60/pill60.h
new file mode 100644
index 000000000..e020f1eb7
--- /dev/null
+++ b/keyboards/handwired/pill60/pill60.h
@@ -0,0 +1,42 @@
1 /* Copyright 2020 Imam Rafii
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/* LAYOUT
21 ENCODER
22 ESC| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |BCKS | DEL
23 TAB| Q | W | E | R | T | Y | U | I | O | P | [ | ] | \
24 CAP| A | S | D | F | G | H | J | K | L | ; | ' | ENTER
25 LSHFT| Z | X | C | V | B | N | M | , | . | / | RSHIF | FN
26 LCT| WIN| ALT| ESPACE | ALT| WIN | MN| RCT|
27*/
28
29#define LAYOUT( \
30 e00, \
31 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \
32 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, \
33 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2e, \
34 k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3e, \
35 k40, k41, k42, k47, k4a, k4b, k4c, k4e \
36) { \
37 { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d }, \
38 { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e }, \
39 { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2e, k0e }, \
40 { k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3e, KC_NO }, \
41 { k40, k41, k42, e00, KC_NO, KC_NO, k47, KC_NO, KC_NO, KC_NO, k4a, k4b, k4c, k4e }\
42}
diff --git a/keyboards/handwired/pill60/readme.md b/keyboards/handwired/pill60/readme.md
new file mode 100644
index 000000000..3d1d142e7
--- /dev/null
+++ b/keyboards/handwired/pill60/readme.md
@@ -0,0 +1,25 @@
1# Pill60
2
3![Pill60](https://i.imgur.com/7WmHa6ml.png)
4
5A 60% open source keyboard with rotary encoder, OLED screen, and Hotswap socket, using STM32F103 / Blue Pill.
6
7* Keyboard Maintainer: [Ikta](https://github.com/IktaS)#8871 (Discord)
8* Hardware Supported: Pill60 PCB, STM32F103C8T6
9* Hardware Availability: [github](https://github.com/IktaS/Pill60)
10
11Step by step guide on how to install a bootloader if your bluepill don't have one :
121. Download [this bootloader]( https://github.com/rogerclarkmelbourne/STM32duino-bootloader/blob/master/bootloader_only_binaries/generic_boot20_pc13_fastboot.bin)
132. Flash Using FTDI Serial to USB converter or an ST-Link, as in [this](https://www.youtube.com/watch?v=Myon8H111PQ) video, but replacing the bootloader file
143. Put Boot 1 to 1, then reset the board, if you're using the same bootloader, the LED should blink
154. Flash your .bin file using dfu-util
165. Put Boot 1 back to 0, then reset again
17
18Building Guide :
19- Use `qmk compile -kb handwired/pill60 -km default` to compile default keymap and using STM32F103 as an MCU
20- Use `qmk compile -kb handwired/pill60/blackpill_f401 -km default` to compile default keymap and using STM32F401 as an MCU
21- Use `qmk compile -kb handwired/pill60/blackpill_f411 -km default` to compile default keymap and using STM32F411 as an MCU
22
23## Warning: currently tested MCU is STM32F103, I am still waiting for f401 and f411 to arrive
24
25See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/handwired/pill60/rules.mk b/keyboards/handwired/pill60/rules.mk
new file mode 100644
index 000000000..7658a814d
--- /dev/null
+++ b/keyboards/handwired/pill60/rules.mk
@@ -0,0 +1,21 @@
1# Build Options
2# change yes to no to disable
3#
4BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
5MOUSEKEY_ENABLE = yes # Mouse keys
6EXTRAKEY_ENABLE = yes # Audio control and System control
7CONSOLE_ENABLE = yes # Console for debug
8COMMAND_ENABLE = yes # Commands for debug and configuration
9# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
10SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
11# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
12NKRO_ENABLE = yes # USB Nkey Rollover
13BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
14BACKLIGHT_DRIVER = software
15RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
16BLUETOOTH_ENABLE = no # Enable Bluetooth
17AUDIO_ENABLE = no # Audio output
18OLED_DRIVER_ENABLE = yes
19ENCODER_ENABLE = yes
20
21DEFAULT_FOLDER = handwired/pill60/bluepill