aboutsummaryrefslogtreecommitdiff
path: root/keyboards/hs60
diff options
context:
space:
mode:
authoryiancar <yiangosyiangou@cytanet.com.cy>2018-10-27 00:14:29 +0100
committerDrashna Jaelre <drashna@live.com>2018-10-26 16:14:29 -0700
commit6fa3cfbf534b54290f693dc1986437aebd092b32 (patch)
treec558381963dc1195e3b0cf34f5894f0af5aa0f47 /keyboards/hs60
parent24b3556e844ec76813a42ce4c5b7a77a6f874d5a (diff)
downloadqmk_firmware-6fa3cfbf534b54290f693dc1986437aebd092b32.tar.gz
qmk_firmware-6fa3cfbf534b54290f693dc1986437aebd092b32.zip
Keyboard: Add HS60 V2 (#4250)
* HS60 V2 - Created V1 and V2 folders - Added V2 ARM configuration * Problems in paradise * More touble * We got it now!
Diffstat (limited to 'keyboards/hs60')
-rw-r--r--keyboards/hs60/v1/config.h (renamed from keyboards/hs60/config.h)5
-rw-r--r--keyboards/hs60/v1/info.json (renamed from keyboards/hs60/info.json)0
-rw-r--r--keyboards/hs60/v1/keymaps/ansi/config.h (renamed from keyboards/hs60/keymaps/ansi/config.h)7
-rw-r--r--keyboards/hs60/v1/keymaps/ansi/keymap.c (renamed from keyboards/hs60/keymaps/ansi/keymap.c)0
-rw-r--r--keyboards/hs60/v1/keymaps/ansi/readme.md (renamed from keyboards/hs60/keymaps/ansi/readme.md)0
-rw-r--r--keyboards/hs60/v1/keymaps/default/keymap.c (renamed from keyboards/hs60/keymaps/default/keymap.c)0
-rw-r--r--keyboards/hs60/v1/keymaps/default/readme.md (renamed from keyboards/hs60/keymaps/default/readme.md)0
-rw-r--r--keyboards/hs60/v1/readme.md (renamed from keyboards/hs60/readme.md)2
-rw-r--r--keyboards/hs60/v1/rules.mk (renamed from keyboards/hs60/rules.mk)0
-rw-r--r--keyboards/hs60/v1/v1.c (renamed from keyboards/hs60/hs60.c)3
-rw-r--r--keyboards/hs60/v1/v1.h (renamed from keyboards/hs60/hs60.h)0
-rw-r--r--keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.c126
-rw-r--r--keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.h1187
-rw-r--r--keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.mk5
-rw-r--r--keyboards/hs60/v2/bootloader_defs.h7
-rw-r--r--keyboards/hs60/v2/chconf.h520
-rw-r--r--keyboards/hs60/v2/config.h117
-rw-r--r--keyboards/hs60/v2/halconf.h388
-rw-r--r--keyboards/hs60/v2/info.json1650
-rw-r--r--keyboards/hs60/v2/keymaps/ansi/config.h21
-rw-r--r--keyboards/hs60/v2/keymaps/ansi/keymap.c46
-rw-r--r--keyboards/hs60/v2/keymaps/ansi/readme.md6
-rw-r--r--keyboards/hs60/v2/keymaps/default/keymap.c46
-rw-r--r--keyboards/hs60/v2/keymaps/default/readme.md6
-rw-r--r--keyboards/hs60/v2/keymaps/hhkb/config.h21
-rw-r--r--keyboards/hs60/v2/keymaps/hhkb/keymap.c46
-rw-r--r--keyboards/hs60/v2/mcuconf.h257
-rw-r--r--keyboards/hs60/v2/readme.md18
-rw-r--r--keyboards/hs60/v2/rules.mk58
-rw-r--r--keyboards/hs60/v2/v2.c635
-rw-r--r--keyboards/hs60/v2/v2.h67
31 files changed, 5231 insertions, 13 deletions
diff --git a/keyboards/hs60/config.h b/keyboards/hs60/v1/config.h
index 31f7c0790..c297a6e19 100644
--- a/keyboards/hs60/config.h
+++ b/keyboards/hs60/v1/config.h
@@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>. 15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17 17
18#ifndef CONFIG_H 18#pragma once
19#define CONFIG_H
20 19
21#include "config_common.h" 20#include "config_common.h"
22 21
@@ -142,5 +141,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
142#endif 141#endif
143 142
144#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL 143#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL
145
146#endif
diff --git a/keyboards/hs60/info.json b/keyboards/hs60/v1/info.json
index 677054cc6..677054cc6 100644
--- a/keyboards/hs60/info.json
+++ b/keyboards/hs60/v1/info.json
diff --git a/keyboards/hs60/keymaps/ansi/config.h b/keyboards/hs60/v1/keymaps/ansi/config.h
index bab67fd55..f51cc16d8 100644
--- a/keyboards/hs60/keymaps/ansi/config.h
+++ b/keyboards/hs60/v1/keymaps/ansi/config.h
@@ -14,13 +14,8 @@ GNU General Public License for more details.
14You should have received a copy of the GNU General Public License 14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>. 15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17#ifndef CONFIG_USER_H 17#pragma once
18#define CONFIG_USER_H
19
20#include "../../config.h"
21 18
22/* Include overwrites for specific keymap */ 19/* Include overwrites for specific keymap */
23 20
24#define HS60_ANSI 21#define HS60_ANSI
25
26#endif \ No newline at end of file
diff --git a/keyboards/hs60/keymaps/ansi/keymap.c b/keyboards/hs60/v1/keymaps/ansi/keymap.c
index 923af9e2c..923af9e2c 100644
--- a/keyboards/hs60/keymaps/ansi/keymap.c
+++ b/keyboards/hs60/v1/keymaps/ansi/keymap.c
diff --git a/keyboards/hs60/keymaps/ansi/readme.md b/keyboards/hs60/v1/keymaps/ansi/readme.md
index fa811319d..fa811319d 100644
--- a/keyboards/hs60/keymaps/ansi/readme.md
+++ b/keyboards/hs60/v1/keymaps/ansi/readme.md
diff --git a/keyboards/hs60/keymaps/default/keymap.c b/keyboards/hs60/v1/keymaps/default/keymap.c
index 2a5e82361..2a5e82361 100644
--- a/keyboards/hs60/keymaps/default/keymap.c
+++ b/keyboards/hs60/v1/keymaps/default/keymap.c
diff --git a/keyboards/hs60/keymaps/default/readme.md b/keyboards/hs60/v1/keymaps/default/readme.md
index 9125cb349..9125cb349 100644
--- a/keyboards/hs60/keymaps/default/readme.md
+++ b/keyboards/hs60/v1/keymaps/default/readme.md
diff --git a/keyboards/hs60/readme.md b/keyboards/hs60/v1/readme.md
index 939b58828..a77bbc25c 100644
--- a/keyboards/hs60/readme.md
+++ b/keyboards/hs60/v1/readme.md
@@ -13,6 +13,6 @@ Due to the RGB implementation, the HS60 is currently not compatible with communi
13 13
14Make example for this keyboard (after setting up your build environment): 14Make example for this keyboard (after setting up your build environment):
15 15
16 make hs60:default 16 make hs60/v1:default
17 17
18See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. 18See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
diff --git a/keyboards/hs60/rules.mk b/keyboards/hs60/v1/rules.mk
index bff965948..bff965948 100644
--- a/keyboards/hs60/rules.mk
+++ b/keyboards/hs60/v1/rules.mk
diff --git a/keyboards/hs60/hs60.c b/keyboards/hs60/v1/v1.c
index 169f84b02..882611030 100644
--- a/keyboards/hs60/hs60.c
+++ b/keyboards/hs60/v1/v1.c
@@ -13,8 +13,7 @@
13 * You should have received a copy of the GNU General Public License 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/>. 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 15 */
16#include "hs60.h" 16#include "v1.h"
17#include "config.h"
18 17
19// Please ignore this is for upcoming features 18// Please ignore this is for upcoming features
20/*#ifdef RAW_ENABLE 19/*#ifdef RAW_ENABLE
diff --git a/keyboards/hs60/hs60.h b/keyboards/hs60/v1/v1.h
index 4de781e5f..4de781e5f 100644
--- a/keyboards/hs60/hs60.h
+++ b/keyboards/hs60/v1/v1.h
diff --git a/keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.c b/keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.c
new file mode 100644
index 000000000..4331155df
--- /dev/null
+++ b/keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.c
@@ -0,0 +1,126 @@
1/*
2 ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17#include "hal.h"
18
19#if HAL_USE_PAL || defined(__DOXYGEN__)
20/**
21 * @brief PAL setup.
22 * @details Digital I/O ports static configuration as defined in @p board.h.
23 * This variable is used by the HAL when initializing the PAL driver.
24 */
25const PALConfig pal_default_config = {
26#if STM32_HAS_GPIOA
27 {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR,
28 VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH},
29#endif
30#if STM32_HAS_GPIOB
31 {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR,
32 VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH},
33#endif
34#if STM32_HAS_GPIOC
35 {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR,
36 VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH},
37#endif
38#if STM32_HAS_GPIOD
39 {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR,
40 VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH},
41#endif
42#if STM32_HAS_GPIOE
43 {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR,
44 VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH},
45#endif
46#if STM32_HAS_GPIOF
47 {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR,
48 VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH},
49#endif
50#if STM32_HAS_GPIOG
51 {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR,
52 VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH},
53#endif
54#if STM32_HAS_GPIOH
55 {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR,
56 VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH},
57#endif
58#if STM32_HAS_GPIOI
59 {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR,
60 VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}
61#endif
62};
63#endif
64
65void enter_bootloader_mode_if_requested(void);
66
67/**
68 * @brief Early initialization code.
69 * @details This initialization must be performed just after stack setup
70 * and before any other initialization.
71 */
72void __early_init(void) {
73 enter_bootloader_mode_if_requested();
74 stm32_clock_init();
75}
76
77#if HAL_USE_SDC || defined(__DOXYGEN__)
78/**
79 * @brief SDC card detection.
80 */
81bool sdc_lld_is_card_inserted(SDCDriver *sdcp) {
82
83 (void)sdcp;
84 /* TODO: Fill the implementation.*/
85 return true;
86}
87
88/**
89 * @brief SDC card write protection detection.
90 */
91bool sdc_lld_is_write_protected(SDCDriver *sdcp) {
92
93 (void)sdcp;
94 /* TODO: Fill the implementation.*/
95 return false;
96}
97#endif /* HAL_USE_SDC */
98
99#if HAL_USE_MMC_SPI || defined(__DOXYGEN__)
100/**
101 * @brief MMC_SPI card detection.
102 */
103bool mmc_lld_is_card_inserted(MMCDriver *mmcp) {
104
105 (void)mmcp;
106 /* TODO: Fill the implementation.*/
107 return true;
108}
109
110/**
111 * @brief MMC_SPI card write protection detection.
112 */
113bool mmc_lld_is_write_protected(MMCDriver *mmcp) {
114
115 (void)mmcp;
116 /* TODO: Fill the implementation.*/
117 return false;
118}
119#endif
120
121/**
122 * @brief Board-specific initialization code.
123 * @todo Add your board-specific code, if any.
124 */
125void boardInit(void) {
126}
diff --git a/keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.h b/keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.h
new file mode 100644
index 000000000..fb7283add
--- /dev/null
+++ b/keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.h
@@ -0,0 +1,1187 @@
1/*
2 ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17#ifndef _BOARD_H_
18#define _BOARD_H_
19
20/*
21 * Setup for Clueboard 60% Keyboard
22 */
23
24/*
25 * Board identifier.
26 */
27#define BOARD_GENERIC_STM32_F303XC
28#define BOARD_NAME "HS60 V2.0 PCB"
29
30/*
31 * Board oscillators-related settings.
32 * NOTE: LSE not fitted.
33 */
34#if !defined(STM32_LSECLK)
35#define STM32_LSECLK 0U
36#endif
37
38#define STM32_LSEDRV (3U << 3U)
39
40#if !defined(STM32_HSECLK)
41#define STM32_HSECLK 8000000U
42#endif
43
44// #define STM32_HSE_BYPASS
45
46/*
47 * MCU type as defined in the ST header.
48 */
49#define STM32F303xC
50
51/*
52 * IO pins assignments.
53 */
54#define GPIOA_PIN0 0U
55#define GPIOA_PIN1 1U
56#define GPIOA_PIN2 2U
57#define GPIOA_PIN3 3U
58#define GPIOA_PIN4 4U
59#define GPIOA_PIN5 5U
60#define GPIOA_PIN6 6U
61#define GPIOA_PIN7 7U
62#define GPIOA_PIN8 8U
63#define GPIOA_PIN9 9U
64#define GPIOA_PIN10 10U
65#define GPIOA_USB_DM 11U
66#define GPIOA_USB_DP 12U
67#define GPIOA_SWDIO 13U
68#define GPIOA_SWCLK 14U
69#define GPIOA_PIN15 15U
70
71#define GPIOB_PIN0 0U
72#define GPIOB_PIN1 1U
73#define GPIOB_PIN2 2U
74#define GPIOB_PIN3 3U
75#define GPIOB_PIN4 4U
76#define GPIOB_PIN5 5U
77#define GPIOB_PIN6 6U
78#define GPIOB_PIN7 7U
79#define GPIOB_PIN8 8U
80#define GPIOB_PIN9 9U
81#define GPIOB_PIN10 10U
82#define GPIOB_PIN11 11U
83#define GPIOB_PIN12 12U
84#define GPIOB_PIN13 13U
85#define GPIOB_PIN14 14U
86#define GPIOB_PIN15 15U
87
88#define GPIOC_PIN0 0U
89#define GPIOC_PIN1 1U
90#define GPIOC_PIN2 2U
91#define GPIOC_PIN3 3U
92#define GPIOC_PIN4 4U
93#define GPIOC_PIN5 5U
94#define GPIOC_PIN6 6U
95#define GPIOC_PIN7 7U
96#define GPIOC_PIN8 8U
97#define GPIOC_PIN9 9U
98#define GPIOC_PIN10 10U
99#define GPIOC_PIN11 11U
100#define GPIOC_PIN12 12U
101#define GPIOC_PIN13 13U
102#define GPIOC_PIN14 14U
103#define GPIOC_PIN15 15U
104
105#define GPIOD_PIN0 0U
106#define GPIOD_PIN1 1U
107#define GPIOD_PIN2 2U
108#define GPIOD_PIN3 3U
109#define GPIOD_PIN4 4U
110#define GPIOD_PIN5 5U
111#define GPIOD_PIN6 6U
112#define GPIOD_PIN7 7U
113#define GPIOD_PIN8 8U
114#define GPIOD_PIN9 9U
115#define GPIOD_PIN10 10U
116#define GPIOD_PIN11 11U
117#define GPIOD_PIN12 12U
118#define GPIOD_PIN13 13U
119#define GPIOD_PIN14 14U
120#define GPIOD_PIN15 15U
121
122#define GPIOE_PIN0 0U
123#define GPIOE_PIN1 1U
124#define GPIOE_PIN2 2U
125#define GPIOE_PIN3 3U
126#define GPIOE_PIN4 4U
127#define GPIOE_PIN5 5U
128#define GPIOE_PIN6 6U
129#define GPIOE_PIN7 7U
130#define GPIOE_PIN8 8U
131#define GPIOE_PIN9 9U
132#define GPIOE_PIN10 10U
133#define GPIOE_PIN11 11U
134#define GPIOE_PIN12 12U
135#define GPIOE_PIN13 13U
136#define GPIOE_PIN14 14U
137#define GPIOE_PIN15 15U
138
139#define GPIOF_I2C2_SDA 0U
140#define GPIOF_I2C2_SCL 1U
141#define GPIOF_PIN2 2U
142#define GPIOF_PIN3 3U
143#define GPIOF_PIN4 4U
144#define GPIOF_PIN5 5U
145#define GPIOF_PIN6 6U
146#define GPIOF_PIN7 7U
147#define GPIOF_PIN8 8U
148#define GPIOF_PIN9 9U
149#define GPIOF_PIN10 10U
150#define GPIOF_PIN11 11U
151#define GPIOF_PIN12 12U
152#define GPIOF_PIN13 13U
153#define GPIOF_PIN14 14U
154#define GPIOF_PIN15 15U
155
156#define GPIOG_PIN0 0U
157#define GPIOG_PIN1 1U
158#define GPIOG_PIN2 2U
159#define GPIOG_PIN3 3U
160#define GPIOG_PIN4 4U
161#define GPIOG_PIN5 5U
162#define GPIOG_PIN6 6U
163#define GPIOG_PIN7 7U
164#define GPIOG_PIN8 8U
165#define GPIOG_PIN9 9U
166#define GPIOG_PIN10 10U
167#define GPIOG_PIN11 11U
168#define GPIOG_PIN12 12U
169#define GPIOG_PIN13 13U
170#define GPIOG_PIN14 14U
171#define GPIOG_PIN15 15U
172
173#define GPIOH_PIN0 0U
174#define GPIOH_PIN1 1U
175#define GPIOH_PIN2 2U
176#define GPIOH_PIN3 3U
177#define GPIOH_PIN4 4U
178#define GPIOH_PIN5 5U
179#define GPIOH_PIN6 6U
180#define GPIOH_PIN7 7U
181#define GPIOH_PIN8 8U
182#define GPIOH_PIN9 9U
183#define GPIOH_PIN10 10U
184#define GPIOH_PIN11 11U
185#define GPIOH_PIN12 12U
186#define GPIOH_PIN13 13U
187#define GPIOH_PIN14 14U
188#define GPIOH_PIN15 15U
189
190/*
191 * IO lines assignments.
192 */
193#define LINE_L3GD20_SDI PAL_LINE(GPIOA, 7U)
194#define LINE_USB_DM PAL_LINE(GPIOA, 11U)
195#define LINE_USB_DP PAL_LINE(GPIOA, 12U)
196#define LINE_SWDIO PAL_LINE(GPIOA, 13U)
197#define LINE_SWCLK PAL_LINE(GPIOA, 14U)
198
199#define LINE_PIN6 PAL_LINE(GPIOF, 0U)
200#define LINE_PIN7 PAL_LINE(GPIOF, 1U)
201
202#define LINE_CAPS_LOCK PAL_LINE(GPIOB, 7U)
203
204
205/*
206 * I/O ports initial setup, this configuration is established soon after reset
207 * in the initialization code.
208 * Please refer to the STM32 Reference Manual for details.
209 */
210#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
211#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
212#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
213#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
214#define PIN_ODR_LOW(n) (0U << (n))
215#define PIN_ODR_HIGH(n) (1U << (n))
216#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
217#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
218#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U))
219#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U))
220#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U))
221#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U))
222#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
223#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
224#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
225#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
226
227/*
228 * GPIOA setup:
229 *
230 * PA0 - NC
231 * PA1 - NC
232 * PA2 - COL1
233 * PA3 - COL2
234 * PA4 - SPEAKER1
235 * PA5 - SPEAKER2
236 * PA6 - COL3
237 * PA7 - COL8
238 * PA8 - COL6
239 * PA9 - COL7
240 * PA10 - ROW5
241 * PA11 - USB_DM (alternate 14).
242 * PA12 - USB_DP (alternate 14).
243 * PA13 - SWDIO (alternate 0).
244 * PA14 - SWCLK (alternate 0).
245 * PA15 - ROW4
246 */
247#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_PIN0) | \
248 PIN_MODE_ALTERNATE(GPIOA_PIN1) | \
249 PIN_MODE_INPUT(GPIOA_PIN2) | \
250 PIN_MODE_INPUT(GPIOA_PIN3) | \
251 PIN_MODE_INPUT(GPIOA_PIN4) | \
252 PIN_MODE_INPUT(GPIOA_PIN5) | \
253 PIN_MODE_INPUT(GPIOA_PIN6) | \
254 PIN_MODE_INPUT(GPIOA_PIN7) | \
255 PIN_MODE_INPUT(GPIOA_PIN8) | \
256 PIN_MODE_INPUT(GPIOA_PIN9) | \
257 PIN_MODE_INPUT(GPIOA_PIN10) | \
258 PIN_MODE_ALTERNATE(GPIOA_USB_DM) | \
259 PIN_MODE_ALTERNATE(GPIOA_USB_DP) | \
260 PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \
261 PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \
262 PIN_MODE_INPUT(GPIOA_PIN15))
263#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \
264 PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \
265 PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \
266 PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \
267 PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \
268 PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \
269 PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \
270 PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \
271 PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \
272 PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \
273 PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \
274 PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \
275 PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \
276 PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \
277 PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \
278 PIN_OTYPE_PUSHPULL(GPIOA_PIN15))
279#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_PIN0) | \
280 PIN_OSPEED_HIGH(GPIOA_PIN1) | \
281 PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \
282 PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \
283 PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \
284 PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \
285 PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \
286 PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \
287 PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \
288 PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \
289 PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \
290 PIN_OSPEED_HIGH(GPIOA_USB_DM) | \
291 PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \
292 PIN_OSPEED_HIGH(GPIOA_SWDIO) | \
293 PIN_OSPEED_HIGH(GPIOA_SWCLK) | \
294 PIN_OSPEED_VERYLOW(GPIOA_PIN15))
295#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_PIN0) | \
296 PIN_PUPDR_FLOATING(GPIOA_PIN1) | \
297 PIN_PUPDR_PULLUP(GPIOA_PIN2) | \
298 PIN_PUPDR_PULLUP(GPIOA_PIN3) | \
299 PIN_PUPDR_PULLUP(GPIOA_PIN4) | \
300 PIN_PUPDR_PULLUP(GPIOA_PIN5) | \
301 PIN_PUPDR_PULLUP(GPIOA_PIN6) | \
302 PIN_PUPDR_FLOATING(GPIOA_PIN7) | \
303 PIN_PUPDR_PULLUP(GPIOA_PIN8) | \
304 PIN_PUPDR_PULLUP(GPIOA_PIN9) | \
305 PIN_PUPDR_PULLUP(GPIOA_PIN10) | \
306 PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \
307 PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \
308 PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \
309 PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \
310 PIN_PUPDR_PULLUP(GPIOA_PIN15))
311#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_PIN0) | \
312 PIN_ODR_HIGH(GPIOA_PIN1) | \
313 PIN_ODR_HIGH(GPIOA_PIN2) | \
314 PIN_ODR_HIGH(GPIOA_PIN3) | \
315 PIN_ODR_HIGH(GPIOA_PIN4) | \
316 PIN_ODR_HIGH(GPIOA_PIN5) | \
317 PIN_ODR_HIGH(GPIOA_PIN6) | \
318 PIN_ODR_HIGH(GPIOA_PIN7) | \
319 PIN_ODR_HIGH(GPIOA_PIN8) | \
320 PIN_ODR_HIGH(GPIOA_PIN9) | \
321 PIN_ODR_HIGH(GPIOA_PIN10) | \
322 PIN_ODR_HIGH(GPIOA_USB_DM) | \
323 PIN_ODR_HIGH(GPIOA_USB_DP) | \
324 PIN_ODR_HIGH(GPIOA_SWDIO) | \
325 PIN_ODR_HIGH(GPIOA_SWCLK) | \
326 PIN_ODR_HIGH(GPIOA_PIN15))
327#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0) | \
328 PIN_AFIO_AF(GPIOA_PIN1, 1) | \
329 PIN_AFIO_AF(GPIOA_PIN2, 0) | \
330 PIN_AFIO_AF(GPIOA_PIN3, 0) | \
331 PIN_AFIO_AF(GPIOA_PIN4, 0) | \
332 PIN_AFIO_AF(GPIOA_PIN5, 5) | \
333 PIN_AFIO_AF(GPIOA_PIN6, 5) | \
334 PIN_AFIO_AF(GPIOA_PIN7, 5))
335#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0) | \
336 PIN_AFIO_AF(GPIOA_PIN9, 0) | \
337 PIN_AFIO_AF(GPIOA_PIN10, 0) | \
338 PIN_AFIO_AF(GPIOA_USB_DM, 14) | \
339 PIN_AFIO_AF(GPIOA_USB_DP, 14) | \
340 PIN_AFIO_AF(GPIOA_SWDIO, 0) | \
341 PIN_AFIO_AF(GPIOA_SWCLK, 0) | \
342 PIN_AFIO_AF(GPIOA_PIN15, 0))
343
344/*
345 * GPIOB setup:
346 *
347 * PB0 - PIN0 (input pullup).
348 * PB1 - PIN1 (input pullup).
349 * PB2 - PIN2 (input pullup).
350 * PB3 - PIN3 (alternate 0).
351 * PB4 - PIN4 (input pullup).
352 * PB5 - PIN5 (input pullup).
353 * PB6 - PIN6 LSM303DLHC_SCL (alternate 4).
354 * PB7 - PIN7 LSM303DLHC_SDA (alternate 4).
355 * PB8 - PIN8 (input pullup).
356 * PB9 - PIN9 (input pullup).
357 * PB10 - PIN10 (input pullup).
358 * PB11 - PIN11 (input pullup).
359 * PB12 - PIN12 (input pullup).
360 * PB13 - PIN13 (input pullup).
361 * PB14 - PIN14 (input pullup).
362 * PB15 - PIN15 (input pullup).
363 */
364#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \
365 PIN_MODE_INPUT(GPIOB_PIN1) | \
366 PIN_MODE_INPUT(GPIOB_PIN2) | \
367 PIN_MODE_ALTERNATE(GPIOB_PIN3) | \
368 PIN_MODE_INPUT(GPIOB_PIN4) | \
369 PIN_MODE_INPUT(GPIOB_PIN5) | \
370 PIN_MODE_ALTERNATE(GPIOB_PIN6) | \
371 PIN_MODE_OUTPUT(GPIOB_PIN7) | \
372 PIN_MODE_INPUT(GPIOB_PIN8) | \
373 PIN_MODE_INPUT(GPIOB_PIN9) | \
374 PIN_MODE_INPUT(GPIOB_PIN10) | \
375 PIN_MODE_INPUT(GPIOB_PIN11) | \
376 PIN_MODE_INPUT(GPIOB_PIN12) | \
377 PIN_MODE_INPUT(GPIOB_PIN13) | \
378 PIN_MODE_INPUT(GPIOB_PIN14) | \
379 PIN_MODE_INPUT(GPIOB_PIN15))
380#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \
381 PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \
382 PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \
383 PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \
384 PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \
385 PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \
386 PIN_OTYPE_OPENDRAIN(GPIOB_PIN6) | \
387 PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \
388 PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \
389 PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \
390 PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \
391 PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \
392 PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \
393 PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \
394 PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \
395 PIN_OTYPE_PUSHPULL(GPIOB_PIN15))
396#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \
397 PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \
398 PIN_OSPEED_VERYLOW(GPIOB_PIN2) | \
399 PIN_OSPEED_HIGH(GPIOB_PIN3) | \
400 PIN_OSPEED_VERYLOW(GPIOB_PIN4) | \
401 PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \
402 PIN_OSPEED_HIGH(GPIOB_PIN6) | \
403 PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \
404 PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \
405 PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \
406 PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \
407 PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \
408 PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \
409 PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \
410 PIN_OSPEED_VERYLOW(GPIOB_PIN14) | \
411 PIN_OSPEED_VERYLOW(GPIOB_PIN15))
412#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \
413 PIN_PUPDR_PULLUP(GPIOB_PIN1) | \
414 PIN_PUPDR_PULLUP(GPIOB_PIN2) | \
415 PIN_PUPDR_FLOATING(GPIOB_PIN3) | \
416 PIN_PUPDR_PULLUP(GPIOB_PIN4) | \
417 PIN_PUPDR_PULLUP(GPIOB_PIN5) | \
418 PIN_PUPDR_FLOATING(GPIOB_PIN6) | \
419 PIN_PUPDR_PULLDOWN(GPIOB_PIN7) | \
420 PIN_PUPDR_PULLUP(GPIOB_PIN8) | \
421 PIN_PUPDR_PULLUP(GPIOB_PIN9) | \
422 PIN_PUPDR_PULLUP(GPIOB_PIN10) | \
423 PIN_PUPDR_PULLUP(GPIOB_PIN11) | \
424 PIN_PUPDR_PULLUP(GPIOB_PIN12) | \
425 PIN_PUPDR_PULLUP(GPIOB_PIN13) | \
426 PIN_PUPDR_PULLUP(GPIOB_PIN14) | \
427 PIN_PUPDR_PULLUP(GPIOB_PIN15))
428#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \
429 PIN_ODR_HIGH(GPIOB_PIN1) | \
430 PIN_ODR_HIGH(GPIOB_PIN2) | \
431 PIN_ODR_HIGH(GPIOB_PIN3) | \
432 PIN_ODR_HIGH(GPIOB_PIN4) | \
433 PIN_ODR_HIGH(GPIOB_PIN5) | \
434 PIN_ODR_HIGH(GPIOB_PIN6) | \
435 PIN_ODR_LOW(GPIOB_PIN7) | \
436 PIN_ODR_HIGH(GPIOB_PIN8) | \
437 PIN_ODR_HIGH(GPIOB_PIN9) | \
438 PIN_ODR_HIGH(GPIOB_PIN10) | \
439 PIN_ODR_HIGH(GPIOB_PIN11) | \
440 PIN_ODR_HIGH(GPIOB_PIN12) | \
441 PIN_ODR_HIGH(GPIOB_PIN13) | \
442 PIN_ODR_HIGH(GPIOB_PIN14) | \
443 PIN_ODR_HIGH(GPIOB_PIN15))
444#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0) | \
445 PIN_AFIO_AF(GPIOB_PIN1, 0) | \
446 PIN_AFIO_AF(GPIOB_PIN2, 0) | \
447 PIN_AFIO_AF(GPIOB_PIN3, 0) | \
448 PIN_AFIO_AF(GPIOB_PIN4, 0) | \
449 PIN_AFIO_AF(GPIOB_PIN5, 0) | \
450 PIN_AFIO_AF(GPIOB_PIN6, 4) | \
451 PIN_AFIO_AF(GPIOB_PIN7, 0))
452#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0) | \
453 PIN_AFIO_AF(GPIOB_PIN9, 0) | \
454 PIN_AFIO_AF(GPIOB_PIN10, 0) | \
455 PIN_AFIO_AF(GPIOB_PIN11, 0) | \
456 PIN_AFIO_AF(GPIOB_PIN12, 0) | \
457 PIN_AFIO_AF(GPIOB_PIN13, 0) | \
458 PIN_AFIO_AF(GPIOB_PIN14, 0) | \
459 PIN_AFIO_AF(GPIOB_PIN15, 0))
460
461/*
462 * GPIOC setup:
463 *
464 * PC0 - PIN0 (input pullup).
465 * PC1 - PIN1 (input pullup).
466 * PC2 - PIN2 (input pullup).
467 * PC3 - PIN3 (input pullup).
468 * PC4 - PIN4 (input pullup).
469 * PC5 - PIN5 (input pullup).
470 * PC6 - PIN6 (input pullup).
471 * PC7 - PIN7 (input pullup).
472 * PC8 - PIN8 (input pullup).
473 * PC9 - PIN9 (input pullup).
474 * PC10 - PIN10 (input pullup).
475 * PC11 - PIN11 (input pullup).
476 * PC12 - PIN12 (input pullup).
477 * PC13 - PIN13 (input pullup).
478 * PC14 - PIN14 (input floating).
479 * PC15 - PIN15 (input floating).
480 */
481#define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \
482 PIN_MODE_INPUT(GPIOC_PIN1) | \
483 PIN_MODE_INPUT(GPIOC_PIN2) | \
484 PIN_MODE_INPUT(GPIOC_PIN3) | \
485 PIN_MODE_INPUT(GPIOC_PIN4) | \
486 PIN_MODE_INPUT(GPIOC_PIN5) | \
487 PIN_MODE_INPUT(GPIOC_PIN6) | \
488 PIN_MODE_INPUT(GPIOC_PIN7) | \
489 PIN_MODE_INPUT(GPIOC_PIN8) | \
490 PIN_MODE_INPUT(GPIOC_PIN9) | \
491 PIN_MODE_INPUT(GPIOC_PIN10) | \
492 PIN_MODE_INPUT(GPIOC_PIN11) | \
493 PIN_MODE_INPUT(GPIOC_PIN12) | \
494 PIN_MODE_INPUT(GPIOC_PIN13) | \
495 PIN_MODE_INPUT(GPIOC_PIN14) | \
496 PIN_MODE_INPUT(GPIOC_PIN15))
497#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \
498 PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \
499 PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \
500 PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \
501 PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \
502 PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \
503 PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \
504 PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \
505 PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \
506 PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \
507 PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \
508 PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \
509 PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \
510 PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \
511 PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \
512 PIN_OTYPE_PUSHPULL(GPIOC_PIN15))
513#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | \
514 PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \
515 PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \
516 PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \
517 PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \
518 PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \
519 PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \
520 PIN_OSPEED_VERYLOW(GPIOC_PIN7) | \
521 PIN_OSPEED_VERYLOW(GPIOC_PIN8) | \
522 PIN_OSPEED_VERYLOW(GPIOC_PIN9) | \
523 PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \
524 PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \
525 PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \
526 PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \
527 PIN_OSPEED_HIGH(GPIOC_PIN14) | \
528 PIN_OSPEED_HIGH(GPIOC_PIN15))
529#define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \
530 PIN_PUPDR_PULLUP(GPIOC_PIN1) | \
531 PIN_PUPDR_PULLUP(GPIOC_PIN2) | \
532 PIN_PUPDR_PULLUP(GPIOC_PIN3) | \
533 PIN_PUPDR_PULLUP(GPIOC_PIN4) | \
534 PIN_PUPDR_PULLUP(GPIOC_PIN5) | \
535 PIN_PUPDR_PULLUP(GPIOC_PIN6) | \
536 PIN_PUPDR_PULLUP(GPIOC_PIN7) | \
537 PIN_PUPDR_PULLUP(GPIOC_PIN8) | \
538 PIN_PUPDR_PULLUP(GPIOC_PIN9) | \
539 PIN_PUPDR_PULLUP(GPIOC_PIN10) | \
540 PIN_PUPDR_PULLUP(GPIOC_PIN11) | \
541 PIN_PUPDR_PULLUP(GPIOC_PIN12) | \
542 PIN_PUPDR_PULLUP(GPIOC_PIN13) | \
543 PIN_PUPDR_FLOATING(GPIOC_PIN14) | \
544 PIN_PUPDR_FLOATING(GPIOC_PIN15))
545#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \
546 PIN_ODR_HIGH(GPIOC_PIN1) | \
547 PIN_ODR_HIGH(GPIOC_PIN2) | \
548 PIN_ODR_HIGH(GPIOC_PIN3) | \
549 PIN_ODR_HIGH(GPIOC_PIN4) | \
550 PIN_ODR_HIGH(GPIOC_PIN5) | \
551 PIN_ODR_HIGH(GPIOC_PIN6) | \
552 PIN_ODR_HIGH(GPIOC_PIN7) | \
553 PIN_ODR_HIGH(GPIOC_PIN8) | \
554 PIN_ODR_HIGH(GPIOC_PIN9) | \
555 PIN_ODR_HIGH(GPIOC_PIN10) | \
556 PIN_ODR_HIGH(GPIOC_PIN11) | \
557 PIN_ODR_HIGH(GPIOC_PIN12) | \
558 PIN_ODR_HIGH(GPIOC_PIN13) | \
559 PIN_ODR_HIGH(GPIOC_PIN14) | \
560 PIN_ODR_HIGH(GPIOC_PIN15))
561#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0) | \
562 PIN_AFIO_AF(GPIOC_PIN1, 0) | \
563 PIN_AFIO_AF(GPIOC_PIN2, 0) | \
564 PIN_AFIO_AF(GPIOC_PIN3, 0) | \
565 PIN_AFIO_AF(GPIOC_PIN4, 0) | \
566 PIN_AFIO_AF(GPIOC_PIN5, 0) | \
567 PIN_AFIO_AF(GPIOC_PIN6, 0) | \
568 PIN_AFIO_AF(GPIOC_PIN7, 0))
569#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0) | \
570 PIN_AFIO_AF(GPIOC_PIN9, 0) | \
571 PIN_AFIO_AF(GPIOC_PIN10, 0) | \
572 PIN_AFIO_AF(GPIOC_PIN11, 0) | \
573 PIN_AFIO_AF(GPIOC_PIN12, 0) | \
574 PIN_AFIO_AF(GPIOC_PIN13, 0) | \
575 PIN_AFIO_AF(GPIOC_PIN14, 0) | \
576 PIN_AFIO_AF(GPIOC_PIN15, 0))
577
578/*
579 * GPIOD setup:
580 *
581 * PD0 - PIN0 (input pullup).
582 * PD1 - PIN1 (input pullup).
583 * PD2 - PIN2 (input pullup).
584 * PD3 - PIN3 (input pullup).
585 * PD4 - PIN4 (input pullup).
586 * PD5 - PIN5 (input pullup).
587 * PD6 - PIN6 (input pullup).
588 * PD7 - PIN7 (input pullup).
589 * PD8 - PIN8 (input pullup).
590 * PD9 - PIN9 (input pullup).
591 * PD11 - PIN10 (input pullup).
592 * PD11 - PIN11 (input pullup).
593 * PD12 - PIN12 (input pullup).
594 * PD13 - PIN13 (input pullup).
595 * PD14 - PIN14 (input pullup).
596 * PD15 - PIN15 (input pullup).
597 */
598#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \
599 PIN_MODE_INPUT(GPIOD_PIN1) | \
600 PIN_MODE_INPUT(GPIOD_PIN2) | \
601 PIN_MODE_INPUT(GPIOD_PIN3) | \
602 PIN_MODE_INPUT(GPIOD_PIN4) | \
603 PIN_MODE_INPUT(GPIOD_PIN5) | \
604 PIN_MODE_INPUT(GPIOD_PIN6) | \
605 PIN_MODE_INPUT(GPIOD_PIN7) | \
606 PIN_MODE_INPUT(GPIOD_PIN8) | \
607 PIN_MODE_INPUT(GPIOD_PIN9) | \
608 PIN_MODE_INPUT(GPIOD_PIN10) | \
609 PIN_MODE_INPUT(GPIOD_PIN11) | \
610 PIN_MODE_INPUT(GPIOD_PIN12) | \
611 PIN_MODE_INPUT(GPIOD_PIN13) | \
612 PIN_MODE_INPUT(GPIOD_PIN14) | \
613 PIN_MODE_INPUT(GPIOD_PIN15))
614#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \
615 PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \
616 PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \
617 PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \
618 PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \
619 PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \
620 PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \
621 PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \
622 PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \
623 PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \
624 PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \
625 PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \
626 PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \
627 PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \
628 PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \
629 PIN_OTYPE_PUSHPULL(GPIOD_PIN15))
630#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \
631 PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \
632 PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \
633 PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \
634 PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \
635 PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \
636 PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \
637 PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \
638 PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \
639 PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \
640 PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \
641 PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \
642 PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \
643 PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \
644 PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \
645 PIN_OSPEED_VERYLOW(GPIOD_PIN15))
646#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \
647 PIN_PUPDR_PULLUP(GPIOD_PIN1) | \
648 PIN_PUPDR_PULLUP(GPIOD_PIN2) | \
649 PIN_PUPDR_PULLUP(GPIOD_PIN3) | \
650 PIN_PUPDR_PULLUP(GPIOD_PIN4) | \
651 PIN_PUPDR_PULLUP(GPIOD_PIN5) | \
652 PIN_PUPDR_PULLUP(GPIOD_PIN6) | \
653 PIN_PUPDR_PULLUP(GPIOD_PIN7) | \
654 PIN_PUPDR_PULLUP(GPIOD_PIN8) | \
655 PIN_PUPDR_PULLUP(GPIOD_PIN9) | \
656 PIN_PUPDR_PULLUP(GPIOD_PIN10) | \
657 PIN_PUPDR_PULLUP(GPIOD_PIN11) | \
658 PIN_PUPDR_PULLUP(GPIOD_PIN12) | \
659 PIN_PUPDR_PULLUP(GPIOD_PIN13) | \
660 PIN_PUPDR_PULLUP(GPIOD_PIN14) | \
661 PIN_PUPDR_PULLUP(GPIOD_PIN15))
662#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \
663 PIN_ODR_HIGH(GPIOD_PIN1) | \
664 PIN_ODR_HIGH(GPIOD_PIN2) | \
665 PIN_ODR_HIGH(GPIOD_PIN3) | \
666 PIN_ODR_HIGH(GPIOD_PIN4) | \
667 PIN_ODR_HIGH(GPIOD_PIN5) | \
668 PIN_ODR_HIGH(GPIOD_PIN6) | \
669 PIN_ODR_HIGH(GPIOD_PIN7) | \
670 PIN_ODR_HIGH(GPIOD_PIN8) | \
671 PIN_ODR_HIGH(GPIOD_PIN9) | \
672 PIN_ODR_HIGH(GPIOD_PIN10) | \
673 PIN_ODR_HIGH(GPIOD_PIN11) | \
674 PIN_ODR_HIGH(GPIOD_PIN12) | \
675 PIN_ODR_HIGH(GPIOD_PIN13) | \
676 PIN_ODR_HIGH(GPIOD_PIN14) | \
677 PIN_ODR_HIGH(GPIOD_PIN15))
678#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0) | \
679 PIN_AFIO_AF(GPIOD_PIN1, 0) | \
680 PIN_AFIO_AF(GPIOD_PIN2, 0) | \
681 PIN_AFIO_AF(GPIOD_PIN3, 0) | \
682 PIN_AFIO_AF(GPIOD_PIN4, 0) | \
683 PIN_AFIO_AF(GPIOD_PIN5, 0) | \
684 PIN_AFIO_AF(GPIOD_PIN6, 0) | \
685 PIN_AFIO_AF(GPIOD_PIN7, 0))
686#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0) | \
687 PIN_AFIO_AF(GPIOD_PIN9, 0) | \
688 PIN_AFIO_AF(GPIOD_PIN10, 0) | \
689 PIN_AFIO_AF(GPIOD_PIN11, 0) | \
690 PIN_AFIO_AF(GPIOD_PIN12, 0) | \
691 PIN_AFIO_AF(GPIOD_PIN13, 0) | \
692 PIN_AFIO_AF(GPIOD_PIN14, 0) | \
693 PIN_AFIO_AF(GPIOD_PIN15, 0))
694
695/*
696 * GPIOE setup:
697 *
698 * PE0 - PIN0 (input pullup).
699 * PE1 - PIN1 (input pullup).
700 * PE2 - PIN2 (input pullup).
701 * PE3 - PIN3 L3GD20_CS (output pushpull maximum).
702 * PE4 - PIN4 (input pullup).
703 * PE5 - PIN5 (input pullup).
704 * PE6 - PIN6 (input pullup).
705 * PE7 - PIN7 (input pullup).
706 * PE8 - PIN8 (output pushpull maximum).
707 * PE9 - PIN9 (output pushpull maximum).
708 * PE10 - PIN10 (output pushpull maximum).
709 * PE11 - PIN11 (output pushpull maximum).
710 * PE12 - PIN12 (output pushpull maximum).
711 * PE13 - PIN13 (output pushpull maximum).
712 * PE14 - PIN14 (output pushpull maximum).
713 * PE15 - PIN15 (output pushpull maximum).
714 */
715#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \
716 PIN_MODE_INPUT(GPIOE_PIN1) | \
717 PIN_MODE_INPUT(GPIOE_PIN2) |\
718 PIN_MODE_OUTPUT(GPIOE_PIN3) | \
719 PIN_MODE_INPUT(GPIOE_PIN4) |\
720 PIN_MODE_INPUT(GPIOE_PIN5) |\
721 PIN_MODE_INPUT(GPIOE_PIN6) | \
722 PIN_MODE_INPUT(GPIOE_PIN7) | \
723 PIN_MODE_OUTPUT(GPIOE_PIN8) | \
724 PIN_MODE_OUTPUT(GPIOE_PIN9) | \
725 PIN_MODE_OUTPUT(GPIOE_PIN10) | \
726 PIN_MODE_OUTPUT(GPIOE_PIN11) | \
727 PIN_MODE_OUTPUT(GPIOE_PIN12) | \
728 PIN_MODE_OUTPUT(GPIOE_PIN13) | \
729 PIN_MODE_OUTPUT(GPIOE_PIN14) | \
730 PIN_MODE_OUTPUT(GPIOE_PIN15))
731#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) |\
732 PIN_OTYPE_PUSHPULL(GPIOE_PIN1) |\
733 PIN_OTYPE_PUSHPULL(GPIOE_PIN2) |\
734 PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \
735 PIN_OTYPE_PUSHPULL(GPIOE_PIN4) |\
736 PIN_OTYPE_PUSHPULL(GPIOE_PIN5) |\
737 PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \
738 PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \
739 PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \
740 PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \
741 PIN_OTYPE_PUSHPULL(GPIOE_PIN10) |\
742 PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \
743 PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \
744 PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \
745 PIN_OTYPE_PUSHPULL(GPIOE_PIN14) |\
746 PIN_OTYPE_PUSHPULL(GPIOE_PIN15))
747#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) |\
748 PIN_OSPEED_VERYLOW(GPIOE_PIN1) |\
749 PIN_OSPEED_VERYLOW(GPIOE_PIN2) |\
750 PIN_OSPEED_HIGH(GPIOE_PIN3) | \
751 PIN_OSPEED_VERYLOW(GPIOE_PIN4) |\
752 PIN_OSPEED_VERYLOW(GPIOE_PIN5) |\
753 PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \
754 PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \
755 PIN_OSPEED_HIGH(GPIOE_PIN8) | \
756 PIN_OSPEED_HIGH(GPIOE_PIN9) | \
757 PIN_OSPEED_HIGH(GPIOE_PIN10) | \
758 PIN_OSPEED_HIGH(GPIOE_PIN11) | \
759 PIN_OSPEED_HIGH(GPIOE_PIN12) | \
760 PIN_OSPEED_HIGH(GPIOE_PIN13) | \
761 PIN_OSPEED_HIGH(GPIOE_PIN14) | \
762 PIN_OSPEED_HIGH(GPIOE_PIN15))
763#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \
764 PIN_PUPDR_PULLUP(GPIOE_PIN1) | \
765 PIN_PUPDR_PULLUP(GPIOE_PIN2) |\
766 PIN_PUPDR_FLOATING(GPIOE_PIN3) | \
767 PIN_PUPDR_PULLUP(GPIOE_PIN4) |\
768 PIN_PUPDR_PULLUP(GPIOE_PIN5) |\
769 PIN_PUPDR_PULLUP(GPIOE_PIN6) | \
770 PIN_PUPDR_PULLUP(GPIOE_PIN7) | \
771 PIN_PUPDR_PULLUP(GPIOE_PIN8) | \
772 PIN_PUPDR_PULLUP(GPIOE_PIN9) | \
773 PIN_PUPDR_PULLUP(GPIOE_PIN10) | \
774 PIN_PUPDR_FLOATING(GPIOE_PIN11) | \
775 PIN_PUPDR_PULLUP(GPIOE_PIN12) | \
776 PIN_PUPDR_FLOATING(GPIOE_PIN13) | \
777 PIN_PUPDR_FLOATING(GPIOE_PIN14) |\
778 PIN_PUPDR_FLOATING(GPIOE_PIN15))
779#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \
780 PIN_ODR_HIGH(GPIOE_PIN1) | \
781 PIN_ODR_HIGH(GPIOE_PIN2) | \
782 PIN_ODR_HIGH(GPIOE_PIN3) | \
783 PIN_ODR_HIGH(GPIOE_PIN4) | \
784 PIN_ODR_HIGH(GPIOE_PIN5) | \
785 PIN_ODR_HIGH(GPIOE_PIN6) | \
786 PIN_ODR_HIGH(GPIOE_PIN7) | \
787 PIN_ODR_LOW(GPIOE_PIN8) | \
788 PIN_ODR_LOW(GPIOE_PIN9) | \
789 PIN_ODR_LOW(GPIOE_PIN10) | \
790 PIN_ODR_LOW(GPIOE_PIN11) | \
791 PIN_ODR_LOW(GPIOE_PIN12) | \
792 PIN_ODR_LOW(GPIOE_PIN13) | \
793 PIN_ODR_LOW(GPIOE_PIN14) | \
794 PIN_ODR_LOW(GPIOE_PIN15))
795#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0) | \
796 PIN_AFIO_AF(GPIOE_PIN1, 0) | \
797 PIN_AFIO_AF(GPIOE_PIN2, 0) |\
798 PIN_AFIO_AF(GPIOE_PIN3, 0) | \
799 PIN_AFIO_AF(GPIOE_PIN4, 0) |\
800 PIN_AFIO_AF(GPIOE_PIN5, 0) |\
801 PIN_AFIO_AF(GPIOE_PIN6, 0) | \
802 PIN_AFIO_AF(GPIOE_PIN7, 0))
803#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0) | \
804 PIN_AFIO_AF(GPIOE_PIN9, 0) | \
805 PIN_AFIO_AF(GPIOE_PIN10, 0) | \
806 PIN_AFIO_AF(GPIOE_PIN11, 0) | \
807 PIN_AFIO_AF(GPIOE_PIN12, 0) | \
808 PIN_AFIO_AF(GPIOE_PIN13, 0) | \
809 PIN_AFIO_AF(GPIOE_PIN14, 0) | \
810 PIN_AFIO_AF(GPIOE_PIN15, 0))
811
812/*
813 * GPIOF setup:
814 *
815 * PF0 - I2C2_SDA (input floating).
816 * PF1 - I2C2_SCL (input floating).
817 * PF2 - PIN2 (input pullup).
818 * PF3 - PIN3 (input pullup).
819 * PF4 - PIN4 (input pullup).
820 * PF5 - PIN5 (input pullup).
821 * PF6 - PIN6 (input pullup).
822 * PF7 - PIN7 (input pullup).
823 * PF8 - PIN8 (input pullup).
824 * PF9 - PIN9 (input pullup).
825 * PF10 - PIN10 (input pullup).
826 * PF11 - PIN11 (input pullup).
827 * PF12 - PIN12 (input pullup).
828 * PF13 - PIN13 (input pullup).
829 * PF14 - PIN14 (input pullup).
830 * PF15 - PIN15 (input pullup).
831 */
832#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_I2C2_SDA) | \
833 PIN_MODE_INPUT(GPIOF_I2C2_SCL) | \
834 PIN_MODE_INPUT(GPIOF_PIN2) | \
835 PIN_MODE_INPUT(GPIOF_PIN3) | \
836 PIN_MODE_INPUT(GPIOF_PIN4) | \
837 PIN_MODE_INPUT(GPIOF_PIN5) | \
838 PIN_MODE_INPUT(GPIOF_PIN6) | \
839 PIN_MODE_INPUT(GPIOF_PIN7) | \
840 PIN_MODE_INPUT(GPIOF_PIN8) | \
841 PIN_MODE_INPUT(GPIOF_PIN9) | \
842 PIN_MODE_INPUT(GPIOF_PIN10) | \
843 PIN_MODE_INPUT(GPIOF_PIN11) | \
844 PIN_MODE_INPUT(GPIOF_PIN12) | \
845 PIN_MODE_INPUT(GPIOF_PIN13) | \
846 PIN_MODE_INPUT(GPIOF_PIN14) | \
847 PIN_MODE_INPUT(GPIOF_PIN15))
848#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SDA) | \
849 PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SCL) | \
850 PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \
851 PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \
852 PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \
853 PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \
854 PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \
855 PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \
856 PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \
857 PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \
858 PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \
859 PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \
860 PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \
861 PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \
862 PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \
863 PIN_OTYPE_PUSHPULL(GPIOF_PIN15))
864#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_I2C2_SDA) | \
865 PIN_OSPEED_HIGH(GPIOF_I2C2_SCL) | \
866 PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \
867 PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \
868 PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \
869 PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \
870 PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \
871 PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \
872 PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \
873 PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \
874 PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \
875 PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \
876 PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \
877 PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \
878 PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \
879 PIN_OSPEED_VERYLOW(GPIOF_PIN15))
880#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_I2C2_SDA) | \
881 PIN_PUPDR_FLOATING(GPIOF_I2C2_SCL) | \
882 PIN_PUPDR_PULLUP(GPIOF_PIN2) | \
883 PIN_PUPDR_PULLUP(GPIOF_PIN3) | \
884 PIN_PUPDR_PULLUP(GPIOF_PIN4) | \
885 PIN_PUPDR_PULLUP(GPIOF_PIN5) | \
886 PIN_PUPDR_PULLUP(GPIOF_PIN6) | \
887 PIN_PUPDR_PULLUP(GPIOF_PIN7) | \
888 PIN_PUPDR_PULLUP(GPIOF_PIN8) | \
889 PIN_PUPDR_PULLUP(GPIOF_PIN9) | \
890 PIN_PUPDR_PULLUP(GPIOF_PIN10) | \
891 PIN_PUPDR_PULLUP(GPIOF_PIN11) | \
892 PIN_PUPDR_PULLUP(GPIOF_PIN12) | \
893 PIN_PUPDR_PULLUP(GPIOF_PIN13) | \
894 PIN_PUPDR_PULLUP(GPIOF_PIN14) | \
895 PIN_PUPDR_PULLUP(GPIOF_PIN15))
896#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_I2C2_SDA) | \
897 PIN_ODR_HIGH(GPIOF_I2C2_SCL) | \
898 PIN_ODR_HIGH(GPIOF_PIN2) | \
899 PIN_ODR_HIGH(GPIOF_PIN3) | \
900 PIN_ODR_HIGH(GPIOF_PIN4) | \
901 PIN_ODR_HIGH(GPIOF_PIN5) | \
902 PIN_ODR_HIGH(GPIOF_PIN6) | \
903 PIN_ODR_HIGH(GPIOF_PIN7) | \
904 PIN_ODR_HIGH(GPIOF_PIN8) | \
905 PIN_ODR_HIGH(GPIOF_PIN9) | \
906 PIN_ODR_HIGH(GPIOF_PIN10) | \
907 PIN_ODR_HIGH(GPIOF_PIN11) | \
908 PIN_ODR_HIGH(GPIOF_PIN12) | \
909 PIN_ODR_HIGH(GPIOF_PIN13) | \
910 PIN_ODR_HIGH(GPIOF_PIN14) | \
911 PIN_ODR_HIGH(GPIOF_PIN15))
912#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_I2C2_SDA, 0) | \
913 PIN_AFIO_AF(GPIOF_I2C2_SCL, 0) | \
914 PIN_AFIO_AF(GPIOF_PIN2, 0) | \
915 PIN_AFIO_AF(GPIOF_PIN3, 0) | \
916 PIN_AFIO_AF(GPIOF_PIN4, 0) | \
917 PIN_AFIO_AF(GPIOF_PIN5, 0) | \
918 PIN_AFIO_AF(GPIOF_PIN6, 0) | \
919 PIN_AFIO_AF(GPIOF_PIN7, 0))
920#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0) | \
921 PIN_AFIO_AF(GPIOF_PIN9, 0) | \
922 PIN_AFIO_AF(GPIOF_PIN10, 0) | \
923 PIN_AFIO_AF(GPIOF_PIN11, 0) | \
924 PIN_AFIO_AF(GPIOF_PIN12, 0) | \
925 PIN_AFIO_AF(GPIOF_PIN13, 0) | \
926 PIN_AFIO_AF(GPIOF_PIN14, 0) | \
927 PIN_AFIO_AF(GPIOF_PIN15, 0))
928
929/*
930 * GPIOG setup:
931 *
932 * PG0 - PIN0 (input pullup).
933 * PG1 - PIN1 (input pullup).
934 * PG2 - PIN2 (input pullup).
935 * PG3 - PIN3 (input pullup).
936 * PG4 - PIN4 (input pullup).
937 * PG5 - PIN5 (input pullup).
938 * PG6 - PIN6 (input pullup).
939 * PG7 - PIN7 (input pullup).
940 * PG8 - PIN8 (input pullup).
941 * PG9 - PIN9 (input pullup).
942 * PG10 - PIN10 (input pullup).
943 * PG11 - PIN11 (input pullup).
944 * PG12 - PIN12 (input pullup).
945 * PG13 - PIN13 (input pullup).
946 * PG14 - PIN14 (input pullup).
947 * PG15 - PIN15 (input pullup).
948 */
949#define VAL_GPIOG_MODER (PIN_MODE_INPUT(GPIOG_PIN0) | \
950 PIN_MODE_INPUT(GPIOG_PIN1) | \
951 PIN_MODE_INPUT(GPIOG_PIN2) | \
952 PIN_MODE_INPUT(GPIOG_PIN3) | \
953 PIN_MODE_INPUT(GPIOG_PIN4) | \
954 PIN_MODE_INPUT(GPIOG_PIN5) | \
955 PIN_MODE_INPUT(GPIOG_PIN6) | \
956 PIN_MODE_INPUT(GPIOG_PIN7) | \
957 PIN_MODE_INPUT(GPIOG_PIN8) | \
958 PIN_MODE_INPUT(GPIOG_PIN9) | \
959 PIN_MODE_INPUT(GPIOG_PIN10) | \
960 PIN_MODE_INPUT(GPIOG_PIN11) | \
961 PIN_MODE_INPUT(GPIOG_PIN12) | \
962 PIN_MODE_INPUT(GPIOG_PIN13) | \
963 PIN_MODE_INPUT(GPIOG_PIN14) | \
964 PIN_MODE_INPUT(GPIOG_PIN15))
965#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \
966 PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \
967 PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \
968 PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \
969 PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \
970 PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \
971 PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \
972 PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \
973 PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \
974 PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \
975 PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \
976 PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \
977 PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \
978 PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \
979 PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \
980 PIN_OTYPE_PUSHPULL(GPIOG_PIN15))
981#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | \
982 PIN_OSPEED_VERYLOW(GPIOG_PIN1) | \
983 PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \
984 PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \
985 PIN_OSPEED_VERYLOW(GPIOG_PIN4) | \
986 PIN_OSPEED_VERYLOW(GPIOG_PIN5) | \
987 PIN_OSPEED_VERYLOW(GPIOG_PIN6) | \
988 PIN_OSPEED_VERYLOW(GPIOG_PIN7) | \
989 PIN_OSPEED_VERYLOW(GPIOG_PIN8) | \
990 PIN_OSPEED_VERYLOW(GPIOG_PIN9) | \
991 PIN_OSPEED_VERYLOW(GPIOG_PIN10) | \
992 PIN_OSPEED_VERYLOW(GPIOG_PIN11) | \
993 PIN_OSPEED_VERYLOW(GPIOG_PIN12) | \
994 PIN_OSPEED_VERYLOW(GPIOG_PIN13) | \
995 PIN_OSPEED_VERYLOW(GPIOG_PIN14) | \
996 PIN_OSPEED_VERYLOW(GPIOG_PIN15))
997#define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \
998 PIN_PUPDR_PULLUP(GPIOG_PIN1) | \
999 PIN_PUPDR_PULLUP(GPIOG_PIN2) | \
1000 PIN_PUPDR_PULLUP(GPIOG_PIN3) | \
1001 PIN_PUPDR_PULLUP(GPIOG_PIN4) | \
1002 PIN_PUPDR_PULLUP(GPIOG_PIN5) | \
1003 PIN_PUPDR_PULLUP(GPIOG_PIN6) | \
1004 PIN_PUPDR_PULLUP(GPIOG_PIN7) | \
1005 PIN_PUPDR_PULLUP(GPIOG_PIN8) | \
1006 PIN_PUPDR_PULLUP(GPIOG_PIN9) | \
1007 PIN_PUPDR_PULLUP(GPIOG_PIN10) | \
1008 PIN_PUPDR_PULLUP(GPIOG_PIN11) | \
1009 PIN_PUPDR_PULLUP(GPIOG_PIN12) | \
1010 PIN_PUPDR_PULLUP(GPIOG_PIN13) | \
1011 PIN_PUPDR_PULLUP(GPIOG_PIN14) | \
1012 PIN_PUPDR_PULLUP(GPIOG_PIN15))
1013#define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \
1014 PIN_ODR_HIGH(GPIOG_PIN1) | \
1015 PIN_ODR_HIGH(GPIOG_PIN2) | \
1016 PIN_ODR_HIGH(GPIOG_PIN3) | \
1017 PIN_ODR_HIGH(GPIOG_PIN4) | \
1018 PIN_ODR_HIGH(GPIOG_PIN5) | \
1019 PIN_ODR_HIGH(GPIOG_PIN6) | \
1020 PIN_ODR_HIGH(GPIOG_PIN7) | \
1021 PIN_ODR_HIGH(GPIOG_PIN8) | \
1022 PIN_ODR_HIGH(GPIOG_PIN9) | \
1023 PIN_ODR_HIGH(GPIOG_PIN10) | \
1024 PIN_ODR_HIGH(GPIOG_PIN11) | \
1025 PIN_ODR_HIGH(GPIOG_PIN12) | \
1026 PIN_ODR_HIGH(GPIOG_PIN13) | \
1027 PIN_ODR_HIGH(GPIOG_PIN14) | \
1028 PIN_ODR_HIGH(GPIOG_PIN15))
1029#define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0) | \
1030 PIN_AFIO_AF(GPIOG_PIN1, 0) | \
1031 PIN_AFIO_AF(GPIOG_PIN2, 0) | \
1032 PIN_AFIO_AF(GPIOG_PIN3, 0) | \
1033 PIN_AFIO_AF(GPIOG_PIN4, 0) | \
1034 PIN_AFIO_AF(GPIOG_PIN5, 0) | \
1035 PIN_AFIO_AF(GPIOG_PIN6, 0) | \
1036 PIN_AFIO_AF(GPIOG_PIN7, 0))
1037#define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0) | \
1038 PIN_AFIO_AF(GPIOG_PIN9, 0) | \
1039 PIN_AFIO_AF(GPIOG_PIN10, 0) | \
1040 PIN_AFIO_AF(GPIOG_PIN11, 0) | \
1041 PIN_AFIO_AF(GPIOG_PIN12, 0) | \
1042 PIN_AFIO_AF(GPIOG_PIN13, 0) | \
1043 PIN_AFIO_AF(GPIOG_PIN14, 0) | \
1044 PIN_AFIO_AF(GPIOG_PIN15, 0))
1045
1046/*
1047 * GPIOH setup:
1048 *
1049 * PH0 - PIN0 (input pullup).
1050 * PH1 - PIN1 (input pullup).
1051 * PH2 - PIN2 (input pullup).
1052 * PH3 - PIN3 (input pullup).
1053 * PH4 - PIN4 (input pullup).
1054 * PH5 - PIN5 (input pullup).
1055 * PH6 - PIN6 (input pullup).
1056 * PH7 - PIN7 (input pullup).
1057 * PH8 - PIN8 (input pullup).
1058 * PH9 - PIN9 (input pullup).
1059 * PH10 - PIN10 (input pullup).
1060 * PH11 - PIN11 (input pullup).
1061 * PH12 - PIN12 (input pullup).
1062 * PH13 - PIN13 (input pullup).
1063 * PH14 - PIN14 (input pullup).
1064 * PH15 - PIN15 (input pullup).
1065 */
1066#define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_PIN0) | \
1067 PIN_MODE_INPUT(GPIOH_PIN1) | \
1068 PIN_MODE_INPUT(GPIOH_PIN2) | \
1069 PIN_MODE_INPUT(GPIOH_PIN3) | \
1070 PIN_MODE_INPUT(GPIOH_PIN4) | \
1071 PIN_MODE_INPUT(GPIOH_PIN5) | \
1072 PIN_MODE_INPUT(GPIOH_PIN6) | \
1073 PIN_MODE_INPUT(GPIOH_PIN7) | \
1074 PIN_MODE_INPUT(GPIOH_PIN8) | \
1075 PIN_MODE_INPUT(GPIOH_PIN9) | \
1076 PIN_MODE_INPUT(GPIOH_PIN10) | \
1077 PIN_MODE_INPUT(GPIOH_PIN11) | \
1078 PIN_MODE_INPUT(GPIOH_PIN12) | \
1079 PIN_MODE_INPUT(GPIOH_PIN13) | \
1080 PIN_MODE_INPUT(GPIOH_PIN14) | \
1081 PIN_MODE_INPUT(GPIOH_PIN15))
1082#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_PIN0) | \
1083 PIN_OTYPE_PUSHPULL(GPIOH_PIN1) | \
1084 PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \
1085 PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \
1086 PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \
1087 PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \
1088 PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \
1089 PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \
1090 PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \
1091 PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \
1092 PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \
1093 PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \
1094 PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \
1095 PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \
1096 PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \
1097 PIN_OTYPE_PUSHPULL(GPIOH_PIN15))
1098#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOH_PIN0) | \
1099 PIN_OSPEED_VERYLOW(GPIOH_PIN1) | \
1100 PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \
1101 PIN_OSPEED_VERYLOW(GPIOH_PIN3) | \
1102 PIN_OSPEED_VERYLOW(GPIOH_PIN4) | \
1103 PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \
1104 PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \
1105 PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \
1106 PIN_OSPEED_VERYLOW(GPIOH_PIN8) | \
1107 PIN_OSPEED_VERYLOW(GPIOH_PIN9) | \
1108 PIN_OSPEED_VERYLOW(GPIOH_PIN10) | \
1109 PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \
1110 PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \
1111 PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \
1112 PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \
1113 PIN_OSPEED_VERYLOW(GPIOH_PIN15))
1114#define VAL_GPIOH_PUPDR (PIN_PUPDR_PULLUP(GPIOH_PIN0) | \
1115 PIN_PUPDR_PULLUP(GPIOH_PIN1) | \
1116 PIN_PUPDR_PULLUP(GPIOH_PIN2) | \
1117 PIN_PUPDR_PULLUP(GPIOH_PIN3) | \
1118 PIN_PUPDR_PULLUP(GPIOH_PIN4) | \
1119 PIN_PUPDR_PULLUP(GPIOH_PIN5) | \
1120 PIN_PUPDR_PULLUP(GPIOH_PIN6) | \
1121 PIN_PUPDR_PULLUP(GPIOH_PIN7) | \
1122 PIN_PUPDR_PULLUP(GPIOH_PIN8) | \
1123 PIN_PUPDR_PULLUP(GPIOH_PIN9) | \
1124 PIN_PUPDR_PULLUP(GPIOH_PIN10) | \
1125 PIN_PUPDR_PULLUP(GPIOH_PIN11) | \
1126 PIN_PUPDR_PULLUP(GPIOH_PIN12) | \
1127 PIN_PUPDR_PULLUP(GPIOH_PIN13) | \
1128 PIN_PUPDR_PULLUP(GPIOH_PIN14) | \
1129 PIN_PUPDR_PULLUP(GPIOH_PIN15))
1130#define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_PIN0) | \
1131 PIN_ODR_HIGH(GPIOH_PIN1) | \
1132 PIN_ODR_HIGH(GPIOH_PIN2) | \
1133 PIN_ODR_HIGH(GPIOH_PIN3) | \
1134 PIN_ODR_HIGH(GPIOH_PIN4) | \
1135 PIN_ODR_HIGH(GPIOH_PIN5) | \
1136 PIN_ODR_HIGH(GPIOH_PIN6) | \
1137 PIN_ODR_HIGH(GPIOH_PIN7) | \
1138 PIN_ODR_HIGH(GPIOH_PIN8) | \
1139 PIN_ODR_HIGH(GPIOH_PIN9) | \
1140 PIN_ODR_HIGH(GPIOH_PIN10) | \
1141 PIN_ODR_HIGH(GPIOH_PIN11) | \
1142 PIN_ODR_HIGH(GPIOH_PIN12) | \
1143 PIN_ODR_HIGH(GPIOH_PIN13) | \
1144 PIN_ODR_HIGH(GPIOH_PIN14) | \
1145 PIN_ODR_HIGH(GPIOH_PIN15))
1146#define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_PIN0, 0) | \
1147 PIN_AFIO_AF(GPIOH_PIN1, 0) | \
1148 PIN_AFIO_AF(GPIOH_PIN2, 0) | \
1149 PIN_AFIO_AF(GPIOH_PIN3, 0) | \
1150 PIN_AFIO_AF(GPIOH_PIN4, 0) | \
1151 PIN_AFIO_AF(GPIOH_PIN5, 0) | \
1152 PIN_AFIO_AF(GPIOH_PIN6, 0) | \
1153 PIN_AFIO_AF(GPIOH_PIN7, 0))
1154#define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0) | \
1155 PIN_AFIO_AF(GPIOH_PIN9, 0) | \
1156 PIN_AFIO_AF(GPIOH_PIN10, 0) | \
1157 PIN_AFIO_AF(GPIOH_PIN11, 0) | \
1158 PIN_AFIO_AF(GPIOH_PIN12, 0) | \
1159 PIN_AFIO_AF(GPIOH_PIN13, 0) | \
1160 PIN_AFIO_AF(GPIOH_PIN14, 0) | \
1161 PIN_AFIO_AF(GPIOH_PIN15, 0))
1162
1163
1164/*
1165 * USB bus activation macro, required by the USB driver.
1166 */
1167// #define usb_lld_connect_bus(usbp)
1168#define usb_lld_connect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_ALTERNATE(14)))
1169// #define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT)
1170/*
1171 * USB bus de-activation macro, required by the USB driver.
1172 */
1173// #define usb_lld_disconnect_bus(usbp)
1174#define usb_lld_disconnect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_OUTPUT_PUSHPULL)); palClearPad(GPIOA, GPIOA_USB_DP)
1175// #define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12)
1176
1177#if !defined(_FROM_ASM_)
1178#ifdef __cplusplus
1179extern "C" {
1180#endif
1181 void boardInit(void);
1182#ifdef __cplusplus
1183}
1184#endif
1185#endif /* _FROM_ASM_ */
1186
1187#endif /* _BOARD_H_ */
diff --git a/keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.mk b/keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.mk
new file mode 100644
index 000000000..43377629a
--- /dev/null
+++ b/keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.mk
@@ -0,0 +1,5 @@
1# List of all the board related files.
2BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F303XC/board.c
3
4# Required include directories
5BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F303XC
diff --git a/keyboards/hs60/v2/bootloader_defs.h b/keyboards/hs60/v2/bootloader_defs.h
new file mode 100644
index 000000000..3b0e9d20a
--- /dev/null
+++ b/keyboards/hs60/v2/bootloader_defs.h
@@ -0,0 +1,7 @@
1/* Address for jumping to bootloader on STM32 chips. */
2/* It is chip dependent, the correct number can be looked up here:
3 * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
4 * This also requires a patch to chibios:
5 * <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
6 */
7#define STM32_BOOTLOADER_ADDRESS 0x1FFFD800
diff --git a/keyboards/hs60/v2/chconf.h b/keyboards/hs60/v2/chconf.h
new file mode 100644
index 000000000..1d9f12ff1
--- /dev/null
+++ b/keyboards/hs60/v2/chconf.h
@@ -0,0 +1,520 @@
1/*
2 ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file templates/chconf.h
19 * @brief Configuration file template.
20 * @details A copy of this file must be placed in each project directory, it
21 * contains the application specific kernel settings.
22 *
23 * @addtogroup config
24 * @details Kernel related settings and hooks.
25 * @{
26 */
27
28#ifndef CHCONF_H
29#define CHCONF_H
30
31#define _CHIBIOS_RT_CONF_
32
33/*===========================================================================*/
34/**
35 * @name System timers settings
36 * @{
37 */
38/*===========================================================================*/
39
40/**
41 * @brief System time counter resolution.
42 * @note Allowed values are 16 or 32 bits.
43 */
44#define CH_CFG_ST_RESOLUTION 32
45
46/**
47 * @brief System tick frequency.
48 * @details Frequency of the system timer that drives the system ticks. This
49 * setting also defines the system tick time unit.
50 */
51#define CH_CFG_ST_FREQUENCY 100000
52
53/**
54 * @brief Time delta constant for the tick-less mode.
55 * @note If this value is zero then the system uses the classic
56 * periodic tick. This value represents the minimum number
57 * of ticks that is safe to specify in a timeout directive.
58 * The value one is not valid, timeouts are rounded up to
59 * this value.
60 */
61#define CH_CFG_ST_TIMEDELTA 2
62
63/** @} */
64
65/*===========================================================================*/
66/**
67 * @name Kernel parameters and options
68 * @{
69 */
70/*===========================================================================*/
71
72/**
73 * @brief Round robin interval.
74 * @details This constant is the number of system ticks allowed for the
75 * threads before preemption occurs. Setting this value to zero
76 * disables the preemption for threads with equal priority and the
77 * round robin becomes cooperative. Note that higher priority
78 * threads can still preempt, the kernel is always preemptive.
79 * @note Disabling the round robin preemption makes the kernel more compact
80 * and generally faster.
81 * @note The round robin preemption is not supported in tickless mode and
82 * must be set to zero in that case.
83 */
84#define CH_CFG_TIME_QUANTUM 0
85
86/**
87 * @brief Managed RAM size.
88 * @details Size of the RAM area to be managed by the OS. If set to zero
89 * then the whole available RAM is used. The core memory is made
90 * available to the heap allocator and/or can be used directly through
91 * the simplified core memory allocator.
92 *
93 * @note In order to let the OS manage the whole RAM the linker script must
94 * provide the @p __heap_base__ and @p __heap_end__ symbols.
95 * @note Requires @p CH_CFG_USE_MEMCORE.
96 */
97#define CH_CFG_MEMCORE_SIZE 0
98
99/**
100 * @brief Idle thread automatic spawn suppression.
101 * @details When this option is activated the function @p chSysInit()
102 * does not spawn the idle thread. The application @p main()
103 * function becomes the idle thread and must implement an
104 * infinite loop.
105 */
106#define CH_CFG_NO_IDLE_THREAD FALSE
107
108/** @} */
109
110/*===========================================================================*/
111/**
112 * @name Performance options
113 * @{
114 */
115/*===========================================================================*/
116
117/**
118 * @brief OS optimization.
119 * @details If enabled then time efficient rather than space efficient code
120 * is used when two possible implementations exist.
121 *
122 * @note This is not related to the compiler optimization options.
123 * @note The default is @p TRUE.
124 */
125#define CH_CFG_OPTIMIZE_SPEED TRUE
126
127/** @} */
128
129/*===========================================================================*/
130/**
131 * @name Subsystem options
132 * @{
133 */
134/*===========================================================================*/
135
136/**
137 * @brief Time Measurement APIs.
138 * @details If enabled then the time measurement APIs are included in
139 * the kernel.
140 *
141 * @note The default is @p TRUE.
142 */
143#define CH_CFG_USE_TM TRUE
144
145/**
146 * @brief Threads registry APIs.
147 * @details If enabled then the registry APIs are included in the kernel.
148 *
149 * @note The default is @p TRUE.
150 */
151#define CH_CFG_USE_REGISTRY TRUE
152
153/**
154 * @brief Threads synchronization APIs.
155 * @details If enabled then the @p chThdWait() function is included in
156 * the kernel.
157 *
158 * @note The default is @p TRUE.
159 */
160#define CH_CFG_USE_WAITEXIT TRUE
161
162/**
163 * @brief Semaphores APIs.
164 * @details If enabled then the Semaphores APIs are included in the kernel.
165 *
166 * @note The default is @p TRUE.
167 */
168#define CH_CFG_USE_SEMAPHORES TRUE
169
170/**
171 * @brief Semaphores queuing mode.
172 * @details If enabled then the threads are enqueued on semaphores by
173 * priority rather than in FIFO order.
174 *
175 * @note The default is @p FALSE. Enable this if you have special
176 * requirements.
177 * @note Requires @p CH_CFG_USE_SEMAPHORES.
178 */
179#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
180
181/**
182 * @brief Mutexes APIs.
183 * @details If enabled then the mutexes APIs are included in the kernel.
184 *
185 * @note The default is @p TRUE.
186 */
187#define CH_CFG_USE_MUTEXES TRUE
188
189/**
190 * @brief Enables recursive behavior on mutexes.
191 * @note Recursive mutexes are heavier and have an increased
192 * memory footprint.
193 *
194 * @note The default is @p FALSE.
195 * @note Requires @p CH_CFG_USE_MUTEXES.
196 */
197#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
198
199/**
200 * @brief Conditional Variables APIs.
201 * @details If enabled then the conditional variables APIs are included
202 * in the kernel.
203 *
204 * @note The default is @p TRUE.
205 * @note Requires @p CH_CFG_USE_MUTEXES.
206 */
207#define CH_CFG_USE_CONDVARS TRUE
208
209/**
210 * @brief Conditional Variables APIs with timeout.
211 * @details If enabled then the conditional variables APIs with timeout
212 * specification are included in the kernel.
213 *
214 * @note The default is @p TRUE.
215 * @note Requires @p CH_CFG_USE_CONDVARS.
216 */
217#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE
218
219/**
220 * @brief Events Flags APIs.
221 * @details If enabled then the event flags APIs are included in the kernel.
222 *
223 * @note The default is @p TRUE.
224 */
225#define CH_CFG_USE_EVENTS TRUE
226
227/**
228 * @brief Events Flags APIs with timeout.
229 * @details If enabled then the events APIs with timeout specification
230 * are included in the kernel.
231 *
232 * @note The default is @p TRUE.
233 * @note Requires @p CH_CFG_USE_EVENTS.
234 */
235#define CH_CFG_USE_EVENTS_TIMEOUT TRUE
236
237/**
238 * @brief Synchronous Messages APIs.
239 * @details If enabled then the synchronous messages APIs are included
240 * in the kernel.
241 *
242 * @note The default is @p TRUE.
243 */
244#define CH_CFG_USE_MESSAGES TRUE
245
246/**
247 * @brief Synchronous Messages queuing mode.
248 * @details If enabled then messages are served by priority rather than in
249 * FIFO order.
250 *
251 * @note The default is @p FALSE. Enable this if you have special
252 * requirements.
253 * @note Requires @p CH_CFG_USE_MESSAGES.
254 */
255#define CH_CFG_USE_MESSAGES_PRIORITY TRUE
256
257/**
258 * @brief Mailboxes APIs.
259 * @details If enabled then the asynchronous messages (mailboxes) APIs are
260 * included in the kernel.
261 *
262 * @note The default is @p TRUE.
263 * @note Requires @p CH_CFG_USE_SEMAPHORES.
264 */
265#define CH_CFG_USE_MAILBOXES TRUE
266
267/**
268 * @brief Core Memory Manager APIs.
269 * @details If enabled then the core memory manager APIs are included
270 * in the kernel.
271 *
272 * @note The default is @p TRUE.
273 */
274#define CH_CFG_USE_MEMCORE TRUE
275
276/**
277 * @brief Heap Allocator APIs.
278 * @details If enabled then the memory heap allocator APIs are included
279 * in the kernel.
280 *
281 * @note The default is @p TRUE.
282 * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
283 * @p CH_CFG_USE_SEMAPHORES.
284 * @note Mutexes are recommended.
285 */
286#define CH_CFG_USE_HEAP TRUE
287
288/**
289 * @brief Memory Pools Allocator APIs.
290 * @details If enabled then the memory pools allocator APIs are included
291 * in the kernel.
292 *
293 * @note The default is @p TRUE.
294 */
295#define CH_CFG_USE_MEMPOOLS TRUE
296
297/**
298 * @brief Dynamic Threads APIs.
299 * @details If enabled then the dynamic threads creation APIs are included
300 * in the kernel.
301 *
302 * @note The default is @p TRUE.
303 * @note Requires @p CH_CFG_USE_WAITEXIT.
304 * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
305 */
306#define CH_CFG_USE_DYNAMIC TRUE
307
308/** @} */
309
310/*===========================================================================*/
311/**
312 * @name Debug options
313 * @{
314 */
315/*===========================================================================*/
316
317/**
318 * @brief Debug option, kernel statistics.
319 *
320 * @note The default is @p FALSE.
321 */
322#define CH_DBG_STATISTICS FALSE
323
324/**
325 * @brief Debug option, system state check.
326 * @details If enabled the correct call protocol for system APIs is checked
327 * at runtime.
328 *
329 * @note The default is @p FALSE.
330 */
331#define CH_DBG_SYSTEM_STATE_CHECK FALSE
332
333/**
334 * @brief Debug option, parameters checks.
335 * @details If enabled then the checks on the API functions input
336 * parameters are activated.
337 *
338 * @note The default is @p FALSE.
339 */
340#define CH_DBG_ENABLE_CHECKS FALSE
341
342/**
343 * @brief Debug option, consistency checks.
344 * @details If enabled then all the assertions in the kernel code are
345 * activated. This includes consistency checks inside the kernel,
346 * runtime anomalies and port-defined checks.
347 *
348 * @note The default is @p FALSE.
349 */
350#define CH_DBG_ENABLE_ASSERTS FALSE
351
352/**
353 * @brief Debug option, trace buffer.
354 * @details If enabled then the trace buffer is activated.
355 *
356 * @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
357 */
358#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
359
360/**
361 * @brief Trace buffer entries.
362 * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
363 * different from @p CH_DBG_TRACE_MASK_DISABLED.
364 */
365#define CH_DBG_TRACE_BUFFER_SIZE 128
366
367/**
368 * @brief Debug option, stack checks.
369 * @details If enabled then a runtime stack check is performed.
370 *
371 * @note The default is @p FALSE.
372 * @note The stack check is performed in a architecture/port dependent way.
373 * It may not be implemented or some ports.
374 * @note The default failure mode is to halt the system with the global
375 * @p panic_msg variable set to @p NULL.
376 */
377#define CH_DBG_ENABLE_STACK_CHECK TRUE
378
379/**
380 * @brief Debug option, stacks initialization.
381 * @details If enabled then the threads working area is filled with a byte
382 * value when a thread is created. This can be useful for the
383 * runtime measurement of the used stack.
384 *
385 * @note The default is @p FALSE.
386 */
387#define CH_DBG_FILL_THREADS FALSE
388
389/**
390 * @brief Debug option, threads profiling.
391 * @details If enabled then a field is added to the @p thread_t structure that
392 * counts the system ticks occurred while executing the thread.
393 *
394 * @note The default is @p FALSE.
395 * @note This debug option is not currently compatible with the
396 * tickless mode.
397 */
398#define CH_DBG_THREADS_PROFILING FALSE
399
400/** @} */
401
402/*===========================================================================*/
403/**
404 * @name Kernel hooks
405 * @{
406 */
407/*===========================================================================*/
408
409/**
410 * @brief Threads descriptor structure extension.
411 * @details User fields added to the end of the @p thread_t structure.
412 */
413#define CH_CFG_THREAD_EXTRA_FIELDS \
414 /* Add threads custom fields here.*/
415
416/**
417 * @brief Threads initialization hook.
418 * @details User initialization code added to the @p chThdInit() API.
419 *
420 * @note It is invoked from within @p chThdInit() and implicitly from all
421 * the threads creation APIs.
422 */
423#define CH_CFG_THREAD_INIT_HOOK(tp) { \
424 /* Add threads initialization code here.*/ \
425}
426
427/**
428 * @brief Threads finalization hook.
429 * @details User finalization code added to the @p chThdExit() API.
430 */
431#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
432 /* Add threads finalization code here.*/ \
433}
434
435/**
436 * @brief Context switch hook.
437 * @details This hook is invoked just before switching between threads.
438 */
439#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
440 /* Context switch code here.*/ \
441}
442
443/**
444 * @brief ISR enter hook.
445 */
446#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
447 /* IRQ prologue code here.*/ \
448}
449
450/**
451 * @brief ISR exit hook.
452 */
453#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
454 /* IRQ epilogue code here.*/ \
455}
456
457/**
458 * @brief Idle thread enter hook.
459 * @note This hook is invoked within a critical zone, no OS functions
460 * should be invoked from here.
461 * @note This macro can be used to activate a power saving mode.
462 */
463#define CH_CFG_IDLE_ENTER_HOOK() { \
464 /* Idle-enter code here.*/ \
465}
466
467/**
468 * @brief Idle thread leave hook.
469 * @note This hook is invoked within a critical zone, no OS functions
470 * should be invoked from here.
471 * @note This macro can be used to deactivate a power saving mode.
472 */
473#define CH_CFG_IDLE_LEAVE_HOOK() { \
474 /* Idle-leave code here.*/ \
475}
476
477/**
478 * @brief Idle Loop hook.
479 * @details This hook is continuously invoked by the idle thread loop.
480 */
481#define CH_CFG_IDLE_LOOP_HOOK() { \
482 /* Idle loop code here.*/ \
483}
484
485/**
486 * @brief System tick event hook.
487 * @details This hook is invoked in the system tick handler immediately
488 * after processing the virtual timers queue.
489 */
490#define CH_CFG_SYSTEM_TICK_HOOK() { \
491 /* System tick event code here.*/ \
492}
493
494/**
495 * @brief System halt hook.
496 * @details This hook is invoked in case to a system halting error before
497 * the system is halted.
498 */
499#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
500 /* System halt code here.*/ \
501}
502
503/**
504 * @brief Trace hook.
505 * @details This hook is invoked each time a new record is written in the
506 * trace buffer.
507 */
508#define CH_CFG_TRACE_HOOK(tep) { \
509 /* Trace code here.*/ \
510}
511
512/** @} */
513
514/*===========================================================================*/
515/* Port-specific settings (override port settings defaulted in chcore.h). */
516/*===========================================================================*/
517
518#endif /* CHCONF_H */
519
520/** @} */
diff --git a/keyboards/hs60/v2/config.h b/keyboards/hs60/v2/config.h
new file mode 100644
index 000000000..192f7d6f2
--- /dev/null
+++ b/keyboards/hs60/v2/config.h
@@ -0,0 +1,117 @@
1/*
2Copyright 2018 Yiancar
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#pragma once
19
20#include "config_common.h"
21
22/* USB Device descriptor parameter */
23#define VENDOR_ID 0xFEED
24#define PRODUCT_ID 0x0258
25#define DEVICE_VER 0x0001
26#define MANUFACTURER Yiancar-Designs
27#define PRODUCT HS60 V2
28#define DESCRIPTION GH60 compatible, tool free RGB keyboard
29
30/* key matrix size */
31#define MATRIX_ROWS 5
32#define MATRIX_COLS 14
33
34#define MATRIX_ROW_PINS { B3, B4, B5, A8, A4 }
35#define MATRIX_COL_PINS { A13, A10, A9, A14, A15, B8, B9, C13, C14, C15, A0, A1, A2, A3 }
36// To enable debugger set A13 A14 -> A5 A6
37
38/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
39#define DIODE_DIRECTION COL2ROW
40
41/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
42#define DEBOUNCE 0
43
44/* define if matrix has ghost (lacks anti-ghosting diodes) */
45//#define MATRIX_HAS_GHOST
46
47/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
48 * This is userful for the Windows task manager shortcut (ctrl+shift+esc).
49 */
50// #define GRAVE_ESC_CTRL_OVERRIDE
51
52/*
53 * Force NKRO
54 *
55 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
56 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
57 * makefile for this to work.)
58 *
59 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
60 * until the next keyboard reset.
61 *
62 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
63 * fully operational during normal computer usage.
64 *
65 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
66 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
67 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
68 * power-up.
69 *
70 */
71//#define FORCE_NKRO
72
73/*
74 * Magic Key Options
75 *
76 * Magic keys are hotkey commands that allow control over firmware functions of
77 * the keyboard. They are best used in combination with the HID Listen program,
78 * found here: https://www.pjrc.com/teensy/hid_listen.html
79 *
80 * The options below allow the magic key functionality to be changed. This is
81 * useful if your keyboard/keypad is missing keys and you want magic key support.
82 *
83 */
84
85/* key combination for magic key command */
86#define IS_COMMAND() ( \
87 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
88)
89
90/*
91 * Feature disable options
92 * These options are also useful to firmware size reduction.
93 */
94
95/* disable debug print */
96//#define NO_DEBUG
97
98/* disable print */
99//#define NO_PRINT
100
101/* Backlight options */
102
103#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
104#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended
105#define RGB_MATRIX_SKIP_FRAMES 3
106
107#define DRIVER_ADDR_1 0b1010000
108#define DRIVER_ADDR_2 0b1010000 // this is here for compliancy reasons.
109
110#define DRIVER_COUNT 2
111#ifdef HS60_ANSI
112#define DRIVER_1_LED_TOTAL 61
113#else
114#define DRIVER_1_LED_TOTAL 62
115#endif
116
117#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL
diff --git a/keyboards/hs60/v2/halconf.h b/keyboards/hs60/v2/halconf.h
new file mode 100644
index 000000000..eda293c49
--- /dev/null
+++ b/keyboards/hs60/v2/halconf.h
@@ -0,0 +1,388 @@
1/*
2 ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file templates/halconf.h
19 * @brief HAL configuration header.
20 * @details HAL configuration file, this file allows to enable or disable the
21 * various device drivers from your application. You may also use
22 * this file in order to override the device drivers default settings.
23 *
24 * @addtogroup HAL_CONF
25 * @{
26 */
27
28#ifndef HALCONF_H
29#define HALCONF_H
30
31#include "mcuconf.h"
32
33/**
34 * @brief Enables the PAL subsystem.
35 */
36#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
37#define HAL_USE_PAL TRUE
38#endif
39
40/**
41 * @brief Enables the ADC subsystem.
42 */
43#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
44#define HAL_USE_ADC FALSE
45#endif
46
47/**
48 * @brief Enables the CAN subsystem.
49 */
50#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
51#define HAL_USE_CAN FALSE
52#endif
53
54/**
55 * @brief Enables the DAC subsystem.
56 */
57#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
58#define HAL_USE_DAC TRUE
59#endif
60
61/**
62 * @brief Enables the EXT subsystem.
63 */
64#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
65#define HAL_USE_EXT FALSE
66#endif
67
68/**
69 * @brief Enables the GPT subsystem.
70 */
71#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
72#define HAL_USE_GPT TRUE
73#endif
74
75/**
76 * @brief Enables the I2C subsystem.
77 */
78#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
79#define HAL_USE_I2C TRUE
80#endif
81
82/**
83 * @brief Enables the I2S subsystem.
84 */
85#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
86#define HAL_USE_I2S FALSE
87#endif
88
89/**
90 * @brief Enables the ICU subsystem.
91 */
92#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
93#define HAL_USE_ICU FALSE
94#endif
95
96/**
97 * @brief Enables the MAC subsystem.
98 */
99#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
100#define HAL_USE_MAC FALSE
101#endif
102
103/**
104 * @brief Enables the MMC_SPI subsystem.
105 */
106#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
107#define HAL_USE_MMC_SPI FALSE
108#endif
109
110/**
111 * @brief Enables the PWM subsystem.
112 */
113#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
114#define HAL_USE_PWM FALSE
115#endif
116
117/**
118 * @brief Enables the QSPI subsystem.
119 */
120#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__)
121#define HAL_USE_QSPI FALSE
122#endif
123
124/**
125 * @brief Enables the RTC subsystem.
126 */
127#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
128#define HAL_USE_RTC FALSE
129#endif
130
131/**
132 * @brief Enables the SDC subsystem.
133 */
134#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
135#define HAL_USE_SDC FALSE
136#endif
137
138/**
139 * @brief Enables the SERIAL subsystem.
140 */
141#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
142#define HAL_USE_SERIAL FALSE
143#endif
144
145/**
146 * @brief Enables the SERIAL over USB subsystem.
147 */
148#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
149#define HAL_USE_SERIAL_USB FALSE
150#endif
151
152/**
153 * @brief Enables the SPI subsystem.
154 */
155#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
156#define HAL_USE_SPI FALSE
157#endif
158
159/**
160 * @brief Enables the UART subsystem.
161 */
162#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
163#define HAL_USE_UART FALSE
164#endif
165
166/**
167 * @brief Enables the USB subsystem.
168 */
169#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
170#define HAL_USE_USB TRUE
171#endif
172
173/**
174 * @brief Enables the WDG subsystem.
175 */
176#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
177#define HAL_USE_WDG FALSE
178#endif
179
180/*===========================================================================*/
181/* ADC driver related settings. */
182/*===========================================================================*/
183
184/**
185 * @brief Enables synchronous APIs.
186 * @note Disabling this option saves both code and data space.
187 */
188#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
189#define ADC_USE_WAIT TRUE
190#endif
191
192/**
193 * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
194 * @note Disabling this option saves both code and data space.
195 */
196#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
197#define ADC_USE_MUTUAL_EXCLUSION TRUE
198#endif
199
200/*===========================================================================*/
201/* CAN driver related settings. */
202/*===========================================================================*/
203
204/**
205 * @brief Sleep mode related APIs inclusion switch.
206 */
207#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
208#define CAN_USE_SLEEP_MODE TRUE
209#endif
210
211/*===========================================================================*/
212/* I2C driver related settings. */
213/*===========================================================================*/
214
215/**
216 * @brief Enables the mutual exclusion APIs on the I2C bus.
217 */
218#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
219#define I2C_USE_MUTUAL_EXCLUSION TRUE
220#endif
221
222/*===========================================================================*/
223/* MAC driver related settings. */
224/*===========================================================================*/
225
226/**
227 * @brief Enables an event sources for incoming packets.
228 */
229#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
230#define MAC_USE_ZERO_COPY FALSE
231#endif
232
233/**
234 * @brief Enables an event sources for incoming packets.
235 */
236#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
237#define MAC_USE_EVENTS TRUE
238#endif
239
240/*===========================================================================*/
241/* MMC_SPI driver related settings. */
242/*===========================================================================*/
243
244/**
245 * @brief Delays insertions.
246 * @details If enabled this options inserts delays into the MMC waiting
247 * routines releasing some extra CPU time for the threads with
248 * lower priority, this may slow down the driver a bit however.
249 * This option is recommended also if the SPI driver does not
250 * use a DMA channel and heavily loads the CPU.
251 */
252#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
253#define MMC_NICE_WAITING TRUE
254#endif
255
256/*===========================================================================*/
257/* SDC driver related settings. */
258/*===========================================================================*/
259
260/**
261 * @brief Number of initialization attempts before rejecting the card.
262 * @note Attempts are performed at 10mS intervals.
263 */
264#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
265#define SDC_INIT_RETRY 100
266#endif
267
268/**
269 * @brief Include support for MMC cards.
270 * @note MMC support is not yet implemented so this option must be kept
271 * at @p FALSE.
272 */
273#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
274#define SDC_MMC_SUPPORT FALSE
275#endif
276
277/**
278 * @brief Delays insertions.
279 * @details If enabled this options inserts delays into the MMC waiting
280 * routines releasing some extra CPU time for the threads with
281 * lower priority, this may slow down the driver a bit however.
282 */
283#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
284#define SDC_NICE_WAITING TRUE
285#endif
286
287/*===========================================================================*/
288/* SERIAL driver related settings. */
289/*===========================================================================*/
290
291/**
292 * @brief Default bit rate.
293 * @details Configuration parameter, this is the baud rate selected for the
294 * default configuration.
295 */
296#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
297#define SERIAL_DEFAULT_BITRATE 38400
298#endif
299
300/**
301 * @brief Serial buffers size.
302 * @details Configuration parameter, you can change the depth of the queue
303 * buffers depending on the requirements of your application.
304 * @note The default is 16 bytes for both the transmission and receive
305 * buffers.
306 */
307#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
308#define SERIAL_BUFFERS_SIZE 16
309#endif
310
311/*===========================================================================*/
312/* SERIAL_USB driver related setting. */
313/*===========================================================================*/
314
315/**
316 * @brief Serial over USB buffers size.
317 * @details Configuration parameter, the buffer size must be a multiple of
318 * the USB data endpoint maximum packet size.
319 * @note The default is 256 bytes for both the transmission and receive
320 * buffers.
321 */
322#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
323#define SERIAL_USB_BUFFERS_SIZE 1
324#endif
325
326/**
327 * @brief Serial over USB number of buffers.
328 * @note The default is 2 buffers.
329 */
330#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__)
331#define SERIAL_USB_BUFFERS_NUMBER 2
332#endif
333
334/*===========================================================================*/
335/* SPI driver related settings. */
336/*===========================================================================*/
337
338/**
339 * @brief Enables synchronous APIs.
340 * @note Disabling this option saves both code and data space.
341 */
342#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
343#define SPI_USE_WAIT TRUE
344#endif
345
346/**
347 * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
348 * @note Disabling this option saves both code and data space.
349 */
350#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
351#define SPI_USE_MUTUAL_EXCLUSION TRUE
352#endif
353
354/*===========================================================================*/
355/* UART driver related settings. */
356/*===========================================================================*/
357
358/**
359 * @brief Enables synchronous APIs.
360 * @note Disabling this option saves both code and data space.
361 */
362#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__)
363#define UART_USE_WAIT FALSE
364#endif
365
366/**
367 * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs.
368 * @note Disabling this option saves both code and data space.
369 */
370#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
371#define UART_USE_MUTUAL_EXCLUSION FALSE
372#endif
373
374/*===========================================================================*/
375/* USB driver related settings. */
376/*===========================================================================*/
377
378/**
379 * @brief Enables synchronous APIs.
380 * @note Disabling this option saves both code and data space.
381 */
382#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
383#define USB_USE_WAIT TRUE
384#endif
385
386#endif /* HALCONF_H */
387
388/** @} */
diff --git a/keyboards/hs60/v2/info.json b/keyboards/hs60/v2/info.json
new file mode 100644
index 000000000..abafb69f9
--- /dev/null
+++ b/keyboards/hs60/v2/info.json
@@ -0,0 +1,1650 @@
1{
2 "keyboard_name": "clueboard/60",
3 "maintainer": "skullydazed",
4 "url": "",
5 "width": 15,
6 "height": 5,
7 "layouts": {
8 "LAYOUT_60_ansi": {
9 "key_count": 61,
10 "layout": [
11 {
12 "label": "~",
13 "x": 0,
14 "y": 0
15 },
16 {
17 "label": "!",
18 "x": 1,
19 "y": 0
20 },
21 {
22 "label": "@",
23 "x": 2,
24 "y": 0
25 },
26 {
27 "label": "#",
28 "x": 3,
29 "y": 0
30 },
31 {
32 "label": "$",
33 "x": 4,
34 "y": 0
35 },
36 {
37 "label": "%",
38 "x": 5,
39 "y": 0
40 },
41 {
42 "label": "^",
43 "x": 6,
44 "y": 0
45 },
46 {
47 "label": "&",
48 "x": 7,
49 "y": 0
50 },
51 {
52 "label": "*",
53 "x": 8,
54 "y": 0
55 },
56 {
57 "label": "(",
58 "x": 9,
59 "y": 0
60 },
61 {
62 "label": ")",
63 "x": 10,
64 "y": 0
65 },
66 {
67 "label": "_",
68 "x": 11,
69 "y": 0
70 },
71 {
72 "label": "+",
73 "x": 12,
74 "y": 0
75 },
76 {
77 "label": "Backspace",
78 "x": 13,
79 "y": 0,
80 "w": 2
81 },
82 {
83 "label": "Tab",
84 "x": 0,
85 "y": 1,
86 "w": 1.5
87 },
88 {
89 "label": "Q",
90 "x": 1.5,
91 "y": 1
92 },
93 {
94 "label": "W",
95 "x": 2.5,
96 "y": 1
97 },
98 {
99 "label": "E",
100 "x": 3.5,
101 "y": 1
102 },
103 {
104 "label": "R",
105 "x": 4.5,
106 "y": 1
107 },
108 {
109 "label": "T",
110 "x": 5.5,
111 "y": 1
112 },
113 {
114 "label": "Y",
115 "x": 6.5,
116 "y": 1
117 },
118 {
119 "label": "U",
120 "x": 7.5,
121 "y": 1
122 },
123 {
124 "label": "I",
125 "x": 8.5,
126 "y": 1
127 },
128 {
129 "label": "O",
130 "x": 9.5,
131 "y": 1
132 },
133 {
134 "label": "P",
135 "x": 10.5,
136 "y": 1
137 },
138 {
139 "label": "{",
140 "x": 11.5,
141 "y": 1
142 },
143 {
144 "label": "}",
145 "x": 12.5,
146 "y": 1
147 },
148 {
149 "label": "|",
150 "x": 13.5,
151 "y": 1,
152 "w": 1.5
153 },
154 {
155 "label": "Caps Lock",
156 "x": 0,
157 "y": 2,
158 "w": 1.75
159 },
160 {
161 "label": "A",
162 "x": 1.75,
163 "y": 2
164 },
165 {
166 "label": "S",
167 "x": 2.75,
168 "y": 2
169 },
170 {
171 "label": "D",
172 "x": 3.75,
173 "y": 2
174 },
175 {
176 "label": "F",
177 "x": 4.75,
178 "y": 2
179 },
180 {
181 "label": "G",
182 "x": 5.75,
183 "y": 2
184 },
185 {
186 "label": "H",
187 "x": 6.75,
188 "y": 2
189 },
190 {
191 "label": "J",
192 "x": 7.75,
193 "y": 2
194 },
195 {
196 "label": "K",
197 "x": 8.75,
198 "y": 2
199 },
200 {
201 "label": "L",
202 "x": 9.75,
203 "y": 2
204 },
205 {
206 "label": ":",
207 "x": 10.75,
208 "y": 2
209 },
210 {
211 "label": "\"",
212 "x": 11.75,
213 "y": 2
214 },
215 {
216 "label": "Enter",
217 "x": 12.75,
218 "y": 2,
219 "w": 2.25
220 },
221 {
222 "label": "Shift",
223 "x": 0,
224 "y": 3,
225 "w": 2.25
226 },
227 {
228 "label": "Z",
229 "x": 2.25,
230 "y": 3
231 },
232 {
233 "label": "X",
234 "x": 3.25,
235 "y": 3
236 },
237 {
238 "label": "C",
239 "x": 4.25,
240 "y": 3
241 },
242 {
243 "label": "V",
244 "x": 5.25,
245 "y": 3
246 },
247 {
248 "label": "B",
249 "x": 6.25,
250 "y": 3
251 },
252 {
253 "label": "N",
254 "x": 7.25,
255 "y": 3
256 },
257 {
258 "label": "M",
259 "x": 8.25,
260 "y": 3
261 },
262 {
263 "label": "<",
264 "x": 9.25,
265 "y": 3
266 },
267 {
268 "label": ">",
269 "x": 10.25,
270 "y": 3
271 },
272 {
273 "label": "?",
274 "x": 11.25,
275 "y": 3
276 },
277 {
278 "label": "Shift",
279 "x": 12.25,
280 "y": 3,
281 "w": 2.75
282 },
283 {
284 "label": "Ctrl",
285 "x": 0,
286 "y": 4,
287 "w": 1.25
288 },
289 {
290 "label": "Win",
291 "x": 1.25,
292 "y": 4,
293 "w": 1.25
294 },
295 {
296 "label": "Alt",
297 "x": 2.5,
298 "y": 4,
299 "w": 1.25
300 },
301 {
302 "x": 3.75,
303 "y": 4,
304 "w": 6.25
305 },
306 {
307 "label": "Alt",
308 "x": 10,
309 "y": 4,
310 "w": 1.25
311 },
312 {
313 "label": "Win",
314 "x": 11.25,
315 "y": 4,
316 "w": 1.25
317 },
318 {
319 "label": "Menu",
320 "x": 12.5,
321 "y": 4,
322 "w": 1.25
323 },
324 {
325 "label": "Ctrl",
326 "x": 13.75,
327 "y": 4,
328 "w": 1.25
329 }
330 ]
331 },
332 "LAYOUT_60_iso": {
333 "key_count": 62,
334 "layout": [
335 {
336 "label": "\\u00ac",
337 "x": 0,
338 "y": 0
339 },
340 {
341 "label": "!",
342 "x": 1,
343 "y": 0
344 },
345 {
346 "label": "\"",
347 "x": 2,
348 "y": 0
349 },
350 {
351 "label": "\\u00a3",
352 "x": 3,
353 "y": 0
354 },
355 {
356 "label": "$",
357 "x": 4,
358 "y": 0
359 },
360 {
361 "label": "%",
362 "x": 5,
363 "y": 0
364 },
365 {
366 "label": "^",
367 "x": 6,
368 "y": 0
369 },
370 {
371 "label": "&",
372 "x": 7,
373 "y": 0
374 },
375 {
376 "label": "*",
377 "x": 8,
378 "y": 0
379 },
380 {
381 "label": "(",
382 "x": 9,
383 "y": 0
384 },
385 {
386 "label": ")",
387 "x": 10,
388 "y": 0
389 },
390 {
391 "label": "_",
392 "x": 11,
393 "y": 0
394 },
395 {
396 "label": "+",
397 "x": 12,
398 "y": 0
399 },
400 {
401 "label": "Backspace",
402 "x": 13,
403 "y": 0,
404 "w": 2
405 },
406 {
407 "label": "Tab",
408 "x": 0,
409 "y": 1,
410 "w": 1.5
411 },
412 {
413 "label": "Q",
414 "x": 1.5,
415 "y": 1
416 },
417 {
418 "label": "W",
419 "x": 2.5,
420 "y": 1
421 },
422 {
423 "label": "E",
424 "x": 3.5,
425 "y": 1
426 },
427 {
428 "label": "R",
429 "x": 4.5,
430 "y": 1
431 },
432 {
433 "label": "T",
434 "x": 5.5,
435 "y": 1
436 },
437 {
438 "label": "Y",
439 "x": 6.5,
440 "y": 1
441 },
442 {
443 "label": "U",
444 "x": 7.5,
445 "y": 1
446 },
447 {
448 "label": "I",
449 "x": 8.5,
450 "y": 1
451 },
452 {
453 "label": "O",
454 "x": 9.5,
455 "y": 1
456 },
457 {
458 "label": "P",
459 "x": 10.5,
460 "y": 1
461 },
462 {
463 "label": "{",
464 "x": 11.5,
465 "y": 1
466 },
467 {
468 "label": "}",
469 "x": 12.5,
470 "y": 1
471 },
472 {
473 "label": "Enter",
474 "x": 13.75,
475 "y": 1,
476 "w": 1.25,
477 "h": 2
478 },
479 {
480 "label": "Caps Lock",
481 "x": 0,
482 "y": 2,
483 "w": 1.75
484 },
485 {
486 "label": "A",
487 "x": 1.75,
488 "y": 2
489 },
490 {
491 "label": "S",
492 "x": 2.75,
493 "y": 2
494 },
495 {
496 "label": "D",
497 "x": 3.75,
498 "y": 2
499 },
500 {
501 "label": "F",
502 "x": 4.75,
503 "y": 2
504 },
505 {
506 "label": "G",
507 "x": 5.75,
508 "y": 2
509 },
510 {
511 "label": "H",
512 "x": 6.75,
513 "y": 2
514 },
515 {
516 "label": "J",
517 "x": 7.75,
518 "y": 2
519 },
520 {
521 "label": "K",
522 "x": 8.75,
523 "y": 2
524 },
525 {
526 "label": "L",
527 "x": 9.75,
528 "y": 2
529 },
530 {
531 "label": ":",
532 "x": 10.75,
533 "y": 2
534 },
535 {
536 "label": "@",
537 "x": 11.75,
538 "y": 2
539 },
540 {
541 "label": "~",
542 "x": 12.75,
543 "y": 2
544 },
545 {
546 "label": "Shift",
547 "x": 0,
548 "y": 3,
549 "w": 1.25
550 },
551 {
552 "label": "|",
553 "x": 1.25,
554 "y": 3
555 },
556 {
557 "label": "Z",
558 "x": 2.25,
559 "y": 3
560 },
561 {
562 "label": "X",
563 "x": 3.25,
564 "y": 3
565 },
566 {
567 "label": "C",
568 "x": 4.25,
569 "y": 3
570 },
571 {
572 "label": "V",
573 "x": 5.25,
574 "y": 3
575 },
576 {
577 "label": "B",
578 "x": 6.25,
579 "y": 3
580 },
581 {
582 "label": "N",
583 "x": 7.25,
584 "y": 3
585 },
586 {
587 "label": "M",
588 "x": 8.25,
589 "y": 3
590 },
591 {
592 "label": "<",
593 "x": 9.25,
594 "y": 3
595 },
596 {
597 "label": ">",
598 "x": 10.25,
599 "y": 3
600 },
601 {
602 "label": "?",
603 "x": 11.25,
604 "y": 3
605 },
606 {
607 "label": "Shift",
608 "x": 12.25,
609 "y": 3,
610 "w": 2.75
611 },
612 {
613 "label": "Ctrl",
614 "x": 0,
615 "y": 4,
616 "w": 1.25
617 },
618 {
619 "label": "Win",
620 "x": 1.25,
621 "y": 4,
622 "w": 1.25
623 },
624 {
625 "label": "Alt",
626 "x": 2.5,
627 "y": 4,
628 "w": 1.25
629 },
630 {
631 "x": 3.75,
632 "y": 4,
633 "w": 6.25
634 },
635 {
636 "label": "AltGr",
637 "x": 10,
638 "y": 4,
639 "w": 1.25
640 },
641 {
642 "label": "Win",
643 "x": 11.25,
644 "y": 4,
645 "w": 1.25
646 },
647 {
648 "label": "Menu",
649 "x": 12.5,
650 "y": 4,
651 "w": 1.25
652 },
653 {
654 "label": "Ctrl",
655 "x": 13.75,
656 "y": 4,
657 "w": 1.25
658 }
659 ]
660 },
661 "KEYMAP_AEK": {
662 "key_count": 60,
663 "layout": [
664 {
665 "label": "~",
666 "x": 0,
667 "y": 0
668 },
669 {
670 "label": "!",
671 "x": 1,
672 "y": 0
673 },
674 {
675 "label": "@",
676 "x": 2,
677 "y": 0
678 },
679 {
680 "label": "#",
681 "x": 3,
682 "y": 0
683 },
684 {
685 "label": "$",
686 "x": 4,
687 "y": 0
688 },
689 {
690 "label": "%",
691 "x": 5,
692 "y": 0
693 },
694 {
695 "label": "^",
696 "x": 6,
697 "y": 0
698 },
699 {
700 "label": "&",
701 "x": 7,
702 "y": 0
703 },
704 {
705 "label": "*",
706 "x": 8,
707 "y": 0
708 },
709 {
710 "label": "(",
711 "x": 9,
712 "y": 0
713 },
714 {
715 "label": ")",
716 "x": 10,
717 "y": 0
718 },
719 {
720 "label": "_",
721 "x": 11,
722 "y": 0
723 },
724 {
725 "label": "+",
726 "x": 12,
727 "y": 0
728 },
729 {
730 "label": "Backspace",
731 "x": 13,
732 "y": 0,
733 "w": 2
734 },
735 {
736 "label": "Tab",
737 "x": 0,
738 "y": 1,
739 "w": 1.5
740 },
741 {
742 "label": "Q",
743 "x": 1.5,
744 "y": 1
745 },
746 {
747 "label": "W",
748 "x": 2.5,
749 "y": 1
750 },
751 {
752 "label": "E",
753 "x": 3.5,
754 "y": 1
755 },
756 {
757 "label": "R",
758 "x": 4.5,
759 "y": 1
760 },
761 {
762 "label": "T",
763 "x": 5.5,
764 "y": 1
765 },
766 {
767 "label": "Y",
768 "x": 6.5,
769 "y": 1
770 },
771 {
772 "label": "U",
773 "x": 7.5,
774 "y": 1
775 },
776 {
777 "label": "I",
778 "x": 8.5,
779 "y": 1
780 },
781 {
782 "label": "O",
783 "x": 9.5,
784 "y": 1
785 },
786 {
787 "label": "P",
788 "x": 10.5,
789 "y": 1
790 },
791 {
792 "label": "{",
793 "x": 11.5,
794 "y": 1
795 },
796 {
797 "label": "}",
798 "x": 12.5,
799 "y": 1
800 },
801 {
802 "label": "|",
803 "x": 13.5,
804 "y": 1,
805 "w": 1.5
806 },
807 {
808 "label": "Caps Lock",
809 "x": 0,
810 "y": 2,
811 "w": 1.75
812 },
813 {
814 "label": "A",
815 "x": 1.75,
816 "y": 2
817 },
818 {
819 "label": "S",
820 "x": 2.75,
821 "y": 2
822 },
823 {
824 "label": "D",
825 "x": 3.75,
826 "y": 2
827 },
828 {
829 "label": "F",
830 "x": 4.75,
831 "y": 2
832 },
833 {
834 "label": "G",
835 "x": 5.75,
836 "y": 2
837 },
838 {
839 "label": "H",
840 "x": 6.75,
841 "y": 2
842 },
843 {
844 "label": "J",
845 "x": 7.75,
846 "y": 2
847 },
848 {
849 "label": "K",
850 "x": 8.75,
851 "y": 2
852 },
853 {
854 "label": "L",
855 "x": 9.75,
856 "y": 2
857 },
858 {
859 "label": ":",
860 "x": 10.75,
861 "y": 2
862 },
863 {
864 "label": "\"",
865 "x": 11.75,
866 "y": 2
867 },
868 {
869 "label": "Enter",
870 "x": 12.75,
871 "y": 2,
872 "w": 2.25
873 },
874 {
875 "label": "Shift",
876 "x": 0,
877 "y": 3,
878 "w": 2.25
879 },
880 {
881 "label": "Z",
882 "x": 2.25,
883 "y": 3
884 },
885 {
886 "label": "X",
887 "x": 3.25,
888 "y": 3
889 },
890 {
891 "label": "C",
892 "x": 4.25,
893 "y": 3
894 },
895 {
896 "label": "V",
897 "x": 5.25,
898 "y": 3
899 },
900 {
901 "label": "B",
902 "x": 6.25,
903 "y": 3
904 },
905 {
906 "label": "N",
907 "x": 7.25,
908 "y": 3
909 },
910 {
911 "label": "M",
912 "x": 8.25,
913 "y": 3
914 },
915 {
916 "label": "<",
917 "x": 9.25,
918 "y": 3
919 },
920 {
921 "label": ">",
922 "x": 10.25,
923 "y": 3
924 },
925 {
926 "label": "?",
927 "x": 11.25,
928 "y": 3
929 },
930 {
931 "label": "Shift",
932 "x": 12.25,
933 "y": 3,
934 "w": 2.75
935 },
936 {
937 "label": "Ctrl",
938 "x": 0,
939 "y": 4,
940 "w": 1.5
941 },
942 {
943 "label": "Win",
944 "x": 1.5,
945 "y": 4,
946 "w": 1.25
947 },
948 {
949 "label": "Alt",
950 "x": 2.75,
951 "y": 4,
952 "w": 1.5
953 },
954 {
955 "x": 4.25,
956 "y": 4,
957 "w": 6.5
958 },
959 {
960 "label": "AltGr",
961 "x": 10.75,
962 "y": 4,
963 "w": 1.5
964 },
965 {
966 "label": "Win",
967 "x": 12.25,
968 "y": 4,
969 "w": 1.25
970 },
971 {
972 "label": "Ctrl",
973 "x": 13.5,
974 "y": 4,
975 "w": 1.5
976 }
977 ]
978 },
979 "KEYMAP": {
980 "key_count": 65,
981 "layout": [
982 {
983 "label": "~",
984 "x": 0,
985 "y": 0
986 },
987 {
988 "label": "!",
989 "x": 1,
990 "y": 0
991 },
992 {
993 "label": "@",
994 "x": 2,
995 "y": 0
996 },
997 {
998 "label": "#",
999 "x": 3,
1000 "y": 0
1001 },
1002 {
1003 "label": "$",
1004 "x": 4,
1005 "y": 0
1006 },
1007 {
1008 "label": "%",
1009 "x": 5,
1010 "y": 0
1011 },
1012 {
1013 "label": "^",
1014 "x": 6,
1015 "y": 0
1016 },
1017 {
1018 "label": "&",
1019 "x": 7,
1020 "y": 0
1021 },
1022 {
1023 "label": "*",
1024 "x": 8,
1025 "y": 0
1026 },
1027 {
1028 "label": "(",
1029 "x": 9,
1030 "y": 0
1031 },
1032 {
1033 "label": ")",
1034 "x": 10,
1035 "y": 0
1036 },
1037 {
1038 "label": "_",
1039 "x": 11,
1040 "y": 0
1041 },
1042 {
1043 "label": "+",
1044 "x": 12,
1045 "y": 0
1046 },
1047 {
1048 "x": 13,
1049 "y": 0
1050 },
1051 {
1052 "label": "Back",
1053 "x": 14,
1054 "y": 0
1055 },
1056 {
1057 "label": "Tab",
1058 "x": 0,
1059 "y": 1,
1060 "w": 1.5
1061 },
1062 {
1063 "label": "Q",
1064 "x": 1.5,
1065 "y": 1
1066 },
1067 {
1068 "label": "W",
1069 "x": 2.5,
1070 "y": 1
1071 },
1072 {
1073 "label": "E",
1074 "x": 3.5,
1075 "y": 1
1076 },
1077 {
1078 "label": "R",
1079 "x": 4.5,
1080 "y": 1
1081 },
1082 {
1083 "label": "T",
1084 "x": 5.5,
1085 "y": 1
1086 },
1087 {
1088 "label": "Y",
1089 "x": 6.5,
1090 "y": 1
1091 },
1092 {
1093 "label": "U",
1094 "x": 7.5,
1095 "y": 1
1096 },
1097 {
1098 "label": "I",
1099 "x": 8.5,
1100 "y": 1
1101 },
1102 {
1103 "label": "O",
1104 "x": 9.5,
1105 "y": 1
1106 },
1107 {
1108 "label": "P",
1109 "x": 10.5,
1110 "y": 1
1111 },
1112 {
1113 "label": "{",
1114 "x": 11.5,
1115 "y": 1
1116 },
1117 {
1118 "label": "}",
1119 "x": 12.5,
1120 "y": 1
1121 },
1122 {
1123 "label": "|",
1124 "x": 13.5,
1125 "y": 1,
1126 "w": 1.5
1127 },
1128 {
1129 "label": "Caps Lock",
1130 "x": 0,
1131 "y": 2,
1132 "w": 1.75
1133 },
1134 {
1135 "label": "A",
1136 "x": 1.75,
1137 "y": 2
1138 },
1139 {
1140 "label": "S",
1141 "x": 2.75,
1142 "y": 2
1143 },
1144 {
1145 "label": "D",
1146 "x": 3.75,
1147 "y": 2
1148 },
1149 {
1150 "label": "F",
1151 "x": 4.75,
1152 "y": 2
1153 },
1154 {
1155 "label": "G",
1156 "x": 5.75,
1157 "y": 2
1158 },
1159 {
1160 "label": "H",
1161 "x": 6.75,
1162 "y": 2
1163 },
1164 {
1165 "label": "J",
1166 "x": 7.75,
1167 "y": 2
1168 },
1169 {
1170 "label": "K",
1171 "x": 8.75,
1172 "y": 2
1173 },
1174 {
1175 "label": "L",
1176 "x": 9.75,
1177 "y": 2
1178 },
1179 {
1180 "label": ":",
1181 "x": 10.75,
1182 "y": 2
1183 },
1184 {
1185 "label": "\"",
1186 "x": 11.75,
1187 "y": 2
1188 },
1189 {
1190 "x": 12.75,
1191 "y": 2
1192 },
1193 {
1194 "label": "Enter",
1195 "x": 13.75,
1196 "y": 2,
1197 "w": 1.25
1198 },
1199 {
1200 "x": 0,
1201 "y": 3
1202 },
1203 {
1204 "label": "Shift",
1205 "x": 1,
1206 "y": 3,
1207 "w": 1.25
1208 },
1209 {
1210 "label": "Z",
1211 "x": 2.25,
1212 "y": 3
1213 },
1214 {
1215 "label": "X",
1216 "x": 3.25,
1217 "y": 3
1218 },
1219 {
1220 "label": "C",
1221 "x": 4.25,
1222 "y": 3
1223 },
1224 {
1225 "label": "V",
1226 "x": 5.25,
1227 "y": 3
1228 },
1229 {
1230 "label": "B",
1231 "x": 6.25,
1232 "y": 3
1233 },
1234 {
1235 "label": "N",
1236 "x": 7.25,
1237 "y": 3
1238 },
1239 {
1240 "label": "M",
1241 "x": 8.25,
1242 "y": 3
1243 },
1244 {
1245 "label": "<",
1246 "x": 9.25,
1247 "y": 3
1248 },
1249 {
1250 "label": ">",
1251 "x": 10.25,
1252 "y": 3
1253 },
1254 {
1255 "label": "?",
1256 "x": 11.25,
1257 "y": 3
1258 },
1259 {
1260 "label": "Shift",
1261 "x": 12.25,
1262 "y": 3,
1263 "w": 1.75
1264 },
1265 {
1266 "x": 14,
1267 "y": 3
1268 },
1269 {
1270 "label": "Ctrl",
1271 "x": 0,
1272 "y": 4,
1273 "w": 1.25
1274 },
1275 {
1276 "label": "Win",
1277 "x": 1.25,
1278 "y": 4,
1279 "w": 1.25
1280 },
1281 {
1282 "label": "Alt",
1283 "x": 2.5,
1284 "y": 4,
1285 "w": 1.25
1286 },
1287 {
1288 "x": 3.75,
1289 "y": 4,
1290 "w": 6.25
1291 },
1292 {
1293 "label": "Alt",
1294 "x": 10,
1295 "y": 4,
1296 "w": 1.25
1297 },
1298 {
1299 "label": "Win",
1300 "x": 11.25,
1301 "y": 4,
1302 "w": 1.25
1303 },
1304 {
1305 "label": "Menu",
1306 "x": 12.5,
1307 "y": 4,
1308 "w": 1.25
1309 },
1310 {
1311 "label": "Ctrl",
1312 "x": 13.75,
1313 "y": 4,
1314 "w": 1.25
1315 }
1316 ]
1317 },
1318 "LAYOUT_60_ansi_split_bs_rshift": {
1319 "key_count": 63,
1320 "layout": [
1321 {
1322 "label": "~",
1323 "x": 0,
1324 "y": 0
1325 },
1326 {
1327 "label": "!",
1328 "x": 1,
1329 "y": 0
1330 },
1331 {
1332 "label": "@",
1333 "x": 2,
1334 "y": 0
1335 },
1336 {
1337 "label": "#",
1338 "x": 3,
1339 "y": 0
1340 },
1341 {
1342 "label": "$",
1343 "x": 4,
1344 "y": 0
1345 },
1346 {
1347 "label": "%",
1348 "x": 5,
1349 "y": 0
1350 },
1351 {
1352 "label": "^",
1353 "x": 6,
1354 "y": 0
1355 },
1356 {
1357 "label": "&",
1358 "x": 7,
1359 "y": 0
1360 },
1361 {
1362 "label": "*",
1363 "x": 8,
1364 "y": 0
1365 },
1366 {
1367 "label": "(",
1368 "x": 9,
1369 "y": 0
1370 },
1371 {
1372 "label": ")",
1373 "x": 10,
1374 "y": 0
1375 },
1376 {
1377 "label": "_",
1378 "x": 11,
1379 "y": 0
1380 },
1381 {
1382 "label": "+",
1383 "x": 12,
1384 "y": 0
1385 },
1386 {
1387 "x": 13,
1388 "y": 0
1389 },
1390 {
1391 "label": "Back",
1392 "x": 14,
1393 "y": 0
1394 },
1395 {
1396 "label": "Tab",
1397 "x": 0,
1398 "y": 1,
1399 "w": 1.5
1400 },
1401 {
1402 "label": "Q",
1403 "x": 1.5,
1404 "y": 1
1405 },
1406 {
1407 "label": "W",
1408 "x": 2.5,
1409 "y": 1
1410 },
1411 {
1412 "label": "E",
1413 "x": 3.5,
1414 "y": 1
1415 },
1416 {
1417 "label": "R",
1418 "x": 4.5,
1419 "y": 1
1420 },
1421 {
1422 "label": "T",
1423 "x": 5.5,
1424 "y": 1
1425 },
1426 {
1427 "label": "Y",
1428 "x": 6.5,
1429 "y": 1
1430 },
1431 {
1432 "label": "U",
1433 "x": 7.5,
1434 "y": 1
1435 },
1436 {
1437 "label": "I",
1438 "x": 8.5,
1439 "y": 1
1440 },
1441 {
1442 "label": "O",
1443 "x": 9.5,
1444 "y": 1
1445 },
1446 {
1447 "label": "P",
1448 "x": 10.5,
1449 "y": 1
1450 },
1451 {
1452 "label": "{",
1453 "x": 11.5,
1454 "y": 1
1455 },
1456 {
1457 "label": "}",
1458 "x": 12.5,
1459 "y": 1
1460 },
1461 {
1462 "label": "|",
1463 "x": 13.5,
1464 "y": 1,
1465 "w": 1.5
1466 },
1467 {
1468 "label": "Caps Lock",
1469 "x": 0,
1470 "y": 2,
1471 "w": 1.75
1472 },
1473 {
1474 "label": "A",
1475 "x": 1.75,
1476 "y": 2
1477 },
1478 {
1479 "label": "S",
1480 "x": 2.75,
1481 "y": 2
1482 },
1483 {
1484 "label": "D",
1485 "x": 3.75,
1486 "y": 2
1487 },
1488 {
1489 "label": "F",
1490 "x": 4.75,
1491 "y": 2
1492 },
1493 {
1494 "label": "G",
1495 "x": 5.75,
1496 "y": 2
1497 },
1498 {
1499 "label": "H",
1500 "x": 6.75,
1501 "y": 2
1502 },
1503 {
1504 "label": "J",
1505 "x": 7.75,
1506 "y": 2
1507 },
1508 {
1509 "label": "K",
1510 "x": 8.75,
1511 "y": 2
1512 },
1513 {
1514 "label": "L",
1515 "x": 9.75,
1516 "y": 2
1517 },
1518 {
1519 "label": ":",
1520 "x": 10.75,
1521 "y": 2
1522 },
1523 {
1524 "label": "\"",
1525 "x": 11.75,
1526 "y": 2
1527 },
1528 {
1529 "label": "Enter",
1530 "x": 12.75,
1531 "y": 2,
1532 "w": 2.25
1533 },
1534 {
1535 "label": "Shift",
1536 "x": 0,
1537 "y": 3,
1538 "w": 2.25
1539 },
1540 {
1541 "label": "Z",
1542 "x": 2.25,
1543 "y": 3
1544 },
1545 {
1546 "label": "X",
1547 "x": 3.25,
1548 "y": 3
1549 },
1550 {
1551 "label": "C",
1552 "x": 4.25,
1553 "y": 3
1554 },
1555 {
1556 "label": "V",
1557 "x": 5.25,
1558 "y": 3
1559 },
1560 {
1561 "label": "B",
1562 "x": 6.25,
1563 "y": 3
1564 },
1565 {
1566 "label": "N",
1567 "x": 7.25,
1568 "y": 3
1569 },
1570 {
1571 "label": "M",
1572 "x": 8.25,
1573 "y": 3
1574 },
1575 {
1576 "label": "<",
1577 "x": 9.25,
1578 "y": 3
1579 },
1580 {
1581 "label": ">",
1582 "x": 10.25,
1583 "y": 3
1584 },
1585 {
1586 "label": "?",
1587 "x": 11.25,
1588 "y": 3
1589 },
1590 {
1591 "label": "Shift",
1592 "x": 12.25,
1593 "y": 3,
1594 "w": 1.75
1595 },
1596 {
1597 "x": 14,
1598 "y": 3
1599 },
1600 {
1601 "label": "Ctrl",
1602 "x": 0,
1603 "y": 4,
1604 "w": 1.25
1605 },
1606 {
1607 "label": "Win",
1608 "x": 1.25,
1609 "y": 4,
1610 "w": 1.25
1611 },
1612 {
1613 "label": "Alt",
1614 "x": 2.5,
1615 "y": 4,
1616 "w": 1.25
1617 },
1618 {
1619 "x": 3.75,
1620 "y": 4,
1621 "w": 6.25
1622 },
1623 {
1624 "label": "Alt",
1625 "x": 10,
1626 "y": 4,
1627 "w": 1.25
1628 },
1629 {
1630 "label": "Win",
1631 "x": 11.25,
1632 "y": 4,
1633 "w": 1.25
1634 },
1635 {
1636 "label": "Menu",
1637 "x": 12.5,
1638 "y": 4,
1639 "w": 1.25
1640 },
1641 {
1642 "label": "Ctrl",
1643 "x": 13.75,
1644 "y": 4,
1645 "w": 1.25
1646 }
1647 ]
1648 }
1649 }
1650}
diff --git a/keyboards/hs60/v2/keymaps/ansi/config.h b/keyboards/hs60/v2/keymaps/ansi/config.h
new file mode 100644
index 000000000..f51cc16d8
--- /dev/null
+++ b/keyboards/hs60/v2/keymaps/ansi/config.h
@@ -0,0 +1,21 @@
1/*
2Copyright 2018 Yiancar
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#pragma once
18
19/* Include overwrites for specific keymap */
20
21#define HS60_ANSI
diff --git a/keyboards/hs60/v2/keymaps/ansi/keymap.c b/keyboards/hs60/v2/keymaps/ansi/keymap.c
new file mode 100644
index 000000000..923af9e2c
--- /dev/null
+++ b/keyboards/hs60/v2/keymaps/ansi/keymap.c
@@ -0,0 +1,46 @@
1/* Copyright 2018 Yiancar
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18//This is the ANSI version of the PCB
19
20const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
21[0] = LAYOUT_60_ansi( /* Base */
22 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_BSPC,\
23 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,\
24 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
25 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,\
26 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1) , KC_APP, KC_RCTL),
27
28[1] = LAYOUT_60_ansi( /* FN */
29 KC_TRNS, 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_DEL ,\
30 KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET , KC_TRNS,\
31 KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\
32 KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD, KC_TRNS,\
33 KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
34};
35
36void matrix_init_user(void) {
37 //user initialization
38}
39
40void matrix_scan_user(void) {
41 //user matrix
42}
43
44bool process_record_user(uint16_t keycode, keyrecord_t *record) {
45 return true;
46} \ No newline at end of file
diff --git a/keyboards/hs60/v2/keymaps/ansi/readme.md b/keyboards/hs60/v2/keymaps/ansi/readme.md
new file mode 100644
index 000000000..fa811319d
--- /dev/null
+++ b/keyboards/hs60/v2/keymaps/ansi/readme.md
@@ -0,0 +1,6 @@
1The default keymap for ANSI HS60
2================================
3
4![Layout image](https://imgur.com/CSyPw0J.png)
5
6Default layer is normal ANSI and Fn layer is used for RGB functions, Volume control and arrow cluster \ No newline at end of file
diff --git a/keyboards/hs60/v2/keymaps/default/keymap.c b/keyboards/hs60/v2/keymaps/default/keymap.c
new file mode 100644
index 000000000..2a5e82361
--- /dev/null
+++ b/keyboards/hs60/v2/keymaps/default/keymap.c
@@ -0,0 +1,46 @@
1/* Copyright 2018 Yiancar
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18//This is the ISO version of the PCB
19
20const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
21[0] = LAYOUT_60_iso( /* Base */
22 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_BSPC,\
23 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, \
24 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \
25 KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,\
26 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1) , KC_APP, KC_RCTL),
27
28[1] = LAYOUT_60_iso( /* FN */
29 KC_TRNS, 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_DEL ,\
30 KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET , \
31 KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\
32 KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD, KC_TRNS, KC_TRNS,\
33 KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
34};
35
36void matrix_init_user(void) {
37 //user initialization
38}
39
40void matrix_scan_user(void) {
41 //user matrix
42}
43
44bool process_record_user(uint16_t keycode, keyrecord_t *record) {
45 return true;
46} \ No newline at end of file
diff --git a/keyboards/hs60/v2/keymaps/default/readme.md b/keyboards/hs60/v2/keymaps/default/readme.md
new file mode 100644
index 000000000..9125cb349
--- /dev/null
+++ b/keyboards/hs60/v2/keymaps/default/readme.md
@@ -0,0 +1,6 @@
1The default keymap for ISO HS60
2===============================
3
4![Layout image](https://imgur.com/HXj4tYL.png)
5
6Default layer is normal ISO and Fn layer is used for RGB functions, Volume control and arrow cluster \ No newline at end of file
diff --git a/keyboards/hs60/v2/keymaps/hhkb/config.h b/keyboards/hs60/v2/keymaps/hhkb/config.h
new file mode 100644
index 000000000..3db403ecc
--- /dev/null
+++ b/keyboards/hs60/v2/keymaps/hhkb/config.h
@@ -0,0 +1,21 @@
1/*
2Copyright 2018 Yiancar
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#pragma once
18
19/* Include overwrites for specific keymap */
20
21#define HS60_HHKB
diff --git a/keyboards/hs60/v2/keymaps/hhkb/keymap.c b/keyboards/hs60/v2/keymaps/hhkb/keymap.c
new file mode 100644
index 000000000..d52fc4bac
--- /dev/null
+++ b/keyboards/hs60/v2/keymaps/hhkb/keymap.c
@@ -0,0 +1,46 @@
1/* Copyright 2018 Yiancar
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18//This is the HHKB version of the PCB
19
20const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
21[0] = LAYOUT_60_hhkb( /* Base */
22 KC_ESC, 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_GRV, KC_BSLS, \
23 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, \
24 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, \
25 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), \
26 KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL ),
27
28[1] = LAYOUT_60_hhkb( /* FN */
29 RESET, 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_TRNS, KC_TRNS,\
30 KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD, KC_UP, KC_TRNS, KC_DEL, \
31 KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, \
32 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, \
33 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS )
34};
35
36void matrix_init_user(void) {
37 //user initialization
38}
39
40void matrix_scan_user(void) {
41 //user matrix
42}
43
44bool process_record_user(uint16_t keycode, keyrecord_t *record) {
45 return true;
46} \ No newline at end of file
diff --git a/keyboards/hs60/v2/mcuconf.h b/keyboards/hs60/v2/mcuconf.h
new file mode 100644
index 000000000..226da48d5
--- /dev/null
+++ b/keyboards/hs60/v2/mcuconf.h
@@ -0,0 +1,257 @@
1/*
2 ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17#ifndef MCUCONF_H
18#define MCUCONF_H
19
20/*
21 * STM32F3xx drivers configuration.
22 * The following settings override the default settings present in
23 * the various device driver implementation headers.
24 * Note that the settings for each driver only have effect if the whole
25 * driver is enabled in halconf.h.
26 *
27 * IRQ priorities:
28 * 15...0 Lowest...Highest.
29 *
30 * DMA priorities:
31 * 0...3 Lowest...Highest.
32 */
33
34#define STM32F3xx_MCUCONF
35
36/*
37 * HAL driver system settings.
38 */
39#define STM32_NO_INIT FALSE
40#define STM32_PVD_ENABLE FALSE
41#define STM32_PLS STM32_PLS_LEV0
42#define STM32_HSI_ENABLED TRUE
43#define STM32_LSI_ENABLED TRUE
44#define STM32_HSE_ENABLED TRUE
45#define STM32_LSE_ENABLED FALSE
46#define STM32_SW STM32_SW_PLL
47#define STM32_PLLSRC STM32_PLLSRC_HSE
48#define STM32_PREDIV_VALUE 1
49#define STM32_PLLMUL_VALUE 9
50#define STM32_HPRE STM32_HPRE_DIV1
51#define STM32_PPRE1 STM32_PPRE1_DIV2
52#define STM32_PPRE2 STM32_PPRE2_DIV2
53#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
54#define STM32_ADC12PRES STM32_ADC12PRES_DIV1
55#define STM32_ADC34PRES STM32_ADC34PRES_DIV1
56#define STM32_USART1SW STM32_USART1SW_PCLK
57#define STM32_USART2SW STM32_USART2SW_PCLK
58#define STM32_USART3SW STM32_USART3SW_PCLK
59#define STM32_UART4SW STM32_UART4SW_PCLK
60#define STM32_UART5SW STM32_UART5SW_PCLK
61#define STM32_I2C1SW STM32_I2C1SW_SYSCLK
62#define STM32_I2C2SW STM32_I2C2SW_SYSCLK
63#define STM32_TIM1SW STM32_TIM1SW_PCLK2
64#define STM32_TIM8SW STM32_TIM8SW_PCLK2
65#define STM32_RTCSEL STM32_RTCSEL_LSI
66#define STM32_USB_CLOCK_REQUIRED TRUE
67#define STM32_USBPRE STM32_USBPRE_DIV1P5
68
69#undef STM32_HSE_BYPASS
70// #error "oh no"
71// #endif
72
73/*
74 * ADC driver system settings.
75 */
76#define STM32_ADC_DUAL_MODE FALSE
77#define STM32_ADC_COMPACT_SAMPLES FALSE
78#define STM32_ADC_USE_ADC1 FALSE
79#define STM32_ADC_USE_ADC2 FALSE
80#define STM32_ADC_USE_ADC3 FALSE
81#define STM32_ADC_USE_ADC4 FALSE
82#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1)
83#define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 1)
84#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 5)
85#define STM32_ADC_ADC4_DMA_STREAM STM32_DMA_STREAM_ID(2, 2)
86#define STM32_ADC_ADC1_DMA_PRIORITY 2
87#define STM32_ADC_ADC2_DMA_PRIORITY 2
88#define STM32_ADC_ADC3_DMA_PRIORITY 2
89#define STM32_ADC_ADC4_DMA_PRIORITY 2
90#define STM32_ADC_ADC12_IRQ_PRIORITY 5
91#define STM32_ADC_ADC3_IRQ_PRIORITY 5
92#define STM32_ADC_ADC4_IRQ_PRIORITY 5
93#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 5
94#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 5
95#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 5
96#define STM32_ADC_ADC4_DMA_IRQ_PRIORITY 5
97#define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1
98#define STM32_ADC_ADC34_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1
99
100/*
101 * CAN driver system settings.
102 */
103#define STM32_CAN_USE_CAN1 FALSE
104#define STM32_CAN_CAN1_IRQ_PRIORITY 11
105
106/*
107 * DAC driver system settings.
108 */
109#define STM32_DAC_DUAL_MODE FALSE
110#define STM32_DAC_USE_DAC1_CH1 TRUE
111#define STM32_DAC_USE_DAC1_CH2 TRUE
112#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10
113#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10
114#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2
115#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2
116
117/*
118 * EXT driver system settings.
119 */
120#define STM32_EXT_EXTI0_IRQ_PRIORITY 6
121#define STM32_EXT_EXTI1_IRQ_PRIORITY 6
122#define STM32_EXT_EXTI2_IRQ_PRIORITY 6
123#define STM32_EXT_EXTI3_IRQ_PRIORITY 6
124#define STM32_EXT_EXTI4_IRQ_PRIORITY 6
125#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6
126#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6
127#define STM32_EXT_EXTI16_IRQ_PRIORITY 6
128#define STM32_EXT_EXTI17_IRQ_PRIORITY 6
129#define STM32_EXT_EXTI18_IRQ_PRIORITY 6
130#define STM32_EXT_EXTI19_IRQ_PRIORITY 6
131#define STM32_EXT_EXTI20_IRQ_PRIORITY 6
132#define STM32_EXT_EXTI21_22_29_IRQ_PRIORITY 6
133#define STM32_EXT_EXTI30_32_IRQ_PRIORITY 6
134#define STM32_EXT_EXTI33_IRQ_PRIORITY 6
135
136/*
137 * GPT driver system settings.
138 */
139#define STM32_GPT_USE_TIM1 FALSE
140#define STM32_GPT_USE_TIM2 FALSE
141#define STM32_GPT_USE_TIM3 FALSE
142#define STM32_GPT_USE_TIM4 FALSE
143#define STM32_GPT_USE_TIM6 TRUE
144#define STM32_GPT_USE_TIM7 TRUE
145#define STM32_GPT_USE_TIM8 TRUE
146#define STM32_GPT_TIM1_IRQ_PRIORITY 7
147#define STM32_GPT_TIM2_IRQ_PRIORITY 7
148#define STM32_GPT_TIM3_IRQ_PRIORITY 7
149#define STM32_GPT_TIM4_IRQ_PRIORITY 7
150#define STM32_GPT_TIM6_IRQ_PRIORITY 7
151#define STM32_GPT_TIM7_IRQ_PRIORITY 7
152#define STM32_GPT_TIM8_IRQ_PRIORITY 7
153
154/*
155 * I2C driver system settings.
156 */
157#define STM32_I2C_USE_I2C1 TRUE
158#define STM32_I2C_USE_I2C2 FALSE
159#define STM32_I2C_BUSY_TIMEOUT 50
160#define STM32_I2C_I2C1_IRQ_PRIORITY 10
161#define STM32_I2C_I2C2_IRQ_PRIORITY 10
162#define STM32_I2C_USE_DMA TRUE
163#define STM32_I2C_I2C1_DMA_PRIORITY 1
164#define STM32_I2C_I2C2_DMA_PRIORITY 1
165#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure")
166
167/*
168 * ICU driver system settings.
169 */
170#define STM32_ICU_USE_TIM1 FALSE
171#define STM32_ICU_USE_TIM2 FALSE
172#define STM32_ICU_USE_TIM3 FALSE
173#define STM32_ICU_USE_TIM4 FALSE
174#define STM32_ICU_USE_TIM8 FALSE
175#define STM32_ICU_TIM1_IRQ_PRIORITY 7
176#define STM32_ICU_TIM2_IRQ_PRIORITY 7
177#define STM32_ICU_TIM3_IRQ_PRIORITY 7
178#define STM32_ICU_TIM4_IRQ_PRIORITY 7
179#define STM32_ICU_TIM8_IRQ_PRIORITY 7
180
181/*
182 * PWM driver system settings.
183 */
184#define STM32_PWM_USE_ADVANCED FALSE
185#define STM32_PWM_USE_TIM1 FALSE
186#define STM32_PWM_USE_TIM2 FALSE
187#define STM32_PWM_USE_TIM3 FALSE
188#define STM32_PWM_USE_TIM4 FALSE
189#define STM32_PWM_USE_TIM8 FALSE
190#define STM32_PWM_TIM1_IRQ_PRIORITY 7
191#define STM32_PWM_TIM2_IRQ_PRIORITY 7
192#define STM32_PWM_TIM3_IRQ_PRIORITY 7
193#define STM32_PWM_TIM4_IRQ_PRIORITY 7
194#define STM32_PWM_TIM8_IRQ_PRIORITY 7
195
196/*
197 * SERIAL driver system settings.
198 */
199#define STM32_SERIAL_USE_USART1 FALSE
200#define STM32_SERIAL_USE_USART2 FALSE
201#define STM32_SERIAL_USE_USART3 FALSE
202#define STM32_SERIAL_USE_UART4 FALSE
203#define STM32_SERIAL_USE_UART5 FALSE
204#define STM32_SERIAL_USART1_PRIORITY 12
205#define STM32_SERIAL_USART2_PRIORITY 12
206#define STM32_SERIAL_USART3_PRIORITY 12
207#define STM32_SERIAL_UART4_PRIORITY 12
208#define STM32_SERIAL_UART5_PRIORITY 12
209
210/*
211 * SPI driver system settings.
212 */
213#define STM32_SPI_USE_SPI1 FALSE
214#define STM32_SPI_USE_SPI2 FALSE
215#define STM32_SPI_USE_SPI3 FALSE
216#define STM32_SPI_SPI1_DMA_PRIORITY 1
217#define STM32_SPI_SPI2_DMA_PRIORITY 1
218#define STM32_SPI_SPI3_DMA_PRIORITY 1
219#define STM32_SPI_SPI1_IRQ_PRIORITY 10
220#define STM32_SPI_SPI2_IRQ_PRIORITY 10
221#define STM32_SPI_SPI3_IRQ_PRIORITY 10
222#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
223
224/*
225 * ST driver system settings.
226 */
227#define STM32_ST_IRQ_PRIORITY 8
228#define STM32_ST_USE_TIMER 2
229
230/*
231 * UART driver system settings.
232 */
233#define STM32_UART_USE_USART1 FALSE
234#define STM32_UART_USE_USART2 FALSE
235#define STM32_UART_USE_USART3 FALSE
236#define STM32_UART_USART1_IRQ_PRIORITY 12
237#define STM32_UART_USART2_IRQ_PRIORITY 12
238#define STM32_UART_USART3_IRQ_PRIORITY 12
239#define STM32_UART_USART1_DMA_PRIORITY 0
240#define STM32_UART_USART2_DMA_PRIORITY 0
241#define STM32_UART_USART3_DMA_PRIORITY 0
242#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
243
244/*
245 * USB driver system settings.
246 */
247#define STM32_USB_USE_USB1 TRUE
248#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE
249#define STM32_USB_USB1_HP_IRQ_PRIORITY 13
250#define STM32_USB_USB1_LP_IRQ_PRIORITY 14
251
252/*
253 * WDG driver system settings.
254 */
255#define STM32_WDG_USE_IWDG FALSE
256
257#endif /* MCUCONF_H */
diff --git a/keyboards/hs60/v2/readme.md b/keyboards/hs60/v2/readme.md
new file mode 100644
index 000000000..50c91698d
--- /dev/null
+++ b/keyboards/hs60/v2/readme.md
@@ -0,0 +1,18 @@
1HS60 V2.0
2=========
3
4[HS60](https://mechboards.co.uk/wp-content/uploads/2018/04/IMG_20180420_140353.jpg)
5
6This is a standard fixed layout 60% PCB. It comes in three variants; ISO, ANSI and HHKB and support full per-key RGB.
7
8Keyboard Maintainer: [Yiancar](http://yiancar-designs.com/) and on [github](https://github.com/yiancar)
9Hardware Supported: HS60 ISO, ANSI and HHKB PCBs with STM32F303CC
10Hardware Availability: http://groupbuys.mechboards.co.uk/shop/hs60-hotswap-60-pcb/
11
12Due to the RGB implementation, the HS60 is currently not compatible with community layouts.
13
14Make example for this keyboard (after setting up your build environment):
15
16 make hs60/v2:default
17
18See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file
diff --git a/keyboards/hs60/v2/rules.mk b/keyboards/hs60/v2/rules.mk
new file mode 100644
index 000000000..51e3cf0a3
--- /dev/null
+++ b/keyboards/hs60/v2/rules.mk
@@ -0,0 +1,58 @@
1# project specific files
2
3## chip/board settings
4# the next two should match the directories in
5# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
6MCU_FAMILY = STM32
7MCU_SERIES = STM32F3xx
8
9# Linker script to use
10# it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
11# or <this_dir>/ld/
12MCU_LDSCRIPT = STM32F303xC
13
14# Startup code to use
15# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
16MCU_STARTUP = stm32f3xx
17
18# Board: it should exist either in <chibios>/os/hal/boards/
19# or <this_dir>/boards
20BOARD = GENERIC_STM32_F303XC
21
22# Cortex version
23MCU = cortex-m4
24
25# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
26ARMV = 7
27
28USE_FPU = yes
29
30# Vector table for application
31# 0x00000000-0x00001000 area is occupied by bootlaoder.*/
32# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB
33# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000
34OPT_DEFS =
35
36# Do not put the microcontroller into power saving mode
37# when we get USB suspend event. We want it to keep updating
38# backlight effects.
39OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
40
41# Options to pass to dfu-util when flashing
42DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave
43
44# Build Options
45# comment out to disable the options.
46#
47BACKLIGHT_ENABLE = no
48BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
49MOUSEKEY_ENABLE = yes # Mouse keys
50EXTRAKEY_ENABLE = yes # Audio control and System control
51CONSOLE_ENABLE = no # Console for debug
52COMMAND_ENABLE = no # Commands for debug and configuration
53#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
54NKRO_ENABLE = yes # USB Nkey Rollover
55AUDIO_ENABLE = no
56RGB_MATRIX_ENABLE = IS31FL3733 # Use RGB matrix
57NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in
58#SERIAL_LINK_ENABLE = yes
diff --git a/keyboards/hs60/v2/v2.c b/keyboards/hs60/v2/v2.c
new file mode 100644
index 000000000..4289c1fed
--- /dev/null
+++ b/keyboards/hs60/v2/v2.c
@@ -0,0 +1,635 @@
1/* Copyright 2018 Yiancar
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 "v2.h"
17
18//#include "is31fl3733.h"
19
20// Please ignore this is for upcoming features
21/*#ifdef RAW_ENABLE
22
23void raw_hid_receive( uint8_t *data, uint8_t length )
24{
25 uint8_t command = data[0];
26 switch ( command )
27 {
28 case id_protocol_version:
29 {
30 msg_protocol_version *msg = (msg_protocol_version*)&data[1];
31 msg->version = PROTOCOL_VERSION;
32 break;
33 }
34#if USE_KEYMAPS_IN_EEPROM
35 case id_keymap_keycode_load:
36 {
37 msg_keymap_keycode_load *msg = (msg_keymap_keycode_load*)&data[1];
38 msg->keycode = keymap_keycode_load( msg->layer, msg->row, msg->column );
39 break;
40 }
41 case id_keymap_keycode_save:
42 {
43 msg_keymap_keycode_save *msg = (msg_keymap_keycode_save*)&data[1];
44 keymap_keycode_save( msg->layer, msg->row, msg->column, msg->keycode);
45 break;
46 }
47 case id_keymap_default_save:
48 {
49 keymap_default_save();
50 break;
51 }
52#endif // USE_KEYMAPS_IN_EEPROM
53 case id_backlight_config_set_values:
54 {
55 msg_backlight_config_set_values *msg = (msg_backlight_config_set_values*)&data[1];
56 backlight_config_set_values(msg);
57 backlight_config_save();
58 break;
59 }
60 case id_backlight_config_set_alphas_mods:
61 {
62 msg_backlight_config_set_alphas_mods *msg = (msg_backlight_config_set_alphas_mods*)&data[1];
63 backlight_config_set_alphas_mods( msg->alphas_mods );
64 backlight_config_save();
65 break;
66 }
67 case id_backlight_set_key_color:
68 {
69 msg_backlight_set_key_color *msg = (msg_backlight_set_key_color*)&data[1];
70 backlight_set_key_color(msg->row, msg->column, msg->hsv);
71 break;
72 }
73 case id_system_get_state:
74 {
75 msg_system_state *msg = (msg_system_state*)&data[1];
76 msg->value = backlight_get_tick();
77 break;
78 }
79 default:
80 {
81 // Unhandled message.
82 data[0] = id_unhandled;
83 break;
84 }
85 }
86
87 // Return same buffer with values changed
88 raw_hid_send( data, length );
89
90}
91
92#endif*/
93
94#ifdef HS60_ANSI
95
96const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
97/* Refer to IS31 manual for these locations
98 * driver
99 * | R location
100 * | | G location
101 * | | | B location
102 * | | | | */
103 {0, B_1, A_1, C_1}, //MX1
104 {0, E_1, D_1, F_1}, //MX2
105 {0, H_1, G_1, I_1}, //MX3
106 {0, K_1, J_1, L_1}, //MX4
107 {0, B_2, A_2, C_2}, //MX6
108 {0, E_2, D_2, F_2}, //MX7
109 {0, H_2, G_2, I_2}, //MX8
110 {0, K_2, J_2, L_2}, //MX14
111 {0, B_3, A_3, C_3}, //MX11
112 {0, E_3, D_3, F_3}, //MX12
113 {0, H_3, G_3, I_3}, //MX13
114 {0, K_3, J_3, L_3}, //MX19
115 {0, B_4, A_4, C_4}, //MX16
116 {0, E_4, D_4, F_4}, //MX17
117 {0, H_4, G_4, I_4}, //MX18
118 {0, K_4, J_4, L_4}, //MX23
119 {0, B_5, A_5, C_5}, //MX20
120 {0, E_5, D_5, F_5}, //MX21
121 {0, H_5, G_5, I_5}, //MX22
122 {0, K_5, J_5, L_5}, //MX27
123 {0, B_6, A_6, C_6}, //MX24
124 {0, E_6, D_6, F_6}, //MX25
125 {0, H_6, G_6, I_6}, //MX26
126 {0, K_6, J_6, L_6}, //MX31
127 {0, B_7, A_7, C_7}, //MX28
128 {0, E_7, D_7, F_7}, //MX29
129 {0, H_7, G_7, I_7}, //MX30
130 {0, K_7, J_7, L_7}, //MX36
131 {0, B_8, A_8, C_8}, //MX33
132 {0, E_8, D_8, F_8}, //MX34
133 {0, H_8, G_8, I_8}, //MX35
134 {0, K_8, J_8, L_8}, //MX40
135 {0, B_9, A_9, C_9}, //MX37
136 {0, E_9, D_9, F_9}, //MX38
137 {0, H_9, G_9, I_9}, //MX39
138 {0, K_9, J_9, L_9}, //MX44
139 {0, B_10, A_10, C_10}, //MX41
140 {0, E_10, D_10, F_10}, //MX42
141 {0, H_10, G_10, I_10}, //MX43
142 {0, K_10, J_10, L_10}, //MX48
143 {0, B_11, A_11, C_11}, //MX45
144 {0, E_11, D_11, F_11}, //MX46
145 {0, H_11, G_11, I_11}, //MX47
146 {0, K_11, J_11, L_11}, //MX53
147 {0, B_12, A_12, C_12}, //MX50
148 {0, E_12, D_12, F_12}, //MX51
149 {0, H_12, G_12, I_12}, //MX52
150
151 {0, B_13, A_13, C_13}, //MX55
152 {0, E_13, D_13, F_13}, //MX56
153
154 {0, K_13, J_13, L_13}, //MX61
155 {0, B_14, A_14, C_14}, //MX59
156 {0, E_14, D_14, F_14}, //MX57
157 {0, H_14, G_14, I_14}, //MX60
158 {0, K_14, J_14, L_14}, //MX62
159 {0, B_15, A_15, C_15}, //MX5
160 {0, E_15, D_15, F_15}, //MX10
161 {0, H_15, G_15, I_15}, //MX15
162 {0, K_15, J_15, L_15}, //MX32
163
164 {0, E_16, D_16, F_16}, //MX49
165 {0, H_16, G_16, I_16}, //MX54
166 {0, K_16, J_16, L_16}, //MX58
167};
168
169const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
170//
171// MX1, MX6, MX11, MX16, MX20, MX24, MX28, MX33, MX37, MX41, MX45, MX50, MX55, MX59,
172// MX2, MX7, MX12, MX17, MX21, MX25, MX29, MX34, MX38, MX42, MX46, MX51, MX56, ---,
173// MX3, MX8, MX13, MX18, MX22, MX26, MX30, MX35, MX39, MX43, MX47, MX52, MX57, MX60,
174// MX4, ---, MX14, MX19, MX23, MX27, MX31, MX36, MX40, MX44, MX48, MX53, ---, MX61,
175// MX5, MX10, MX15, ---, ---, ---, MX32, ---, ---, ---, MX49, MX54, MX58, MX62
176/* {row | col << 4}
177 * | {x=0..224, y=0..64}
178 * | | modifier
179 * | | | */
180 {{0|(0<<4)}, { 0, 0}, 1}, //MX1
181 {{1|(0<<4)}, { 0, 16}, 1}, //MX2
182 {{2|(0<<4)}, { 0, 32}, 1}, //MX3
183 {{3|(0<<4)}, { 0, 48}, 1}, //MX4
184 {{0|(1<<4)}, { 17, 0}, 0}, //MX6
185 {{1|(1<<4)}, { 17, 16}, 0}, //MX7
186 {{2|(1<<4)}, { 17, 32}, 0}, //MX8
187 {{3|(2<<4)}, { 34, 48}, 0}, //MX14
188 {{0|(2<<4)}, { 34, 0}, 0}, //MX11
189 {{1|(2<<4)}, { 34, 16}, 0}, //MX12
190 {{2|(2<<4)}, { 34, 32}, 0}, //MX13
191 {{3|(3<<4)}, { 51, 48}, 0}, //MX19
192 {{0|(3<<4)}, { 51, 0}, 0}, //MX16
193 {{1|(3<<4)}, { 51, 16}, 0}, //MX17
194 {{2|(3<<4)}, { 51, 32}, 0}, //MX18
195 {{3|(4<<4)}, { 68, 48}, 0}, //MX23
196 {{0|(4<<4)}, { 68, 0}, 0}, //MX20
197 {{1|(4<<4)}, { 68, 16}, 0}, //MX21
198 {{2|(4<<4)}, { 68, 32}, 0}, //MX22
199 {{3|(5<<4)}, { 85, 48}, 0}, //MX27
200 {{0|(5<<4)}, { 85, 0}, 0}, //MX24
201 {{1|(5<<4)}, { 85, 16}, 0}, //MX25
202 {{2|(5<<4)}, { 85, 32}, 0}, //MX26
203 {{3|(6<<4)}, {102, 48}, 0}, //MX31
204 {{0|(6<<4)}, {102, 0}, 0}, //MX28
205 {{1|(6<<4)}, {102, 16}, 0}, //MX29
206 {{2|(6<<4)}, {102, 32}, 0}, //MX30
207 {{3|(7<<4)}, {119, 48}, 0}, //MX36
208 {{0|(7<<4)}, {119, 0}, 0}, //MX33
209 {{1|(7<<4)}, {119, 16}, 0}, //MX34
210 {{2|(7<<4)}, {119, 32}, 0}, //MX35
211 {{3|(8<<4)}, {136, 48}, 0}, //MX40
212 {{0|(8<<4)}, {136, 0}, 0}, //MX37
213 {{1|(8<<4)}, {136, 16}, 0}, //MX38
214 {{2|(8<<4)}, {136, 32}, 0}, //MX39
215 {{3|(9<<4)}, {153, 48}, 0}, //MX44
216 {{0|(9<<4)}, {153, 0}, 0}, //MX41
217 {{1|(9<<4)}, {153, 16}, 0}, //MX42
218 {{2|(9<<4)}, {153, 32}, 0}, //MX43
219 {{3|(10<<4)}, {170, 48}, 0}, //MX48
220 {{0|(10<<4)}, {170, 0}, 0}, //MX45
221 {{1|(10<<4)}, {170, 16}, 0}, //MX46
222 {{2|(10<<4)}, {170, 32}, 0}, //MX47
223 {{3|(11<<4)}, {187, 48}, 0}, //MX53
224 {{0|(11<<4)}, {187, 0}, 0}, //MX50
225 {{1|(11<<4)}, {187, 16}, 0}, //MX51
226 {{2|(11<<4)}, {187, 32}, 0}, //MX52
227
228 {{0|(12<<4)}, {204, 0}, 0}, //MX55
229 {{1|(12<<4)}, {204, 16}, 0}, //MX56
230
231 {{3|(13<<4)}, {221, 48}, 1}, //MX61
232 {{0|(13<<4)}, {221, 0}, 1}, //MX59
233 {{2|(12<<4)}, {221, 16}, 0}, //MX57
234 {{2|(13<<4)}, {221, 32}, 1}, //MX60
235 {{4|(13<<4)}, {221, 64}, 1}, //MX62
236 {{4|(0<<4)}, { 0, 64}, 1}, //MX5
237 {{4|(1<<4)}, { 17, 64}, 1}, //MX10
238 {{4|(2<<4)}, { 34, 64}, 1}, //MX15
239 {{4|(5<<4)}, {102, 64}, 0}, //MX32
240
241 {{4|(10<<4)}, {170, 64}, 1}, //MX49
242 {{4|(11<<4)}, {187, 64}, 1}, //MX54
243 {{4|(12<<4)}, {204, 64}, 1} //MX58
244};
245
246#elif defined(HS60_HHKB)
247
248const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
249/* Refer to IS31 manual for these locations
250 * driver
251 * | R location
252 * | | G location
253 * | | | B location
254 * | | | | */
255 {0, B_1, A_1, C_1}, //MX1
256 {0, E_1, D_1, F_1}, //MX2
257 {0, H_1, G_1, I_1}, //MX3
258 {0, K_1, J_1, L_1}, //MX4
259 {0, B_2, A_2, C_2}, //MX6
260 {0, E_2, D_2, F_2}, //MX7
261 {0, H_2, G_2, I_2}, //MX8
262 {0, K_2, J_2, L_2}, //MX14
263 {0, B_3, A_3, C_3}, //MX11
264 {0, E_3, D_3, F_3}, //MX12
265 {0, H_3, G_3, I_3}, //MX13
266 {0, K_3, J_3, L_3}, //MX19
267 {0, B_4, A_4, C_4}, //MX16
268 {0, E_4, D_4, F_4}, //MX17
269 {0, H_4, G_4, I_4}, //MX18
270 {0, K_4, J_4, L_4}, //MX23
271 {0, B_5, A_5, C_5}, //MX20
272 {0, E_5, D_5, F_5}, //MX21
273 {0, H_5, G_5, I_5}, //MX22
274 {0, K_5, J_5, L_5}, //MX27
275 {0, B_6, A_6, C_6}, //MX24
276 {0, E_6, D_6, F_6}, //MX25
277 {0, H_6, G_6, I_6}, //MX26
278 {0, K_6, J_6, L_6}, //MX31
279 {0, B_7, A_7, C_7}, //MX28
280 {0, E_7, D_7, F_7}, //MX29
281 {0, H_7, G_7, I_7}, //MX30
282 {0, K_7, J_7, L_7}, //MX36
283 {0, B_8, A_8, C_8}, //MX33
284 {0, E_8, D_8, F_8}, //MX34
285 {0, H_8, G_8, I_8}, //MX35
286 {0, K_8, J_8, L_8}, //MX40
287 {0, B_9, A_9, C_9}, //MX37
288 {0, E_9, D_9, F_9}, //MX38
289 {0, H_9, G_9, I_9}, //MX39
290 {0, K_9, J_9, L_9}, //MX44
291 {0, B_10, A_10, C_10}, //MX41
292 {0, E_10, D_10, F_10}, //MX42
293 {0, H_10, G_10, I_10}, //MX43
294 {0, K_10, J_10, L_10}, //MX48
295 {0, B_11, A_11, C_11}, //MX45
296 {0, E_11, D_11, F_11}, //MX46
297 {0, H_11, G_11, I_11}, //MX47
298 {0, K_11, J_11, L_11}, //MX53
299 {0, B_12, A_12, C_12}, //MX50
300 {0, E_12, D_12, F_12}, //MX51
301 {0, H_12, G_12, I_12}, //MX52
302 {0, K_12, J_12, L_12}, //MX64
303 {0, B_13, A_13, C_13}, //MX55
304 {0, E_13, D_13, F_13}, //MX56
305 {0, H_13, G_13, I_13}, //MX63
306 {0, K_13, J_13, L_13}, //MX61
307 {0, B_14, A_14, C_14}, //MX59
308 {0, E_14, D_14, F_14}, //MX57
309 {0, H_14, G_14, I_14}, //MX60
310 {0, K_14, J_14, L_14}, //MX62
311 {0, B_15, A_15, C_15}, //MX5
312 {0, E_15, D_15, F_15}, //MX10
313 {0, H_15, G_15, I_15}, //MX15
314 {0, K_15, J_15, L_15}, //MX32
315
316
317 {0, H_16, G_16, I_16}, //MX54
318 {0, K_16, J_16, L_16}, //MX58
319};
320
321const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
322//
323// MX1, MX6, MX11, MX16, MX20, MX24, MX28, MX33, MX37, MX41, MX45, MX50, MX55, MX59,
324// MX2, MX7, MX12, MX17, MX21, MX25, MX29, MX34, MX38, MX42, MX46, MX51, MX56, MX64,
325// MX3, MX8, MX13, MX18, MX22, MX26, MX30, MX35, MX39, MX43, MX47, MX52, MX57, MX60,
326// MX4, ----, MX14, MX19, MX23, MX27, MX31, MX36, MX40, MX44, MX48, MX53, MX63, MX61,
327// MX5, MX10, MX15, ----, ----, ----, MX32, ----, ---, ----, ----, MX54, MX58, MX62
328/* {row | col << 4}
329 * | {x=0..224, y=0..64}
330 * | | modifier
331 * | | | */
332 {{0|(0<<4)}, { 0, 0}, 1}, //MX1
333 {{1|(0<<4)}, { 0, 16}, 1}, //MX2
334 {{2|(0<<4)}, { 0, 32}, 1}, //MX3
335 {{3|(0<<4)}, { 0, 48}, 1}, //MX4
336 {{0|(1<<4)}, { 17, 0}, 0}, //MX6
337 {{1|(1<<4)}, { 17, 16}, 0}, //MX7
338 {{2|(1<<4)}, { 17, 32}, 0}, //MX8
339 {{3|(2<<4)}, { 34, 48}, 0}, //MX14
340 {{0|(2<<4)}, { 34, 0}, 0}, //MX11
341 {{1|(2<<4)}, { 34, 16}, 0}, //MX12
342 {{2|(2<<4)}, { 34, 32}, 0}, //MX13
343 {{3|(3<<4)}, { 51, 48}, 0}, //MX19
344 {{0|(3<<4)}, { 51, 0}, 0}, //MX16
345 {{1|(3<<4)}, { 51, 16}, 0}, //MX17
346 {{2|(3<<4)}, { 51, 32}, 0}, //MX18
347 {{3|(4<<4)}, { 68, 48}, 0}, //MX23
348 {{0|(4<<4)}, { 68, 0}, 0}, //MX20
349 {{1|(4<<4)}, { 68, 16}, 0}, //MX21
350 {{2|(4<<4)}, { 68, 32}, 0}, //MX22
351 {{3|(5<<4)}, { 85, 48}, 0}, //MX27
352 {{0|(5<<4)}, { 85, 0}, 0}, //MX24
353 {{1|(5<<4)}, { 85, 16}, 0}, //MX25
354 {{2|(5<<4)}, { 85, 32}, 0}, //MX26
355 {{3|(6<<4)}, {102, 48}, 0}, //MX31
356 {{0|(6<<4)}, {102, 0}, 0}, //MX28
357 {{1|(6<<4)}, {102, 16}, 0}, //MX29
358 {{2|(6<<4)}, {102, 32}, 0}, //MX30
359 {{3|(7<<4)}, {119, 48}, 0}, //MX36
360 {{0|(7<<4)}, {119, 0}, 0}, //MX33
361 {{1|(7<<4)}, {119, 16}, 0}, //MX34
362 {{2|(7<<4)}, {119, 32}, 0}, //MX35
363 {{3|(8<<4)}, {136, 48}, 0}, //MX40
364 {{0|(8<<4)}, {136, 0}, 0}, //MX37
365 {{1|(8<<4)}, {136, 16}, 0}, //MX38
366 {{2|(8<<4)}, {136, 32}, 0}, //MX39
367 {{3|(9<<4)}, {153, 48}, 0}, //MX44
368 {{0|(9<<4)}, {153, 0}, 0}, //MX41
369 {{1|(9<<4)}, {153, 16}, 0}, //MX42
370 {{2|(9<<4)}, {153, 32}, 0}, //MX43
371 {{3|(10<<4)}, {170, 48}, 0}, //MX48
372 {{0|(10<<4)}, {170, 0}, 0}, //MX45
373 {{1|(10<<4)}, {170, 16}, 0}, //MX46
374 {{2|(10<<4)}, {170, 32}, 0}, //MX47
375 {{3|(11<<4)}, {187, 48}, 0}, //MX53
376 {{0|(11<<4)}, {187, 0}, 0}, //MX50
377 {{1|(11<<4)}, {187, 16}, 0}, //MX51
378 {{2|(11<<4)}, {187, 32}, 0}, //MX52
379 {{1|(13<<4)}, {221, 0}, 1}, //MX64
380 {{0|(12<<4)}, {204, 0}, 0}, //MX55
381 {{1|(12<<4)}, {204, 16}, 0}, //MX56
382 {{3|(12<<4)}, {204, 48}, 0}, //MX63
383 {{3|(13<<4)}, {212, 48}, 1}, //MX61
384 {{0|(13<<4)}, {221, 0}, 0}, //MX59
385 {{2|(12<<4)}, {221, 16}, 0}, //MX57
386 {{2|(13<<4)}, {221, 32}, 1}, //MX60
387 {{4|(13<<4)}, {221, 64}, 1}, //MX62
388 {{4|(0<<4)}, { 0, 64}, 1}, //MX5
389 {{4|(1<<4)}, { 17, 64}, 1}, //MX10
390 {{4|(2<<4)}, { 34, 64}, 1}, //MX15
391 {{4|(5<<4)}, {102, 64}, 0}, //MX32
392
393
394 {{4|(11<<4)}, {187, 64}, 1}, //MX54
395 {{4|(12<<4)}, {204, 64}, 1} //MX58
396};
397
398#else //ISO layout
399
400const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
401/* Refer to IS31 manual for these locations
402 * driver
403 * | R location
404 * | | G location
405 * | | | B location
406 * | | | | */
407 {0, B_1, A_1, C_1}, //MX1
408 {0, E_1, D_1, F_1}, //MX2
409 {0, H_1, G_1, I_1}, //MX3
410 {0, K_1, J_1, L_1}, //MX4
411 {0, B_2, A_2, C_2}, //MX6
412 {0, E_2, D_2, F_2}, //MX7
413 {0, H_2, G_2, I_2}, //MX8
414 {0, K_2, J_2, L_2}, //MX14
415 {0, B_3, A_3, C_3}, //MX11
416 {0, E_3, D_3, F_3}, //MX12
417 {0, H_3, G_3, I_3}, //MX13
418 {0, K_3, J_3, L_3}, //MX19
419 {0, B_4, A_4, C_4}, //MX16
420 {0, E_4, D_4, F_4}, //MX17
421 {0, H_4, G_4, I_4}, //MX18
422 {0, K_4, J_4, L_4}, //MX23
423 {0, B_5, A_5, C_5}, //MX20
424 {0, E_5, D_5, F_5}, //MX21
425 {0, H_5, G_5, I_5}, //MX22
426 {0, K_5, J_5, L_5}, //MX27
427 {0, B_6, A_6, C_6}, //MX24
428 {0, E_6, D_6, F_6}, //MX25
429 {0, H_6, G_6, I_6}, //MX26
430 {0, K_6, J_6, L_6}, //MX31
431 {0, B_7, A_7, C_7}, //MX28
432 {0, E_7, D_7, F_7}, //MX29
433 {0, H_7, G_7, I_7}, //MX30
434 {0, K_7, J_7, L_7}, //MX36
435 {0, B_8, A_8, C_8}, //MX33
436 {0, E_8, D_8, F_8}, //MX34
437 {0, H_8, G_8, I_8}, //MX35
438 {0, K_8, J_8, L_8}, //MX40
439 {0, B_9, A_9, C_9}, //MX37
440 {0, E_9, D_9, F_9}, //MX38
441 {0, H_9, G_9, I_9}, //MX39
442 {0, K_9, J_9, L_9}, //MX44
443 {0, B_10, A_10, C_10}, //MX41
444 {0, E_10, D_10, F_10}, //MX42
445 {0, H_10, G_10, I_10}, //MX43
446 {0, K_10, J_10, L_10}, //MX48
447 {0, B_11, A_11, C_11}, //MX45
448 {0, E_11, D_11, F_11}, //MX46
449 {0, H_11, G_11, I_11}, //MX47
450 {0, K_11, J_11, L_11}, //MX53
451 {0, B_12, A_12, C_12}, //MX50
452 {0, E_12, D_12, F_12}, //MX51
453 {0, H_12, G_12, I_12}, //MX52
454 {0, K_12, J_12, L_12}, //MX9
455 {0, B_13, A_13, C_13}, //MX55
456 {0, E_13, D_13, F_13}, //MX56
457
458 {0, K_13, J_13, L_13}, //MX61
459 {0, B_14, A_14, C_14}, //MX59
460 {0, E_14, D_14, F_14}, //MX57
461 {0, H_14, G_14, I_14}, //MX60
462 {0, K_14, J_14, L_14}, //MX62
463 {0, B_15, A_15, C_15}, //MX5
464 {0, E_15, D_15, F_15}, //MX10
465 {0, H_15, G_15, I_15}, //MX15
466 {0, K_15, J_15, L_15}, //MX32
467
468 {0, E_16, D_16, F_16}, //MX49
469 {0, H_16, G_16, I_16}, //MX54
470 {0, K_16, J_16, L_16}, //MX58
471};
472
473const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
474//
475// MX1, MX6, MX11, MX16, MX20, MX24, MX28, MX33, MX37, MX41, MX45, MX50, MX55, MX59,
476// MX2, MX7, MX12, MX17, MX21, MX25, MX29, MX34, MX38, MX42, MX46, MX51, MX56, ---,
477// MX3, MX8, MX13, MX18, MX22, MX26, MX30, MX35, MX39, MX43, MX47, MX52, MX57, MX60,
478// MX4, ---, MX14, MX19, MX23, MX27, MX31, MX36, MX40, MX44, MX48, MX53, ---, MX61,
479// MX5, MX10, MX15, ---, ---, ---, MX32, ---, ---, ---, MX49, MX54, MX58, MX62
480/* {row | col << 4}
481 * | {x=0..224, y=0..64}
482 * | | modifier
483 * | | | */
484 {{0|(0<<4)}, { 0, 0}, 1}, //MX1
485 {{1|(0<<4)}, { 0, 16}, 1}, //MX2
486 {{2|(0<<4)}, { 0, 32}, 1}, //MX3
487 {{3|(0<<4)}, { 0, 48}, 1}, //MX4
488 {{0|(1<<4)}, { 17, 0}, 0}, //MX6
489 {{1|(1<<4)}, { 17, 16}, 0}, //MX7
490 {{2|(1<<4)}, { 17, 32}, 0}, //MX8
491 {{3|(2<<4)}, { 34, 48}, 0}, //MX14
492 {{0|(2<<4)}, { 34, 0}, 0}, //MX11
493 {{1|(2<<4)}, { 34, 16}, 0}, //MX12
494 {{2|(2<<4)}, { 34, 32}, 0}, //MX13
495 {{3|(3<<4)}, { 51, 48}, 0}, //MX19
496 {{0|(3<<4)}, { 51, 0}, 0}, //MX16
497 {{1|(3<<4)}, { 51, 16}, 0}, //MX17
498 {{2|(3<<4)}, { 51, 32}, 0}, //MX18
499 {{3|(4<<4)}, { 68, 48}, 0}, //MX23
500 {{0|(4<<4)}, { 68, 0}, 0}, //MX20
501 {{1|(4<<4)}, { 68, 16}, 0}, //MX21
502 {{2|(4<<4)}, { 68, 32}, 0}, //MX22
503 {{3|(5<<4)}, { 85, 48}, 0}, //MX27
504 {{0|(5<<4)}, { 85, 0}, 0}, //MX24
505 {{1|(5<<4)}, { 85, 16}, 0}, //MX25
506 {{2|(5<<4)}, { 85, 32}, 0}, //MX26
507 {{3|(6<<4)}, {102, 48}, 0}, //MX31
508 {{0|(6<<4)}, {102, 0}, 0}, //MX28
509 {{1|(6<<4)}, {102, 16}, 0}, //MX29
510 {{2|(6<<4)}, {102, 32}, 0}, //MX30
511 {{3|(7<<4)}, {119, 48}, 0}, //MX36
512 {{0|(7<<4)}, {119, 0}, 0}, //MX33
513 {{1|(7<<4)}, {119, 16}, 0}, //MX34
514 {{2|(7<<4)}, {119, 32}, 0}, //MX35
515 {{3|(8<<4)}, {136, 48}, 0}, //MX40
516 {{0|(8<<4)}, {136, 0}, 0}, //MX37
517 {{1|(8<<4)}, {136, 16}, 0}, //MX38
518 {{2|(8<<4)}, {136, 32}, 0}, //MX39
519 {{3|(9<<4)}, {153, 48}, 0}, //MX44
520 {{0|(9<<4)}, {153, 0}, 0}, //MX41
521 {{1|(9<<4)}, {153, 16}, 0}, //MX42
522 {{2|(9<<4)}, {153, 32}, 0}, //MX43
523 {{3|(10<<4)}, {170, 48}, 0}, //MX48
524 {{0|(10<<4)}, {170, 0}, 0}, //MX45
525 {{1|(10<<4)}, {170, 16}, 0}, //MX46
526 {{2|(10<<4)}, {170, 32}, 0}, //MX47
527 {{3|(11<<4)}, {187, 48}, 0}, //MX53
528 {{0|(11<<4)}, {187, 0}, 0}, //MX50
529 {{1|(11<<4)}, {187, 16}, 0}, //MX51
530 {{2|(11<<4)}, {187, 32}, 0}, //MX52
531 {{3|(2<<4)}, { 17, 32}, 1}, //MX9
532 {{0|(12<<4)}, {204, 0}, 0}, //MX55
533 {{1|(12<<4)}, {204, 16}, 0}, //MX56
534
535 {{3|(13<<4)}, {221, 48}, 1}, //MX61
536 {{0|(13<<4)}, {221, 0}, 1}, //MX59
537 {{2|(12<<4)}, {204, 32}, 0}, //MX57
538 {{2|(13<<4)}, {221, 24}, 1}, //MX60
539 {{4|(13<<4)}, {221, 64}, 1}, //MX62
540 {{4|(0<<4)}, { 0, 64}, 1}, //MX5
541 {{4|(1<<4)}, { 17, 64}, 1}, //MX10
542 {{4|(2<<4)}, { 34, 64}, 1}, //MX15
543 {{4|(5<<4)}, {102, 64}, 0}, //MX32
544
545 {{4|(10<<4)}, {170, 64}, 1}, //MX49
546 {{4|(11<<4)}, {187, 64}, 1}, //MX54
547 {{4|(12<<4)}, {204, 64}, 1} //MX58
548};
549
550#endif
551
552void bootmagic_lite(void)
553{
554 // The lite version of TMK's bootmagic made by Wilba.
555 // 100% less potential for accidentally making the
556 // keyboard do stupid things.
557
558 // We need multiple scans because debouncing can't be turned off.
559 matrix_scan();
560 wait_ms(10);
561 matrix_scan();
562
563 // If the Esc and space bar are held down on power up,
564 // reset the EEPROM valid state and jump to bootloader.
565 // Assumes Esc is at [0,0] and spacebar is at [4,6].
566 // This isn't very generalized, but we need something that doesn't
567 // rely on user's keymaps in firmware or EEPROM.
568 if ( ( matrix_get_row(0) & (1<<0) ) &&
569 ( matrix_get_row(4) & (1<<6) ) )
570 {
571 // Set the TMK/QMK EEPROM state as invalid.
572 eeconfig_disable();
573 //eeprom_set_valid(false);
574 // Jump to bootloader.
575 bootloader_jump();
576 }
577}
578
579void matrix_init_kb(void) {
580 // put your keyboard start-up code here
581 // runs once when the firmware starts up
582
583 bootmagic_lite();
584
585 // Please ignore this is for upcoming features
586 // If the EEPROM has the magic, the data is good.
587 // OK to load from EEPROM.
588 /*if (eeprom_is_valid())
589 {
590 backlight_config_load();
591
592 // TODO: do something to "turn on" keymaps in EEPROM?
593 }
594 else
595 {
596 // If the EEPROM has not been saved before, or is out of date,
597 // save the default values to the EEPROM. Default values
598 // come from construction of the zeal_backlight_config instance.
599 backlight_config_save();
600
601 // Clear the LED colors stored in EEPROM
602 for ( int row=0; row < MATRIX_ROWS; row++ )
603 {
604 HSV hsv;
605 for ( int column=0; column < MATRIX_COLS; column++ )
606 {
607 hsv.h = rand() & 0xFF;
608 hsv.s = rand() & 0x7F;
609 hsv.v = 255;
610 backlight_set_key_color( row, column, hsv );
611 }
612 }
613 #ifdef USE_KEYMAPS_IN_EEPROM
614 keymap_default_save();
615 #endif
616 // Save the magic number last, in case saving was interrupted
617 eeprom_set_valid(true);
618 }*/
619
620 matrix_init_user();
621}
622
623void matrix_scan_kb(void) {
624
625 matrix_scan_user();
626}
627
628bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
629
630 return process_record_user(keycode, record);
631}
632
633void led_set_kb(uint8_t usb_led) {
634 //backlight_set_indicator_state(usb_led);
635} \ No newline at end of file
diff --git a/keyboards/hs60/v2/v2.h b/keyboards/hs60/v2/v2.h
new file mode 100644
index 000000000..86aeb68a7
--- /dev/null
+++ b/keyboards/hs60/v2/v2.h
@@ -0,0 +1,67 @@
1/* Copyright 2018 Yiancar
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#ifndef HS60_H
17#define HS60_H
18
19#define XXX KC_NO
20
21#include "quantum.h"
22
23// This a shortcut to help you visually see your layout.
24
25#define LAYOUT_60_iso( \
26 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
27 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \
28 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
29 K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \
30 K40, K41, K42, K46, K4A, K4B, K4C, K4D \
31) { \
32 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
33 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, XXX }, \
34 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
35 { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D }, \
36 { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D } \
37}
38
39#define LAYOUT_60_ansi( \
40 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
41 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2C, \
42 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
43 K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \
44 K40, K41, K42, K46, K4A, K4B, K4C, K4D \
45) { \
46 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
47 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, XXX }, \
48 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
49 { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D }, \
50 { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D } \
51}
52
53#define LAYOUT_60_hhkb( \
54 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K1D, \
55 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2C, \
56 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
57 K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
58 K40, K41, K42, K46, K4B, K4C, K4D \
59) { \
60 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
61 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
62 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
63 { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \
64 { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, XXX, K4B, K4C, K4D } \
65}
66
67#endif \ No newline at end of file