aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilba6582 <Wilba6582@users.noreply.github.com>2018-09-14 04:37:13 +1000
committerJack Humbert <jack.humb@gmail.com>2018-09-13 14:37:13 -0400
commit48a992f1c037658bbacccefd2709ffdcda8bb345 (patch)
treef1583b0eaef1c366b896a11db6f8dd17ce2da9b5
parent170de1273cde78d93b3f955aca133a4d690742b2 (diff)
downloadqmk_firmware-48a992f1c037658bbacccefd2709ffdcda8bb345.tar.gz
qmk_firmware-48a992f1c037658bbacccefd2709ffdcda8bb345.zip
Zeal60/Zeal65/M60-A implementation (#3879)
* Initial version of zeal60 * WIP * Fixes issue #900 * Adding RGB underglow functionality. Fixed a compile-time conflict caused by enabling RGB underglow functionality. * Refactor RPC protocol * Fix last merge * README for RGB underglow updated. * Additional README changes. * Adding RGBW strip software-based current-limiting functionality. * RGBW current-limiting functionality should be handled by RGBSTRIP_MAX_CURRENT_PER_LIGHT instead. * Updated README to reflect implementation of built-in current limiting. * Keymap readability improvements. * Minor keymap improvements. * Fixed LED driver init sequence, formatting * Dimming implementation tested, working. * Stab LEDs synced with spacebar hits in effects. * RGB underglow tested and functional. Simplified README for RGB underglow. * Undid accidental file deletion from previous merge conflict. Safer values for RGB underglow. * Improved arrow key positions in keymap. * Added functionality to correct uneven RGB underglow. Refactored related code. * Reverted to safer values for underglow. * Changes for v0.3 * Custom LED brightness scaling will take place after current adjustment in order to avoid being overridden. * Create keymap.c Added split backspace and split shift to ISO layout * Create config.h Turned on LEDs for new layout * Fixed bug where left spacebar stabilizer LED (LC06) would adopt color of row above. * Added hhkb_wilba keymap * Update keymap.c * Update keymap.c * Update keymap.c * Added indicators, full param setting via host * Added "mousekey" layout * Added Zeal65 support, factory test mode * Keycode safe range changed, caused bugs * Bumped EEPROM version due to change in QMK keycodes * Disable HHKB "blocked" LEDs if KC_NO in keymap * Added "disable_hhkb_blocker_leds" * Required overridden function for keymaps in EEPROM * Added polar coordinate mapping, effect speed * Force Raw HID interface number to 1 always * Fixed last merge from master * Added effect speed to default keymaps * add BACKLIGHT_ prefix to vars * add BACKLIGHT_ prefix to vars * Keymap speed effect; keymap improvements/fixes Readme updated to match changes * Refactored to use common IS31FL3731/I2C drivers * Fixed make rules, backlight disabled feature * Make split rightshift default for Zeal65 * Added M60-A as a "version" of Zeal60. * Renamed IS31FL3731 driver functions * Fix suspend_wakeup_init_kb() being defined twice * First pass refactor dynamic keymaps * Updated to changed I2C and ISSI drivers * Refactor zeal_color.* usage to quantum/color.* * Updated Zeal65, fixed dynamic_keymap * Major refactoring of Zeal60 backlight and API * Lots of little cleanups * Added readme.md * Added readme.md * Added LAYOUT_60*() macros, refactored and cleaned up default keymaps * Fix compile error in suspend.c * Added Zeal65 LAYOUT macros, info.json * Added rama/m60_a, deleted zeal60/keymaps/m60_a * Fixed rama/m60_a/keymaps/proto * Fixed compilation error for suspend.c * Requested changes for PR * Fixed readme.md images * Another readme.md fix * Added drashna's requested changes
-rw-r--r--common_features.mk5
-rw-r--r--keyboards/rama/m60_a/config.h128
-rw-r--r--keyboards/rama/m60_a/info.json13
-rw-r--r--keyboards/rama/m60_a/keymaps/default/keymap.c40
-rw-r--r--keyboards/rama/m60_a/keymaps/proto/config.h5
-rw-r--r--keyboards/rama/m60_a/keymaps/proto/keymap.c40
-rw-r--r--keyboards/rama/m60_a/m60_a.c18
-rw-r--r--keyboards/rama/m60_a/m60_a.h37
-rw-r--r--keyboards/rama/m60_a/readme.md15
-rw-r--r--keyboards/rama/m60_a/rules.mk79
-rw-r--r--keyboards/zeal60/config.h125
-rw-r--r--keyboards/zeal60/info.json25
-rw-r--r--keyboards/zeal60/keymaps/ansi_split_bs_rshift/config.h21
-rw-r--r--keyboards/zeal60/keymaps/ansi_split_bs_rshift/keymap.c38
-rw-r--r--keyboards/zeal60/keymaps/default/config.h20
-rw-r--r--keyboards/zeal60/keymaps/default/keymap.c38
-rw-r--r--keyboards/zeal60/keymaps/hhkb/config.h20
-rw-r--r--keyboards/zeal60/keymaps/hhkb/keymap.c38
-rw-r--r--keyboards/zeal60/keymaps/iso/config.h20
-rw-r--r--keyboards/zeal60/keymaps/iso/keymap.c38
-rw-r--r--keyboards/zeal60/keymaps/ryanmaclean/config.h21
-rw-r--r--keyboards/zeal60/keymaps/ryanmaclean/keymap.c84
-rw-r--r--keyboards/zeal60/keymaps/tusing/Makefile6
-rw-r--r--keyboards/zeal60/keymaps/tusing/README.md80
-rw-r--r--keyboards/zeal60/keymaps/tusing/config.h40
-rw-r--r--keyboards/zeal60/keymaps/tusing/keymap.c49
-rw-r--r--keyboards/zeal60/readme.md47
-rw-r--r--keyboards/zeal60/rgb_backlight.c1519
-rw-r--r--keyboards/zeal60/rgb_backlight.h101
-rw-r--r--keyboards/zeal60/rgb_backlight_api.h42
-rw-r--r--keyboards/zeal60/rgb_backlight_keycodes.h34
-rw-r--r--keyboards/zeal60/rules.mk78
-rw-r--r--keyboards/zeal60/zeal60.c341
-rw-r--r--keyboards/zeal60/zeal60.h93
-rw-r--r--keyboards/zeal60/zeal60_api.h33
-rw-r--r--keyboards/zeal60/zeal60_keycodes.h42
-rw-r--r--keyboards/zeal65/config.h125
-rw-r--r--keyboards/zeal65/info.json16
-rw-r--r--keyboards/zeal65/keymaps/default/config.h5
-rw-r--r--keyboards/zeal65/keymaps/default/keymap.c38
-rw-r--r--keyboards/zeal65/keymaps/split_bs/config.h5
-rw-r--r--keyboards/zeal65/keymaps/split_bs/keymap.c38
-rw-r--r--keyboards/zeal65/readme.md16
-rw-r--r--keyboards/zeal65/rules.mk79
-rw-r--r--keyboards/zeal65/zeal65.c18
-rw-r--r--keyboards/zeal65/zeal65.h50
-rw-r--r--quantum/dynamic_keymap.c97
-rw-r--r--quantum/dynamic_keymap.h31
-rw-r--r--tmk_core/common/avr/suspend.c37
49 files changed, 3912 insertions, 16 deletions
diff --git a/common_features.mk b/common_features.mk
index e0d4ca297..c637582d4 100644
--- a/common_features.mk
+++ b/common_features.mk
@@ -227,6 +227,11 @@ ifeq ($(strip $(HD44780_ENABLE)), yes)
227 OPT_DEFS += -DHD44780_ENABLE 227 OPT_DEFS += -DHD44780_ENABLE
228endif 228endif
229 229
230ifeq ($(strip $(DYNAMIC_KEYMAP_ENABLE)), yes)
231 OPT_DEFS += -DDYNAMIC_KEYMAP_ENABLE
232 SRC += $(QUANTUM_DIR)/dynamic_keymap.c
233endif
234
230QUANTUM_SRC:= \ 235QUANTUM_SRC:= \
231 $(QUANTUM_DIR)/quantum.c \ 236 $(QUANTUM_DIR)/quantum.c \
232 $(QUANTUM_DIR)/keymap_common.c \ 237 $(QUANTUM_DIR)/keymap_common.c \
diff --git a/keyboards/rama/m60_a/config.h b/keyboards/rama/m60_a/config.h
new file mode 100644
index 000000000..45e7d8896
--- /dev/null
+++ b/keyboards/rama/m60_a/config.h
@@ -0,0 +1,128 @@
1/* Copyright 2017 Jason Williams (Wilba)
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#include "config_common.h"
19
20// USB Device descriptor parameter
21#define VENDOR_ID 0xFEED // This is same as Zeal60 for now
22#define PRODUCT_ID 0x6060 // This is same as Zeal60 for now
23#define DEVICE_VER 0x0001
24#define MANUFACTURER RAMA.WORKS
25#define PRODUCT RAMA M60-A
26#define DESCRIPTION RAMA M60-A Keyboard
27
28
29
30// key matrix size
31#define MATRIX_ROWS 5
32#define MATRIX_COLS 14
33
34// Zeal60 PCB default pin-out
35#define MATRIX_ROW_PINS { F0, F1, F4, F6, F7 }
36#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6 }
37#define UNUSED_PINS
38
39// IS31FL3731 driver
40#define DRIVER_COUNT 2
41#define DRIVER_LED_TOTAL 72
42
43// COL2ROW or ROW2COL
44#define DIODE_DIRECTION COL2ROW
45
46// Set 0 if debouncing isn't needed
47#define DEBOUNCING_DELAY 5
48
49// Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap
50#define LOCKING_SUPPORT_ENABLE
51// Locking resynchronize hack
52#define LOCKING_RESYNC_ENABLE
53
54// key combination for command
55#define IS_COMMAND() ( \
56 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
57)
58
59/*
60 * Feature disable options
61 * These options are also useful to firmware size reduction.
62 */
63
64// disable debug print
65//#define NO_DEBUG
66
67// disable print
68//#define NO_PRINT
69
70// disable action features
71//#define NO_ACTION_LAYER
72//#define NO_ACTION_TAPPING
73//#define NO_ACTION_ONESHOT
74//#define NO_ACTION_MACRO
75//#define NO_ACTION_FUNCTION
76
77#define RGB_BACKLIGHT_ENABLED 1
78
79// This conditionally compiles the backlight code for M60-A specifics
80#define RGB_BACKLIGHT_M60_A
81
82// enable/disable LEDs based on layout
83// they aren't really used if RGB_BACKLIGHT_M60_A defined
84#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 1
85#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0
86#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 1
87#define RGB_BACKLIGHT_USE_7U_SPACEBAR 1
88#define RGB_BACKLIGHT_USE_ISO_ENTER 0
89#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 1
90
91// disable backlight when USB suspended (PC sleep/hibernate/shutdown)
92#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0
93
94// disable backlight after timeout in minutes, 0 = no timeout
95#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0
96
97// the default effect (RGB test)
98#define RGB_BACKLIGHT_EFFECT 255
99
100// These define which keys in the matrix are alphas/mods
101// Used for backlight effects so colors are different for
102// alphas vs. mods
103// Each value is for a row, bit 0 is column 0
104// Alpha=0 Mod=1
105#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0000000000000001
106#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0010000000000001
107#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0011000000000001
108#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0011000000000001
109#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011100000000111
110
111#define DYNAMIC_KEYMAP_LAYER_COUNT 4
112
113// EEPROM usage
114
115// TODO: refactor with new user EEPROM code (coming soon)
116#define EEPROM_MAGIC 0x451F
117#define EEPROM_MAGIC_ADDR 32
118// Bump this every time we change what we store
119// This will automatically reset the EEPROM with defaults
120// and avoid loading invalid data from the EEPROM
121#define EEPROM_VERSION 0x07
122#define EEPROM_VERSION_ADDR 34
123
124// Backlight config starts after EEPROM version
125#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35
126// Dynamic keymap starts after backlight config (35+37)
127#define DYNAMIC_KEYMAP_EEPROM_ADDR 72
128
diff --git a/keyboards/rama/m60_a/info.json b/keyboards/rama/m60_a/info.json
new file mode 100644
index 000000000..577becd21
--- /dev/null
+++ b/keyboards/rama/m60_a/info.json
@@ -0,0 +1,13 @@
1{
2 "keyboard_name": "M60-A",
3 "url": "",
4 "maintainer": "Wilba",
5 "bootloader": "DFU",
6 "width": 15,
7 "height": 5,
8 "layouts": {
9 "LAYOUT_60_hhkb": {
10 "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Delete", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}]
11 }
12 }
13} \ No newline at end of file
diff --git a/keyboards/rama/m60_a/keymaps/default/keymap.c b/keyboards/rama/m60_a/keymaps/default/keymap.c
new file mode 100644
index 000000000..7b6d9b756
--- /dev/null
+++ b/keyboards/rama/m60_a/keymaps/default/keymap.c
@@ -0,0 +1,40 @@
1// M60-A layout
2#include QMK_KEYBOARD_H
3
4const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
5
6// Default layer
7[0] = LAYOUT_60_hhkb(
8 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_BSLS, KC_DEL,
9 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,
10 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,
11 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, FN_MO13,
12 KC_LGUI, KC_LALT, KC_SPC, KC_RALT, FN_MO23),
13
14// Fn1 Layer
15[1] = LAYOUT_60_hhkb(
16 KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL,
17 KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS,
18 KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS,
19 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS,
20 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
21
22// Fn2 Layer
23[2] = LAYOUT_60_hhkb(
24 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
25 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
26 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
27 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
28 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
29
30// Fn3 Layer (zeal60 Configuration)
31[3] = LAYOUT_60_hhkb(
32 KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS, KC_TRNS,
33 KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, ES_DEC, ES_INC, KC_TRNS,
34 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
35 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
36 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
37
38};
39
40
diff --git a/keyboards/rama/m60_a/keymaps/proto/config.h b/keyboards/rama/m60_a/keymaps/proto/config.h
new file mode 100644
index 000000000..54a185ff1
--- /dev/null
+++ b/keyboards/rama/m60_a/keymaps/proto/config.h
@@ -0,0 +1,5 @@
1#pragma once
2
3// This fixes the diodes mounted reversed (fab fail) on M60-A prototype
4#undef DIODE_DIRECTION
5#define DIODE_DIRECTION ROW2COL
diff --git a/keyboards/rama/m60_a/keymaps/proto/keymap.c b/keyboards/rama/m60_a/keymaps/proto/keymap.c
new file mode 100644
index 000000000..7b6d9b756
--- /dev/null
+++ b/keyboards/rama/m60_a/keymaps/proto/keymap.c
@@ -0,0 +1,40 @@
1// M60-A layout
2#include QMK_KEYBOARD_H
3
4const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
5
6// Default layer
7[0] = LAYOUT_60_hhkb(
8 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_BSLS, KC_DEL,
9 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,
10 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,
11 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, FN_MO13,
12 KC_LGUI, KC_LALT, KC_SPC, KC_RALT, FN_MO23),
13
14// Fn1 Layer
15[1] = LAYOUT_60_hhkb(
16 KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL,
17 KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS,
18 KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS,
19 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS,
20 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
21
22// Fn2 Layer
23[2] = LAYOUT_60_hhkb(
24 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
25 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
26 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
27 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
28 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
29
30// Fn3 Layer (zeal60 Configuration)
31[3] = LAYOUT_60_hhkb(
32 KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS, KC_TRNS,
33 KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, ES_DEC, ES_INC, KC_TRNS,
34 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
35 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
36 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
37
38};
39
40
diff --git a/keyboards/rama/m60_a/m60_a.c b/keyboards/rama/m60_a/m60_a.c
new file mode 100644
index 000000000..80a98460d
--- /dev/null
+++ b/keyboards/rama/m60_a/m60_a.c
@@ -0,0 +1,18 @@
1/* Copyright 2017 Jason Williams (Wilba)
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 RGB_BACKLIGHT_M60_A
17#error RGB_BACKLIGHT_M60_A not defined, you done goofed somehao, brah
18#endif
diff --git a/keyboards/rama/m60_a/m60_a.h b/keyboards/rama/m60_a/m60_a.h
new file mode 100644
index 000000000..3caab6ac0
--- /dev/null
+++ b/keyboards/rama/m60_a/m60_a.h
@@ -0,0 +1,37 @@
1/* Copyright 2017 Jason Williams (Wilba)
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#include "quantum.h"
19#include "../../zeal60/rgb_backlight_keycodes.h"
20#include "../../zeal60/zeal60_keycodes.h"
21
22#define XXX KC_NO
23
24#define LAYOUT_60_hhkb( \
25 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \
26 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
27 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
28 K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
29 K41, K42, K47, K4B, K4C \
30) { \
31 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
32 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
33 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
34 { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \
35 { XXX, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, XXX, K4B, K4C, XXX } \
36}
37
diff --git a/keyboards/rama/m60_a/readme.md b/keyboards/rama/m60_a/readme.md
new file mode 100644
index 000000000..fe54f0163
--- /dev/null
+++ b/keyboards/rama/m60_a/readme.md
@@ -0,0 +1,15 @@
1# RAMA M60-A
2
3![RAMA M60-A](https://static1.squarespace.com/static/563c788ae4b099120ae219e2/t/5aafa6a20e2e7254480b21bf/1535873164793/RAMA-M60-A-03.688.jpg?format=1500w)
4
5The M60-A represents the benchmark and equilibrium between function and design for us at Rama Works. The gently exaggerated design of the frame is not understated, but rather provocative. Inspiration and evolution from previous models are evident in the beautifully articulated design and the well defined aesthetic, the fingerprint of our 'Industrial Modern' designs. The M60-A offers a unique contender in the traditional 60% form factor. [More info at RAMA WORKS](https://rama.works/m60-a/)
6
7Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582)
8Hardware Supported: RAMA M60-A PCB
9Hardware Availability: [RAMA WORKS Store](https://ramaworks.store/)
10
11Make example for this keyboard (after setting up your build environment):
12
13 make rama/m60_a:default
14
15See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file
diff --git a/keyboards/rama/m60_a/rules.mk b/keyboards/rama/m60_a/rules.mk
new file mode 100644
index 000000000..02617cf1c
--- /dev/null
+++ b/keyboards/rama/m60_a/rules.mk
@@ -0,0 +1,79 @@
1
2
3# project specific files
4SRC = ../zeal60/zeal60.c \
5 ../zeal60/rgb_backlight.c \
6 quantum/color.c \
7 drivers/issi/is31fl3731.c \
8 drivers/avr/i2c_master.c
9
10# MCU name
11MCU = atmega32u4
12
13# Processor frequency.
14# This will define a symbol, F_CPU, in all source code files equal to the
15# processor frequency in Hz. You can then use this symbol in your source code to
16# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
17# automatically to create a 32-bit value in your source code.
18#
19# This will be an integer division of F_USB below, as it is sourced by
20# F_USB after it has run through any CPU prescalers. Note that this value
21# does not *change* the processor frequency - it should merely be updated to
22# reflect the processor speed set externally so that the code can use accurate
23# software delays.
24F_CPU = 16000000
25
26#
27# LUFA specific
28#
29# Target architecture (see library "Board Types" documentation).
30ARCH = AVR8
31
32# Input clock frequency.
33# This will define a symbol, F_USB, in all source code files equal to the
34# input clock frequency (before any prescaling is performed) in Hz. This value may
35# differ from F_CPU if prescaling is used on the latter, and is required as the
36# raw input clock is fed directly to the PLL sections of the AVR for high speed
37# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
38# at the end, this will be done automatically to create a 32-bit value in your
39# source code.
40#
41# If no clock division is performed on the input clock inside the AVR (via the
42# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
43F_USB = $(F_CPU)
44
45# Interrupt driven control endpoint task(+60)
46OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
47
48# Boot Section
49BOOTLOADER = atmel-dfu
50
51# Do not put the microcontroller into power saving mode
52# when we get USB suspend event. We want it to keep updating
53# backlight effects.
54OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
55
56# Build Options
57# change to "no" to disable the options, or define them in the Makefile in
58# the appropriate keymap folder that will get included automatically
59#
60BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
61MOUSEKEY_ENABLE = no # Mouse keys(+4700)
62EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
63CONSOLE_ENABLE = no # Console for debug(+400)
64COMMAND_ENABLE = no # Commands for debug and configuration
65NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
66BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
67MIDI_ENABLE = no # MIDI controls
68AUDIO_ENABLE = no # Audio output on port C6
69UNICODE_ENABLE = no # Unicode
70BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
71RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
72
73# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
74SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
75
76RAW_ENABLE = yes
77DYNAMIC_KEYMAP_ENABLE = yes
78CIE1931_CURVE = yes
79
diff --git a/keyboards/zeal60/config.h b/keyboards/zeal60/config.h
new file mode 100644
index 000000000..baa4978a8
--- /dev/null
+++ b/keyboards/zeal60/config.h
@@ -0,0 +1,125 @@
1/* Copyright 2017 Jason Williams (Wilba)
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#include "config_common.h"
19
20// USB Device descriptor parameter
21#define VENDOR_ID 0xFEED
22#define PRODUCT_ID 0x6060
23#define DEVICE_VER 0x0001
24#define MANUFACTURER ZealPC
25#define PRODUCT Zeal60
26#define DESCRIPTION Zeal60 (QMK Firmware)
27
28// key matrix size
29#define MATRIX_ROWS 5
30#define MATRIX_COLS 14
31
32// Zeal60 PCB default pin-out
33#define MATRIX_ROW_PINS { F0, F1, F4, F6, F7 }
34#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6 }
35#define UNUSED_PINS
36
37// IS31FL3731 driver
38#define DRIVER_COUNT 2
39#define DRIVER_LED_TOTAL 72
40
41// COL2ROW or ROW2COL
42#define DIODE_DIRECTION COL2ROW
43
44// Set 0 if debouncing isn't needed
45#define DEBOUNCING_DELAY 5
46
47// Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap
48#define LOCKING_SUPPORT_ENABLE
49// Locking resynchronize hack
50#define LOCKING_RESYNC_ENABLE
51
52// key combination for command
53#define IS_COMMAND() ( \
54 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
55)
56
57/*
58 * Feature disable options
59 * These options are also useful to firmware size reduction.
60 */
61
62// disable debug print
63//#define NO_DEBUG
64
65// disable print
66//#define NO_PRINT
67
68// disable action features
69//#define NO_ACTION_LAYER
70//#define NO_ACTION_TAPPING
71//#define NO_ACTION_ONESHOT
72//#define NO_ACTION_MACRO
73//#define NO_ACTION_FUNCTION
74
75#define RGB_BACKLIGHT_ENABLED 1
76
77// This conditionally compiles the backlight code for Zeal60 specifics
78#define RGB_BACKLIGHT_ZEAL60
79
80// enable/disable LEDs based on layout
81#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0
82#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0
83#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0
84#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0
85#define RGB_BACKLIGHT_USE_ISO_ENTER 0
86#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0
87
88// disable backlight when USB suspended (PC sleep/hibernate/shutdown)
89#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0
90
91// disable backlight after timeout in minutes, 0 = no timeout
92#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0
93
94// the default effect (RGB test)
95#define RGB_BACKLIGHT_EFFECT 255
96
97// These define which keys in the matrix are alphas/mods
98// Used for backlight effects so colors are different for
99// alphas vs. mods
100// Each value is for a row, bit 0 is column 0
101// Alpha=0 Mod=1
102#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0010000000000001
103#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0000000000000001
104#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0001000000000001
105#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0011000000000001
106#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011110000000111
107
108#define DYNAMIC_KEYMAP_LAYER_COUNT 4
109
110// EEPROM usage
111
112// TODO: refactor with new user EEPROM code (coming soon)
113#define EEPROM_MAGIC 0x451F
114#define EEPROM_MAGIC_ADDR 32
115// Bump this every time we change what we store
116// This will automatically reset the EEPROM with defaults
117// and avoid loading invalid data from the EEPROM
118#define EEPROM_VERSION 0x07
119#define EEPROM_VERSION_ADDR 34
120
121// Backlight config starts after EEPROM version
122#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35
123// Dynamic keymap starts after backlight config (35+37)
124#define DYNAMIC_KEYMAP_EEPROM_ADDR 72
125
diff --git a/keyboards/zeal60/info.json b/keyboards/zeal60/info.json
new file mode 100644
index 000000000..c4234e49a
--- /dev/null
+++ b/keyboards/zeal60/info.json
@@ -0,0 +1,25 @@
1{
2 "keyboard_name": "Zeal60",
3 "url": "",
4 "maintainer": "Wilba",
5 "bootloader": "DFU",
6 "width": 15,
7 "height": 5,
8 "layouts": {
9 "LAYOUT_all": {
10 "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
11 },
12 "LAYOUT_60_ansi": {
13 "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
14 },
15 "LAYOUT_60_iso": {
16 "layout": [{"label":"\u00ac", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
17 },
18 "LAYOUT_60_ansi_split_bs_rshift": {
19 "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
20 },
21 "LAYOUT_60_hhkb": {
22 "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Delete", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}]
23 }
24 }
25} \ No newline at end of file
diff --git a/keyboards/zeal60/keymaps/ansi_split_bs_rshift/config.h b/keyboards/zeal60/keymaps/ansi_split_bs_rshift/config.h
new file mode 100644
index 000000000..011cf5c5a
--- /dev/null
+++ b/keyboards/zeal60/keymaps/ansi_split_bs_rshift/config.h
@@ -0,0 +1,21 @@
1#pragma once
2
3/* enable/disable LEDs based on layout */
4#undef RGB_BACKLIGHT_USE_SPLIT_BACKSPACE
5#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0
6
7#undef RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT
8#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0
9
10#undef RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT
11#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0
12
13#undef RGB_BACKLIGHT_USE_7U_SPACEBAR
14#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0
15
16#undef RGB_BACKLIGHT_USE_ISO_ENTER
17#define RGB_BACKLIGHT_USE_ISO_ENTER 0
18
19#undef RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS
20#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0
21
diff --git a/keyboards/zeal60/keymaps/ansi_split_bs_rshift/keymap.c b/keyboards/zeal60/keymaps/ansi_split_bs_rshift/keymap.c
new file mode 100644
index 000000000..edb4f256b
--- /dev/null
+++ b/keyboards/zeal60/keymaps/ansi_split_bs_rshift/keymap.c
@@ -0,0 +1,38 @@
1// ANSI split backspace/right shift layout for Zeal60
2#include QMK_KEYBOARD_H
3
4const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
5
6// Default layer
7[0] = LAYOUT_60_ansi_split_bs_rshift(
8 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_BSLS, KC_DEL,
9 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,
10 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,
11 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, FN_MO13,
12 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, FN_MO23, KC_RCTL),
13
14// Fn1 Layer
15[1] = LAYOUT_60_ansi_split_bs_rshift(
16 KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL,
17 KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS,
18 KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS,
19 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS,
20 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
21
22// Fn2 Layer
23[2] = LAYOUT_60_ansi_split_bs_rshift(
24 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
25 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
26 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
27 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
28 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
29
30// Fn3 Layer (zeal60 Configuration)
31[3] = LAYOUT_60_ansi_split_bs_rshift(
32 KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS, KC_TRNS,
33 KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, ES_DEC, ES_INC, KC_TRNS,
34 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
35 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
36 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
37
38};
diff --git a/keyboards/zeal60/keymaps/default/config.h b/keyboards/zeal60/keymaps/default/config.h
new file mode 100644
index 000000000..f8478a3df
--- /dev/null
+++ b/keyboards/zeal60/keymaps/default/config.h
@@ -0,0 +1,20 @@
1#pragma once
2
3/* enable/disable LEDs based on layout */
4#undef RGB_BACKLIGHT_USE_SPLIT_BACKSPACE
5#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0
6
7#undef RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT
8#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0
9
10#undef RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT
11#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0
12
13#undef RGB_BACKLIGHT_USE_7U_SPACEBAR
14#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0
15
16#undef RGB_BACKLIGHT_USE_ISO_ENTER
17#define RGB_BACKLIGHT_USE_ISO_ENTER 0
18
19#undef RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS
20#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0
diff --git a/keyboards/zeal60/keymaps/default/keymap.c b/keyboards/zeal60/keymaps/default/keymap.c
new file mode 100644
index 000000000..3a13cf4d5
--- /dev/null
+++ b/keyboards/zeal60/keymaps/default/keymap.c
@@ -0,0 +1,38 @@
1// Default layout for Zeal60
2#include QMK_KEYBOARD_H
3
4const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
5
6// Default layer
7[0] = LAYOUT_60_ansi(
8 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_BSPC,
9 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,
10 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,
11 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
12 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, FN_MO13, FN_MO23, KC_RCTL),
13
14// Fn1 Layer
15[1] = LAYOUT_60_ansi(
16 KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL ,
17 KC_CAPS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS,
18 KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_TRNS,
19 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, KC_PGDN, KC_TRNS,
20 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
21
22// Fn2 Layer
23[2] = LAYOUT_60_ansi(
24 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
25 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
26 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
27 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
28 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
29
30// Fn3 Layer (zeal60 Configuration)
31[3] = LAYOUT_60_ansi(
32 KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS,
33 KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, ES_DEC, ES_INC, KC_TRNS,
34 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
35 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
36 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
37
38};
diff --git a/keyboards/zeal60/keymaps/hhkb/config.h b/keyboards/zeal60/keymaps/hhkb/config.h
new file mode 100644
index 000000000..25f74d3d2
--- /dev/null
+++ b/keyboards/zeal60/keymaps/hhkb/config.h
@@ -0,0 +1,20 @@
1#pragma once
2
3/* enable/disable LEDs based on layout */
4#undef RGB_BACKLIGHT_USE_SPLIT_BACKSPACE
5#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 1
6
7#undef RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT
8#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0
9
10#undef RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT
11#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 1
12
13#undef RGB_BACKLIGHT_USE_7U_SPACEBAR
14#define RGB_BACKLIGHT_USE_7U_SPACEBAR 1
15
16#undef RGB_BACKLIGHT_USE_ISO_ENTER
17#define RGB_BACKLIGHT_USE_ISO_ENTER 0
18
19#undef RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS
20#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 1
diff --git a/keyboards/zeal60/keymaps/hhkb/keymap.c b/keyboards/zeal60/keymaps/hhkb/keymap.c
new file mode 100644
index 000000000..5cedc6e5e
--- /dev/null
+++ b/keyboards/zeal60/keymaps/hhkb/keymap.c
@@ -0,0 +1,38 @@
1// HHKB layout for Zeal60
2#include QMK_KEYBOARD_H
3
4const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
5
6// Default layer
7[0] = LAYOUT_60_hhkb(
8 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_BSLS, KC_GRV,
9 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,
10 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,
11 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, FN_MO13,
12 KC_LGUI, KC_LALT, KC_SPC, KC_RALT, FN_MO23),
13
14// Fn1 Layer
15[1] = LAYOUT_60_hhkb(
16 KC_PWR, 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_INS, KC_DEL,
17 KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS,
18 KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS,
19 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS,
20 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
21
22// Fn2 Layer
23[2] = LAYOUT_60_hhkb(
24 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
25 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
26 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
27 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
28 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
29
30// Fn3 Layer (zeal60 Configuration)
31[3] = LAYOUT_60_hhkb(
32 KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS, KC_TRNS,
33 KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, ES_DEC, ES_INC, KC_TRNS,
34 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
35 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
36 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
37
38};
diff --git a/keyboards/zeal60/keymaps/iso/config.h b/keyboards/zeal60/keymaps/iso/config.h
new file mode 100644
index 000000000..c96ef1f05
--- /dev/null
+++ b/keyboards/zeal60/keymaps/iso/config.h
@@ -0,0 +1,20 @@
1#pragma once
2
3/* enable/disable LEDs based on layout */
4#undef RGB_BACKLIGHT_USE_SPLIT_BACKSPACE
5#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0
6
7#undef RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT
8#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 1
9
10#undef RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT
11#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0
12
13#undef RGB_BACKLIGHT_USE_7U_SPACEBAR
14#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0
15
16#undef RGB_BACKLIGHT_USE_ISO_ENTER
17#define RGB_BACKLIGHT_USE_ISO_ENTER 1
18
19#undef RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS
20#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0
diff --git a/keyboards/zeal60/keymaps/iso/keymap.c b/keyboards/zeal60/keymaps/iso/keymap.c
new file mode 100644
index 000000000..55120f05e
--- /dev/null
+++ b/keyboards/zeal60/keymaps/iso/keymap.c
@@ -0,0 +1,38 @@
1// ISO layout for Zeal60
2#include QMK_KEYBOARD_H
3
4const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
5
6// Default layer
7[0] = LAYOUT_60_iso(
8 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_BSPC,
9 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_ENT,
10 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,
11 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,
12 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, FN_MO13, FN_MO23, KC_RCTL),
13
14// Fn1 Layer
15[1] = LAYOUT_60_iso(
16 KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL ,
17 KC_CAPS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS,
18 KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_TRNS,
19 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, KC_PGDN, KC_TRNS,
20 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
21
22// Fn2 Layer
23[2] = LAYOUT_60_iso(
24 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
25 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
26 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
27 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
28 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
29
30// Fn3 Layer (zeal60 Configuration)
31[3] = LAYOUT_60_iso(
32 KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS,
33 KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, ES_DEC, ES_INC, KC_TRNS,
34 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
35 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
36 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
37
38};
diff --git a/keyboards/zeal60/keymaps/ryanmaclean/config.h b/keyboards/zeal60/keymaps/ryanmaclean/config.h
new file mode 100644
index 000000000..f1531eb34
--- /dev/null
+++ b/keyboards/zeal60/keymaps/ryanmaclean/config.h
@@ -0,0 +1,21 @@
1#pragma once
2
3/* enable/disable LEDs based on layout */
4#undef RGB_BACKLIGHT_USE_SPLIT_BACKSPACE
5#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 1
6
7#undef RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT
8#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0
9
10#undef RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT
11#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 1
12
13#undef RGB_BACKLIGHT_USE_7U_SPACEBAR
14#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0
15
16#undef RGB_BACKLIGHT_USE_ISO_ENTER
17#define RGB_BACKLIGHT_USE_ISO_ENTER 0
18
19#undef RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS
20#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0
21
diff --git a/keyboards/zeal60/keymaps/ryanmaclean/keymap.c b/keyboards/zeal60/keymaps/ryanmaclean/keymap.c
new file mode 100644
index 000000000..2e342b497
--- /dev/null
+++ b/keyboards/zeal60/keymaps/ryanmaclean/keymap.c
@@ -0,0 +1,84 @@
1// Ryan MacLean's layout for Zeal60
2// Note that LGUI and RGUI are swapped with LALT and RALT respectively, for use with Macs
3// Also note that Control has replaced Caps Lock, and that pressing left or right shift once
4// will output left parenthese and right parenthese respectively.
5#include QMK_KEYBOARD_H
6
7// [0,13] is either left key of split backspace (e.g. HHKB \| key) or 2U backspace
8// [1,13] is either backslash or ISO Enter
9// [2,12] is either ANSI Enter or key left of ISO Enter
10// [2,13] is right key of split backspace (e.g. HHKB `~ key)
11// [3,1] is right key of split left-shift (e.g ISO key)
12// [3,13] is right key of split right-shift (e.g. HHKB Fn key)
13
14
15
16const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // this is the function signature -- just copy/paste it into your keymap file as it is. KC_LSFT KC_LALT KC_LGUI KC_4
17{
18 switch(id) {
19 case 0: // macOS screenshot to capture are to clipboard - this would trigger when you hit a key mapped as M(0)
20 if (record->event.pressed) {
21 return MACRO( D(LSFT), D(LCTL), D(LGUI), T(4), U(LSFT), U(LCTL), U(LGUI), W(255), END ); // this sends the string 'hello' when the macro executes
22 }
23 break;
24 case 1: // macOS screenshot capture area to file - this would trigger when you hit a key mapped as M(1)
25 if (record->event.pressed) {
26 return MACRO( D(LSFT), D(LGUI), T(4), U(LSFT), U(LGUI), W(255), END ); // this sends the string 'hello' when the macro executes
27 }
28 break;
29 case 2: // macOS screenshot to clipboard - this would trigger when you hit a key mapped as M(2)
30 if (record->event.pressed) {
31 return MACRO( D(LSFT), D(LCTL), D(LGUI), T(3), U(LSFT), U(LCTL), U(LGUI), W(255), END ); // this sends the string 'hello' when the macro executes
32 }
33 break;
34 case 3: // macOS screenshot to file - this would trigger when you hit a key mapped as M(3)
35 if (record->event.pressed) {
36 return MACRO( D(LSFT), D(LGUI), T(3), U(LSFT), U(LGUI), W(255), END ); // this sends the string 'hello' when the macro executes
37 }
38 break;
39 }
40 return MACRO_NONE;
41};
42
43#define CADETL MT(KC_LSFT, KC_LBRC)
44#define CADETR MT(KC_RSFT, KC_RBRC)
45
46const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
47
48// Default layer
49[0] = {
50 {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_BSLS},
51 {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},
52 {KC_LGUI, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_GRV},
53 {KC_LSPO, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, FN_MO13},
54 {KC_LCTL, KC_LALT, KC_LGUI, KC_NO, KC_NO, KC_NO, KC_NO, KC_SPC, KC_NO, KC_NO, KC_RGUI, KC_RALT, KC_RCTL, FN_MO23}
55},
56
57// Fn1 Layer
58[1] = {
59 {KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS},
60 {KC_CAPS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_DEL},
61 {KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT, KC_HOME, KC_PGUP, KC_TRNS, KC_TRNS},
62 {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, KC_PGDN, KC_TRNS, KC_TRNS},
63 {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}
64},
65
66// Fn2 Layer
67[2] = {
68 {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS},
69 {KC_TRNS, M(2), M(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS},
70 {KC_TRNS, M(1), M(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS},
71 {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS},
72 {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}
73},
74
75// Fn3 Layer (zeal60 Configuration)
76[3] = {
77 {KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS},
78 {KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS},
79 {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS},
80 {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS},
81 {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}
82}
83
84};
diff --git a/keyboards/zeal60/keymaps/tusing/Makefile b/keyboards/zeal60/keymaps/tusing/Makefile
new file mode 100644
index 000000000..762905da0
--- /dev/null
+++ b/keyboards/zeal60/keymaps/tusing/Makefile
@@ -0,0 +1,6 @@
1# Build Options
2# change to "no" to disable the options, or define them in the Makefile in
3# the appropriate keymap folder that will get included automatically
4#
5RGBLIGHT_ENABLE = yes
6AUDIO_ENABLE = no # Underglow cannot be used with audio.
diff --git a/keyboards/zeal60/keymaps/tusing/README.md b/keyboards/zeal60/keymaps/tusing/README.md
new file mode 100644
index 000000000..edddf1c58
--- /dev/null
+++ b/keyboards/zeal60/keymaps/tusing/README.md
@@ -0,0 +1,80 @@
1# RGB Underglow Strip on the Zeal60: A Guide
2
3<img src="https://i.imgur.com/UuUdOCb.jpg" width="800">
4
5## Requirements
6
7- WS2812B RGB strip, preferably 60 LEDs/meter
8- Wire, solder
9- Tape, hot glue, or some sort of adhesive
10
11## A. Connecting the strip
12You might find the [**full PCB image**](https://cdn.shopify.com/s/files/1/0490/7329/files/zeal60jumpers.png) helpful. Ignore the red boxes!
13
141. Connect V+ to the receiving end of the thermistor labeled F1; connect GND to the board's GND pin. (*Avoid connecting +V to the board's +5V pin* - you will likely overload the thermistor, and you will limit your maximum brightness.)
15
16 <img src="https://i.imgur.com/jd7qivh.png" width="300">
17
182. Connect DI to PB0.
19
20 <img src="https://i.imgur.com/BiMyMLv.jpg" width="300">
21
223. Should look something like this when finished:
23
24 <img src="https://i.imgur.com/ngxYMuA.jpg" width="600">
25
26*Optional:* To allow considerably more light to escape, consider angling the strip outwards by using some sort of fulcrum under the strip. (I used a thick wire.)
27
28## B. Enabling the strip
291. If it is not present already, add the following to your ***keymap's*** ```Makefile```:
30
31 ```Makefile
32 RGBLIGHT_ENABLE = yes
33 AUDIO_ENABLE = no #Underglow animations cannot be used with audio.
34 ```
352. If it is not present already, add the following to your *keymap's* ```config.h```, and edit the values as necessary:
36
37 ```c
38 // Set up RGB underglow.
39 #define RGB_DI_PIN B0 // The pin your RGB strip is wired to
40 #define RGBLIGHT_ANIMATIONS // Require for fancier stuff (not compatible with audio)
41 #define RGBLED_NUM 35 // Number of LEDs
42 #define RGBLIGHT_HUE_STEP 5 // How much each press of rgb_hue changes hue
43 #define RGBLIGHT_SAT_STEP 10 // How much each press of rgb_sat changes sat
44 #define RGBLIGHT_VAL_STEP 10 // How much each press of rgb_val changes val
45 ```
463. If they are not present already, add the following keycodes to your keymap to control the RGB strip: ```RGB_TOG``` (on/off), ```RGB_MOD``` (step through modes), ```RGB_HUI```, ```RGB_HUD```, ```RGB_SAI```, ```RGB_SAD```, ```RGB_VAI```, ```RGB_VAD``` (HSV increase/decrease). Add these to your keymap.
47
48## C. Dealing with current limits
49USB 2.0 ports on laptops provide up to 500mA max, but USB 3.0 ports can provide up to 900mA; USB 3.1 up to 1.5A; and powered USB hubs even more. We can run our keyboard at a higher brightness if we draw more power. **The Zeal60 uses 500mA at max brightness.** This means that **you have about 400mA remaining for the strip to use on a USB 3.0 port**; 1000mA free on a USB 3.1 port, so on and so forth.
50
51***Warning:*** **This means you will need to turn *off* your RGB strip before connecting to a USB 2.0 port**, as USB 2.0 cannot sustain the current necessary!
52
531. If not present already, add the following to your keymap's ```config.h```. Change the numbers based on your needs. The ones below are safe underestimates.
54
55 ```c
56 // Enable current limiting for RGB underglow.
57 #define RGBSTRIP_CURRENT_LIMIT 400 // Strip current limit in mA. (USB amperage - 500mA for keyboard)
58 #define RGBSTRIP_MAX_CURRENT_PER_LIGHT 50 // mA per light when at max brightness.
59 ```
60 *Example:* I use a USB port capable of providing 1800 mA. The keyboard uses 500mA, so my personal value (in the `tusing` keymap) for `RGBSTRIP_CURRENT_LIMIT` is 1300. The particular WS2812B RGB strip I have uses a maximum of 60 mA per LED, so that is my personal value for `RGBSTRIP_MAX_CURRENT_PER_LIGHT`.
612. Toggle on the LED strip (```RGB_TOG```) and step through animations (```RGB_MOD```) to test it out!
62
63## D. Sources and resources
64### A. Connecting the strip.
65* [In-depth description of connecting an RGB strip to the GH60](https://www.reddit.com/r/MechanicalKeyboards/comments/4d5or2/my_first_custom_build_satan_gh60_rbg_underglow_in/d1nz3o7/)
66* [32U4 Pinout](https://40.media.tumblr.com/93b6bbd4113418c2b45459bb177e67c5/tumblr_mi49a20QMB1s5t695o1_1280.png)
67* [Redditor describes connecting RGB strips on his Satan GH60](https://www.reddit.com/r/MechanicalKeyboards/comments/4hbjw4/finally_finished_my_satan_gh60_also_granite_o/d2qn8zx/?context=3)
68* [Another Redditor on RGB with the Satan GH60](https://www.reddit.com/r/MechanicalKeyboards/comments/4ewzdx/gh60_satan_with_the_rgb_mod/d251uu6/ )
69
70### B. Enabling the strip.
71* [QMK Wiki portion on underglow](https://github.com/jackhumbert/qmk_firmware/wiki#rgb-under-glow-mod)
72* [Planck ```Makefile```, ```config.h```, and ```keymap.c``` config example](https://github.com/jackhumbert/qmk_firmware/tree/master/keyboards/planck/keymaps/yang)
73* [Video demonstrating keycode functions and RGB modes on a KC60](https://www.youtube.com/watch?v=VKrpPAHlisY)
74
75### C. Dealing with current limits.
76* [Discussion of cutting jumpers and adding resistors to lower current from Zeal60](https://www.reddit.com/r/MechanicalKeyboards/comments/5hou92/photos_zeal60_lets_just_say_santa_came_early_this/db23qid/)
77* [A selection of 900mA-1.5A current hold fuses - look for an SMD 0805-sized fuse.](https://goo.gl/748avG)
78* [Video detailing technique to solder 0805 resistors](https://www.youtube.com/watch?v=PU7wLcuqc-I&t=123s&list=FLheMlKEVQ5cmVXazUt6HrxQ&index=2)
79* [QMK feature request to implement max power draw limits in ```config.h```](https://github.com/jackhumbert/qmk_firmware/issues/954)
80* [Commit enabling max power draw limits in ```config.h```](https://github.com/jackhumbert/qmk_firmware/commit/83e613ad239459582ae28f78b6c81535b9b138d7) \ No newline at end of file
diff --git a/keyboards/zeal60/keymaps/tusing/config.h b/keyboards/zeal60/keymaps/tusing/config.h
new file mode 100644
index 000000000..93f260946
--- /dev/null
+++ b/keyboards/zeal60/keymaps/tusing/config.h
@@ -0,0 +1,40 @@
1#pragma once
2
3/* Enable/disable LEDs based on layout. */
4#undef RGB_BACKLIGHT_USE_SPLIT_BACKSPACE
5#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0
6
7#undef RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT
8#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0
9
10#undef RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT
11#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0
12
13#undef RGB_BACKLIGHT_USE_7U_SPACEBAR
14#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0
15
16#undef RGB_BACKLIGHT_USE_ISO_ENTER
17#define RGB_BACKLIGHT_USE_ISO_ENTER 0
18
19#undef RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS
20#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0
21
22// Set up RGB underglow.
23#define RGB_DI_PIN B0 // The pin your RGB strip is wired to
24#define RGBLIGHT_ANIMATIONS // Require for fancier stuff (not compatible with audio)
25#define RGBLED_NUM 35 // Number of LEDs
26#define RGBLIGHT_HUE_STEP 5 // How much each press of rgb_hue changes hue
27#define RGBLIGHT_SAT_STEP 10 // How much each press of rgb_sat changes sat
28#define RGBLIGHT_VAL_STEP 10 // How much each press of rgb_val changes val
29
30// Enable current limiting for RGB underglow.
31#define RGBSTRIP_CURRENT_LIMIT 1300 // Strip current limit in mA. (USB amperage - 500mA for keyboard)
32#define RGBSTRIP_MAX_CURRENT_PER_LIGHT 40 // mA per light when at max brightness.
33
34// Scale brightnes according to BRIGHTNESS_CORRECTION_TABLE in quantum/rgblight.c.
35// This allows to mitigate uneven brightness from LED underglow strips.
36// #define LED_BRIGHTNESS_CORRECTION
37
38// Prevent modifiers on layer 1 from persisting after we let go
39#define PREVENT_STUCK_MODIFIERS
40
diff --git a/keyboards/zeal60/keymaps/tusing/keymap.c b/keyboards/zeal60/keymaps/tusing/keymap.c
new file mode 100644
index 000000000..41d2effd4
--- /dev/null
+++ b/keyboards/zeal60/keymaps/tusing/keymap.c
@@ -0,0 +1,49 @@
1// Default layout for Zeal60
2#include QMK_KEYBOARD_H
3
4// For readability.
5#define _______ KC_TRNS
6#define _x_ KC_NO
7#define AUD_PRV LCTL(KC_MPRV) // Previous music track
8#define AUD_PLY LCTL(KC_MPLY) // Pause music
9#define AUD_NXT LCTL(KC_MNXT) // Next music track
10
11// Zeal60-specific keys:
12// EF_INC, EF_DEC, // next/previous backlight effect
13// H1_INC, H1_DEC, // Color 1 hue increase/decrease
14// S1_INC, S1_DEC, // Color 1 saturation increase/decrease
15// H2_INC, H2_DEC, // Color 2 hue increase/decrease
16// S2_INC, S2_DEC, // Color 2 saturation increase/decrease
17// BR_INC, BR_DEC, // backlight brightness increase/decrease
18
19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
20// Default layer: Pressing caps-lock momentarily switches to Layer 1.
21// This is the default layer. Pressing an empty keycode on another layer will take you here.
22 [0] = {
23 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC},
24 {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},
25 {MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, _x_ },
26 {KC_LSFT, _x_ , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, _x_ },
27 {KC_LCTL, KC_LGUI, KC_LALT, _x_ , _x_ , _x_ , _x_ , KC_SPC, _x_ , _x_ , KC_LEFT, KC_UP, KC_DOWN, KC_RGHT}
28 },
29
30// Layer 1: Pressing enter switches to layer 2, where backlight controls live.
31// This is a momentary layer: once you let go of caps, you'll be back in layer 1.
32 [1] = {
33 {KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL },
34 {_______, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_INS, KC_DEL, _______},
35 {_______, AUD_PRV, AUD_PLY, AUD_NXT, _______, _______, _______, _______, _______, _______, _______, _______, TO(2) , _x_ },
36 {KC_CAPS, _x_ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _x_ },
37 {KC_RCTL, KC_RGUI, KC_RALT, _x_ , _x_ , _x_ , _x_ , _______, _x_ , _x_ , KC_HOME, KC_PGUP, KC_PGDN, KC_END}
38 },
39
40// Layer 2: Zeal60 and backlight configuration. (Get here quickly by pressing Caps+Enter from Layer 1.)
41// This is a persistent layer. Get back to the default layer by pressing enter.
42 [2] = {
43 {RESET, EF_DEC, EF_INC, BR_DEC, BR_INC, ES_DEC, ES_INC, _______, _______, _______, _______, _______, _______, _______},
44 {_______, H1_DEC, H1_INC, S1_DEC, S1_INC, _______, _______, _______, _______, _______, _______, _______, _______, _______},
45 {_______, H2_DEC, H2_INC, S2_DEC, S2_INC, _______, _______, _______, _______, _______, _______, _______, TO(0) , _x_ },
46 {RGB_MOD, _x_ , RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, _______, _______, _______, _______, _______, _______, _______, _x_ },
47 {RGB_TOG, RGB_VAD, RGB_VAI, _x_ , _x_ , _x_ , _x_ , _______, _x_ , _x_ , _______, _______, _______, _______}
48 }
49};
diff --git a/keyboards/zeal60/readme.md b/keyboards/zeal60/readme.md
new file mode 100644
index 000000000..9eca28f83
--- /dev/null
+++ b/keyboards/zeal60/readme.md
@@ -0,0 +1,47 @@
1Zeal60
2====
3
4![Zeal60](https://cdn.shopify.com/s/files/1/0490/7329/products/Zeal60.jpg)
5
6This is a 60% PCB with per-key RGB LEDs and supports ANSI, ISO, winkey/winkeyless bottom row, HHKB-layout (split right shift and backspace).
7
8Keyboard Maintainer: [Wilba](http://wilba.tech/) and on [github](https://github.com/Wilba6582)
9Hardware Supported: Zeal60 PCB Rev 0-3
10Hardware Availability: https://zealpc.net/collections/group-buy-pre-orders/products/zeal60rgb
11
12Make example for this keyboard (after setting up your build environment):
13
14 make zeal60:default
15
16See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
17
18
19RGB Backlight Configuration
20====
21
22A keymap (in the keymaps directory) can optionally configure which RGB backlight LEDs are used, depending on the needs of the layout, by adding a config.h file in the keymap's directory.
23The following #define symbols will enable/disable a feature using 1 or 0.
24
25 RGB_BACKLIGHT_USE_SPLIT_BACKSPACE
26
27Split backspace is being used, enables the right LED of the split backspace (the top-right corner)
28
29 RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT
30
31Split left shift is being used (i.e. ISO layout), enables the right LED of the split left shift (the ISO key)
32
33 RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT
34
35Split right shift is being used (i.e. HHKB style layouts), enables the right LED of the split right shift (the Fn key)
36
37 RGB_BACKLIGHT_USE_7U_SPACEBAR
38
39A 7U spacebar is being used, controls the LEDs under the right stabilizer (of 7U spacebar) and right Alt (if 6.25U spacebar).
40
41 RGB_BACKLIGHT_USE_ISO_ENTER
42
43An ISO Enter is being used. Only used to tweak the location of the LED being used under ANSI Enter/backslash
44
45 RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS
46
47Disables the LEDs under HHKB corner blockers, useful for transparent cases.
diff --git a/keyboards/zeal60/rgb_backlight.c b/keyboards/zeal60/rgb_backlight.c
new file mode 100644
index 000000000..9f62a8d38
--- /dev/null
+++ b/keyboards/zeal60/rgb_backlight.c
@@ -0,0 +1,1519 @@
1/* Copyright 2017 Jason Williams (Wilba)
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#if RGB_BACKLIGHT_ENABLED
17
18#if defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_ZEAL65) || defined (RGB_BACKLIGHT_M60_A)
19#else
20#error None of the following was defined: RGB_BACKLIGHT_ZEAL60, RGB_BACKLIGHT_ZEAL65, RGB_BACKLIGHT_M60_A
21#endif
22
23#include "zeal60.h"
24#include "rgb_backlight.h"
25#include "rgb_backlight_api.h"
26#include "rgb_backlight_keycodes.h"
27
28#include <avr/io.h>
29#include <util/delay.h>
30#include <avr/interrupt.h>
31#include "progmem.h"
32
33#include "quantum/color.h"
34#include "drivers/avr/i2c_master.h"
35#include "drivers/issi/is31fl3731.h"
36
37#define BACKLIGHT_EFFECT_MAX 10
38
39backlight_config g_config = {
40 .use_split_backspace = RGB_BACKLIGHT_USE_SPLIT_BACKSPACE,
41 .use_split_left_shift = RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT,
42 .use_split_right_shift = RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT,
43 .use_7u_spacebar = RGB_BACKLIGHT_USE_7U_SPACEBAR,
44 .use_iso_enter = RGB_BACKLIGHT_USE_ISO_ENTER,
45 .disable_hhkb_blocker_leds = RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS,
46 .disable_when_usb_suspended = RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED,
47 .disable_after_timeout = RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT,
48 .brightness = 255,
49 .effect = RGB_BACKLIGHT_EFFECT,
50 .effect_speed = 0,
51 .color_1 = { .h = 0, .s = 255, .v = 255 },
52 .color_2 = { .h = 127, .s = 255, .v = 255 },
53 .caps_lock_indicator = { .color = { .h = 0, .s = 0, .v = 255 }, .index = 255 },
54 .layer_1_indicator = { .color = { .h = 0, .s = 0, .v = 255 }, .index = 255 },
55 .layer_2_indicator = { .color = { .h = 0, .s = 0, .v = 255 }, .index = 255 },
56 .layer_3_indicator = { .color = { .h = 0, .s = 0, .v = 255 }, .index = 255 },
57 .alphas_mods = {
58 RGB_BACKLIGHT_ALPHAS_MODS_ROW_0,
59 RGB_BACKLIGHT_ALPHAS_MODS_ROW_1,
60 RGB_BACKLIGHT_ALPHAS_MODS_ROW_2,
61 RGB_BACKLIGHT_ALPHAS_MODS_ROW_3,
62 RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 }
63};
64
65bool g_suspend_state = false;
66uint8_t g_indicator_state = 0;
67
68// Global tick at 20 Hz
69uint32_t g_tick = 0;
70
71// Ticks since this key was last hit.
72uint8_t g_key_hit[72];
73
74// Ticks since any key was last hit.
75uint32_t g_any_key_hit = 0;
76
77// This is a 7-bit address, that gets left-shifted and bit 0
78// set to 0 for write, 1 for read (as per I2C protocol)
79#define ISSI_ADDR_1 0x74
80#define ISSI_ADDR_2 0x76
81
82const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
83/* Refer to IS31 manual for these locations
84 * driver
85 * | R location
86 * | | G location
87 * | | | B location
88 * | | | | */
89 {0, C2_1, C3_1, C4_1}, // LA0
90 {0, C1_1, C3_2, C4_2}, // LA1
91 {0, C1_2, C2_2, C4_3}, // LA2
92 {0, C1_3, C2_3, C3_3}, // LA3
93 {0, C1_4, C2_4, C3_4}, // LA4
94 {0, C1_5, C2_5, C3_5}, // LA5
95 {0, C1_6, C2_6, C3_6}, // LA6
96 {0, C1_7, C2_7, C3_7}, // LA7
97 {0, C1_8, C2_8, C3_8}, // LA8
98 {0, C9_1, C8_1, C7_1}, // LA9
99 {0, C9_2, C8_2, C7_2}, // LA10
100 {0, C9_3, C8_3, C7_3}, // LA11
101 {0, C9_4, C8_4, C7_4}, // LA12
102 {0, C9_5, C8_5, C7_5}, // LA13
103 {0, C9_6, C8_6, C7_6}, // LA14
104 {0, C9_7, C8_7, C6_6}, // LA15
105 {0, C9_8, C7_7, C6_7}, // LA16
106 {0, C8_8, C7_8, C6_8}, // LA17
107
108 {0, C2_9, C3_9, C4_9}, // LB0
109 {0, C1_9, C3_10, C4_10}, // LB1
110 {0, C1_10, C2_10, C4_11}, // LB2
111 {0, C1_11, C2_11, C3_11}, // LB3
112 {0, C1_12, C2_12, C3_12}, // LB4
113 {0, C1_13, C2_13, C3_13}, // LB5
114 {0, C1_14, C2_14, C3_14}, // LB6
115 {0, C1_15, C2_15, C3_15}, // LB7
116 {0, C1_16, C2_16, C3_16}, // LB8
117 {0, C9_9, C8_9, C7_9}, // LB9
118 {0, C9_10, C8_10, C7_10}, // LB10
119 {0, C9_11, C8_11, C7_11}, // LB11
120 {0, C9_12, C8_12, C7_12}, // LB12
121 {0, C9_13, C8_13, C7_13}, // LB13
122 {0, C9_14, C8_14, C7_14}, // LB14
123 {0, C9_15, C8_15, C6_14}, // LB15
124 {0, C9_16, C7_15, C6_15}, // LB16
125 {0, C8_16, C7_16, C6_16}, // LB17
126
127 {1, C2_1, C3_1, C4_1}, // LC0
128 {1, C1_1, C3_2, C4_2}, // LC1
129 {1, C1_2, C2_2, C4_3}, // LC2
130 {1, C1_3, C2_3, C3_3}, // LC3
131 {1, C1_4, C2_4, C3_4}, // LC4
132 {1, C1_5, C2_5, C3_5}, // LC5
133 {1, C1_6, C2_6, C3_6}, // LC6
134 {1, C1_7, C2_7, C3_7}, // LC7
135 {1, C1_8, C2_8, C3_8}, // LC8
136 {1, C9_1, C8_1, C7_1}, // LC9
137 {1, C9_2, C8_2, C7_2}, // LC10
138 {1, C9_3, C8_3, C7_3}, // LC11
139 {1, C9_4, C8_4, C7_4}, // LC12
140 {1, C9_5, C8_5, C7_5}, // LC13
141 {1, C9_6, C8_6, C7_6}, // LC14
142 {1, C9_7, C8_7, C6_6}, // LC15
143 {1, C9_8, C7_7, C6_7}, // LC16
144 {1, C8_8, C7_8, C6_8}, // LC17
145
146 {1, C2_9, C3_9, C4_9}, // LD0
147 {1, C1_9, C3_10, C4_10}, // LD1
148 {1, C1_10, C2_10, C4_11}, // LD2
149 {1, C1_11, C2_11, C3_11}, // LD3
150 {1, C1_12, C2_12, C3_12}, // LD4
151 {1, C1_13, C2_13, C3_13}, // LD5
152 {1, C1_14, C2_14, C3_14}, // LD6
153 {1, C1_15, C2_15, C3_15}, // LD7
154 {1, C1_16, C2_16, C3_16}, // LD8
155 {1, C9_9, C8_9, C7_9}, // LD9
156 {1, C9_10, C8_10, C7_10}, // LD10
157 {1, C9_11, C8_11, C7_11}, // LD11
158 {1, C9_12, C8_12, C7_12}, // LD12
159 {1, C9_13, C8_13, C7_13}, // LD13
160 {1, C9_14, C8_14, C7_14}, // LD14
161 {1, C9_15, C8_15, C6_14}, // LD15
162 {1, C9_16, C7_15, C6_15}, // LD16
163 {1, C8_16, C7_16, C6_16}, // LD17
164};
165
166
167
168typedef struct Point {
169 uint8_t x;
170 uint8_t y;
171} Point;
172
173
174// index in range 0..71 (LA0..LA17, LB0..LB17, LC0..LC17, LD0..LD17)
175// point values in range x=0..224 y=0..64
176// origin is center of top-left key (i.e Esc)
177#if defined (RGB_BACKLIGHT_ZEAL65)
178const Point g_map_led_to_point[72] PROGMEM = {
179 // LA0..LA17
180 {120,16}, {104,16}, {88,16}, {72,16}, {56,16}, {40,16}, {24,16}, {4,16}, {4,32},
181 {128,0}, {112,0}, {96,0}, {80,0}, {64,0}, {48,0}, {32,0}, {16,0}, {0,0},
182 // LB0..LB17
183 {144,0}, {160,0}, {176,0}, {192,0}, {216,0}, {224,0}, {240,0}, {240,16}, {240,32},
184 {136,16}, {152,16}, {168,16}, {184,16}, {200,16}, {220,16}, {240,48}, {240,64}, {224,64},
185 // LC0..LC17
186 {96,64}, {100,48}, {84,48}, {68,48}, {52,48}, {36,48}, {255,255}, {48,60}, {28,64},
187 {108,32}, {92,32}, {76,32}, {60,32}, {44,32}, {28,32}, {20,44}, {10,48}, {4,64},
188 // LD0..LD17
189 {124,32}, {140,32}, {156,32}, {172,32}, {188,32}, {214,32}, {180,48}, {202,48}, {224,48},
190 {116,48}, {132,48}, {148,48}, {164,48}, {255,255}, {144,60}, {164,64}, {188,64}, {208,64}
191};
192const Point g_map_led_to_point_polar[72] PROGMEM = {
193 // LA0..LA17
194 {64,128}, {75,132}, {84,145}, {91,164}, {97,187}, {102,213}, {105,242}, {109,255}, {128,247},
195 {61,255}, {67,255}, {72,255}, {77,255}, {82,255}, {86,255}, {90,255}, {93,255}, {96,255},
196 // LB0..LB17
197 {56,255}, {51,255}, {46,255}, {42,255}, {37,255}, {35,255}, {32,255}, {19,255}, {0,255},
198 {53,132}, {44,145}, {37,164}, {31,187}, {26,213}, {22,249}, {237,255}, {224,255}, {221,255},
199 // LC0..LC17
200 {184,255}, {179,135}, {170,149}, {163,169}, {157,193}, {153,220}, {255,255}, {167,255}, {165,255},
201 {128,26}, {128,60}, {128,94}, {128,128}, {128,162}, {128,196}, {145,233}, {148,255}, {161,255},
202 // LD0..LD17
203 {0,9}, {0,43}, {0,77}, {0,111}, {0,145}, {255,201}, {224,181}, {230,217}, {235,255},
204 {189,128}, {200,131}, {210,141}, {218,159}, {201,228}, {201,228}, {206,255}, {213,255}, {218,255}
205};
206#elif defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_M60_A)
207const Point g_map_led_to_point[72] PROGMEM = {
208 // LA0..LA17
209 {120,16}, {104,16}, {88,16}, {72,16}, {56,16}, {40,16}, {24,16}, {4,16}, {4,32},
210 {128,0}, {112,0}, {96,0}, {80,0}, {64,0}, {48,0}, {32,0}, {16,0}, {0,0},
211 // LB0..LB17
212 {144,0}, {160,0}, {176,0}, {192,0}, {216,0}, {224,0}, {255,255}, {255,255}, {255,255},
213 {136,16}, {152,16}, {168,16}, {184,16}, {200,16}, {220,16}, {255,255}, {255,255}, {255,255},
214 // LC0..LC17
215 {102,64}, {100,48}, {84,48}, {68,48}, {52,48}, {36,48}, {60,64}, {43,64}, {23,64},
216 {108,32}, {92,32}, {76,32}, {60,32}, {44,32}, {28,32}, {20,48}, {2,48}, {3,64},
217 // LD0..LD17
218 {124,32}, {140,32}, {156,32}, {172,32}, {188,32}, {214,32}, {180,48}, {210,48}, {224,48},
219 {116,48}, {132,48}, {148,48}, {164,48}, {144,64}, {161,64}, {181,64}, {201,64}, {221,64}
220};
221const Point g_map_led_to_point_polar[72] PROGMEM = {
222 // LA0..LA17
223 {58,129}, {70,129}, {80,139}, {89,157}, {96,181}, {101,208}, {105,238}, {109,255}, {128,247}, {58,255},
224 {64,255}, {70,255}, {75,255}, {80,255}, {85,255}, {89,255}, {93,255}, {96,255},
225 // LB0..LB17
226 {53,255}, {48,255}, {43,255}, {39,255}, {34,255}, {32,255}, {255,255}, {255,255}, {255,255},
227 {48,139}, {39,157}, {32,181}, {27,208}, {23,238}, {19,255}, {255,255}, {255,255}, {255,255},
228 // LC0..LC17
229 {188,255}, {183,131}, {173,143}, {165,163}, {159,188}, {154,216}, {172,252}, {170,255}, {165,255},
230 {128,9}, {128,46}, {128,82}, {128,119}, {128,155}, {128,192}, {150,244}, {147,255}, {161,255},
231 // LD0..LD17
232 {0,27}, {0,64}, {0,101}, {0,137}, {0,174}, {255,233}, {228,201}, {235,255}, {237,255},
233 {195,128}, {206,136}, {215,152}, {222,175}, {205,234}, {209,255}, {214,255}, {219,255}, {223,255}
234};
235#endif
236
237// This may seem counter-intuitive, but it's quite flexible.
238// For each LED, get it's position to decide what color to make it.
239// This solves the issue of LEDs (and switches) not aligning to a grid,
240// or having a large "bitmap" and sampling them.
241void map_led_to_point( uint8_t index, Point *point )
242{
243 // Slightly messy way to get Point structs out of progmem.
244 uint8_t *addr = (uint8_t*)&g_map_led_to_point[index];
245 point->x = pgm_read_byte(addr);
246 point->y = pgm_read_byte(addr+1);
247
248 switch (index)
249 {
250 case 18+4: // LB4A
251 if ( g_config.use_split_backspace )
252 point->x -= 8;
253 break;
254 case 18+14: // LB14A
255 if ( g_config.use_iso_enter )
256 point->y += 8; // extremely pedantic
257 break;
258#if defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_M60_A)
259 case 36+0: // LC0A
260 if ( g_config.use_7u_spacebar )
261 point->x += 10;
262 break;
263 case 36+6: // LC6A
264 if ( g_config.use_7u_spacebar )
265 point->x += 4;
266 break;
267#endif
268 case 36+16: // LC16A
269 if ( !g_config.use_split_left_shift )
270 point->x += 8;
271 break;
272 case 54+5: // LD5A
273 if ( !g_config.use_iso_enter )
274 point->x -= 10;
275 break;
276 case 54+7: // LD7A
277 if ( !g_config.use_split_right_shift )
278 point->x -= 8;
279 break;
280 }
281}
282
283void map_led_to_point_polar( uint8_t index, Point *point )
284{
285 // Slightly messy way to get Point structs out of progmem.
286 uint8_t *addr = (uint8_t*)&g_map_led_to_point_polar[index];
287 point->x = pgm_read_byte(addr);
288 point->y = pgm_read_byte(addr+1);
289}
290
291//
292// Maps switch matrix coordinate (row,col) to LED index
293//
294
295
296#if defined (RGB_BACKLIGHT_ZEAL65)
297// Note: Left spacebar stab is at 4,3 (LC7)
298// Right spacebar stab is at 4,9 (D14)
299//
300// A17, A16, A15, A14, A13, A12, A11, A10, A9, B0, B1, B2, B3, B4, B6
301// A7, A6, A5, A4, A3, A2, A1, A0, B9, B10, B11, B12, B13, B14, B7
302// A8, C14, C13, C12, C11, C10, C9, D0, D1, D2, D3, D4, D5, B5, B8
303// C16, C15, C5, C4, C3, C2, C1, D9, D10, D11, D12, D6, D7, D8, B15
304// C17, C8, C7, ---, ---, ---, ---, C0, ---, D14, D15, D16, D17, B17, B16
305const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
306 { 0+17, 0+16, 0+15, 0+14, 0+13, 0+12, 0+11, 0+10, 0+9, 18+0, 18+1, 18+2, 18+3, 18+4, 18+6 },
307 { 0+7, 0+6, 0+5, 0+4, 0+3, 0+2, 0+1, 0+0, 18+9, 18+10, 18+11, 18+12, 18+13, 18+14, 18+7 },
308 { 0+8, 36+14, 36+13, 36+12, 36+11, 36+10, 36+9, 54+0, 54+1, 54+2, 54+3, 54+4, 54+5, 18+5, 18+8 },
309 { 36+16, 36+15, 36+5, 36+4, 36+3, 36+2, 36+1, 54+9, 54+10, 54+11, 54+12, 54+6, 54+7, 54+8, 18+15 },
310 { 36+17, 36+8, 36+7, 255, 255, 255, 255, 36+0, 255, 54+14, 54+15, 54+16, 54+17, 18+17, 18+16 }
311};
312#elif defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_M60_A)
313// Note: Left spacebar stab is at 4,3 (LC6)
314// Right spacebar stab is at 4,9 (LD13) or 4,10 (LD14)
315//
316// A17, A16, A15, A14, A13, A12, A11, A10, A9, B0, B1, B2, B3, B4,
317// A7, A6, A5, A4, A3, A2, A1, A0, B9, B10, B11, B12, B13, B14,
318// A8, C14, C13, C12, C11, C10, C9, D0, D1, D2, D3, D4, D5, B5,
319// C16, C15, C5, C4, C3, C2, C1, D9, D10, D11, D12, D6, D7, D8,
320// C17, C8, C7, C6, ---, ---, ---, C0, ---, D13, D14, D15, D16, D17,
321const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
322 { 0+17, 0+16, 0+15, 0+14, 0+13, 0+12, 0+11, 0+10, 0+9, 18+0, 18+1, 18+2, 18+3, 18+4 },
323 { 0+7, 0+6, 0+5, 0+4, 0+3, 0+2, 0+1, 0+0, 18+9, 18+10, 18+11, 18+12, 18+13, 18+14 },
324 { 0+8, 36+14, 36+13, 36+12, 36+11, 36+10, 36+9, 54+0, 54+1, 54+2, 54+3, 54+4, 54+5, 18+5 },
325 { 36+16, 36+15, 36+5, 36+4, 36+3, 36+2, 36+1, 54+9, 54+10, 54+11, 54+12, 54+6, 54+7, 54+8 },
326 { 36+17, 36+8, 36+7, 36+6, 255, 255, 255, 36+0, 255, 54+13, 54+14, 54+15, 54+16, 54+17 }
327};
328#endif
329
330void map_row_column_to_led( uint8_t row, uint8_t column, uint8_t *led )
331{
332 *led = 255;
333 if ( row < MATRIX_ROWS && column < MATRIX_COLS )
334 {
335 *led = pgm_read_byte(&g_map_row_column_to_led[row][column]);
336 }
337}
338
339void backlight_update_pwm_buffers(void)
340{
341 IS31FL3731_update_pwm_buffers( ISSI_ADDR_1, ISSI_ADDR_2 );
342 IS31FL3731_update_led_control_registers( ISSI_ADDR_1, ISSI_ADDR_2 );
343}
344
345void backlight_set_color( int index, uint8_t red, uint8_t green, uint8_t blue )
346{
347 IS31FL3731_set_color( index, red, green, blue );
348}
349
350void backlight_set_color_all( uint8_t red, uint8_t green, uint8_t blue )
351{
352 IS31FL3731_set_color_all( red, green, blue );
353}
354
355void backlight_set_key_hit(uint8_t row, uint8_t column)
356{
357 uint8_t led;
358 map_row_column_to_led(row,column,&led);
359 g_key_hit[led] = 0;
360
361 g_any_key_hit = 0;
362}
363
364// This is (F_CPU/1024) / 20 Hz
365// = 15625 Hz / 20 Hz
366// = 781
367#define TIMER3_TOP 781
368
369void backlight_timer_init(void)
370{
371 static uint8_t backlight_timer_is_init = 0;
372 if ( backlight_timer_is_init )
373 {
374 return;
375 }
376 backlight_timer_is_init = 1;
377
378 // Timer 3 setup
379 TCCR3B = _BV(WGM32) | // CTC mode OCR3A as TOP
380 _BV(CS32) | _BV(CS30); // prescale by /1024
381 // Set TOP value
382 uint8_t sreg = SREG;
383 cli();
384
385 OCR3AH = (TIMER3_TOP >> 8) & 0xff;
386 OCR3AL = TIMER3_TOP & 0xff;
387 SREG = sreg;
388}
389
390void backlight_timer_enable(void)
391{
392 TIMSK3 |= _BV(OCIE3A);
393}
394
395void backlight_timer_disable(void)
396{
397 TIMSK3 &= ~_BV(OCIE3A);
398}
399
400void backlight_set_suspend_state(bool state)
401{
402 g_suspend_state = state;
403}
404
405void backlight_set_indicator_state(uint8_t state)
406{
407 g_indicator_state = state;
408}
409
410void backlight_effect_rgb_test(void)
411{
412 // Mask out bits 4 and 5
413 // This 2-bit value will stay the same for 16 ticks.
414 switch ( (g_tick & 0x30) >> 4 )
415 {
416 case 0:
417 {
418 backlight_set_color_all( 255, 0, 0 );
419 break;
420 }
421 case 1:
422 {
423 backlight_set_color_all( 0, 255, 0 );
424 break;
425 }
426 case 2:
427 {
428 backlight_set_color_all( 0, 0, 255 );
429 break;
430 }
431 case 3:
432 {
433 backlight_set_color_all( 255, 255, 255 );
434 break;
435 }
436 }
437}
438
439// This tests the LEDs
440// Note that it will change the LED control registers
441// in the LED drivers, and leave them in an invalid
442// state for other backlight effects.
443// ONLY USE THIS FOR TESTING LEDS!
444void backlight_effect_single_LED_test(void)
445{
446 static uint8_t color = 0; // 0,1,2 for R,G,B
447 static uint8_t row = 0;
448 static uint8_t column = 0;
449
450 static uint8_t tick = 0;
451 tick++;
452
453 if ( tick > 2 )
454 {
455 tick = 0;
456 column++;
457 }
458 if ( column > 14 )
459 {
460 column = 0;
461 row++;
462 }
463 if ( row > 4 )
464 {
465 row = 0;
466 color++;
467 }
468 if ( color > 2 )
469 {
470 color = 0;
471 }
472
473 uint8_t led;
474 map_row_column_to_led( row, column, &led );
475 backlight_set_color_all( 255, 255, 255 );
476 backlight_test_led( led, color==0, color==1, color==2 );
477}
478
479// All LEDs off
480void backlight_effect_all_off(void)
481{
482 backlight_set_color_all( 0, 0, 0 );
483}
484
485// Solid color
486void backlight_effect_solid_color(void)
487{
488 HSV hsv = { .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness };
489 RGB rgb = hsv_to_rgb( hsv );
490 backlight_set_color_all( rgb.r, rgb.g, rgb.b );
491}
492
493// alphas = color1, mods = color2
494void backlight_effect_alphas_mods(void)
495{
496 RGB rgb1 = hsv_to_rgb( (HSV){ .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness } );
497 RGB rgb2 = hsv_to_rgb( (HSV){ .h = g_config.color_2.h, .s = g_config.color_2.s, .v = g_config.brightness } );
498
499 for ( int row = 0; row < MATRIX_ROWS; row++ )
500 {
501 for ( int column = 0; column < MATRIX_COLS; column++ )
502 {
503 uint8_t index;
504 map_row_column_to_led( row, column, &index );
505 if ( index < 72 )
506 {
507 if ( ( g_config.alphas_mods[row] & (1<<column) ) == 0 )
508 {
509 backlight_set_color( index, rgb1.r, rgb1.g, rgb1.b );
510 }
511 else
512 {
513 backlight_set_color( index, rgb2.r, rgb2.g, rgb2.b );
514 }
515 }
516 }
517 }
518}
519
520void backlight_effect_gradient_up_down(void)
521{
522 int16_t h1 = g_config.color_1.h;
523 int16_t h2 = g_config.color_2.h;
524 int16_t deltaH = h2 - h1;
525
526 // Take the shortest path between hues
527 if ( deltaH > 127 )
528 {
529 deltaH -= 256;
530 }
531 else if ( deltaH < -127 )
532 {
533 deltaH += 256;
534 }
535 // Divide delta by 4, this gives the delta per row
536 deltaH /= 4;
537
538 int16_t s1 = g_config.color_1.s;
539 int16_t s2 = g_config.color_2.s;
540 int16_t deltaS = ( s2 - s1 ) / 4;
541
542 HSV hsv = { .h = 0, .s = 255, .v = g_config.brightness };
543 RGB rgb;
544 Point point;
545 for ( int i=0; i<72; i++ )
546 {
547 map_led_to_point( i, &point );
548 // The y range will be 0..64, map this to 0..4
549 uint8_t y = (point.y>>4);
550 // Relies on hue being 8-bit and wrapping
551 hsv.h = g_config.color_1.h + ( deltaH * y );
552 hsv.s = g_config.color_1.s + ( deltaS * y );
553 rgb = hsv_to_rgb( hsv );
554 backlight_set_color( i, rgb.r, rgb.g, rgb.b );
555 }
556}
557
558void backlight_effect_raindrops(bool initialize)
559{
560 int16_t h1 = g_config.color_1.h;
561 int16_t h2 = g_config.color_2.h;
562 int16_t deltaH = h2 - h1;
563 deltaH /= 4;
564
565 // Take the shortest path between hues
566 if ( deltaH > 127 )
567 {
568 deltaH -= 256;
569 }
570 else if ( deltaH < -127 )
571 {
572 deltaH += 256;
573 }
574
575 int16_t s1 = g_config.color_1.s;
576 int16_t s2 = g_config.color_2.s;
577 int16_t deltaS = ( s2 - s1 ) / 4;
578
579 HSV hsv;
580 RGB rgb;
581
582 // Change one LED every tick
583 uint8_t led_to_change = ( g_tick & 0x000 ) == 0 ? rand() % 72 : 255;
584
585 for ( int i=0; i<72; i++ )
586 {
587 // If initialize, all get set to random colors
588 // If not, all but one will stay the same as before.
589 if ( initialize || i == led_to_change )
590 {
591 hsv.h = h1 + ( deltaH * ( rand() & 0x03 ) );
592 hsv.s = s1 + ( deltaS * ( rand() & 0x03 ) );
593 // Override brightness with global brightness control
594 hsv.v = g_config.brightness;;
595
596 rgb = hsv_to_rgb( hsv );
597 backlight_set_color( i, rgb.r, rgb.g, rgb.b );
598 }
599 }
600}
601
602void backlight_effect_cycle_all(void)
603{
604 uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF;
605
606 // Relies on hue being 8-bit and wrapping
607 for ( int i=0; i<72; i++ )
608 {
609 uint16_t offset2 = g_key_hit[i]<<2;
610 // stabilizer LEDs use spacebar hits
611 if ( i == 36+6 || i == 54+13 || // LC6, LD13
612 ( g_config.use_7u_spacebar && i == 54+14 ) ) // LD14
613 {
614 offset2 = g_key_hit[36+0]<<2;
615 }
616 offset2 = (offset2<=63) ? (63-offset2) : 0;
617
618 HSV hsv = { .h = offset+offset2, .s = 255, .v = g_config.brightness };
619 RGB rgb = hsv_to_rgb( hsv );
620 backlight_set_color( i, rgb.r, rgb.g, rgb.b );
621 }
622}
623
624void backlight_effect_cycle_left_right(void)
625{
626 uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF;
627 HSV hsv = { .h = 0, .s = 255, .v = g_config.brightness };
628 RGB rgb;
629 Point point;
630 for ( int i=0; i<72; i++ )
631 {
632 uint16_t offset2 = g_key_hit[i]<<2;
633 // stabilizer LEDs use spacebar hits
634 if ( i == 36+6 || i == 54+13 || // LC6, LD13
635 ( g_config.use_7u_spacebar && i == 54+14 ) ) // LD14
636 {
637 offset2 = g_key_hit[36+0]<<2;
638 }
639 offset2 = (offset2<=63) ? (63-offset2) : 0;
640
641 map_led_to_point( i, &point );
642 // Relies on hue being 8-bit and wrapping
643 hsv.h = point.x + offset + offset2;
644 rgb = hsv_to_rgb( hsv );
645 backlight_set_color( i, rgb.r, rgb.g, rgb.b );
646 }
647}
648
649void backlight_effect_cycle_up_down(void)
650{
651 uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF;
652 HSV hsv = { .h = 0, .s = 255, .v = g_config.brightness };
653 RGB rgb;
654 Point point;
655 for ( int i=0; i<72; i++ )
656 {
657 uint16_t offset2 = g_key_hit[i]<<2;
658 // stabilizer LEDs use spacebar hits
659 if ( i == 36+6 || i == 54+13 || // LC6, LD13
660 ( g_config.use_7u_spacebar && i == 54+14 ) ) // LD14
661 {
662 offset2 = g_key_hit[36+0]<<2;
663 }
664 offset2 = (offset2<=63) ? (63-offset2) : 0;
665
666 map_led_to_point( i, &point );
667 // Relies on hue being 8-bit and wrapping
668 hsv.h = point.y + offset + offset2;
669 rgb = hsv_to_rgb( hsv );
670 backlight_set_color( i, rgb.r, rgb.g, rgb.b );
671 }
672}
673
674void backlight_effect_jellybean_raindrops( bool initialize )
675{
676 HSV hsv;
677 RGB rgb;
678
679 // Change one LED every tick
680 uint8_t led_to_change = ( g_tick & 0x000 ) == 0 ? rand() % 72 : 255;
681
682 for ( int i=0; i<72; i++ )
683 {
684 // If initialize, all get set to random colors
685 // If not, all but one will stay the same as before.
686 if ( initialize || i == led_to_change )
687 {
688 hsv.h = rand() & 0xFF;
689 hsv.s = rand() & 0xFF;
690 // Override brightness with global brightness control
691 hsv.v = g_config.brightness;;
692
693 rgb = hsv_to_rgb( hsv );
694 backlight_set_color( i, rgb.r, rgb.g, rgb.b );
695 }
696 }
697}
698
699void backlight_effect_cycle_radial1(void)
700{
701 uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF;
702 HSV hsv = { .h = 0, .s = 255, .v = g_config.brightness };
703 RGB rgb;
704 Point point;
705 for ( int i=0; i<72; i++ )
706 {
707 map_led_to_point_polar( i, &point );
708 // Relies on hue being 8-bit and wrapping
709 hsv.h = point.x + offset;
710 hsv.s = point.y;
711 rgb = hsv_to_rgb( hsv );
712 backlight_set_color( i, rgb.r, rgb.g, rgb.b );
713 }
714}
715
716void backlight_effect_cycle_radial2(void)
717{
718 uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF;
719
720 HSV hsv = { .h = 0, .s = g_config.color_1.s, .v = g_config.brightness };
721 RGB rgb;
722 Point point;
723 for ( int i=0; i<72; i++ )
724 {
725 map_led_to_point_polar( i, &point );
726 uint8_t offset2 = offset + point.x;
727 if ( offset2 & 0x80 )
728 {
729 offset2 = ~offset2;
730 }
731 offset2 = offset2 >> 2;
732 hsv.h = g_config.color_1.h + offset2;
733 hsv.s = 127 + ( point.y >> 1 );
734 rgb = hsv_to_rgb( hsv );
735 backlight_set_color( i, rgb.r, rgb.g, rgb.b );
736 }
737}
738
739void backlight_effect_indicators_set_colors( uint8_t index, HSV hsv )
740{
741 RGB rgb = hsv_to_rgb( hsv );
742 if ( index == 254 )
743 {
744 backlight_set_color_all( rgb.r, rgb.g, rgb.b );
745 }
746 else
747 {
748 backlight_set_color( index, rgb.r, rgb.g, rgb.b );
749
750 // If the spacebar LED is the indicator,
751 // do the same for the spacebar stabilizers
752 if ( index == 36+0 ) // LC0
753 {
754#if defined (RGB_BACKLIGHT_ZEAL65)
755 backlight_set_color( 36+7, rgb.r, rgb.g, rgb.b ); // LC7
756 backlight_set_color( 54+14, rgb.r, rgb.g, rgb.b ); // LD14
757#elif defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_M60_A)
758 backlight_set_color( 36+6, rgb.r, rgb.g, rgb.b ); // LC6
759 backlight_set_color( 54+13, rgb.r, rgb.g, rgb.b ); // LD13
760 if ( g_config.use_7u_spacebar )
761 {
762 backlight_set_color( 54+14, rgb.r, rgb.g, rgb.b ); // LD14
763 }
764#endif
765 }
766 }
767}
768
769// This runs after another backlight effect and replaces
770// colors already set
771void backlight_effect_indicators(void)
772{
773 if ( g_config.caps_lock_indicator.index != 255 &&
774 ( g_indicator_state & (1<<USB_LED_CAPS_LOCK) ) )
775 {
776 backlight_effect_indicators_set_colors( g_config.caps_lock_indicator.index, g_config.caps_lock_indicator.color );
777 }
778
779 // This if/else if structure allows higher layers to
780 // override lower ones. If we set layer 3's indicator
781 // to none, then it will NOT show layer 2 or layer 1
782 // indicators, even if those layers are on via the
783 // MO13/MO23 Fn combo magic.
784 //
785 // Basically we want to handle the case where layer 3 is
786 // still the backlight configuration layer and we don't
787 // want "all LEDs" indicators hiding the backlight effect,
788 // but still allow end users to do whatever they want.
789 if ( IS_LAYER_ON(3) )
790 {
791 if ( g_config.layer_3_indicator.index != 255 )
792 {
793 backlight_effect_indicators_set_colors( g_config.layer_3_indicator.index, g_config.layer_3_indicator.color );
794 }
795 }
796 else if ( IS_LAYER_ON(2) )
797 {
798 if ( g_config.layer_2_indicator.index != 255 )
799 {
800 backlight_effect_indicators_set_colors( g_config.layer_2_indicator.index, g_config.layer_2_indicator.color );
801 }
802 }
803 else if ( IS_LAYER_ON(1) )
804 {
805 if ( g_config.layer_1_indicator.index != 255 )
806 {
807 backlight_effect_indicators_set_colors( g_config.layer_1_indicator.index, g_config.layer_1_indicator.color );
808 }
809 }
810}
811
812ISR(TIMER3_COMPA_vect)
813{
814 // delay 1 second before driving LEDs or doing anything else
815 static uint8_t startup_tick = 0;
816 if ( startup_tick < 20 )
817 {
818 startup_tick++;
819 return;
820 }
821
822 g_tick++;
823
824 if ( g_any_key_hit < 0xFFFFFFFF )
825 {
826 g_any_key_hit++;
827 }
828
829 for ( int led = 0; led < 72; led++ )
830 {
831 if ( g_key_hit[led] < 255 )
832 {
833 g_key_hit[led]++;
834 }
835 }
836
837 // Factory default magic value
838 if ( g_config.effect == 255 )
839 {
840 backlight_effect_rgb_test();
841 return;
842 }
843
844 // Ideally we would also stop sending zeros to the LED driver PWM buffers
845 // while suspended and just do a software shutdown. This is a cheap hack for now.
846 bool suspend_backlight = ((g_suspend_state && g_config.disable_when_usb_suspended) ||
847 (g_config.disable_after_timeout > 0 && g_any_key_hit > g_config.disable_after_timeout * 60 * 20));
848 uint8_t effect = suspend_backlight ? 0 : g_config.effect;
849
850 // Keep track of the effect used last time,
851 // detect change in effect, so each effect can
852 // have an optional initialization.
853 static uint8_t effect_last = 255;
854 bool initialize = effect != effect_last;
855 effect_last = effect;
856
857 // this gets ticked at 20 Hz.
858 // each effect can opt to do calculations
859 // and/or request PWM buffer updates.
860 switch ( effect )
861 {
862 case 0:
863 backlight_effect_all_off();
864 break;
865 case 1:
866 backlight_effect_solid_color();
867 break;
868 case 2:
869 backlight_effect_alphas_mods();
870 break;
871 case 3:
872 backlight_effect_gradient_up_down();
873 break;
874 case 4:
875 backlight_effect_raindrops( initialize );
876 break;
877 case 5:
878 backlight_effect_cycle_all();
879 break;
880 case 6:
881 backlight_effect_cycle_left_right();
882 break;
883 case 7:
884 backlight_effect_cycle_up_down();
885 break;
886 case 8:
887 backlight_effect_jellybean_raindrops( initialize );
888 break;
889 case 9:
890 backlight_effect_cycle_radial1();
891 break;
892 case 10:
893 backlight_effect_cycle_radial2();
894 break;
895 default:
896 backlight_effect_all_off();
897 break;
898 }
899
900 if ( ! suspend_backlight )
901 {
902 backlight_effect_indicators();
903 }
904}
905
906void backlight_set_indicator_index( uint8_t *index, uint8_t row, uint8_t column )
907{
908 if ( row >= MATRIX_ROWS )
909 {
910 // Special value, 255=none, 254=all
911 *index = row;
912 }
913 else
914 {
915 map_row_column_to_led( row, column, index );
916 }
917}
918
919// Some helpers for setting/getting HSV
920void _set_color( HSV *color, uint8_t *data )
921{
922 color->h = data[0];
923 color->s = data[1];
924 color->v = data[2];
925}
926
927void _get_color( HSV *color, uint8_t *data )
928{
929 data[0] = color->h;
930 data[1] = color->s;
931 data[2] = color->v;
932}
933
934void backlight_config_set_value( uint8_t *data )
935{
936 bool reinitialize = false;
937 uint8_t *value_id = &(data[0]);
938 uint8_t *value_data = &(data[1]);
939 switch ( *value_id )
940 {
941#if defined (RGB_BACKLIGHT_ZEAL60) || defined(RGB_BACKLIGHT_ZEAL65)
942 case id_use_split_backspace:
943 {
944 g_config.use_split_backspace = (bool)*value_data;
945 reinitialize = true;
946 break;
947 }
948#endif
949#if defined (RGB_BACKLIGHT_ZEAL60)
950 case id_use_split_left_shift:
951 {
952 g_config.use_split_left_shift = (bool)*value_data;
953 reinitialize = true;
954 break;
955 }
956 case id_use_split_right_shift:
957 {
958 g_config.use_split_right_shift = (bool)*value_data;
959 reinitialize = true;
960 break;
961 }
962 case id_use_7u_spacebar:
963 {
964 g_config.use_7u_spacebar = (bool)*value_data;
965 reinitialize = true;
966 break;
967 }
968 case id_use_iso_enter:
969 {
970 g_config.use_iso_enter = (bool)*value_data;
971 reinitialize = true;
972 break;
973 }
974 case id_disable_hhkb_blocker_leds:
975 {
976 g_config.disable_hhkb_blocker_leds = (bool)*value_data;
977 reinitialize = true;
978 break;
979 }
980#endif
981 case id_disable_when_usb_suspended:
982 {
983 g_config.disable_when_usb_suspended = (bool)*value_data;
984 break;
985 }
986 case id_disable_after_timeout:
987 {
988 g_config.disable_after_timeout = *value_data;
989 break;
990 }
991 case id_brightness:
992 {
993 g_config.brightness = *value_data;
994 break;
995 }
996 case id_effect:
997 {
998 g_config.effect = *value_data;
999 break;
1000 }
1001 case id_effect_speed:
1002 {
1003 g_config.effect_speed = *value_data;
1004 break;
1005 }
1006 case id_color_1:
1007 {
1008 _set_color( &(g_config.color_1), value_data );
1009 break;
1010 }
1011 case id_color_2:
1012 {
1013 _set_color( &(g_config.color_2), value_data );
1014 break;
1015 }
1016 case id_caps_lock_indicator_color:
1017 {
1018 _set_color( &(g_config.caps_lock_indicator.color), value_data );
1019 break;
1020 }
1021 case id_caps_lock_indicator_row_col:
1022 {
1023 backlight_set_indicator_index( &(g_config.caps_lock_indicator.index), value_data[0], value_data[1] );
1024 break;
1025 }
1026 case id_layer_1_indicator_color:
1027 {
1028 _set_color( &(g_config.layer_1_indicator.color), value_data );
1029 break;
1030 }
1031 case id_layer_1_indicator_row_col:
1032 {
1033 backlight_set_indicator_index( &(g_config.layer_1_indicator.index), value_data[0], value_data[1] );
1034 break;
1035 }
1036 case id_layer_2_indicator_color:
1037 {
1038 _set_color( &(g_config.layer_2_indicator.color), value_data );
1039 break;
1040 }
1041 case id_layer_2_indicator_row_col:
1042 {
1043 backlight_set_indicator_index( &(g_config.layer_2_indicator.index), value_data[0], value_data[1] );
1044 break;
1045 }
1046 case id_layer_3_indicator_color:
1047 {
1048 _set_color( &(g_config.layer_3_indicator.color), value_data );
1049 break;
1050 }
1051 case id_layer_3_indicator_row_col:
1052 {
1053 backlight_set_indicator_index( &(g_config.layer_3_indicator.index), value_data[0], value_data[1] );
1054 break;
1055 }
1056 case id_alphas_mods:
1057 {
1058 for ( int i=0; i<5; i++ )
1059 {
1060 g_config.alphas_mods[i] = ( *(value_data+i*2) << 8 ) | ( *(value_data+i*2+1) );
1061 }
1062 }
1063 }
1064
1065 if ( reinitialize )
1066 {
1067 backlight_init_drivers();
1068 }
1069}
1070
1071void backlight_config_get_value( uint8_t *data )
1072{
1073 uint8_t *value_id = &(data[0]);
1074 uint8_t *value_data = &(data[1]);
1075 switch ( *value_id )
1076 {
1077 case id_use_split_backspace:
1078 {
1079 *value_data = ( g_config.use_split_backspace ? 1 : 0 );
1080 break;
1081 }
1082 case id_use_split_left_shift:
1083 {
1084 *value_data = ( g_config.use_split_left_shift ? 1 : 0 );
1085 break;
1086 }
1087 case id_use_split_right_shift:
1088 {
1089 *value_data = ( g_config.use_split_right_shift ? 1 : 0 );
1090 break;
1091 }
1092 case id_use_7u_spacebar:
1093 {
1094 *value_data = ( g_config.use_7u_spacebar ? 1 : 0 );
1095 break;
1096 }
1097 case id_use_iso_enter:
1098 {
1099 *value_data = ( g_config.use_iso_enter ? 1 : 0 );
1100 break;
1101 }
1102 case id_disable_when_usb_suspended:
1103 {
1104 *value_data = ( g_config.disable_when_usb_suspended ? 1 : 0 );
1105 break;
1106 }
1107 case id_disable_hhkb_blocker_leds:
1108 {
1109 *value_data = ( g_config.disable_hhkb_blocker_leds ? 1 : 0 );
1110 break;
1111 }
1112 case id_disable_after_timeout:
1113 {
1114 *value_data = g_config.disable_after_timeout;
1115 break;
1116 }
1117 case id_brightness:
1118 {
1119 *value_data = g_config.brightness;
1120 break;
1121 }
1122 case id_effect:
1123 {
1124 *value_data = g_config.effect;
1125 break;
1126 }
1127 case id_effect_speed:
1128 {
1129 *value_data = g_config.effect_speed;
1130 break;
1131 }
1132 case id_color_1:
1133 {
1134 _get_color( &(g_config.color_1), value_data );
1135 break;
1136 }
1137 case id_color_2:
1138 {
1139 _get_color( &(g_config.color_2), value_data );
1140 break;
1141 }
1142 case id_caps_lock_indicator_color:
1143 {
1144 _get_color( &(g_config.caps_lock_indicator.color), value_data );
1145 break;
1146 }
1147 case id_caps_lock_indicator_row_col:
1148 {
1149 //*value_data = g_config.caps_lock_indicator.index;
1150 break;
1151 }
1152 case id_layer_1_indicator_color:
1153 {
1154 _get_color( &(g_config.layer_1_indicator.color), value_data );
1155 break;
1156 }
1157 case id_layer_1_indicator_row_col:
1158 {
1159 //*value_data = g_config.layer_1_indicator.index;
1160 break;
1161 }
1162 case id_layer_2_indicator_color:
1163 {
1164 _get_color( &(g_config.layer_2_indicator.color), value_data );
1165 break;
1166 }
1167 case id_layer_2_indicator_row_col:
1168 {
1169 //*value_data = g_config.layer_2_indicator.index;
1170 break;
1171 }
1172 case id_layer_3_indicator_color:
1173 {
1174 _get_color( &(g_config.layer_3_indicator.color), value_data );
1175 break;
1176 }
1177 case id_layer_3_indicator_row_col:
1178 {
1179 //*value_data = g_config.layer_3_indicator.index;
1180 break;
1181 }
1182 case id_alphas_mods:
1183 {
1184 for ( int i=0; i<5; i++ )
1185 {
1186 *(value_data+i*2) = g_config.alphas_mods[i] >> 8;
1187 *(value_data+i*2+1) = g_config.alphas_mods[i] & 0xFF;
1188 }
1189 }
1190 }
1191}
1192
1193void backlight_config_set_alphas_mods( uint16_t *alphas_mods )
1194{
1195 for ( int i=0; i<5; i++ )
1196 {
1197 g_config.alphas_mods[i] = alphas_mods[i];
1198 }
1199
1200 backlight_config_save();
1201}
1202
1203void backlight_config_load(void)
1204{
1205 eeprom_read_block( &g_config, ((void*)RGB_BACKLIGHT_CONFIG_EEPROM_ADDR), sizeof(backlight_config) );
1206}
1207
1208void backlight_config_save(void)
1209{
1210 eeprom_update_block( &g_config, ((void*)RGB_BACKLIGHT_CONFIG_EEPROM_ADDR), sizeof(backlight_config) );
1211}
1212
1213void backlight_init_drivers(void)
1214{
1215 // Initialize I2C
1216 i2c_init();
1217 IS31FL3731_init( ISSI_ADDR_1 );
1218 IS31FL3731_init( ISSI_ADDR_2 );
1219
1220 for ( int index = 0; index < 72; index++ )
1221 {
1222 // OR the possible "disabled" cases together, then NOT the result to get the enabled state
1223 // LC6 LD13 not present on Zeal65
1224#if defined (RGB_BACKLIGHT_ZEAL65)
1225 bool enabled = !( ( index == 18+5 && !g_config.use_split_backspace ) || // LB5
1226 ( index == 36+15 && !g_config.use_split_left_shift ) || // LC15
1227 ( index == 54+8 && !g_config.use_split_right_shift ) || // LD8
1228 ( index == 36+6 ) || // LC6
1229 ( index == 54+13 ) ); // LD13
1230#elif defined (RGB_BACKLIGHT_M60_A)
1231 bool enabled = !(
1232 // LB6 LB7 LB8 LB15 LB16 LB17 not present on M60-A
1233 ( index == 18+6 ) || // LB6
1234 ( index == 18+7 ) || // LB7
1235 ( index == 18+8 ) || // LB8
1236 ( index == 18+15 ) || // LB15
1237 ( index == 18+16 ) || // LB16
1238 ( index == 18+17 ) || // LB17
1239 // HHKB blockers (LC17, LD17) and ISO extra keys (LC15,LD13) not present on M60-A
1240 ( index == 36+17 ) || // LC17
1241 ( index == 54+17 ) || // LD17
1242 ( index == 36+15 ) || // LC15
1243 ( index == 54+13 ) ); // LD13
1244#elif defined (RGB_BACKLIGHT_ZEAL60)
1245 // LB6 LB7 LB8 LB15 LB16 LB17 not present on Zeal60
1246 bool enabled = !( ( index == 18+5 && !g_config.use_split_backspace ) || // LB5
1247 ( index == 36+15 && !g_config.use_split_left_shift ) || // LC15
1248 ( index == 54+8 && !g_config.use_split_right_shift ) || // LD8
1249 ( index == 54+13 && g_config.use_7u_spacebar ) || // LD13
1250 ( index == 36+17 && g_config.disable_hhkb_blocker_leds ) || // LC17
1251 ( index == 54+17 && g_config.disable_hhkb_blocker_leds ) || // LD17
1252 ( index == 18+6 ) || // LB6
1253 ( index == 18+7 ) || // LB7
1254 ( index == 18+8 ) || // LB8
1255 ( index == 18+15 ) || // LB15
1256 ( index == 18+16 ) || // LB16
1257 ( index == 18+17 ) ); // LB17
1258#endif
1259 // This only caches it for later
1260 IS31FL3731_set_led_control_register( index, enabled, enabled, enabled );
1261 }
1262 // This actually updates the LED drivers
1263 IS31FL3731_update_led_control_registers( ISSI_ADDR_1, ISSI_ADDR_2 );
1264
1265 // TODO: put the 1 second startup delay here?
1266
1267 // clear the key hits
1268 for ( int led=0; led<72; led++ )
1269 {
1270 g_key_hit[led] = 255;
1271 }
1272}
1273
1274bool process_record_backlight(uint16_t keycode, keyrecord_t *record)
1275{
1276 // Record keypresses for backlight effects
1277 if ( record->event.pressed )
1278 {
1279 backlight_set_key_hit( record->event.key.row, record->event.key.col );
1280 }
1281
1282 switch(keycode)
1283 {
1284 case BR_INC:
1285 if (record->event.pressed)
1286 {
1287 backlight_brightness_increase();
1288 }
1289 return false;
1290 break;
1291 case BR_DEC:
1292 if (record->event.pressed)
1293 {
1294 backlight_brightness_decrease();
1295 }
1296 return false;
1297 break;
1298 case EF_INC:
1299 if (record->event.pressed)
1300 {
1301 backlight_effect_increase();
1302 }
1303 return false;
1304 break;
1305 case EF_DEC:
1306 if (record->event.pressed)
1307 {
1308 backlight_effect_decrease();
1309 }
1310 return false;
1311 break;
1312 case ES_INC:
1313 if (record->event.pressed)
1314 {
1315 backlight_effect_speed_increase();
1316 }
1317 return false;
1318 break;
1319 case ES_DEC:
1320 if (record->event.pressed)
1321 {
1322 backlight_effect_speed_decrease();
1323 }
1324 return false;
1325 break;
1326 case H1_INC:
1327 if (record->event.pressed)
1328 {
1329 backlight_color_1_hue_increase();
1330 }
1331 return false;
1332 break;
1333 case H1_DEC:
1334 if (record->event.pressed)
1335 {
1336 backlight_color_1_hue_decrease();
1337 }
1338 return false;
1339 break;
1340 case S1_INC:
1341 if (record->event.pressed)
1342 {
1343 backlight_color_1_sat_increase();
1344 }
1345 return false;
1346 break;
1347 case S1_DEC:
1348 if (record->event.pressed)
1349 {
1350 backlight_color_1_sat_decrease();
1351 break;
1352 }
1353 return false;
1354 break;
1355 case H2_INC:
1356 if (record->event.pressed)
1357 {
1358 backlight_color_2_hue_increase();
1359 }
1360 return false;
1361 break;
1362 case H2_DEC:
1363 if (record->event.pressed)
1364 {
1365 backlight_color_2_hue_decrease();
1366 }
1367 return false;
1368 break;
1369 case S2_INC:
1370 if (record->event.pressed)
1371 {
1372 backlight_color_2_sat_increase();
1373 }
1374 return false;
1375 break;
1376 case S2_DEC:
1377 if (record->event.pressed)
1378 {
1379 backlight_color_2_sat_decrease();
1380 break;
1381 }
1382 return false;
1383 break;
1384 }
1385
1386 return true;
1387}
1388
1389// Deals with the messy details of incrementing an integer
1390uint8_t increment( uint8_t value, uint8_t step, uint8_t min, uint8_t max )
1391{
1392 int16_t new_value = value;
1393 new_value += step;
1394 return MIN( MAX( new_value, min ), max );
1395}
1396
1397uint8_t decrement( uint8_t value, uint8_t step, uint8_t min, uint8_t max )
1398{
1399 int16_t new_value = value;
1400 new_value -= step;
1401 return MIN( MAX( new_value, min ), max );
1402}
1403
1404void backlight_effect_increase(void)
1405{
1406 g_config.effect = increment( g_config.effect, 1, 0, BACKLIGHT_EFFECT_MAX );
1407 backlight_config_save();
1408}
1409
1410void backlight_effect_decrease(void)
1411{
1412 g_config.effect = decrement( g_config.effect, 1, 0, BACKLIGHT_EFFECT_MAX );
1413 backlight_config_save();
1414}
1415
1416void backlight_effect_speed_increase(void)
1417{
1418 g_config.effect_speed = increment( g_config.effect_speed, 1, 0, 3 );
1419 backlight_config_save();
1420}
1421
1422void backlight_effect_speed_decrease(void)
1423{
1424 g_config.effect_speed = decrement( g_config.effect_speed, 1, 0, 3 );
1425 backlight_config_save();
1426}
1427
1428void backlight_brightness_increase(void)
1429{
1430 g_config.brightness = increment( g_config.brightness, 8, 0, 255 );
1431 backlight_config_save();
1432}
1433
1434void backlight_brightness_decrease(void)
1435{
1436 g_config.brightness = decrement( g_config.brightness, 8, 0, 255 );
1437 backlight_config_save();
1438}
1439
1440void backlight_color_1_hue_increase(void)
1441{
1442 g_config.color_1.h = increment( g_config.color_1.h, 8, 0, 255 );
1443 backlight_config_save();
1444}
1445
1446void backlight_color_1_hue_decrease(void)
1447{
1448 g_config.color_1.h = decrement( g_config.color_1.h, 8, 0, 255 );
1449 backlight_config_save();
1450}
1451
1452void backlight_color_1_sat_increase(void)
1453{
1454 g_config.color_1.s = increment( g_config.color_1.s, 8, 0, 255 );
1455 backlight_config_save();
1456}
1457
1458void backlight_color_1_sat_decrease(void)
1459{
1460 g_config.color_1.s = decrement( g_config.color_1.s, 8, 0, 255 );
1461 backlight_config_save();
1462}
1463
1464void backlight_color_2_hue_increase(void)
1465{
1466 g_config.color_2.h = increment( g_config.color_2.h, 8, 0, 255 );
1467 backlight_config_save();
1468}
1469
1470void backlight_color_2_hue_decrease(void)
1471{
1472 g_config.color_2.h = decrement( g_config.color_2.h, 8, 0, 255 );
1473 backlight_config_save();
1474}
1475
1476void backlight_color_2_sat_increase(void)
1477{
1478 g_config.color_2.s = increment( g_config.color_2.s, 8, 0, 255 );
1479 backlight_config_save();
1480}
1481
1482void backlight_color_2_sat_decrease(void)
1483{
1484 g_config.color_2.s = decrement( g_config.color_2.s, 8, 0, 255 );
1485 backlight_config_save();
1486}
1487
1488void backlight_test_led( uint8_t index, bool red, bool green, bool blue )
1489{
1490 for ( int i=0; i<72; i++ )
1491 {
1492 if ( i == index )
1493 {
1494 IS31FL3731_set_led_control_register( i, red, green, blue );
1495 }
1496 else
1497 {
1498 IS31FL3731_set_led_control_register( i, false, false, false );
1499 }
1500 }
1501}
1502
1503void backlight_debug_led( bool state )
1504{
1505 if (state)
1506 {
1507 // Output high.
1508 DDRE |= (1<<6);
1509 PORTE |= (1<<6);
1510 }
1511 else
1512 {
1513 // Output low.
1514 DDRE &= ~(1<<6);
1515 PORTE &= ~(1<<6);
1516 }
1517}
1518
1519#endif // BACKLIGHT_ENABLED
diff --git a/keyboards/zeal60/rgb_backlight.h b/keyboards/zeal60/rgb_backlight.h
new file mode 100644
index 000000000..60f2ace51
--- /dev/null
+++ b/keyboards/zeal60/rgb_backlight.h
@@ -0,0 +1,101 @@
1/* Copyright 2017 Jason Williams (Wilba)
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#if RGB_BACKLIGHT_ENABLED
19#else
20#error rgb_backlight.h included when RGB_BACKLIGHT_ENABLED == 0
21#endif // RGB_BACKLIGHT_ENABLED
22
23#include <stdint.h>
24#include <stdbool.h>
25
26#include "quantum/color.h"
27
28typedef struct
29{
30 HSV color;
31 uint8_t index;
32} backlight_config_indicator;
33
34typedef struct
35{
36 bool use_split_backspace:1; // |
37 bool use_split_left_shift:1; // |
38 bool use_split_right_shift:1; // |
39 bool use_7u_spacebar:1; // |
40 bool use_iso_enter:1; // |
41 bool disable_when_usb_suspended:1; // |
42 bool disable_hhkb_blocker_leds:1; // |
43 bool __pad7:1; // 1 byte
44 uint8_t disable_after_timeout; // 1 byte
45 uint8_t brightness; // 1 byte
46 uint8_t effect; // 1 byte
47 uint8_t effect_speed; // 1 byte
48 HSV color_1; // 3 bytes
49 HSV color_2; // 3 bytes
50 backlight_config_indicator caps_lock_indicator; // 4 bytes
51 backlight_config_indicator layer_1_indicator; // 4 bytes
52 backlight_config_indicator layer_2_indicator; // 4 bytes
53 backlight_config_indicator layer_3_indicator; // 4 bytes
54 uint16_t alphas_mods[5]; // 10 bytes
55} backlight_config; // = 37 bytes
56
57void backlight_config_load(void);
58void backlight_config_save(void);
59void backlight_config_set_value( uint8_t *data );
60void backlight_config_get_value( uint8_t *data );
61
62void backlight_init_drivers(void);
63
64void backlight_timer_init(void);
65void backlight_timer_enable(void);
66void backlight_timer_disable(void);
67
68void backlight_set_suspend_state(bool state);
69void backlight_set_indicator_state(uint8_t state);
70
71// This should not be called from an interrupt
72// (eg. from a timer interrupt).
73// Call this while idle (in between matrix scans).
74// If the buffer is dirty, it will update the driver with the buffer.
75void backlight_update_pwm_buffers(void);
76
77// Handle backlight specific keycodes
78bool process_record_backlight(uint16_t keycode, keyrecord_t *record);
79
80void backlight_set_key_hit(uint8_t row, uint8_t col);
81
82void backlight_effect_increase(void);
83void backlight_effect_decrease(void);
84void backlight_effect_speed_increase(void);
85void backlight_effect_speed_decrease(void);
86
87void backlight_brightness_increase(void);
88void backlight_brightness_decrease(void);
89
90void backlight_color_1_hue_increase(void);
91void backlight_color_1_hue_decrease(void);
92void backlight_color_1_sat_increase(void);
93void backlight_color_1_sat_decrease(void);
94void backlight_color_2_hue_increase(void);
95void backlight_color_2_hue_decrease(void);
96void backlight_color_2_sat_increase(void);
97void backlight_color_2_sat_decrease(void);
98
99void backlight_test_led( uint8_t index, bool red, bool green, bool blue );
100void backlight_debug_led(bool state);
101
diff --git a/keyboards/zeal60/rgb_backlight_api.h b/keyboards/zeal60/rgb_backlight_api.h
new file mode 100644
index 000000000..01827e849
--- /dev/null
+++ b/keyboards/zeal60/rgb_backlight_api.h
@@ -0,0 +1,42 @@
1/* Copyright 2017 Jason Williams (Wilba)
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18enum backlight_config_value
19{
20 id_use_split_backspace = 0x01,
21 id_use_split_left_shift = 0x02,
22 id_use_split_right_shift = 0x03,
23 id_use_7u_spacebar = 0x04,
24 id_use_iso_enter = 0x05,
25 id_disable_hhkb_blocker_leds = 0x06,
26 id_disable_when_usb_suspended = 0x07,
27 id_disable_after_timeout = 0x08,
28 id_brightness = 0x09,
29 id_effect = 0x0A,
30 id_effect_speed = 0x0B,
31 id_color_1 = 0x0C,
32 id_color_2 = 0x0D,
33 id_caps_lock_indicator_color = 0x0E,
34 id_caps_lock_indicator_row_col = 0x0F,
35 id_layer_1_indicator_color = 0x10,
36 id_layer_1_indicator_row_col = 0x11,
37 id_layer_2_indicator_color = 0x12,
38 id_layer_2_indicator_row_col = 0x13,
39 id_layer_3_indicator_color = 0x14,
40 id_layer_3_indicator_row_col = 0x15,
41 id_alphas_mods = 0x16
42};
diff --git a/keyboards/zeal60/rgb_backlight_keycodes.h b/keyboards/zeal60/rgb_backlight_keycodes.h
new file mode 100644
index 000000000..ba7f03f89
--- /dev/null
+++ b/keyboards/zeal60/rgb_backlight_keycodes.h
@@ -0,0 +1,34 @@
1/* Copyright 2017 Jason Williams (Wilba)
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18// This is hardcoded at 0x5F00 so it's well after keycode value SAFE_RANGE
19enum backlight_keycodes {
20 BR_INC = 0x5F00, // backlight brightness increase
21 BR_DEC, // backlight brightness decrease
22 EF_INC, // backlight effect increase
23 EF_DEC, // backlight effect decrease
24 ES_INC,
25 ES_DEC,
26 H1_INC,
27 H1_DEC,
28 S1_INC,
29 S1_DEC,
30 H2_INC,
31 H2_DEC,
32 S2_INC,
33 S2_DEC
34};
diff --git a/keyboards/zeal60/rules.mk b/keyboards/zeal60/rules.mk
new file mode 100644
index 000000000..c4686f985
--- /dev/null
+++ b/keyboards/zeal60/rules.mk
@@ -0,0 +1,78 @@
1
2
3# project specific files
4SRC = rgb_backlight.c \
5 quantum/color.c \
6 drivers/issi/is31fl3731.c \
7 drivers/avr/i2c_master.c
8
9# MCU name
10MCU = atmega32u4
11
12# Processor frequency.
13# This will define a symbol, F_CPU, in all source code files equal to the
14# processor frequency in Hz. You can then use this symbol in your source code to
15# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
16# automatically to create a 32-bit value in your source code.
17#
18# This will be an integer division of F_USB below, as it is sourced by
19# F_USB after it has run through any CPU prescalers. Note that this value
20# does not *change* the processor frequency - it should merely be updated to
21# reflect the processor speed set externally so that the code can use accurate
22# software delays.
23F_CPU = 16000000
24
25#
26# LUFA specific
27#
28# Target architecture (see library "Board Types" documentation).
29ARCH = AVR8
30
31# Input clock frequency.
32# This will define a symbol, F_USB, in all source code files equal to the
33# input clock frequency (before any prescaling is performed) in Hz. This value may
34# differ from F_CPU if prescaling is used on the latter, and is required as the
35# raw input clock is fed directly to the PLL sections of the AVR for high speed
36# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
37# at the end, this will be done automatically to create a 32-bit value in your
38# source code.
39#
40# If no clock division is performed on the input clock inside the AVR (via the
41# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
42F_USB = $(F_CPU)
43
44# Interrupt driven control endpoint task(+60)
45OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
46
47# Boot Section
48BOOTLOADER = atmel-dfu
49
50# Do not put the microcontroller into power saving mode
51# when we get USB suspend event. We want it to keep updating
52# backlight effects.
53OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
54
55# Build Options
56# change to "no" to disable the options, or define them in the Makefile in
57# the appropriate keymap folder that will get included automatically
58#
59BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
60MOUSEKEY_ENABLE = no # Mouse keys(+4700)
61EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
62CONSOLE_ENABLE = no # Console for debug(+400)
63COMMAND_ENABLE = no # Commands for debug and configuration
64NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
65BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
66MIDI_ENABLE = no # MIDI controls
67AUDIO_ENABLE = no # Audio output on port C6
68UNICODE_ENABLE = no # Unicode
69BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
70RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
71
72# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
73SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
74
75RAW_ENABLE = yes
76DYNAMIC_KEYMAP_ENABLE = yes
77CIE1931_CURVE = yes
78
diff --git a/keyboards/zeal60/zeal60.c b/keyboards/zeal60/zeal60.c
new file mode 100644
index 000000000..e516c4dbf
--- /dev/null
+++ b/keyboards/zeal60/zeal60.c
@@ -0,0 +1,341 @@
1/* Copyright 2017 Jason Williams (Wilba)
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 "zeal60.h"
17#include "zeal60_api.h"
18
19// Check that no backlight functions are called
20#if RGB_BACKLIGHT_ENABLED
21#include "rgb_backlight.h"
22#endif // BACKLIGHT_ENABLED
23
24#include "raw_hid.h"
25#include "dynamic_keymap.h"
26#include "timer.h"
27#include "tmk_core/common/eeprom.h"
28
29bool eeprom_is_valid(void)
30{
31 return (eeprom_read_word(((void*)EEPROM_MAGIC_ADDR)) == EEPROM_MAGIC &&
32 eeprom_read_byte(((void*)EEPROM_VERSION_ADDR)) == EEPROM_VERSION);
33}
34
35void eeprom_set_valid(bool valid)
36{
37 eeprom_update_word(((void*)EEPROM_MAGIC_ADDR), valid ? EEPROM_MAGIC : 0xFFFF);
38 eeprom_update_byte(((void*)EEPROM_VERSION_ADDR), valid ? EEPROM_VERSION : 0xFF);
39}
40
41#ifdef RAW_ENABLE
42
43void raw_hid_receive( uint8_t *data, uint8_t length )
44{
45 uint8_t *command_id = &(data[0]);
46 uint8_t *command_data = &(data[1]);
47 switch ( *command_id )
48 {
49 case id_get_protocol_version:
50 {
51 command_data[0] = PROTOCOL_VERSION >> 8;
52 command_data[1] = PROTOCOL_VERSION & 0xFF;
53 break;
54 }
55 case id_get_keyboard_value:
56 {
57 if ( command_data[0] == 0x01 )
58 {
59 uint32_t value = timer_read32();
60 command_data[1] = (value >> 24 ) & 0xFF;
61 command_data[2] = (value >> 16 ) & 0xFF;
62 command_data[3] = (value >> 8 ) & 0xFF;
63 command_data[4] = value & 0xFF;
64 }
65 else
66 {
67 *command_id = id_unhandled;
68 }
69 break;
70 }
71#ifdef DYNAMIC_KEYMAP_ENABLE
72 case id_dynamic_keymap_get_keycode:
73 {
74 uint16_t keycode = dynamic_keymap_get_keycode( command_data[0], command_data[1], command_data[2] );
75 command_data[3] = keycode >> 8;
76 command_data[4] = keycode & 0xFF;
77 break;
78 }
79 case id_dynamic_keymap_set_keycode:
80 {
81 dynamic_keymap_set_keycode( command_data[0], command_data[1], command_data[2], ( command_data[3] << 8 ) | command_data[4] );
82 break;
83 }
84 case id_dynamic_keymap_clear_all:
85 {
86 dynamic_keymap_clear_all();
87 break;
88 }
89#endif // DYNAMIC_KEYMAP_ENABLE
90#if RGB_BACKLIGHT_ENABLED
91 case id_backlight_config_set_value:
92 {
93 backlight_config_set_value(command_data);
94 break;
95 }
96 case id_backlight_config_get_value:
97 {
98 backlight_config_get_value(command_data);
99 break;
100 }
101 case id_backlight_config_save:
102 {
103 backlight_config_save();
104 break;
105 }
106#endif // RGB_BACKLIGHT_ENABLED
107 default:
108 {
109 // Unhandled message.
110 *command_id = id_unhandled;
111 break;
112 }
113 }
114
115 // Return same buffer with values changed
116 raw_hid_send( data, length );
117
118}
119
120#endif
121
122void bootmagic_lite(void)
123{
124 // The lite version of TMK's bootmagic.
125 // 100% less potential for accidentally making the
126 // keyboard do stupid things.
127
128 // We need multiple scans because debouncing can't be turned off.
129 matrix_scan();
130 wait_ms(DEBOUNCING_DELAY);
131 wait_ms(DEBOUNCING_DELAY);
132 matrix_scan();
133
134 // If the Esc and space bar are held down on power up,
135 // reset the EEPROM valid state and jump to bootloader.
136 // Assumes Esc is at [0,0] and spacebar is at [4,7].
137 // This isn't very generalized, but we need something that doesn't
138 // rely on user's keymaps in firmware or EEPROM.
139 if ( ( matrix_get_row(0) & (1<<0) ) &&
140 ( matrix_get_row(4) & (1<<7) ) )
141 {
142 // Set the Zeal60 specific EEPROM state as invalid.
143 eeprom_set_valid(false);
144 // Set the TMK/QMK EEPROM state as invalid.
145 eeconfig_disable();
146 // Jump to bootloader.
147 bootloader_jump();
148 }
149}
150
151void matrix_init_kb(void)
152{
153 bootmagic_lite();
154
155 // If the EEPROM has the magic, the data is good.
156 // OK to load from EEPROM.
157 if (eeprom_is_valid())
158 {
159#if RGB_BACKLIGHT_ENABLED
160 backlight_config_load();
161#endif // RGB_BACKLIGHT_ENABLED
162 // TODO: do something to "turn on" keymaps in EEPROM?
163 }
164 else
165 {
166#if RGB_BACKLIGHT_ENABLED
167 // If the EEPROM has not been saved before, or is out of date,
168 // save the default values to the EEPROM. Default values
169 // come from construction of the zeal_backlight_config instance.
170 backlight_config_save();
171#endif // RGB_BACKLIGHT_ENABLED
172
173#ifdef DYNAMIC_KEYMAP_ENABLE
174 // This saves "empty" keymaps so it falls back to the keymaps
175 // in the firmware (aka. progmem/flash)
176 dynamic_keymap_clear_all();
177#endif
178
179 // Save the magic number last, in case saving was interrupted
180 eeprom_set_valid(true);
181 }
182
183#if RGB_BACKLIGHT_ENABLED
184 // Initialize LED drivers for backlight.
185 backlight_init_drivers();
186
187 backlight_timer_init();
188 backlight_timer_enable();
189#endif // RGB_BACKLIGHT_ENABLED
190
191 matrix_init_user();
192}
193
194void matrix_scan_kb(void)
195{
196#if RGB_BACKLIGHT_ENABLED
197 // This only updates the LED driver buffers if something has changed.
198 backlight_update_pwm_buffers();
199#endif // BACKLIGHT_ENABLED
200 matrix_scan_user();
201}
202
203bool process_record_kb(uint16_t keycode, keyrecord_t *record)
204{
205#if RGB_BACKLIGHT_ENABLED
206 process_record_backlight(keycode, record);
207#endif // BACKLIGHT_ENABLED
208
209 switch(keycode)
210 {
211 case FN_MO13:
212 if (record->event.pressed)
213 {
214 layer_on(1);
215 update_tri_layer(1, 2, 3);
216 }
217 else
218 {
219 layer_off(1);
220 update_tri_layer(1, 2, 3);
221 }
222 return false;
223 break;
224 case FN_MO23:
225 if (record->event.pressed)
226 {
227 layer_on(2);
228 update_tri_layer(1, 2, 3);
229 }
230 else
231 {
232 layer_off(2);
233 update_tri_layer(1, 2, 3);
234 }
235 return false;
236 break;
237 }
238
239 return process_record_user(keycode, record);
240}
241
242// This overrides the one in quantum/keymap_common.c
243uint16_t keymap_function_id_to_action( uint16_t function_id )
244{
245 // Zeal60 specific "action functions" are 0xF00 to 0xFFF
246 // i.e. F(0xF00) to F(0xFFF) are mapped to
247 // enum zeal60_action_functions by masking last 8 bits.
248 if ( function_id >= 0x0F00 && function_id <= 0x0FFF )
249 {
250 uint8_t id = function_id & 0xFF;
251 switch ( id )
252 {
253 case TRIPLE_TAP_1_3:
254 case TRIPLE_TAP_2_3:
255 {
256 return ACTION_FUNCTION_TAP(id);
257 break;
258 }
259 default:
260 break;
261 }
262 }
263
264#if USE_KEYMAPS_IN_EEPROM
265
266#if 0
267 // This is how to implement actions stored in EEPROM.
268 // Not yet implemented. Not sure if it's worth the trouble
269 // before we have a nice GUI for keymap editing.
270 if ( eeprom_is_valid() &&
271 function_id < 32 ) // TODO: replace magic number
272 {
273 uint16_t action = keymap_action_load(function_id);
274
275 // If action is not "empty", return it, otherwise
276 // drop down to return the one in flash
277 if ( action != 0x0000 ) // TODO: replace magic number
278 {
279 return action;
280 }
281 }
282#endif
283
284#endif // USE_KEYMAPS_IN_EEPROM
285
286 return pgm_read_word(&fn_actions[function_id]);
287}
288
289
290// Zeal60 specific "action functions"
291void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
292{
293 switch (id)
294 {
295 case TRIPLE_TAP_1_3:
296 case TRIPLE_TAP_2_3:
297 if (record->event.pressed)
298 {
299 layer_on( id == TRIPLE_TAP_1_3 ? 1 : 2 );
300
301 if (record->tap.count && !record->tap.interrupted)
302 {
303 if (record->tap.count >= 3)
304 {
305 layer_invert(3);
306 }
307 }
308 else
309 {
310 record->tap.count = 0;
311 }
312 }
313 else
314 {
315 layer_off( id == TRIPLE_TAP_1_3 ? 1 : 2 );
316 }
317 break;
318 }
319}
320
321void led_set_kb(uint8_t usb_led)
322{
323#if RGB_BACKLIGHT_ENABLED
324 backlight_set_indicator_state(usb_led);
325#endif // RGB_BACKLIGHT_ENABLED
326}
327
328void suspend_power_down_kb(void)
329{
330#if RGB_BACKLIGHT_ENABLED
331 backlight_set_suspend_state(true);
332#endif // RGB_BACKLIGHT_ENABLED
333}
334
335void suspend_wakeup_init_kb(void)
336{
337#if RGB_BACKLIGHT_ENABLED
338 backlight_set_suspend_state(false);
339#endif // RGB_BACKLIGHT_ENABLED
340}
341
diff --git a/keyboards/zeal60/zeal60.h b/keyboards/zeal60/zeal60.h
new file mode 100644
index 000000000..ef9de7989
--- /dev/null
+++ b/keyboards/zeal60/zeal60.h
@@ -0,0 +1,93 @@
1/* Copyright 2017 Jason Williams (Wilba)
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#include "quantum.h"
19#include "rgb_backlight_keycodes.h"
20#include "zeal60_keycodes.h"
21
22#define XXX KC_NO
23
24#define LAYOUT_60_all( \
25 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \
26 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
27 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
28 K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
29 K40, K41, K42, K47, K4A, K4B, K4C, K4D \
30) { \
31 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
32 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
33 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
34 { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \
35 { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D } \
36}
37
38#define LAYOUT_60_ansi( \
39 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
40 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
41 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
42 K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \
43 K40, K41, K42, K47, K4A, K4B, K4C, K4D \
44) { \
45 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
46 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
47 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, XXX }, \
48 { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, XXX }, \
49 { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D } \
50}
51
52#define LAYOUT_60_iso( \
53 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
54 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
55 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
56 K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \
57 K40, K41, K42, K47, K4A, K4B, K4C, K4D \
58) { \
59 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
60 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
61 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, XXX }, \
62 { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, XXX }, \
63 { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D } \
64}
65
66#define LAYOUT_60_ansi_split_bs_rshift( \
67 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \
68 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
69 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
70 K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
71 K40, K41, K42, K47, K4A, K4B, K4C, K4D \
72) { \
73 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
74 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
75 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
76 { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \
77 { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D } \
78}
79
80#define LAYOUT_60_hhkb( \
81 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \
82 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
83 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
84 K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
85 K41, K42, K47, K4B, K4C \
86) { \
87 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
88 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
89 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
90 { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \
91 { XXX, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, XXX, K4B, K4C, XXX } \
92}
93
diff --git a/keyboards/zeal60/zeal60_api.h b/keyboards/zeal60/zeal60_api.h
new file mode 100644
index 000000000..baa8ac09f
--- /dev/null
+++ b/keyboards/zeal60/zeal60_api.h
@@ -0,0 +1,33 @@
1/* Copyright 2017 Jason Williams (Wilba)
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#define PROTOCOL_VERSION 0x0007
19
20enum zeal60_command_id
21{
22 id_get_protocol_version = 0x01, // always 0x01
23 id_get_keyboard_value,
24 id_set_keyboard_value,
25 id_dynamic_keymap_get_keycode,
26 id_dynamic_keymap_set_keycode,
27 id_dynamic_keymap_clear_all,
28 id_backlight_config_set_value,
29 id_backlight_config_get_value,
30 id_backlight_config_save,
31
32 id_unhandled = 0xFF,
33};
diff --git a/keyboards/zeal60/zeal60_keycodes.h b/keyboards/zeal60/zeal60_keycodes.h
new file mode 100644
index 000000000..9511801eb
--- /dev/null
+++ b/keyboards/zeal60/zeal60_keycodes.h
@@ -0,0 +1,42 @@
1/* Copyright 2017 Jason Williams (Wilba)
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18// Can't use SAFE_RANGE here, it might change if someone adds
19// new values to enum quantum_keycodes.
20// Need to keep checking 0x5F10 is still in the safe range.
21// TODO: merge this into quantum_keycodes
22// Backlight keycodes are in range 0x5F00-0x5F0F
23enum zeal60_keycodes {
24 FN_MO13 = 0x5F10,
25 FN_MO23
26};
27
28// Zeal60 specific "action functions"
29// These are only valid IDs in action_function()
30// Use FN_TT13, FN_TT23, etc. in keymaps
31enum zeal60_action_functions {
32 TRIPLE_TAP_1_3 = 0x31,
33 TRIPLE_TAP_2_3 = 0x32
34};
35
36// Bitwise OR the above with 0x0F00 to use in F(x) macro
37// This reserves the top 256 of the 4096 range of F(x) keycodes,
38// leaving the rest for use in fn_actions[] or actions in EEPROM.
39#define FN_TT13 F((0x0F00|TRIPLE_TAP_1_3))
40#define FN_TT23 F((0x0F00|TRIPLE_TAP_2_3))
41
42#define TG_NKRO MAGIC_TOGGLE_NKRO
diff --git a/keyboards/zeal65/config.h b/keyboards/zeal65/config.h
new file mode 100644
index 000000000..2dbf61237
--- /dev/null
+++ b/keyboards/zeal65/config.h
@@ -0,0 +1,125 @@
1/* Copyright 2017 Jason Williams (Wilba)
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#include "config_common.h"
19
20// USB Device descriptor parameter
21#define VENDOR_ID 0xFEED
22#define PRODUCT_ID 0x6065
23#define DEVICE_VER 0x0001
24#define MANUFACTURER ZealPC
25#define PRODUCT Zeal65
26#define DESCRIPTION Zeal65 (QMK Firmware)
27
28// key matrix size
29#define MATRIX_ROWS 5
30#define MATRIX_COLS 15
31
32// Zeal60 PCB default pin-out
33#define MATRIX_ROW_PINS { F0, F1, F4, F6, F7 }
34#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6, D4 }
35#define UNUSED_PINS
36
37// IS31FL3731 driver
38#define DRIVER_COUNT 2
39#define DRIVER_LED_TOTAL 72
40
41// COL2ROW or ROW2COL
42#define DIODE_DIRECTION COL2ROW
43
44// Set 0 if debouncing isn't needed
45#define DEBOUNCING_DELAY 5
46
47// Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap
48#define LOCKING_SUPPORT_ENABLE
49// Locking resynchronize hack
50#define LOCKING_RESYNC_ENABLE
51
52// key combination for command
53#define IS_COMMAND() ( \
54 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
55)
56
57/*
58 * Feature disable options
59 * These options are also useful to firmware size reduction.
60 */
61
62// disable debug print
63//#define NO_DEBUG
64
65// disable print
66//#define NO_PRINT
67
68// disable action features
69//#define NO_ACTION_LAYER
70//#define NO_ACTION_TAPPING
71//#define NO_ACTION_ONESHOT
72//#define NO_ACTION_MACRO
73//#define NO_ACTION_FUNCTION
74
75#define RGB_BACKLIGHT_ENABLED 1
76
77// This conditionally compiles the backlight code for Zeal65 specifics
78#define RGB_BACKLIGHT_ZEAL65
79
80// enable/disable LEDs based on layout
81#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0
82#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0
83#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 1
84#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0
85#define RGB_BACKLIGHT_USE_ISO_ENTER 0
86#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0
87
88// disable backlight when USB suspended (PC sleep/hibernate/shutdown)
89#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0
90
91// disable backlight after timeout in minutes, 0 = no timeout
92#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0
93
94// the default effect (RGB test)
95#define RGB_BACKLIGHT_EFFECT 255
96
97// These define which keys in the matrix are alphas/mods
98// Used for backlight effects so colors are different for
99// alphas vs. mods
100// Each value is for a row, bit 0 is column 0
101// Alpha=0 Mod=1
102#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0110000000000001
103#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0100000000000001
104#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0101000000000001
105#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0111000000000001
106#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0111110000000011
107
108#define DYNAMIC_KEYMAP_LAYER_COUNT 4
109
110// EEPROM usage
111
112// TODO: refactor with new user EEPROM code (coming soon)
113#define EEPROM_MAGIC 0x451F
114#define EEPROM_MAGIC_ADDR 32
115// Bump this every time we change what we store
116// This will automatically reset the EEPROM with defaults
117// and avoid loading invalid data from the EEPROM
118#define EEPROM_VERSION 0x07
119#define EEPROM_VERSION_ADDR 34
120
121// Backlight config starts after EEPROM version
122#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35
123// Dynamic keymap starts after backlight config (35+37)
124#define DYNAMIC_KEYMAP_EEPROM_ADDR 72
125
diff --git a/keyboards/zeal65/info.json b/keyboards/zeal65/info.json
new file mode 100644
index 000000000..94a090689
--- /dev/null
+++ b/keyboards/zeal65/info.json
@@ -0,0 +1,16 @@
1{
2 "keyboard_name": "Zeal65",
3 "url": "",
4 "maintainer": "Wilba",
5 "bootloader": "DFU",
6 "width": 16,
7 "height": 5,
8 "layouts": {
9 "LAYOUT_65_split_bs": {
10 "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"Del", "x":14, "y":0}, {"label":"Home", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"PgUp", "x":15, "y":1}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgDn", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"End", "x":15, "y":3}, {"label":"Win", "x":0, "y":4, "w":1.5}, {"label":"Alt", "x":1.5, "y":4, "w":1.5}, {"x":3, "y":4, "w":7}, {"label":"Fn2", "x":10, "y":4, "w":1.5}, {"label":"Fn1", "x":11.5, "y":4, "w":1.5}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}]
11 },
12 "LAYOUT_65_normie": {
13 "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Home", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"PgUp", "x":15, "y":1}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgDn", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"End", "x":15, "y":3}, {"label":"Win", "x":0, "y":4, "w":1.5}, {"label":"Alt", "x":1.5, "y":4, "w":1.5}, {"x":3, "y":4, "w":7}, {"label":"Fn2", "x":10, "y":4, "w":1.5}, {"label":"Fn1", "x":11.5, "y":4, "w":1.5}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}]
14 }
15 }
16} \ No newline at end of file
diff --git a/keyboards/zeal65/keymaps/default/config.h b/keyboards/zeal65/keymaps/default/config.h
new file mode 100644
index 000000000..f579dfaa7
--- /dev/null
+++ b/keyboards/zeal65/keymaps/default/config.h
@@ -0,0 +1,5 @@
1#pragma once
2
3/* enable/disable LEDs based on layout */
4#undef RGB_BACKLIGHT_USE_SPLIT_BACKSPACE
5#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0
diff --git a/keyboards/zeal65/keymaps/default/keymap.c b/keyboards/zeal65/keymaps/default/keymap.c
new file mode 100644
index 000000000..dd1a715d0
--- /dev/null
+++ b/keyboards/zeal65/keymaps/default/keymap.c
@@ -0,0 +1,38 @@
1// Default layout for Zeal65
2#include QMK_KEYBOARD_H
3
4const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
5
6// Default layer
7[0] = LAYOUT_65_normie(
8 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_BSPC, KC_HOME,
9 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP,
10 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, KC_PGDN,
11 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END,
12 KC_LCTL, KC_LALT, KC_SPC, FN_MO23, FN_MO13, KC_LEFT, KC_DOWN, KC_RGHT),
13
14// Fn1 Layer
15[1] = LAYOUT_65_normie(
16 KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_TRNS,
17 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
18 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
19 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
20 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
21
22// Fn2 Layer
23[2] = LAYOUT_65_normie(
24 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
25 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
26 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
27 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
28 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
29
30// Fn3 Layer (zeal60 Configuration)
31[3] = LAYOUT_65_normie(
32 KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS, KC_TRNS,
33 KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
34 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
35 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
36 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
37
38};
diff --git a/keyboards/zeal65/keymaps/split_bs/config.h b/keyboards/zeal65/keymaps/split_bs/config.h
new file mode 100644
index 000000000..018be8d7c
--- /dev/null
+++ b/keyboards/zeal65/keymaps/split_bs/config.h
@@ -0,0 +1,5 @@
1#pragma once
2
3/* enable/disable LEDs based on layout */
4#undef RGB_BACKLIGHT_USE_SPLIT_BACKSPACE
5#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 1
diff --git a/keyboards/zeal65/keymaps/split_bs/keymap.c b/keyboards/zeal65/keymaps/split_bs/keymap.c
new file mode 100644
index 000000000..96b04c358
--- /dev/null
+++ b/keyboards/zeal65/keymaps/split_bs/keymap.c
@@ -0,0 +1,38 @@
1// Split-backspace layout for Zeal65
2#include QMK_KEYBOARD_H
3
4const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
5
6// Default layer
7[0] = LAYOUT_65_split_bs(
8 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_BSLS, KC_DEL, KC_HOME,
9 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, KC_PGUP,
10 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, KC_PGDN,
11 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END,
12 KC_LGUI, KC_LALT, KC_SPC, FN_MO23, FN_MO13, KC_LEFT, KC_DOWN, KC_RGHT),
13
14// Fn1 Layer
15[1] = LAYOUT_65_split_bs(
16 KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, KC_TRNS,
17 KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
18 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
19 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
20 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
21
22// Fn2 Layer
23[2] = LAYOUT_65_split_bs(
24 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
25 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
26 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
27 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
28 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
29
30// Fn3 Layer (zeal60 Configuration)
31[3] = LAYOUT_65_split_bs(
32 KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS, KC_TRNS, KC_TRNS,
33 KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
34 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
35 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
36 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
37
38};
diff --git a/keyboards/zeal65/readme.md b/keyboards/zeal65/readme.md
new file mode 100644
index 000000000..8f43dc243
--- /dev/null
+++ b/keyboards/zeal65/readme.md
@@ -0,0 +1,16 @@
1Zeal65
2====
3
4![Zeal65](https://cdn.shopify.com/s/files/1/0490/7329/products/Zeal65_PCB2.jpg)
5
6This is a 65% PCB with per-key RGB LEDs and supports fixed, 1800-like bottom row and split backspace. It was designed for the Zephyr custom keyboard.
7
8Keyboard Maintainer: [Wilba](http://wilba.tech/) and on [github](https://github.com/Wilba6582)
9Hardware Supported: Zeal65 PCB Rev 1
10Hardware Availability: https://zealpc.net/collections/group-buy-pre-orders/products/zephyr
11
12Make example for this keyboard (after setting up your build environment):
13
14 make zeal65:default
15
16See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/zeal65/rules.mk b/keyboards/zeal65/rules.mk
new file mode 100644
index 000000000..02617cf1c
--- /dev/null
+++ b/keyboards/zeal65/rules.mk
@@ -0,0 +1,79 @@
1
2
3# project specific files
4SRC = ../zeal60/zeal60.c \
5 ../zeal60/rgb_backlight.c \
6 quantum/color.c \
7 drivers/issi/is31fl3731.c \
8 drivers/avr/i2c_master.c
9
10# MCU name
11MCU = atmega32u4
12
13# Processor frequency.
14# This will define a symbol, F_CPU, in all source code files equal to the
15# processor frequency in Hz. You can then use this symbol in your source code to
16# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
17# automatically to create a 32-bit value in your source code.
18#
19# This will be an integer division of F_USB below, as it is sourced by
20# F_USB after it has run through any CPU prescalers. Note that this value
21# does not *change* the processor frequency - it should merely be updated to
22# reflect the processor speed set externally so that the code can use accurate
23# software delays.
24F_CPU = 16000000
25
26#
27# LUFA specific
28#
29# Target architecture (see library "Board Types" documentation).
30ARCH = AVR8
31
32# Input clock frequency.
33# This will define a symbol, F_USB, in all source code files equal to the
34# input clock frequency (before any prescaling is performed) in Hz. This value may
35# differ from F_CPU if prescaling is used on the latter, and is required as the
36# raw input clock is fed directly to the PLL sections of the AVR for high speed
37# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
38# at the end, this will be done automatically to create a 32-bit value in your
39# source code.
40#
41# If no clock division is performed on the input clock inside the AVR (via the
42# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
43F_USB = $(F_CPU)
44
45# Interrupt driven control endpoint task(+60)
46OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
47
48# Boot Section
49BOOTLOADER = atmel-dfu
50
51# Do not put the microcontroller into power saving mode
52# when we get USB suspend event. We want it to keep updating
53# backlight effects.
54OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
55
56# Build Options
57# change to "no" to disable the options, or define them in the Makefile in
58# the appropriate keymap folder that will get included automatically
59#
60BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
61MOUSEKEY_ENABLE = no # Mouse keys(+4700)
62EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
63CONSOLE_ENABLE = no # Console for debug(+400)
64COMMAND_ENABLE = no # Commands for debug and configuration
65NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
66BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
67MIDI_ENABLE = no # MIDI controls
68AUDIO_ENABLE = no # Audio output on port C6
69UNICODE_ENABLE = no # Unicode
70BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
71RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
72
73# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
74SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
75
76RAW_ENABLE = yes
77DYNAMIC_KEYMAP_ENABLE = yes
78CIE1931_CURVE = yes
79
diff --git a/keyboards/zeal65/zeal65.c b/keyboards/zeal65/zeal65.c
new file mode 100644
index 000000000..540c93080
--- /dev/null
+++ b/keyboards/zeal65/zeal65.c
@@ -0,0 +1,18 @@
1/* Copyright 2017 Jason Williams (Wilba)
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 RGB_BACKLIGHT_ZEAL65
17#error RGB_BACKLIGHT_ZEAL65 not defined, you done goofed somehao, brah
18#endif
diff --git a/keyboards/zeal65/zeal65.h b/keyboards/zeal65/zeal65.h
new file mode 100644
index 000000000..3ee4f49e5
--- /dev/null
+++ b/keyboards/zeal65/zeal65.h
@@ -0,0 +1,50 @@
1/* Copyright 2017 Jason Williams (Wilba)
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#include "quantum.h"
19#include "../zeal60/rgb_backlight_keycodes.h"
20#include "../zeal60/zeal60_keycodes.h"
21
22#define XXX KC_NO
23
24#define LAYOUT_65_split_bs( \
25 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, K0E, \
26 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \
27 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2E, \
28 K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \
29 K40, K41, K47, K4A, K4B, K4C, K4D, K4E \
30) { \
31 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \
32 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \
33 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \
34 { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \
35 { K40, K41, XXX, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D, K4E } \
36}
37
38#define LAYOUT_65_normie( \
39 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \
40 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \
41 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2E, \
42 K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \
43 K40, K41, K47, K4A, K4B, K4C, K4D, K4E \
44) { \
45 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \
46 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \
47 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, XXX, K2E }, \
48 { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \
49 { K40, K41, XXX, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D, K4E } \
50}
diff --git a/quantum/dynamic_keymap.c b/quantum/dynamic_keymap.c
new file mode 100644
index 000000000..9f18612d5
--- /dev/null
+++ b/quantum/dynamic_keymap.c
@@ -0,0 +1,97 @@
1/* Copyright 2017 Jason Williams (Wilba)
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "config.h"
18#include "keymap.h" // to get keymaps[][][]
19
20#include "dynamic_keymap.h"
21
22#ifdef DYNAMIC_KEYMAP_ENABLE
23
24#ifndef DYNAMIC_KEYMAP_EEPROM_ADDR
25#error DYNAMIC_KEYMAP_EEPROM_ADDR not defined
26#endif
27
28#ifndef DYNAMIC_KEYMAP_LAYER_COUNT
29#error DYNAMIC_KEYMAP_LAYER_COUNT not defined
30#endif
31
32#define KC_EENULL 0xFFFF // TODO: move to enum quantum_keycodes
33
34void *dynamic_keymap_key_to_eeprom_address(uint8_t layer, uint8_t row, uint8_t column)
35{
36 // TODO: optimize this with some left shifts
37 return ((void*)DYNAMIC_KEYMAP_EEPROM_ADDR) + ( layer * MATRIX_ROWS * MATRIX_COLS * 2 ) +
38 ( row * MATRIX_COLS * 2 ) + ( column * 2 );
39}
40
41uint16_t dynamic_keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t column)
42{
43 void *address = dynamic_keymap_key_to_eeprom_address(layer, row, column);
44 // Big endian, so we can read/write EEPROM directly from host if we want
45 uint16_t keycode = eeprom_read_byte(address) << 8;
46 keycode |= eeprom_read_byte(address + 1);
47 return keycode;
48}
49
50void dynamic_keymap_set_keycode(uint8_t layer, uint8_t row, uint8_t column, uint16_t keycode)
51{
52 void *address = dynamic_keymap_key_to_eeprom_address(layer, row, column);
53 // Big endian, so we can read/write EEPROM directly from host if we want
54 eeprom_update_byte(address, (uint8_t)(keycode >> 8));
55 eeprom_update_byte(address+1, (uint8_t)(keycode & 0xFF));
56}
57
58void dynamic_keymap_clear_all(void)
59{
60 // Save "empty" keymaps.
61 for ( int layer = 0; layer < DYNAMIC_KEYMAP_LAYER_COUNT; layer++ )
62 {
63 for ( int row = 0; row < MATRIX_ROWS; row++ )
64 {
65 for ( int column = 0; column < MATRIX_COLS; column++ )
66 {
67 dynamic_keymap_set_keycode(layer, row, column, KC_EENULL);
68 }
69 }
70 }
71}
72
73// This overrides the one in quantum/keymap_common.c
74uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
75{
76 // This used to test EEPROM for magic bytes, but it was redundant.
77 // Test for EEPROM usage change (fresh install, address change, etc.)
78 // externally and call dynamic_keymap_default_save()
79 if ( layer < DYNAMIC_KEYMAP_LAYER_COUNT &&
80 key.row < MATRIX_ROWS && // possibly redundant
81 key.col < MATRIX_COLS ) // possibly redundant
82 {
83 uint16_t keycode = dynamic_keymap_get_keycode(layer, key.row, key.col);
84
85 // If keycode is not "empty", return it, otherwise
86 // drop down to return the one in flash
87 if ( keycode != KC_EENULL)
88 {
89 return keycode;
90 }
91 }
92
93 return pgm_read_word(&keymaps[layer][key.row][key.col]);
94}
95
96#endif // DYNAMIC_KEYMAP_ENABLE
97
diff --git a/quantum/dynamic_keymap.h b/quantum/dynamic_keymap.h
new file mode 100644
index 000000000..b0133aeb8
--- /dev/null
+++ b/quantum/dynamic_keymap.h
@@ -0,0 +1,31 @@
1/* Copyright 2017 Jason Williams (Wilba)
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef DYNAMIC_KEYMAP_H
18#define DYNAMIC_KEYMAP_H
19
20#include <stdint.h>
21#include <stdbool.h>
22
23void *dynamic_keymap_key_to_eeprom_address(uint8_t layer, uint8_t row, uint8_t column);
24uint16_t dynamic_keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t column);
25void dynamic_keymap_set_keycode(uint8_t layer, uint8_t row, uint8_t column, uint16_t keycode);
26void dynamic_keymap_clear_all(void);
27
28// This overrides the one in quantum/keymap_common.c
29// uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key);
30
31#endif //DYNAMIC_KEYMAP_H
diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c
index d7a7f049c..5bca64685 100644
--- a/tmk_core/common/avr/suspend.c
+++ b/tmk_core/common/avr/suspend.c
@@ -56,6 +56,24 @@ void suspend_idle(uint8_t time)
56 sleep_disable(); 56 sleep_disable();
57} 57}
58 58
59
60// TODO: This needs some cleanup
61
62/** \brief Run keyboard level Power down
63 *
64 * FIXME: needs doc
65 */
66__attribute__ ((weak))
67void suspend_power_down_user (void) { }
68/** \brief Run keyboard level Power down
69 *
70 * FIXME: needs doc
71 */
72__attribute__ ((weak))
73void suspend_power_down_kb(void) {
74 suspend_power_down_user();
75}
76
59#ifndef NO_SUSPEND_POWER_DOWN 77#ifndef NO_SUSPEND_POWER_DOWN
60/** \brief Power down MCU with watchdog timer 78/** \brief Power down MCU with watchdog timer
61 * 79 *
@@ -73,21 +91,6 @@ void suspend_idle(uint8_t time)
73 */ 91 */
74static uint8_t wdt_timeout = 0; 92static uint8_t wdt_timeout = 0;
75 93
76/** \brief Run keyboard level Power down
77 *
78 * FIXME: needs doc
79 */
80__attribute__ ((weak))
81void suspend_power_down_user (void) { }
82/** \brief Run keyboard level Power down
83 *
84 * FIXME: needs doc
85 */
86__attribute__ ((weak))
87void suspend_power_down_kb(void) {
88 suspend_power_down_user();
89}
90
91/** \brief Power down 94/** \brief Power down
92 * 95 *
93 * FIXME: needs doc 96 * FIXME: needs doc
@@ -144,6 +147,8 @@ static void power_down(uint8_t wdto)
144 */ 147 */
145void suspend_power_down(void) 148void suspend_power_down(void)
146{ 149{
150 suspend_power_down_kb();
151
147#ifndef NO_SUSPEND_POWER_DOWN 152#ifndef NO_SUSPEND_POWER_DOWN
148 power_down(WDTO_15MS); 153 power_down(WDTO_15MS);
149#endif 154#endif
@@ -198,7 +203,7 @@ void suspend_wakeup_init(void)
198 rgblight_timer_enable(); 203 rgblight_timer_enable();
199#endif 204#endif
200#endif 205#endif
201 suspend_wakeup_init_kb(); 206 suspend_wakeup_init_kb();
202} 207}
203 208
204#ifndef NO_SUSPEND_POWER_DOWN 209#ifndef NO_SUSPEND_POWER_DOWN