diff options
-rw-r--r-- | keyboards/hs60/config.h | 139 | ||||
-rw-r--r-- | keyboards/hs60/hs60.c | 338 | ||||
-rw-r--r-- | keyboards/hs60/hs60.h | 39 | ||||
-rw-r--r-- | keyboards/hs60/keymaps/default/keymap.c | 46 | ||||
-rw-r--r-- | keyboards/hs60/keymaps/default/readme.md | 6 | ||||
-rw-r--r-- | keyboards/hs60/readme.md | 16 | ||||
-rw-r--r-- | keyboards/hs60/rules.mk | 76 |
7 files changed, 660 insertions, 0 deletions
diff --git a/keyboards/hs60/config.h b/keyboards/hs60/config.h new file mode 100644 index 000000000..185b31cf6 --- /dev/null +++ b/keyboards/hs60/config.h | |||
@@ -0,0 +1,139 @@ | |||
1 | /* | ||
2 | Copyright 2018 Yiancar | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation, either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | #ifndef CONFIG_H | ||
19 | #define CONFIG_H | ||
20 | |||
21 | #include "config_common.h" | ||
22 | |||
23 | /* USB Device descriptor parameter */ | ||
24 | #define VENDOR_ID 0xFEED | ||
25 | #define PRODUCT_ID 0x0257 | ||
26 | #define DEVICE_VER 0x0001 | ||
27 | #define MANUFACTURER Yiancar-Designs | ||
28 | #define PRODUCT HS60 | ||
29 | #define DESCRIPTION GH60 compatible, tool free RGB keyboard | ||
30 | |||
31 | /* key matrix size */ | ||
32 | #define MATRIX_ROWS 5 | ||
33 | #define MATRIX_COLS 14 | ||
34 | |||
35 | /* | ||
36 | * Keyboard Matrix Assignments | ||
37 | * | ||
38 | * Change this to how you wired your keyboard | ||
39 | * COLS: AVR pins used for columns, left to right | ||
40 | * ROWS: AVR pins used for rows, top to bottom | ||
41 | * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) | ||
42 | * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) | ||
43 | * | ||
44 | */ | ||
45 | #define MATRIX_ROW_PINS { B0, B1, B2, B3, F7 } | ||
46 | #define MATRIX_COL_PINS { F1, F4, F5, E6, F0, B7, D2, D3, D5, D4, D6, D7, B4, B5 } | ||
47 | #define UNUSED_PINS { B6, C6, C7, F6 } | ||
48 | |||
49 | /* bootloader configuration */ | ||
50 | |||
51 | #define QMK_ESC_OUTPUT B5 // usually COL | ||
52 | #define QMK_ESC_INPUT B2 // usually ROW | ||
53 | |||
54 | /* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ | ||
55 | #define DIODE_DIRECTION COL2ROW | ||
56 | |||
57 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
58 | #define DEBOUNCING_DELAY 5 | ||
59 | |||
60 | /* define if matrix has ghost (lacks anti-ghosting diodes) */ | ||
61 | //#define MATRIX_HAS_GHOST | ||
62 | |||
63 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
64 | #define LOCKING_SUPPORT_ENABLE | ||
65 | /* Locking resynchronize hack */ | ||
66 | #define LOCKING_RESYNC_ENABLE | ||
67 | |||
68 | /* If defined, GRAVE_ESC will always act as ESC when CTRL is held. | ||
69 | * This is userful for the Windows task manager shortcut (ctrl+shift+esc). | ||
70 | */ | ||
71 | // #define GRAVE_ESC_CTRL_OVERRIDE | ||
72 | |||
73 | /* | ||
74 | * Force NKRO | ||
75 | * | ||
76 | * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved | ||
77 | * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the | ||
78 | * makefile for this to work.) | ||
79 | * | ||
80 | * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) | ||
81 | * until the next keyboard reset. | ||
82 | * | ||
83 | * NKRO may prevent your keystrokes from being detected in the BIOS, but it is | ||
84 | * fully operational during normal computer usage. | ||
85 | * | ||
86 | * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) | ||
87 | * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by | ||
88 | * bootmagic, NKRO mode will always be enabled until it is toggled again during a | ||
89 | * power-up. | ||
90 | * | ||
91 | */ | ||
92 | //#define FORCE_NKRO | ||
93 | |||
94 | /* | ||
95 | * Magic Key Options | ||
96 | * | ||
97 | * Magic keys are hotkey commands that allow control over firmware functions of | ||
98 | * the keyboard. They are best used in combination with the HID Listen program, | ||
99 | * found here: https://www.pjrc.com/teensy/hid_listen.html | ||
100 | * | ||
101 | * The options below allow the magic key functionality to be changed. This is | ||
102 | * useful if your keyboard/keypad is missing keys and you want magic key support. | ||
103 | * | ||
104 | */ | ||
105 | |||
106 | /* key combination for magic key command */ | ||
107 | #define IS_COMMAND() ( \ | ||
108 | keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ | ||
109 | ) | ||
110 | |||
111 | /* | ||
112 | * Feature disable options | ||
113 | * These options are also useful to firmware size reduction. | ||
114 | */ | ||
115 | |||
116 | /* disable debug print */ | ||
117 | //#define NO_DEBUG | ||
118 | |||
119 | /* disable print */ | ||
120 | //#define NO_PRINT | ||
121 | |||
122 | /* Backlight options */ | ||
123 | |||
124 | //This is experimental do not enable yet | ||
125 | //#define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) | ||
126 | |||
127 | #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects | ||
128 | #define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended | ||
129 | #define RGB_MATRIX_SKIP_FRAMES 0 | ||
130 | |||
131 | #define DRIVER_ADDR_1 0b1110100 | ||
132 | #define DRIVER_ADDR_2 0b1110101 | ||
133 | |||
134 | #define DRIVER_COUNT 2 | ||
135 | #define DRIVER_1_LED_TOTAL 30 | ||
136 | #define DRIVER_2_LED_TOTAL 32 | ||
137 | #define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL | ||
138 | |||
139 | #endif | ||
diff --git a/keyboards/hs60/hs60.c b/keyboards/hs60/hs60.c new file mode 100644 index 000000000..b4820af27 --- /dev/null +++ b/keyboards/hs60/hs60.c | |||
@@ -0,0 +1,338 @@ | |||
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 "hs60.h" | ||
17 | #include "config.h" | ||
18 | |||
19 | // Please ignore this is for upcoming features | ||
20 | /*#ifdef RAW_ENABLE | ||
21 | |||
22 | void raw_hid_receive( uint8_t *data, uint8_t length ) | ||
23 | { | ||
24 | uint8_t command = data[0]; | ||
25 | switch ( command ) | ||
26 | { | ||
27 | case id_protocol_version: | ||
28 | { | ||
29 | msg_protocol_version *msg = (msg_protocol_version*)&data[1]; | ||
30 | msg->version = PROTOCOL_VERSION; | ||
31 | break; | ||
32 | } | ||
33 | #if USE_KEYMAPS_IN_EEPROM | ||
34 | case id_keymap_keycode_load: | ||
35 | { | ||
36 | msg_keymap_keycode_load *msg = (msg_keymap_keycode_load*)&data[1]; | ||
37 | msg->keycode = keymap_keycode_load( msg->layer, msg->row, msg->column ); | ||
38 | break; | ||
39 | } | ||
40 | case id_keymap_keycode_save: | ||
41 | { | ||
42 | msg_keymap_keycode_save *msg = (msg_keymap_keycode_save*)&data[1]; | ||
43 | keymap_keycode_save( msg->layer, msg->row, msg->column, msg->keycode); | ||
44 | break; | ||
45 | } | ||
46 | case id_keymap_default_save: | ||
47 | { | ||
48 | keymap_default_save(); | ||
49 | break; | ||
50 | } | ||
51 | #endif // USE_KEYMAPS_IN_EEPROM | ||
52 | case id_backlight_config_set_values: | ||
53 | { | ||
54 | msg_backlight_config_set_values *msg = (msg_backlight_config_set_values*)&data[1]; | ||
55 | backlight_config_set_values(msg); | ||
56 | backlight_config_save(); | ||
57 | break; | ||
58 | } | ||
59 | case id_backlight_config_set_alphas_mods: | ||
60 | { | ||
61 | msg_backlight_config_set_alphas_mods *msg = (msg_backlight_config_set_alphas_mods*)&data[1]; | ||
62 | backlight_config_set_alphas_mods( msg->alphas_mods ); | ||
63 | backlight_config_save(); | ||
64 | break; | ||
65 | } | ||
66 | case id_backlight_set_key_color: | ||
67 | { | ||
68 | msg_backlight_set_key_color *msg = (msg_backlight_set_key_color*)&data[1]; | ||
69 | backlight_set_key_color(msg->row, msg->column, msg->hsv); | ||
70 | break; | ||
71 | } | ||
72 | case id_system_get_state: | ||
73 | { | ||
74 | msg_system_state *msg = (msg_system_state*)&data[1]; | ||
75 | msg->value = backlight_get_tick(); | ||
76 | break; | ||
77 | } | ||
78 | default: | ||
79 | { | ||
80 | // Unhandled message. | ||
81 | data[0] = id_unhandled; | ||
82 | break; | ||
83 | } | ||
84 | } | ||
85 | |||
86 | // Return same buffer with values changed | ||
87 | raw_hid_send( data, length ); | ||
88 | |||
89 | } | ||
90 | |||
91 | #endif*/ | ||
92 | |||
93 | const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { | ||
94 | /* Refer to IS31 manual for these locations | ||
95 | * driver | ||
96 | * | R location | ||
97 | * | | G location | ||
98 | * | | | B location | ||
99 | * | | | | */ | ||
100 | {0, C1_1, C3_2, C4_2}, //A1 | ||
101 | {0, C1_2, C2_2, C4_3}, //A2 | ||
102 | {0, C1_3, C2_3, C3_3}, //A3 | ||
103 | {0, C1_4, C2_4, C3_4}, //A4 | ||
104 | {0, C1_5, C2_5, C3_5}, //A5 | ||
105 | {0, C1_6, C2_6, C3_6}, //A6 | ||
106 | {0, C1_7, C2_7, C3_7}, //A7 | ||
107 | {0, C1_8, C2_8, C3_8}, //A8 | ||
108 | {0, C9_1, C8_1, C7_1}, //A9 | ||
109 | {0, C9_2, C8_2, C7_2}, //A10 | ||
110 | {0, C9_3, C8_3, C7_3}, //A11 | ||
111 | {0, C9_4, C8_4, C7_4}, //A12 | ||
112 | {0, C9_5, C8_5, C7_5}, //A13 | ||
113 | {0, C9_6, C8_6, C7_6}, //A14 | ||
114 | {0, C9_7, C8_7, C6_6}, //A15 | ||
115 | {0, C9_8, C7_7, C6_7}, //A16 | ||
116 | |||
117 | {0, C1_9, C3_10, C4_10}, //B1 | ||
118 | {0, C1_10, C2_10, C4_11}, //B2 | ||
119 | {0, C1_11, C2_11, C3_11}, //B3 | ||
120 | {0, C1_12, C2_12, C3_12}, //B4 | ||
121 | {0, C1_13, C2_13, C3_13}, //B5 | ||
122 | {0, C1_14, C2_14, C3_14}, //B6 | ||
123 | {0, C1_15, C2_15, C3_15}, //B7 | ||
124 | {0, C1_16, C2_16, C3_16}, //B8 | ||
125 | {0, C9_9, C8_9, C7_9}, //B9 | ||
126 | {0, C9_10, C8_10, C7_10}, //B10 | ||
127 | {0, C9_11, C8_11, C7_11}, //B11 | ||
128 | {0, C9_12, C8_12, C7_12}, //B12 | ||
129 | {0, C9_13, C8_13, C7_13}, //B13 | ||
130 | {0, C9_14, C8_14, C7_14}, //B14 | ||
131 | |||
132 | {1, C1_1, C3_2, C4_2}, //C1 | ||
133 | {1, C1_2, C2_2, C4_3}, //C2 | ||
134 | {1, C1_3, C2_3, C3_3}, //C3 | ||
135 | {1, C1_4, C2_4, C3_4}, //C4 | ||
136 | {1, C1_5, C2_5, C3_5}, //C5 | ||
137 | {1, C1_6, C2_6, C3_6}, //C6 | ||
138 | {1, C1_7, C2_7, C3_7}, //C7 | ||
139 | {1, C1_8, C2_8, C3_8}, //C8 | ||
140 | {1, C9_1, C8_1, C7_1}, //C9 | ||
141 | {1, C9_2, C8_2, C7_2}, //C10 | ||
142 | {1, C9_3, C8_3, C7_3}, //C11 | ||
143 | {1, C9_4, C8_4, C7_4}, //C12 | ||
144 | {1, C9_5, C8_5, C7_5}, //C13 | ||
145 | {1, C9_6, C8_6, C7_6}, //C14 | ||
146 | {1, C9_7, C8_7, C6_6}, //C15 | ||
147 | {1, C9_8, C7_7, C6_7}, //C16 | ||
148 | |||
149 | {1, C1_9, C3_10, C4_10}, //D1 | ||
150 | {1, C1_10, C2_10, C4_11}, //D2 | ||
151 | {1, C1_11, C2_11, C3_11}, //D3 | ||
152 | {1, C1_12, C2_12, C3_12}, //D4 | ||
153 | {1, C1_13, C2_13, C3_13}, //D5 | ||
154 | {1, C1_14, C2_14, C3_14}, //D6 | ||
155 | {1, C1_15, C2_15, C3_15}, //D7 | ||
156 | {1, C1_16, C2_16, C3_16}, //D8 | ||
157 | {1, C9_9, C8_9, C7_9}, //D9 | ||
158 | {1, C9_10, C8_10, C7_10}, //D10 | ||
159 | {1, C9_11, C8_11, C7_11}, //D11 | ||
160 | {1, C9_12, C8_12, C7_12}, //D12 | ||
161 | {1, C9_13, C8_13, C7_13}, //D13 | ||
162 | {1, C9_14, C8_14, C7_14}, //D14 | ||
163 | {1, C9_15, C8_15, C6_14}, //D15 | ||
164 | {1, C9_16, C7_15, C6_15} //D16 | ||
165 | }; | ||
166 | |||
167 | const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { | ||
168 | // | ||
169 | // C7, C6, C5, C4, C3, C2, C1, A7, A6, A5, A4, A3, A2, A1, | ||
170 | // C8, C9, C10, C11, C12, C13, C14, A8, A9, A10, A11, A12, A13, ---, | ||
171 | // D4, D5, D6, D7, D8, C16, C15, B5, B6, B7, B8, A16, A15, A14, | ||
172 | // D3, D2, D1, D9, D10, D11, D12, B4, B3, B2, B1, B9, ---, B10, | ||
173 | // D16, D15, D14, ---, ---, ---, D13, ---, ---, ---, B14, B13, B12, B11 | ||
174 | /* {row | col << 4} | ||
175 | * | {x=0..224, y=0..64} | ||
176 | * | | modifier | ||
177 | * | | | */ | ||
178 | {{0|(13<<4)}, {224, 0}, 1}, //A1-A16 | ||
179 | {{0|(12<<4)}, {204, 0}, 0}, | ||
180 | {{0|(11<<4)}, {187, 0}, 0}, | ||
181 | {{0|(10<<4)}, {170, 0}, 0}, | ||
182 | {{0|(9<<4)}, {153, 0}, 0}, | ||
183 | {{0|(8<<4)}, {136, 0}, 0}, | ||
184 | {{0|(7<<4)}, {119, 0}, 0}, | ||
185 | {{1|(7<<4)}, {119, 16}, 0}, | ||
186 | {{1|(8<<4)}, {136, 16}, 0}, | ||
187 | {{1|(9<<4)}, {153, 16}, 0}, | ||
188 | {{1|(10<<4)}, {170, 16}, 0}, | ||
189 | {{1|(11<<4)}, {187, 16}, 0}, | ||
190 | {{1|(12<<4)}, {204, 16}, 0}, | ||
191 | {{2|(13<<4)}, {224, 8}, 1}, | ||
192 | {{2|(12<<4)}, {204, 32}, 0}, | ||
193 | {{2|(11<<4)}, {187, 32}, 0}, | ||
194 | |||
195 | {{3|(10<<4)}, {170, 48}, 0}, //B1-B14 | ||
196 | {{3|(9<<4)}, {153, 48}, 0}, | ||
197 | {{3|(8<<4)}, {136, 48}, 0}, | ||
198 | {{3|(7<<4)}, {119, 48}, 0}, | ||
199 | {{2|(7<<4)}, {119, 32}, 0}, | ||
200 | {{2|(8<<4)}, {136, 32}, 0}, | ||
201 | {{2|(9<<4)}, {153, 32}, 0}, | ||
202 | {{2|(10<<4)}, {170, 32}, 0}, | ||
203 | {{3|(11<<4)}, {187, 48}, 0}, | ||
204 | {{3|(13<<4)}, {214, 48}, 1}, | ||
205 | {{4|(13<<4)}, {224, 64}, 1}, | ||
206 | {{4|(12<<4)}, {204, 64}, 1}, | ||
207 | {{4|(11<<4)}, {187, 64}, 1}, | ||
208 | {{4|(10<<4)}, {170, 64}, 1}, | ||
209 | |||
210 | {{0|(6<<4)}, {102, 0}, 0}, //C1-C16 | ||
211 | {{0|(5<<4)}, { 85, 0}, 0}, | ||
212 | {{0|(4<<4)}, { 68, 0}, 0}, | ||
213 | {{0|(3<<4)}, { 51, 0}, 0}, | ||
214 | {{0|(2<<4)}, { 34, 0}, 0}, | ||
215 | {{0|(1<<4)}, { 17, 0}, 0}, | ||
216 | {{0|(0<<4)}, { 0, 0}, 1}, | ||
217 | {{1|(0<<4)}, { 0, 16}, 1}, | ||
218 | {{1|(1<<4)}, { 17, 16}, 0}, | ||
219 | {{1|(2<<4)}, { 34, 16}, 0}, | ||
220 | {{1|(3<<4)}, { 51, 16}, 0}, | ||
221 | {{1|(4<<4)}, { 68, 16}, 0}, | ||
222 | {{1|(5<<4)}, { 85, 16}, 0}, | ||
223 | {{1|(6<<4)}, {102, 16}, 0}, | ||
224 | {{2|(6<<4)}, {102, 32}, 0}, | ||
225 | {{2|(5<<4)}, { 85, 32}, 0}, | ||
226 | |||
227 | {{3|(2<<4)}, { 32, 48}, 0}, //D1-D16 | ||
228 | {{3|(1<<4)}, { 17, 48}, 0}, | ||
229 | {{3|(0<<4)}, { 0, 48}, 1}, | ||
230 | {{2|(0<<4)}, { 0, 32}, 1}, | ||
231 | {{2|(1<<4)}, { 17, 32}, 0}, | ||
232 | {{2|(2<<4)}, { 34, 32}, 0}, | ||
233 | {{2|(3<<4)}, { 51, 32}, 0}, | ||
234 | {{2|(4<<4)}, { 68, 32}, 0}, | ||
235 | {{3|(3<<4)}, { 51, 48}, 0}, | ||
236 | {{3|(4<<4)}, { 68, 48}, 0}, | ||
237 | {{3|(5<<4)}, { 85, 48}, 0}, | ||
238 | {{3|(6<<4)}, {102, 48}, 0}, | ||
239 | {{4|(3<<4)}, {102, 64}, 0}, | ||
240 | {{4|(2<<4)}, { 34, 68}, 1}, | ||
241 | {{4|(1<<4)}, { 17, 68}, 1}, | ||
242 | {{4|(0<<4)}, { 0, 68}, 1} | ||
243 | }; | ||
244 | |||
245 | void bootmagic_lite(void) | ||
246 | { | ||
247 | // The lite version of TMK's bootmagic made by Wilba. | ||
248 | // 100% less potential for accidentally making the | ||
249 | // keyboard do stupid things. | ||
250 | |||
251 | // We need multiple scans because debouncing can't be turned off. | ||
252 | matrix_scan(); | ||
253 | wait_ms(DEBOUNCING_DELAY); | ||
254 | matrix_scan(); | ||
255 | |||
256 | // If the Esc and space bar are held down on power up, | ||
257 | // reset the EEPROM valid state and jump to bootloader. | ||
258 | // Assumes Esc is at [0,0] and spacebar is at [4,6]. | ||
259 | // This isn't very generalized, but we need something that doesn't | ||
260 | // rely on user's keymaps in firmware or EEPROM. | ||
261 | if ( ( matrix_get_row(0) & (1<<0) ) && | ||
262 | ( matrix_get_row(4) & (1<<6) ) ) | ||
263 | { | ||
264 | // Set the TMK/QMK EEPROM state as invalid. | ||
265 | eeconfig_disable(); | ||
266 | //eeprom_set_valid(false); | ||
267 | // Jump to bootloader. | ||
268 | bootloader_jump(); | ||
269 | } | ||
270 | } | ||
271 | |||
272 | void matrix_init_kb(void) { | ||
273 | // put your keyboard start-up code here | ||
274 | // runs once when the firmware starts up | ||
275 | |||
276 | bootmagic_lite(); | ||
277 | |||
278 | // Please ignore this is for upcoming features | ||
279 | // If the EEPROM has the magic, the data is good. | ||
280 | // OK to load from EEPROM. | ||
281 | /*if (eeprom_is_valid()) | ||
282 | { | ||
283 | backlight_config_load(); | ||
284 | |||
285 | // TODO: do something to "turn on" keymaps in EEPROM? | ||
286 | } | ||
287 | else | ||
288 | { | ||
289 | // If the EEPROM has not been saved before, or is out of date, | ||
290 | // save the default values to the EEPROM. Default values | ||
291 | // come from construction of the zeal_backlight_config instance. | ||
292 | backlight_config_save(); | ||
293 | |||
294 | // Clear the LED colors stored in EEPROM | ||
295 | for ( int row=0; row < MATRIX_ROWS; row++ ) | ||
296 | { | ||
297 | HSV hsv; | ||
298 | for ( int column=0; column < MATRIX_COLS; column++ ) | ||
299 | { | ||
300 | hsv.h = rand() & 0xFF; | ||
301 | hsv.s = rand() & 0x7F; | ||
302 | hsv.v = 255; | ||
303 | backlight_set_key_color( row, column, hsv ); | ||
304 | } | ||
305 | } | ||
306 | #ifdef USE_KEYMAPS_IN_EEPROM | ||
307 | keymap_default_save(); | ||
308 | #endif | ||
309 | // Save the magic number last, in case saving was interrupted | ||
310 | eeprom_set_valid(true); | ||
311 | }*/ | ||
312 | |||
313 | matrix_init_user(); | ||
314 | } | ||
315 | |||
316 | void matrix_scan_kb(void) { | ||
317 | |||
318 | matrix_scan_user(); | ||
319 | } | ||
320 | |||
321 | bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | ||
322 | |||
323 | return process_record_user(keycode, record); | ||
324 | } | ||
325 | |||
326 | void led_set_kb(uint8_t usb_led) { | ||
327 | //backlight_set_indicator_state(usb_led); | ||
328 | } | ||
329 | |||
330 | void suspend_power_down_kb(void) | ||
331 | { | ||
332 | rgb_matrix_set_suspend_state(true); | ||
333 | } | ||
334 | |||
335 | void suspend_wakeup_init_kb(void) | ||
336 | { | ||
337 | rgb_matrix_set_suspend_state(false); | ||
338 | } \ No newline at end of file | ||
diff --git a/keyboards/hs60/hs60.h b/keyboards/hs60/hs60.h new file mode 100644 index 000000000..b6de3b151 --- /dev/null +++ b/keyboards/hs60/hs60.h | |||
@@ -0,0 +1,39 @@ | |||
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 | #endif | ||
diff --git a/keyboards/hs60/keymaps/default/keymap.c b/keyboards/hs60/keymaps/default/keymap.c new file mode 100644 index 000000000..2a5e82361 --- /dev/null +++ b/keyboards/hs60/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 | |||
20 | const 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 | |||
36 | void matrix_init_user(void) { | ||
37 | //user initialization | ||
38 | } | ||
39 | |||
40 | void matrix_scan_user(void) { | ||
41 | //user matrix | ||
42 | } | ||
43 | |||
44 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
45 | return true; | ||
46 | } \ No newline at end of file | ||
diff --git a/keyboards/hs60/keymaps/default/readme.md b/keyboards/hs60/keymaps/default/readme.md new file mode 100644 index 000000000..cf1ac7a96 --- /dev/null +++ b/keyboards/hs60/keymaps/default/readme.md | |||
@@ -0,0 +1,6 @@ | |||
1 | The default keymap for ISO HS60 | ||
2 | =============================== | ||
3 | |||
4 |  | ||
5 | |||
6 | Default 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/readme.md b/keyboards/hs60/readme.md new file mode 100644 index 000000000..15ecac6cd --- /dev/null +++ b/keyboards/hs60/readme.md | |||
@@ -0,0 +1,16 @@ | |||
1 | HS60 | ||
2 | ==== | ||
3 | |||
4 | [HS60](https://mechboards.co.uk/wp-content/uploads/2018/04/IMG_20180420_140353.jpg) | ||
5 | |||
6 | This is a standard fixed layout 60% PCB. It comes in two varians, ISO and ANSI and support full per-key RGB. | ||
7 | |||
8 | Keyboard Maintainer: [Yiancar](http://yiancar-designs.com/) and on [github](https://github.com/yiancar) | ||
9 | Hardware Supported: HS60 ISO and ANSI PCBs with Atmega 32u4 | ||
10 | Hardware Availability: https://mechboards.co.uk/shop/all/hs60-pcb/ | ||
11 | |||
12 | Make example for this keyboard (after setting up your build environment): | ||
13 | |||
14 | make hs60:default | ||
15 | |||
16 | See [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/rules.mk new file mode 100644 index 000000000..050a1293e --- /dev/null +++ b/keyboards/hs60/rules.mk | |||
@@ -0,0 +1,76 @@ | |||
1 | # MCU name | ||
2 | #MCU = at90usb1286 | ||
3 | MCU = atmega32u4 | ||
4 | |||
5 | # project specific files | ||
6 | #SRC = | ||
7 | |||
8 | # Processor frequency. | ||
9 | # This will define a symbol, F_CPU, in all source code files equal to the | ||
10 | # processor frequency in Hz. You can then use this symbol in your source code to | ||
11 | # calculate timings. Do NOT tack on a 'UL' at the end, this will be done | ||
12 | # automatically to create a 32-bit value in your source code. | ||
13 | # | ||
14 | # This will be an integer division of F_USB below, as it is sourced by | ||
15 | # F_USB after it has run through any CPU prescalers. Note that this value | ||
16 | # does not *change* the processor frequency - it should merely be updated to | ||
17 | # reflect the processor speed set externally so that the code can use accurate | ||
18 | # software delays. | ||
19 | F_CPU = 16000000 | ||
20 | |||
21 | |||
22 | # | ||
23 | # LUFA specific | ||
24 | # | ||
25 | # Target architecture (see library "Board Types" documentation). | ||
26 | ARCH = AVR8 | ||
27 | |||
28 | # Input clock frequency. | ||
29 | # This will define a symbol, F_USB, in all source code files equal to the | ||
30 | # input clock frequency (before any prescaling is performed) in Hz. This value may | ||
31 | # differ from F_CPU if prescaling is used on the latter, and is required as the | ||
32 | # raw input clock is fed directly to the PLL sections of the AVR for high speed | ||
33 | # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' | ||
34 | # at the end, this will be done automatically to create a 32-bit value in your | ||
35 | # source code. | ||
36 | # | ||
37 | # If no clock division is performed on the input clock inside the AVR (via the | ||
38 | # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. | ||
39 | F_USB = $(F_CPU) | ||
40 | |||
41 | # Interrupt driven control endpoint task(+60) | ||
42 | OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT | ||
43 | |||
44 | # Boot Section | ||
45 | BOOTLOADER = qmk-dfu | ||
46 | |||
47 | # Do not put the microcontroller into power saving mode | ||
48 | # when we get USB suspend event. We want it to keep updating | ||
49 | # backlight effects. | ||
50 | OPT_DEFS += -DNO_SUSPEND_POWER_DOWN | ||
51 | |||
52 | # Build Options | ||
53 | # change yes to no to disable | ||
54 | # | ||
55 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) | ||
56 | MOUSEKEY_ENABLE = no # Mouse keys(+4700) | ||
57 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | ||
58 | CONSOLE_ENABLE = no # Console for debug(+400) | ||
59 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
60 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
61 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
62 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
63 | NKRO_ENABLE = yes # USB Nkey Rollover | ||
64 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default | ||
65 | MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) | ||
66 | UNICODE_ENABLE = no # Unicode | ||
67 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID | ||
68 | AUDIO_ENABLE = no # Audio output on port C6 | ||
69 | FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches | ||
70 | RGB_MATRIX_ENABLE = yes # Use RGB matrix | ||
71 | |||
72 | LAYOUTS = 60_iso # Define standard layouts | ||
73 | |||
74 | # Experimental features for zealcmd please do no enable | ||
75 | #RAW_ENABLE = yes | ||
76 | #USE_KEYMAPS_IN_EEPROM = yes | ||