summaryrefslogtreecommitdiff
path: root/keyboards/skyloong
diff options
context:
space:
mode:
authorskyloong <92424712+JZ-Skyloong@users.noreply.github.com>2023-09-25 11:28:08 +0800
committerGitHub <noreply@github.com>2023-09-24 20:28:08 -0700
commit234e099c7242550dd0f662d9647ab9dda00f0c41 (patch)
tree1a52e4e8054746504dcb0d79e00b33f5706425f3 /keyboards/skyloong
parent21ed9b4575fd5c19b4879b90d4a15863aa731ba9 (diff)
Added skyloong/Qk21 v1 Number Pad (#21467)
Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com> Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'keyboards/skyloong')
-rw-r--r--keyboards/skyloong/qk21/v1/config.h12
-rw-r--r--keyboards/skyloong/qk21/v1/info.json129
-rw-r--r--keyboards/skyloong/qk21/v1/keymaps/default/keymap.c54
-rw-r--r--keyboards/skyloong/qk21/v1/keymaps/via/keymap.c54
-rw-r--r--keyboards/skyloong/qk21/v1/keymaps/via/rules.mk1
-rw-r--r--keyboards/skyloong/qk21/v1/readme.md27
-rw-r--r--keyboards/skyloong/qk21/v1/rules.mk1
-rw-r--r--keyboards/skyloong/qk21/v1/v1.c49
8 files changed, 327 insertions, 0 deletions
diff --git a/keyboards/skyloong/qk21/v1/config.h b/keyboards/skyloong/qk21/v1/config.h
new file mode 100644
index 0000000000..c74d5cce78
--- /dev/null
+++ b/keyboards/skyloong/qk21/v1/config.h
@@ -0,0 +1,12 @@
1// Copyright 2021 JZ-Skyloong (@JZ-Skyloong)
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6/* Enable num-lock LED */
7#define NUM_LOCK_INDEX 13
8
9#define RGB_MATRIX_LED_COUNT 21
10#define RGB_MATRIX_FRAMEBUFFER_EFFECTS //Enable frame effects
11#define RGB_MATRIX_KEYPRESSES //Reacts to keypress
12#define RGB_DISABLE_WHEN_USB_SUSPENDED //turn off effects when suspended
diff --git a/keyboards/skyloong/qk21/v1/info.json b/keyboards/skyloong/qk21/v1/info.json
new file mode 100644
index 0000000000..d5aa5e8be9
--- /dev/null
+++ b/keyboards/skyloong/qk21/v1/info.json
@@ -0,0 +1,129 @@
1{
2 "manufacturer": "JZ-Skyloong",
3 "keyboard_name": "qk21",
4 "maintainer": "linlin012",
5 "bootloader": "atmel-dfu",
6 "diode_direction": "ROW2COL",
7 "features": {
8 "bootmagic": true,
9 "command": false,
10 "console": false,
11 "extrakey": true,
12 "mousekey": true,
13 "nkro": true,
14 "rgb_matrix": true
15 },
16 "matrix_pins": {
17 "cols": ["F7", "E6", "C7", "D5"],
18 "rows": ["F0", "F1", "F4", "F5", "F6", "B4"]
19 },
20 "processor": "atmega32u4",
21 "ws2812": {
22 "pin": "B7"
23 },
24 "rgb_matrix":{
25 "driver": "ws2812",
26 "animations": {
27 "alphas_mods": false,
28 "band_pinwheel_sat": false,
29 "band_pinwheel_val": false,
30 "band_sat": false,
31 "band_spiral_sat": false,
32 "band_spiral_val": false,
33 "breathing": true,
34 "cycle_all": true,
35 "cycle_left_right": false,
36 "cycle_out_in": false,
37 "cycle_out_in_dual": false,
38 "cycle_pinwheel": true,
39 "cycle_spiral": true,
40 "cycle_up_down": true,
41 "dual_beacom": false,
42 "gradient_left_right": false,
43 "gradient_up_down": false,
44 "hue_breathing": false,
45 "hue_pendulum": false,
46 "hue_wave": false,
47 "jellybean_raindrops": true,
48 "pixel_fractal": false,
49 "pixel_rain": true,
50 "rainbow_moving_chevron":false,
51 "rainbow_pinwheels": true,
52 "raindrops": true,
53 "ranbow_beacon": true,
54 "typing_heatmap": true,
55 "solid_reactive_simple": true,
56 "solid_reactive_cross": true,
57 "splash": true
58 },
59 "layout": [
60 {"matrix": [5, 0], "x": 37, "y": 64, "flags": 4},
61 {"matrix": [5, 2], "x": 149, "y": 64, "flags": 4},
62 {"matrix": [5, 3], "x": 224, "y": 58, "flags": 4},
63
64 {"matrix": [4, 0], "x": 0, "y": 51, "flags": 4},
65 {"matrix": [4, 1], "x": 75, "y": 51, "flags": 4},
66 {"matrix": [4, 2], "x": 149, "y": 51, "flags": 4},
67
68 {"matrix": [3, 0], "x": 0, "y": 38, "flags": 4},
69 {"matrix": [3, 1], "x": 75, "y": 38, "flags": 4},
70 {"matrix": [3, 2], "x": 149, "y": 38, "flags": 4},
71 {"matrix": [3, 3], "x": 224, "y": 31, "flags": 4},
72
73 {"matrix": [2, 0], "x": 0, "y": 25, "flags": 4},
74 {"matrix": [2, 1], "x": 75, "y": 25, "flags": 4},
75 {"matrix": [2, 2], "x": 149, "y": 25, "flags": 4},
76
77 {"matrix": [1, 0], "x": 0, "y": 12, "flags": 8},
78 {"matrix": [1, 1], "x": 75, "y": 12, "flags": 4},
79 {"matrix": [1, 2], "x": 149, "y": 12, "flags": 4},
80 {"matrix": [1, 3], "x": 224, "y": 12, "flags": 4},
81
82 {"matrix": [0, 0], "x": 0, "y": 0, "flags": 4},
83 {"matrix": [0, 1], "x": 75, "y": 0, "flags": 4},
84 {"matrix": [0, 2], "x": 149, "y": 0, "flags": 4},
85 {"matrix": [0, 3], "x": 224, "y": 0, "flags": 4}
86
87 ],
88 "hue_steps": 20,
89 "max_brightness": 200,
90 "sat_steps": 20,
91 "speed_steps": 20,
92 "val_steps": 20
93 },
94 "url": "https://github.com/JZ-Skyloong",
95 "usb": {
96 "device_version": "1.0.0",
97 "pid": "0x6021",
98 "vid": "0x1EA7",
99 "max_power": 250
100 },
101 "community_layouts": ["numpad_6x4"],
102 "layouts": {
103 "LAYOUT_numpad_6x4": {
104 "layout": [
105 { "matrix": [0, 0], "x": 0, "y": 0 },
106 { "matrix": [0, 1], "x": 1, "y": 0 },
107 { "matrix": [0, 2], "x": 2, "y": 0 },
108 { "matrix": [0, 3], "x": 3, "y": 0 },
109 { "matrix": [1, 0], "x": 0, "y": 1 },
110 { "matrix": [1, 1], "x": 1, "y": 1 },
111 { "matrix": [1, 2], "x": 2, "y": 1 },
112 { "matrix": [1, 3], "x": 3, "y": 1 },
113 { "matrix": [2, 0], "x": 0, "y": 2 },
114 { "matrix": [2, 1], "x": 1, "y": 2 },
115 { "matrix": [2, 2], "x": 2, "y": 2 },
116 { "matrix": [3, 0], "x": 0, "y": 3 },
117 { "matrix": [3, 1], "x": 1, "y": 3 },
118 { "matrix": [3, 2], "x": 2, "y": 3 },
119 { "matrix": [3, 3], "x": 3, "y": 2, "h": 2 },
120 { "matrix": [4, 0], "x": 0, "y": 4 },
121 { "matrix": [4, 1], "x": 1, "y": 4 },
122 { "matrix": [4, 2], "x": 2, "y": 4 },
123 { "matrix": [5, 0], "x": 0, "y": 5, "w": 2 },
124 { "matrix": [5, 2], "x": 2, "y": 5 },
125 { "matrix": [5, 3], "x": 3, "y": 4, "h": 2 }
126 ]
127 }
128 }
129}
diff --git a/keyboards/skyloong/qk21/v1/keymaps/default/keymap.c b/keyboards/skyloong/qk21/v1/keymaps/default/keymap.c
new file mode 100644
index 0000000000..8cb1d20085
--- /dev/null
+++ b/keyboards/skyloong/qk21/v1/keymaps/default/keymap.c
@@ -0,0 +1,54 @@
1// Copyright 2023 QMK
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include QMK_KEYBOARD_H
5
6const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
7 /*
8 * ┌───┬───┬───┬───┐
9 * │Esc│Tab│MO1│Bsp│
10 * ├───┼───┼───┼───┤
11 * │Num│ / │ * │ - │
12 * ├───┼───┼───┼───┤
13 * │ 7 │ 8 │ 9 │ │
14 * ├───┼───┼───┤ + │
15 * │ 4 │ 5 │ 6 │ │
16 * ├───┼───┼───┼───┤
17 * │ 1 │ 2 │ 3 │ │
18 * ├───┴───┼───┤Ent│
19 * │ 0 │ . │ │
20 * └───────┴───┴───┘
21 */
22 [0] = LAYOUT_numpad_6x4(
23 KC_ESC, KC_TAB, MO(1), KC_BSPC,
24 KC_NUM, KC_PSLS, KC_PAST, KC_PMNS,
25 KC_P7, KC_P8, KC_P9,
26 KC_P4, KC_P5, KC_P6, KC_PPLS,
27 KC_P1, KC_P2, KC_P3,
28 KC_P0, KC_PDOT, KC_PENT
29 ),
30
31 /*
32 * ┌───┐───┬───┬───┐
33 * │Rst│MOD│MO1│Bsp│
34 * └───┘───┼───┼───┤
35 * │Num│HUD│HUI│VAD│
36 * ┌───┬───┬───┐───┤
37 * │Hom│ ↑ │PgU│ │
38 * ├───┼───┼───┤VAI│
39 * │ ← │ │ → │ │
40 * ├───┼───┼───┤───┤
41 * │End│ ↓ │PgD│ │
42 * ├───┴───┼───┤TOG│
43 * │Insert │Del│ │
44 * └───────┴───┘───┘
45 */
46 [1] = LAYOUT_numpad_6x4(
47 QK_BOOT, RGB_MOD, _______, _______,
48 _______, RGB_HUD, RGB_HUI, RGB_VAD,
49 KC_HOME, KC_UP, KC_PGUP,
50 KC_LEFT, RGB_M_SW, KC_RGHT, RGB_VAI,
51 KC_END, KC_DOWN, KC_PGDN,
52 KC_INS, KC_DEL, RGB_TOG
53 )
54};
diff --git a/keyboards/skyloong/qk21/v1/keymaps/via/keymap.c b/keyboards/skyloong/qk21/v1/keymaps/via/keymap.c
new file mode 100644
index 0000000000..8cb1d20085
--- /dev/null
+++ b/keyboards/skyloong/qk21/v1/keymaps/via/keymap.c
@@ -0,0 +1,54 @@
1// Copyright 2023 QMK
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include QMK_KEYBOARD_H
5
6const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
7 /*
8 * ┌───┬───┬───┬───┐
9 * │Esc│Tab│MO1│Bsp│
10 * ├───┼───┼───┼───┤
11 * │Num│ / │ * │ - │
12 * ├───┼───┼───┼───┤
13 * │ 7 │ 8 │ 9 │ │
14 * ├───┼───┼───┤ + │
15 * │ 4 │ 5 │ 6 │ │
16 * ├───┼───┼───┼───┤
17 * │ 1 │ 2 │ 3 │ │
18 * ├───┴───┼───┤Ent│
19 * │ 0 │ . │ │
20 * └───────┴───┴───┘
21 */
22 [0] = LAYOUT_numpad_6x4(
23 KC_ESC, KC_TAB, MO(1), KC_BSPC,
24 KC_NUM, KC_PSLS, KC_PAST, KC_PMNS,
25 KC_P7, KC_P8, KC_P9,
26 KC_P4, KC_P5, KC_P6, KC_PPLS,
27 KC_P1, KC_P2, KC_P3,
28 KC_P0, KC_PDOT, KC_PENT
29 ),
30
31 /*
32 * ┌───┐───┬───┬───┐
33 * │Rst│MOD│MO1│Bsp│
34 * └───┘───┼───┼───┤
35 * │Num│HUD│HUI│VAD│
36 * ┌───┬───┬───┐───┤
37 * │Hom│ ↑ │PgU│ │
38 * ├───┼───┼───┤VAI│
39 * │ ← │ │ → │ │
40 * ├───┼───┼───┤───┤
41 * │End│ ↓ │PgD│ │
42 * ├───┴───┼───┤TOG│
43 * │Insert │Del│ │
44 * └───────┴───┘───┘
45 */
46 [1] = LAYOUT_numpad_6x4(
47 QK_BOOT, RGB_MOD, _______, _______,
48 _______, RGB_HUD, RGB_HUI, RGB_VAD,
49 KC_HOME, KC_UP, KC_PGUP,
50 KC_LEFT, RGB_M_SW, KC_RGHT, RGB_VAI,
51 KC_END, KC_DOWN, KC_PGDN,
52 KC_INS, KC_DEL, RGB_TOG
53 )
54};
diff --git a/keyboards/skyloong/qk21/v1/keymaps/via/rules.mk b/keyboards/skyloong/qk21/v1/keymaps/via/rules.mk
new file mode 100644
index 0000000000..1e5b99807c
--- /dev/null
+++ b/keyboards/skyloong/qk21/v1/keymaps/via/rules.mk
@@ -0,0 +1 @@
VIA_ENABLE = yes
diff --git a/keyboards/skyloong/qk21/v1/readme.md b/keyboards/skyloong/qk21/v1/readme.md
new file mode 100644
index 0000000000..871a819f66
--- /dev/null
+++ b/keyboards/skyloong/qk21/v1/readme.md
@@ -0,0 +1,27 @@
1# qk21_V1
2
3![qk21](https://i.imgur.com/d65CJC5h.jpg)
4
5The following is the QMK Firmware for the number pad 6x4 keylayout - designed in Dongguan Jizhi Electronic Technology Co., Ltd
6
7* Keyboard Maintainer: [linlin012](https://github.com/linlin012)
8* Hardware Supported: JK172-RGB(4028)-U PCBs, MEGA32U4-MU
9* Hardware Availability: http://www.skyloong.com.cn
10
11Make example for this keyboard (after setting up your build environment):
12
13 make skyloong/qk21/v1:default
14
15Flashing example for this keyboard:
16
17 make skyloong/qk21/v1:default:flash
18
19See 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).
20
21## Bootloader
22
23Enter the bootloader in 3 ways:
24
25* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard
26* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead
27* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available
diff --git a/keyboards/skyloong/qk21/v1/rules.mk b/keyboards/skyloong/qk21/v1/rules.mk
new file mode 100644
index 0000000000..6e7633bfe0
--- /dev/null
+++ b/keyboards/skyloong/qk21/v1/rules.mk
@@ -0,0 +1 @@
# This file intentionally left blank
diff --git a/keyboards/skyloong/qk21/v1/v1.c b/keyboards/skyloong/qk21/v1/v1.c
new file mode 100644
index 0000000000..9630d3e223
--- /dev/null
+++ b/keyboards/skyloong/qk21/v1/v1.c
@@ -0,0 +1,49 @@
1// Copyright 2021 JZ-Skyloong (@JZ-Skyloong)
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include "quantum.h"
5
6#if defined(RGB_MATRIX_ENABLE) && defined(NUM_LOCK_INDEX)
7
8bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
9 if (!process_record_user(keycode, record)) {
10 return false;
11 }
12 switch (keycode) {
13# ifdef RGB_MATRIX_ENABLE
14 case RGB_TOG:
15 if (record->event.pressed) {
16 switch (rgb_matrix_get_flags()) {
17 case LED_FLAG_ALL: {
18 rgb_matrix_set_flags(LED_FLAG_NONE);
19 rgb_matrix_set_color_all(0, 0, 0);
20 } break;
21 default: {
22 rgb_matrix_set_flags(LED_FLAG_ALL);
23 } break;
24 }
25 }
26 return false;
27# endif
28 }
29 return true;
30}
31
32bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
33 if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) {
34 return false;
35 }
36 // RGB_MATRIX_INDICATOR_SET_COLOR(index, red, green, blue);
37
38 if (host_keyboard_led_state().num_lock) {
39 RGB_MATRIX_INDICATOR_SET_COLOR(NUM_LOCK_INDEX, 255, 255, 255);
40 } else {
41 if (!rgb_matrix_get_flags()) {
42 RGB_MATRIX_INDICATOR_SET_COLOR(NUM_LOCK_INDEX, 0, 0, 0);
43 }
44 }
45 return true;
46}
47
48#endif // NUM_LOCK_INDEX
49