Skip to content

Commit a625d49

Browse files
authored
Convert novelkeys/nk87 to use RGB Matrix (qmk#26349)
1 parent 7b70448 commit a625d49

11 files changed

Lines changed: 277 additions & 391 deletions

File tree

keyboards/novelkeys/nk87/config.h

Lines changed: 4 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,9 @@
1-
/*
2-
Copyright 2020 Yiancar
3-
4-
This program is free software: you can redistribute it and/or modify
5-
it under the terms of the GNU General Public License as published by
6-
the Free Software Foundation, either version 2 of the License, or
7-
(at your option) any later version.
8-
9-
This program is distributed in the hope that it will be useful,
10-
but WITHOUT ANY WARRANTY; without even the implied warranty of
11-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-
GNU General Public License for more details.
13-
14-
You should have received a copy of the GNU General Public License
15-
along with this program. If not, see <http://www.gnu.org/licenses/>.
16-
*/
17-
1+
// Copyright 2020 Yiancar
2+
// SPDX-License-Identifier: GPL-2.0-or-later
183
#pragma once
194

20-
/* Backlight options */
21-
22-
#define RGB_BACKLIGHT_ENABLED 1
23-
24-
#define RGB_BACKLIGHT_NK87
25-
26-
// they aren't really used if RGB_BACKLIGHT_HS60 defined
27-
#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0
28-
#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0
29-
#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0
30-
#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0
31-
#define RGB_BACKLIGHT_USE_ISO_ENTER 0
32-
#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0
33-
34-
// disable backlight when USB suspended (PC sleep/hibernate/shutdown)
35-
#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0
36-
37-
// disable backlight after timeout in minutes, 0 = no timeout
38-
#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0
39-
40-
// the default brightness
41-
#define RGB_BACKLIGHT_BRIGHTNESS 255
42-
43-
// the default effect (RGB test)
44-
#define RGB_BACKLIGHT_EFFECT 6
45-
46-
// the default effect speed (0-3)
47-
#define RGB_BACKLIGHT_EFFECT_SPEED 0
48-
49-
// the default color1 and color2
50-
#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 }
51-
#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 }
52-
535
#define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND
546
#define IS31FL3733_I2C_ADDRESS_2 IS31FL3733_I2C_ADDRESS_GND_SDA
55-
#define IS31FL3733_LED_COUNT 128
56-
57-
// These define which keys in the matrix are alphas/mods
58-
// Used for backlight effects so colors are different for
59-
// alphas vs. mods
60-
// Each value is for a row, bit 0 is column 0
61-
// Alpha=0 Mod=1
62-
// Rows are shifted one down, F-row cannot be dynamically modified at the moment.
63-
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b1110000000000000
64-
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b1100000000000001
65-
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0010000000000001
66-
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b1001000000000001
67-
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b1111100000000111
68-
69-
#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 }
70-
#define RGB_BACKLIGHT_LAYER_1_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 }
71-
#define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 }
72-
#define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 }
737

74-
// Backlight config starts after VIA's EEPROM usage,
75-
// dynamic keymaps start after this.
76-
#define VIA_EEPROM_CUSTOM_CONFIG_SIZE 32
8+
#define IS31FL3733_SW_PULLUP IS31FL3733_PUR_0K5_OHM
9+
#define IS31FL3733_CS_PULLDOWN IS31FL3733_PDR_0K5_OHM

keyboards/novelkeys/nk87/halconf.h

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,7 @@
1-
/* Copyright 2020 QMK
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-
/*
18-
* This file was auto-generated by:
19-
* `qmk chibios-confmigrate -i keyboards/nk87/halconf.h -r platforms/chibios/QMK_PROTON_C/configs/halconf.h`
20-
*/
21-
1+
// Copyright 2020 Yiancar
2+
// SPDX-License-Identifier: GPL-2.0-or-later
223
#pragma once
234

24-
#define HAL_USE_PWM FALSE
25-
26-
#define HAL_USE_SPI FALSE
27-
28-
#define PAL_USE_CALLBACKS FALSE
29-
30-
#define PAL_USE_WAIT FALSE
5+
#define HAL_USE_I2C TRUE
316

327
#include_next <halconf.h>
33-

keyboards/novelkeys/nk87/keyboard.json

Lines changed: 147 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"bootmagic": true,
1313
"extrakey": true,
1414
"mousekey": true,
15+
"rgb_matrix": true,
1516
"nkro": true
1617
},
1718
"matrix_pins": {
@@ -21,7 +22,152 @@
2122
"diode_direction": "COL2ROW",
2223
"processor": "STM32F303",
2324
"bootloader": "stm32-dfu",
24-
"board": "QMK_PROTON_C",
25+
"rgb_matrix": {
26+
"driver": "is31fl3733",
27+
"sleep": true,
28+
"animations": {
29+
"alphas_mods": true,
30+
"gradient_up_down": true,
31+
"gradient_left_right": true,
32+
"breathing": true,
33+
"band_sat": true,
34+
"band_val": true,
35+
"band_pinwheel_sat": true,
36+
"band_pinwheel_val": true,
37+
"band_spiral_sat": true,
38+
"band_spiral_val": true,
39+
"cycle_all": true,
40+
"cycle_left_right": true,
41+
"cycle_up_down": true,
42+
"cycle_out_in": true,
43+
"cycle_out_in_dual": true,
44+
"rainbow_moving_chevron": true,
45+
"cycle_pinwheel": true,
46+
"cycle_spiral": true,
47+
"dual_beacon": true,
48+
"rainbow_beacon": true,
49+
"rainbow_pinwheels": true,
50+
"raindrops": true,
51+
"jellybean_raindrops": true,
52+
"hue_breathing": true,
53+
"hue_pendulum": true,
54+
"hue_wave": true,
55+
"pixel_fractal": true,
56+
"pixel_flow": true,
57+
"pixel_rain": true,
58+
"typing_heatmap": true,
59+
"digital_rain": true,
60+
"solid_reactive_simple": true,
61+
"solid_reactive": true,
62+
"solid_reactive_wide": true,
63+
"solid_reactive_multiwide": true,
64+
"solid_reactive_cross": true,
65+
"solid_reactive_multicross": true,
66+
"solid_reactive_nexus": true,
67+
"solid_reactive_multinexus": true,
68+
"splash": true,
69+
"multisplash": true,
70+
"solid_splash": true,
71+
"solid_multisplash": true
72+
},
73+
"layout": [
74+
{ "flags": 4, "matrix": [0, 0], "x": 6, "y": 8 },
75+
{ "flags": 4, "matrix": [0, 1], "x": 21, "y": 8 },
76+
{ "flags": 4, "matrix": [0, 2], "x": 33, "y": 8 },
77+
{ "flags": 4, "matrix": [0, 3], "x": 45, "y": 8 },
78+
{ "flags": 4, "matrix": [0, 4], "x": 57, "y": 8 },
79+
{ "flags": 4, "matrix": [0, 5], "x": 74, "y": 8 },
80+
{ "flags": 4, "matrix": [0, 6], "x": 86, "y": 8 },
81+
{ "flags": 4, "matrix": [0, 7], "x": 98, "y": 8 },
82+
{ "flags": 4, "matrix": [0, 8], "x": 110, "y": 8 },
83+
{ "flags": 4, "matrix": [0, 9], "x": 125, "y": 8 },
84+
{ "flags": 4, "matrix": [0, 10], "x": 137, "y": 8 },
85+
{ "flags": 4, "matrix": [0, 11], "x": 150, "y": 8 },
86+
{ "flags": 4, "matrix": [0, 12], "x": 161, "y": 8 },
87+
{ "flags": 4, "matrix": [0, 13], "x": 176, "y": 8 },
88+
{ "flags": 4, "matrix": [0, 14], "x": 192, "y": 8 },
89+
{ "flags": 4, "matrix": [0, 15], "x": 204, "y": 8 },
90+
{ "flags": 4, "matrix": [0, 16], "x": 217, "y": 8 },
91+
92+
{ "flags": 4, "matrix": [1, 0], "x": 6, "y": 21 },
93+
{ "flags": 4, "matrix": [1, 1], "x": 18, "y": 21 },
94+
{ "flags": 4, "matrix": [1, 2], "x": 30, "y": 21 },
95+
{ "flags": 4, "matrix": [1, 3], "x": 43, "y": 21 },
96+
{ "flags": 4, "matrix": [1, 4], "x": 55, "y": 21 },
97+
{ "flags": 4, "matrix": [1, 5], "x": 67, "y": 21 },
98+
{ "flags": 4, "matrix": [1, 6], "x": 79, "y": 21 },
99+
{ "flags": 4, "matrix": [1, 7], "x": 92, "y": 21 },
100+
{ "flags": 4, "matrix": [1, 8], "x": 104, "y": 21 },
101+
{ "flags": 4, "matrix": [1, 9], "x": 116, "y": 21 },
102+
{ "flags": 4, "matrix": [1, 10], "x": 128, "y": 21 },
103+
{ "flags": 4, "matrix": [1, 11], "x": 141, "y": 21 },
104+
{ "flags": 4, "matrix": [1, 12], "x": 153, "y": 21 },
105+
{ "flags": 4, "matrix": [1, 13], "x": 171, "y": 21 },
106+
{ "flags": 4, "matrix": [1, 14], "x": 192, "y": 21 },
107+
{ "flags": 4, "matrix": [1, 15], "x": 204, "y": 21 },
108+
{ "flags": 4, "matrix": [1, 16], "x": 217, "y": 21 },
109+
110+
{ "flags": 4, "matrix": [2, 0], "x": 9, "y": 31 },
111+
{ "flags": 4, "matrix": [2, 1], "x": 24, "y": 31 },
112+
{ "flags": 4, "matrix": [2, 2], "x": 36, "y": 31 },
113+
{ "flags": 4, "matrix": [2, 3], "x": 48, "y": 31 },
114+
{ "flags": 4, "matrix": [2, 4], "x": 61, "y": 31 },
115+
{ "flags": 4, "matrix": [2, 5], "x": 73, "y": 31 },
116+
{ "flags": 4, "matrix": [2, 6], "x": 86, "y": 31 },
117+
{ "flags": 4, "matrix": [2, 7], "x": 98, "y": 31 },
118+
{ "flags": 4, "matrix": [2, 8], "x": 110, "y": 31 },
119+
{ "flags": 4, "matrix": [2, 9], "x": 122, "y": 31 },
120+
{ "flags": 4, "matrix": [2, 10], "x": 134, "y": 31 },
121+
{ "flags": 4, "matrix": [2, 11], "x": 146, "y": 31 },
122+
{ "flags": 4, "matrix": [2, 12], "x": 159, "y": 31 },
123+
{ "flags": 4, "matrix": [3, 12], "x": 174, "y": 31 },
124+
{ "flags": 4, "matrix": [2, 14], "x": 192, "y": 31 },
125+
{ "flags": 4, "matrix": [2, 15], "x": 204, "y": 31 },
126+
{ "flags": 4, "matrix": [2, 16], "x": 217, "y": 31 },
127+
128+
{ "flags": 4, "matrix": [3, 0], "x": 11, "y": 41 },
129+
{ "flags": 4, "matrix": [3, 1], "x": 27, "y": 41 },
130+
{ "flags": 4, "matrix": [3, 2], "x": 40, "y": 41 },
131+
{ "flags": 4, "matrix": [3, 3], "x": 52, "y": 41 },
132+
{ "flags": 4, "matrix": [3, 4], "x": 64, "y": 41 },
133+
{ "flags": 4, "matrix": [3, 5], "x": 76, "y": 41 },
134+
{ "flags": 4, "matrix": [3, 6], "x": 88, "y": 41 },
135+
{ "flags": 4, "matrix": [3, 7], "x": 100, "y": 41 },
136+
{ "flags": 4, "matrix": [3, 8], "x": 113, "y": 41 },
137+
{ "flags": 4, "matrix": [3, 9], "x": 124, "y": 41 },
138+
{ "flags": 4, "matrix": [3, 10], "x": 137, "y": 41 },
139+
{ "flags": 4, "matrix": [3, 11], "x": 150, "y": 41 },
140+
{ "flags": 4, "matrix": [3, 13], "x": 170, "y": 41 },
141+
142+
{ "flags": 4, "matrix": [4, 0], "x": 13, "y": 51 },
143+
{ "flags": 4, "matrix": [4, 2], "x": 34, "y": 51 },
144+
{ "flags": 4, "matrix": [4, 3], "x": 45, "y": 51 },
145+
{ "flags": 4, "matrix": [4, 4], "x": 58, "y": 51 },
146+
{ "flags": 4, "matrix": [4, 5], "x": 70, "y": 51 },
147+
{ "flags": 4, "matrix": [4, 6], "x": 82, "y": 51 },
148+
{ "flags": 4, "matrix": [4, 7], "x": 94, "y": 51 },
149+
{ "flags": 4, "matrix": [4, 8], "x": 107, "y": 51 },
150+
{ "flags": 4, "matrix": [4, 9], "x": 119, "y": 51 },
151+
{ "flags": 4, "matrix": [4, 10], "x": 131, "y": 51 },
152+
{ "flags": 4, "matrix": [4, 11], "x": 143, "y": 51 },
153+
{ "flags": 4, "matrix": [4, 12], "x": 166, "y": 51 },
154+
{ "flags": 4, "matrix": [4, 15], "x": 204, "y": 51 },
155+
156+
{ "flags": 4, "matrix": [5, 0], "x": 8, "y": 61 },
157+
{ "flags": 4, "matrix": [5, 1], "x": 23, "y": 61 },
158+
{ "flags": 4, "matrix": [5, 2], "x": 38, "y": 61 },
159+
{ "flags": 4, "matrix": [5, 6], "x": 84, "y": 61 },
160+
{ "flags": 4, "matrix": [5, 11], "x": 135, "y": 61 },
161+
{ "flags": 4, "matrix": [5, 12], "x": 152, "y": 61 },
162+
{ "flags": 4, "matrix": [5, 13], "x": 170, "y": 61 },
163+
{ "flags": 4, "matrix": [5, 14], "x": 192, "y": 61 },
164+
{ "flags": 4, "matrix": [5, 15], "x": 204, "y": 61 },
165+
{ "flags": 4, "matrix": [5, 16], "x": 217, "y": 61 },
166+
{ "flags": 1, "x": 224, "y": 0 },
167+
{ "flags": 1, "x": 224, "y": 5 },
168+
{ "flags": 1, "x": 224, "y": 10 }
169+
]
170+
},
25171
"community_layouts": ["tkl_f13_ansi_tsangan"],
26172
"layout_aliases": {
27173
"LAYOUT_all": "LAYOUT_tkl_f13_ansi_tsangan"
Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,21 @@
1-
/* Copyright 2020 Yiancar
2-
*
3-
* This program is free software: you can redistribute it and/or modify
4-
* it under the terms of the GNU General Public License as published by
5-
* the Free Software Foundation, either version 2 of the License, or
6-
* (at your option) any later version.
7-
*
8-
* This program is distributed in the hope that it will be useful,
9-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11-
* GNU General Public License for more details.
12-
*
13-
* You should have received a copy of the GNU General Public License
14-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15-
*/
1+
// Copyright 2020 Yiancar
2+
// SPDX-License-Identifier: GPL-2.0-or-later
163
#include QMK_KEYBOARD_H
174

185
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
196
[0] = LAYOUT_tkl_f13_ansi_tsangan( /* Base */
20-
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_F13, KC_PSCR, KC_SCRL, KC_PAUS,
21-
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, KC_INS, KC_HOME, KC_PGUP,
22-
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_DEL, KC_END, KC_PGDN,
23-
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,
24-
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,
25-
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
7+
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_F13, KC_PSCR, KC_SCRL, KC_PAUS,
8+
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, KC_INS, KC_HOME, KC_PGUP,
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_DEL, KC_END, KC_PGDN,
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, KC_UP,
12+
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
2613

2714
[1] = LAYOUT_tkl_f13_ansi_tsangan( /* FN */
28-
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_VOLU, KC_VOLD, KC_MUTE,
29-
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, KC_TRNS,
30-
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, QK_BOOT, KC_TRNS, KC_TRNS, KC_TRNS,
31-
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
32-
KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, BR_DEC, BR_INC, ES_DEC, ES_INC, KC_TRNS, KC_TRNS,
33-
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
15+
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, KC_VOLD, KC_MUTE,
16+
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
17+
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT, _______, _______, _______,
18+
_______, RM_TOGG, _______, _______, RM_SATD, RM_SATU, _______, _______, _______, _______, _______, _______, _______,
19+
_______, RM_PREV, RM_NEXT, RM_HUED, RM_HUEU, _______, _______, RM_VALD, RM_VALU, RM_SPDD, RM_SPDU, _______, _______,
20+
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
3421
};

keyboards/novelkeys/nk87/keymaps/default/readme.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

keyboards/novelkeys/nk87/matrix_diagram.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)