aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUy Bui <uybv.cntt@gmail.com>2021-07-20 14:26:26 +0900
committerGitHub <noreply@github.com>2021-07-19 22:26:26 -0700
commit125691558398c4bfff93b457147b2802365cbd3f (patch)
tree1e4ea53de60bef8b57c441f752b52f9518409bc3
parent35ee990bd0293efbd5746671f1e58cec262a066b (diff)
downloadqmk_firmware-125691558398c4bfff93b457147b2802365cbd3f.tar.gz
qmk_firmware-125691558398c4bfff93b457147b2802365cbd3f.zip
[Keyboard] Add we27 numpad (#13137)
Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com>
-rw-r--r--keyboards/wekey/we27/config.h219
-rw-r--r--keyboards/wekey/we27/encoder_actions.c57
-rw-r--r--keyboards/wekey/we27/encoder_actions.h21
-rw-r--r--keyboards/wekey/we27/info.json29
-rw-r--r--keyboards/wekey/we27/keymaps/default/keymap.c52
-rw-r--r--keyboards/wekey/we27/keymaps/default/readme.md1
-rw-r--r--keyboards/wekey/we27/keymaps/via/keymap.c52
-rw-r--r--keyboards/wekey/we27/keymaps/via/readme.md1
-rw-r--r--keyboards/wekey/we27/keymaps/via/rules.mk2
-rw-r--r--keyboards/wekey/we27/readme.md19
-rw-r--r--keyboards/wekey/we27/rgb_matrix_kb.inc27
-rw-r--r--keyboards/wekey/we27/rules.mk32
-rw-r--r--keyboards/wekey/we27/we27.c58
-rw-r--r--keyboards/wekey/we27/we27.h53
14 files changed, 623 insertions, 0 deletions
diff --git a/keyboards/wekey/we27/config.h b/keyboards/wekey/we27/config.h
new file mode 100644
index 000000000..332b476a4
--- /dev/null
+++ b/keyboards/wekey/we27/config.h
@@ -0,0 +1,219 @@
1/*
2Copyright 2021 @wekey
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#pragma once
19
20#include "config_common.h"
21
22/* USB Device descriptor parameter */
23#define VENDOR_ID 0x5559
24#define PRODUCT_ID 0x0001
25#define DEVICE_VER 0x0001
26#define MANUFACTURER @wekey
27#define PRODUCT We27
28
29/* key matrix size */
30#define MATRIX_ROWS 6
31#define MATRIX_COLS 5
32
33/*
34 * Keyboard Matrix Assignments
35 *
36 * Change this to how you wired your keyboard
37 * COLS: AVR pins used for columns, left to right
38 * ROWS: AVR pins used for rows, top to bottom
39 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
40 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
41 *
42 */
43#define MATRIX_ROW_PINS { F1, D7, B4, B5, B6, F6 }
44#define MATRIX_COL_PINS { F4, F5, C7, D6, D4 }
45#define UNUSED_PINS
46
47/* COL2ROW, ROW2COL */
48#define DIODE_DIRECTION COL2ROW
49
50/*
51 * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
52 */
53// #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
54
55#ifdef RGB_MATRIX_ENABLE
56// The pin connected to the data pin of the LEDs
57#define RGB_DI_PIN C6
58// The number of LEDs connected
59#define DRIVER_LED_TOTAL 27
60
61#define RGB_MATRIX_KEYPRESSES // reacts to keypresses
62#define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
63#define RGB_MATRIX_STARTUP_HUE 108 // Sets the default hue value, if none has been set
64#define RGB_MATRIX_STARTUP_SAT 255 // Sets the default saturation value, if none has been set
65#define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS // Sets the default brightness value, if none has been set
66#define RGB_MATRIX_STARTUP_SPD 127 // Sets the default animation speed, if none has been set
67#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_COLOR // Sets the default mode, if none has been set
68
69#define DISABLE_RGB_MATRIX_ALPHAS_MODS
70#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN
71#define DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
72#define DISABLE_RGB_MATRIX_BREATHING
73#define DISABLE_RGB_MATRIX_BAND_SAT // *
74#define DISABLE_RGB_MATRIX_BAND_VAL
75#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
76#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
77#define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT
78#define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL
79#define DISABLE_RGB_MATRIX_CYCLE_ALL
80#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
81#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN
82#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN
83#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
84// #define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON // *
85#define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL
86#define DISABLE_RGB_MATRIX_CYCLE_SPIRAL
87#define DISABLE_RGB_MATRIX_DUAL_BEACON
88#define DISABLE_RGB_MATRIX_RAINBOW_BEACON
89#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS
90#define DISABLE_RGB_MATRIX_RAINDROPS
91#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
92#define DISABLE_RGB_MATRIX_HUE_BREATHING
93#define DISABLE_RGB_MATRIX_HUE_PENDULUM
94#define DISABLE_RGB_MATRIX_HUE_WAVE
95#define DISABLE_RGB_MATRIX_TYPING_HEATMAP
96#define DISABLE_RGB_MATRIX_DIGITAL_RAIN
97#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
98#define DISABLE_RGB_MATRIX_SOLID_REACTIVE
99#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
100#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
101#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
102#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
103#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
104#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
105#define DISABLE_RGB_MATRIX_SPLASH
106#define DISABLE_RGB_MATRIX_MULTISPLASH
107#define DISABLE_RGB_MATRIX_SOLID_SPLASH
108#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH
109
110#endif
111
112#ifdef ENCODER_ENABLE
113#define ENCODERS_PAD_A { D3 }
114#define ENCODERS_PAD_B { D2 }
115#define ENCODER_RESOLUTION 2
116
117#define ENCODERS 1
118#define ENCODERS_CW_KEY { { 4, 5 } }
119#define ENCODERS_CCW_KEY { { 4, 3 } }
120#endif
121
122//#define LED_NUM_LOCK_PIN B0
123//#define LED_CAPS_LOCK_PIN B1
124//#define LED_SCROLL_LOCK_PIN B2
125//#define LED_COMPOSE_PIN B3
126//#define LED_KANA_PIN B4
127
128//#define BACKLIGHT_PIN B7
129//#define BACKLIGHT_LEVELS 3
130//#define BACKLIGHT_BREATHING
131
132//#define RGB_DI_PIN E2
133//#ifdef RGB_DI_PIN
134//# define RGBLED_NUM 16
135//# define RGBLIGHT_HUE_STEP 8
136//# define RGBLIGHT_SAT_STEP 8
137//# define RGBLIGHT_VAL_STEP 8
138//# define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
139//# define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
140/*== all animations enable ==*/
141//# define RGBLIGHT_ANIMATIONS
142/*== or choose animations ==*/
143//# define RGBLIGHT_EFFECT_BREATHING
144//# define RGBLIGHT_EFFECT_RAINBOW_MOOD
145//# define RGBLIGHT_EFFECT_RAINBOW_SWIRL
146//# define RGBLIGHT_EFFECT_SNAKE
147//# define RGBLIGHT_EFFECT_KNIGHT
148//# define RGBLIGHT_EFFECT_CHRISTMAS
149//# define RGBLIGHT_EFFECT_STATIC_GRADIENT
150//# define RGBLIGHT_EFFECT_RGB_TEST
151//# define RGBLIGHT_EFFECT_ALTERNATING
152/*== customize breathing effect ==*/
153/*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
154//# define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
155/*==== use exp() and sin() ====*/
156//# define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
157//# define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
158//#endif
159
160/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
161#define DEBOUNCE 5
162
163/* define if matrix has ghost (lacks anti-ghosting diodes) */
164//#define MATRIX_HAS_GHOST
165
166/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
167#define LOCKING_SUPPORT_ENABLE
168/* Locking resynchronize hack */
169#define LOCKING_RESYNC_ENABLE
170
171/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
172 * This is useful for the Windows task manager shortcut (ctrl+shift+esc).
173 */
174//#define GRAVE_ESC_CTRL_OVERRIDE
175
176/*
177 * Force NKRO
178 *
179 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
180 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
181 * makefile for this to work.)
182 *
183 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
184 * until the next keyboard reset.
185 *
186 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
187 * fully operational during normal computer usage.
188 *
189 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
190 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
191 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
192 * power-up.
193 *
194 */
195//#define FORCE_NKRO
196
197/*
198 * Feature disable options
199 * These options are also useful to firmware size reduction.
200 */
201
202/* disable debug print */
203//#define NO_DEBUG
204
205/* disable print */
206//#define NO_PRINT
207
208/* disable action features */
209//#define NO_ACTION_LAYER
210//#define NO_ACTION_TAPPING
211//#define NO_ACTION_ONESHOT
212
213/* disable these deprecated features by default */
214#define NO_ACTION_MACRO
215#define NO_ACTION_FUNCTION
216
217/* Bootmagic Lite key configuration */
218//#define BOOTMAGIC_LITE_ROW 0
219//#define BOOTMAGIC_LITE_COLUMN 0
diff --git a/keyboards/wekey/we27/encoder_actions.c b/keyboards/wekey/we27/encoder_actions.c
new file mode 100644
index 000000000..0f32ac272
--- /dev/null
+++ b/keyboards/wekey/we27/encoder_actions.c
@@ -0,0 +1,57 @@
1/* Copyright 2020 Neil Brian Ramirez
2 * Copyright 2021 drashna jael're (@drashna)
3 * Copyright 2021 uybv
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#include "encoder_actions.h"
20
21#ifdef ENCODER_ENABLE
22
23# ifdef ENCODERS
24static uint8_t encoder_state[ENCODERS] = {0};
25static keypos_t encoder_cw[ENCODERS] = ENCODERS_CW_KEY;
26static keypos_t encoder_ccw[ENCODERS] = ENCODERS_CCW_KEY;
27# endif
28
29void encoder_action_unregister(void) {
30# ifdef ENCODERS
31 for (int index = 0; index < ENCODERS; ++index) {
32 if (encoder_state[index]) {
33 keyevent_t encoder_event = (keyevent_t) {
34 .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
35 .pressed = false,
36 .time = (timer_read() | 1)
37 };
38 encoder_state[index] = 0;
39 action_exec(encoder_event);
40 }
41 }
42# endif
43}
44
45void encoder_action_register(uint8_t index, bool clockwise) {
46# ifdef ENCODERS
47 keyevent_t encoder_event = (keyevent_t) {
48 .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
49 .pressed = true,
50 .time = (timer_read() | 1)
51 };
52 encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
53 action_exec(encoder_event);
54# endif
55}
56
57#endif
diff --git a/keyboards/wekey/we27/encoder_actions.h b/keyboards/wekey/we27/encoder_actions.h
new file mode 100644
index 000000000..2484af52a
--- /dev/null
+++ b/keyboards/wekey/we27/encoder_actions.h
@@ -0,0 +1,21 @@
1/* Copyright 2020 Neil Brian Ramirez
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 3 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 "quantum.h"
18
19void encoder_action_unregister(void);
20
21void encoder_action_register(uint8_t index, bool clockwise);
diff --git a/keyboards/wekey/we27/info.json b/keyboards/wekey/we27/info.json
new file mode 100644
index 000000000..e83f53b44
--- /dev/null
+++ b/keyboards/wekey/we27/info.json
@@ -0,0 +1,29 @@
1{
2 "keyboard_name": "we27",
3 "url": "",
4 "maintainer": "@wekey.dev",
5 "width": 5,
6 "height": 6.25,
7 "layouts": {
8 "LAYOUT_numpad_6x5": {
9 "layout": [
10 {"label":"ESC", "x":0, "y":0.75}, {"label":"PRTSC", "x":1, "y":0.75}, {"label":"F5", "x":2, "y":0.75}, {"label":"F11", "x":3, "y":0.75},
11 {"label":"NLCK", "x":0, "y":2.25}, {"label":"DEL", "x":1, "y":2.25}, {"label":"/", "x":2, "y":2.25}, {"label":"*", "x":3, "y":2.25}, {"label":"-", "x":4, "y":2.25},
12 {"label":"HOME", "x":0, "y":3.25}, {"label":"7", "x":1, "y":3.25}, {"label":"8", "x":2, "y":3.25}, {"label":"9", "x":3, "y":3.25},
13 {"label":"END", "x":0, "y":4.25}, {"label":"4", "x":1, "y":4.25}, {"label":"5", "x":2, "y":4.25}, {"label":"6", "x":3, "y":4.25}, {"label":"+", "x":4, "y":3.25, "h":2},
14 {"label":"ANY", "x":0, "y":5.25}, {"label":"1", "x":1, "y":5.25}, {"label":"2", "x":2, "y":5.25}, {"label":"3", "x":3, "y":5.25},
15 {"label":"FN", "x":0, "y":6.25}, {"label":"0", "x":1, "y":6.25, "w":2}, {"label":".", "x":3, "y":6.25}, {"label":"ENTER", "x":4, "y":5.25, "h":2}
16 ]
17 },
18 "LAYOUT_numpad_6x5_encoder": {
19 "layout": [
20 {"label":"ESC", "x":0, "y":0.75}, {"label":"PRTSC", "x":1, "y":0.75}, {"label":"F5", "x":2, "y":0.75}, {"label":"F11", "x":3, "y":0.75}, {"label":"MUTE", "x":4, "y":0.75}, {"label":"VOLD", "x":3.75, "y":0, "w":0.75, "h":0.75}, {"label":"VOLU", "x":4.5, "y":0, "w":0.75, "h":0.75},
21 {"label":"NLCK", "x":0, "y":2.25}, {"label":"DEL", "x":1, "y":2.25}, {"label":"/", "x":2, "y":2.25}, {"label":"*", "x":3, "y":2.25}, {"label":"-", "x":4, "y":2.25},
22 {"label":"HOME", "x":0, "y":3.25}, {"label":"7", "x":1, "y":3.25}, {"label":"8", "x":2, "y":3.25}, {"label":"9", "x":3, "y":3.25},
23 {"label":"END", "x":0, "y":4.25}, {"label":"4", "x":1, "y":4.25}, {"label":"5", "x":2, "y":4.25}, {"label":"6", "x":3, "y":4.25}, {"label":"+", "x":4, "y":3.25, "h":2},
24 {"label":"ANY", "x":0, "y":5.25}, {"label":"1", "x":1, "y":5.25}, {"label":"2", "x":2, "y":5.25}, {"label":"3", "x":3, "y":5.25},
25 {"label":"FN", "x":0, "y":6.25}, {"label":"0", "x":1, "y":6.25, "w":2}, {"label":".", "x":3, "y":6.25}, {"label":"ENTER", "x":4, "y":5.25, "h":2}
26 ]
27 }
28 }
29}
diff --git a/keyboards/wekey/we27/keymaps/default/keymap.c b/keyboards/wekey/we27/keymaps/default/keymap.c
new file mode 100644
index 000000000..fdaafa7d8
--- /dev/null
+++ b/keyboards/wekey/we27/keymaps/default/keymap.c
@@ -0,0 +1,52 @@
1/* Copyright 2021 @wekey
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 /* Base */
20 [0] = LAYOUT_numpad_6x5_encoder(
21 KC_ESC , KC_PWR , KC_SLEP, KC_F11 , KC_MUTE, KC_VOLD, KC_VOLU,
22 KC_NLCK, KC_BSPC, KC_PSLS, KC_PAST, KC_PMNS,
23 RGB_MOD, KC_P7 , KC_P8 , KC_P9 ,
24 RGB_RMOD, KC_P4 , KC_P5 , KC_P6 , KC_PPLS,
25 RGB_TOG, KC_P1 , KC_P2 , KC_P3 ,
26 MO(1) , KC_P0 , KC_PDOT, KC_PENT
27 ),
28 [1] = LAYOUT_numpad_6x5_encoder(
29 _______, _______, _______, _______, KC_MPLY, KC_MPRV, KC_MNXT,
30 _______, _______, _______, _______, _______,
31 RGB_SPI, RGB_HUI, RGB_SAI, RGB_VAI,
32 RGB_SPD, RGB_HUD, RGB_SAD, RGB_VAD, _______,
33 _______, _______, _______, _______,
34 _______, _______, _______, RESET
35 ),
36 [2] = LAYOUT_numpad_6x5_encoder(
37 _______, _______, _______, _______, _______, _______, _______,
38 _______, _______, _______, _______, _______,
39 _______, _______, _______, _______,
40 _______, _______, _______, _______, _______,
41 _______, _______, _______, _______,
42 _______, _______, _______, _______
43 ),
44 [3] = LAYOUT_numpad_6x5_encoder(
45 _______, _______, _______, _______, _______, _______, _______,
46 _______, _______, _______, _______, _______,
47 _______, _______, _______, _______,
48 _______, _______, _______, _______, _______,
49 _______, _______, _______, _______,
50 _______, _______, _______, _______
51 )
52};
diff --git a/keyboards/wekey/we27/keymaps/default/readme.md b/keyboards/wekey/we27/keymaps/default/readme.md
new file mode 100644
index 000000000..8ad307a9c
--- /dev/null
+++ b/keyboards/wekey/we27/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default keymap for we27
diff --git a/keyboards/wekey/we27/keymaps/via/keymap.c b/keyboards/wekey/we27/keymaps/via/keymap.c
new file mode 100644
index 000000000..fdaafa7d8
--- /dev/null
+++ b/keyboards/wekey/we27/keymaps/via/keymap.c
@@ -0,0 +1,52 @@
1/* Copyright 2021 @wekey
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 /* Base */
20 [0] = LAYOUT_numpad_6x5_encoder(
21 KC_ESC , KC_PWR , KC_SLEP, KC_F11 , KC_MUTE, KC_VOLD, KC_VOLU,
22 KC_NLCK, KC_BSPC, KC_PSLS, KC_PAST, KC_PMNS,
23 RGB_MOD, KC_P7 , KC_P8 , KC_P9 ,
24 RGB_RMOD, KC_P4 , KC_P5 , KC_P6 , KC_PPLS,
25 RGB_TOG, KC_P1 , KC_P2 , KC_P3 ,
26 MO(1) , KC_P0 , KC_PDOT, KC_PENT
27 ),
28 [1] = LAYOUT_numpad_6x5_encoder(
29 _______, _______, _______, _______, KC_MPLY, KC_MPRV, KC_MNXT,
30 _______, _______, _______, _______, _______,
31 RGB_SPI, RGB_HUI, RGB_SAI, RGB_VAI,
32 RGB_SPD, RGB_HUD, RGB_SAD, RGB_VAD, _______,
33 _______, _______, _______, _______,
34 _______, _______, _______, RESET
35 ),
36 [2] = LAYOUT_numpad_6x5_encoder(
37 _______, _______, _______, _______, _______, _______, _______,
38 _______, _______, _______, _______, _______,
39 _______, _______, _______, _______,
40 _______, _______, _______, _______, _______,
41 _______, _______, _______, _______,
42 _______, _______, _______, _______
43 ),
44 [3] = LAYOUT_numpad_6x5_encoder(
45 _______, _______, _______, _______, _______, _______, _______,
46 _______, _______, _______, _______, _______,
47 _______, _______, _______, _______,
48 _______, _______, _______, _______, _______,
49 _______, _______, _______, _______,
50 _______, _______, _______, _______
51 )
52};
diff --git a/keyboards/wekey/we27/keymaps/via/readme.md b/keyboards/wekey/we27/keymaps/via/readme.md
new file mode 100644
index 000000000..8ad307a9c
--- /dev/null
+++ b/keyboards/wekey/we27/keymaps/via/readme.md
@@ -0,0 +1 @@
# The default keymap for we27
diff --git a/keyboards/wekey/we27/keymaps/via/rules.mk b/keyboards/wekey/we27/keymaps/via/rules.mk
new file mode 100644
index 000000000..36b7ba9cb
--- /dev/null
+++ b/keyboards/wekey/we27/keymaps/via/rules.mk
@@ -0,0 +1,2 @@
1VIA_ENABLE = yes
2LTO_ENABLE = yes
diff --git a/keyboards/wekey/we27/readme.md b/keyboards/wekey/we27/readme.md
new file mode 100644
index 000000000..3212f9505
--- /dev/null
+++ b/keyboards/wekey/we27/readme.md
@@ -0,0 +1,19 @@
1# we27
2
3![we27](https://i.imgur.com/DvZ3EBah.jpg)
4
5A customizable 20% hot-swap, RGB numpad and encoder.
6
7* Keyboard Maintainer: [@wekey](https://github.com/wekey-dev)
8* Hardware Supported: WE27 PCB rev1
9* Hardware Availability: custom pcb group buys
10
11Make example for this keyboard (after setting up your build environment):
12
13 make wekey/we27:default
14
15Flashing example for this keyboard:
16
17 make wekey/we27: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).
diff --git a/keyboards/wekey/we27/rgb_matrix_kb.inc b/keyboards/wekey/we27/rgb_matrix_kb.inc
new file mode 100644
index 000000000..a7eeffbbe
--- /dev/null
+++ b/keyboards/wekey/we27/rgb_matrix_kb.inc
@@ -0,0 +1,27 @@
1
2//RGB_MATRIX_EFFECT(SOLID_REACTIVE_WIDE2)
3RGB_MATRIX_EFFECT(SOLID_REACTIVE_MULTIWIDE2)
4//RGB_MATRIX_EFFECT(SOLID_REACTIVE_NEXUS2)
5//RGB_MATRIX_EFFECT(SOLID_REACTIVE_MULTINEXUS2)
6
7#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
8
9static HSV SOLID_REACTIVE_WIDE_math2(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) {
10 uint16_t effect = tick - dist > 255 || dist > 32 ? 255 : tick - dist;
11 hsv.v = qadd8(hsv.v, 255 - effect);
12 return hsv;
13}
14
15static HSV SOLID_REACTIVE_NEXUS_math2(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) {
16 uint16_t effect = tick - dist > 255 || ((dx > 8 || dx < -8) && (dy > 8 || dy < -8)) ? 255 : tick - dist;
17 hsv.v = qadd8(hsv.v, 255 - effect);
18 hsv.h = rgb_matrix_config.hsv.h + dy / 4;
19 return hsv;
20}
21
22bool SOLID_REACTIVE_WIDE2(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_WIDE_math2); }
23bool SOLID_REACTIVE_MULTIWIDE2(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_WIDE_math2); }
24bool SOLID_REACTIVE_NEXUS2(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_NEXUS_math2); }
25bool SOLID_REACTIVE_MULTINEXUS2(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_NEXUS_math2); }
26
27#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
diff --git a/keyboards/wekey/we27/rules.mk b/keyboards/wekey/we27/rules.mk
new file mode 100644
index 000000000..f510969bf
--- /dev/null
+++ b/keyboards/wekey/we27/rules.mk
@@ -0,0 +1,32 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5BOOTLOADER = caterina
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
11MOUSEKEY_ENABLE = yes # Mouse keys
12EXTRAKEY_ENABLE = yes # Audio control and System control
13CONSOLE_ENABLE = no # Console for debug
14COMMAND_ENABLE = no # Commands for debug and configuration
15# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
16SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
18NKRO_ENABLE = no # USB Nkey Rollover
19BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
20RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
21BLUETOOTH_ENABLE = no # Enable Bluetooth
22AUDIO_ENABLE = no # Audio output
23ENCODER_ENABLE = yes
24RGB_MATRIX_ENABLE = yes # Use RGB matrix
25RGB_MATRIX_DRIVER = WS2812
26
27DEBOUNCE_TYPE = sym_defer_pk
28RGB_MATRIX_CUSTOM_KB = yes
29
30SRC += encoder_actions.c
31
32LAYOUTS = numpad_6x5
diff --git a/keyboards/wekey/we27/we27.c b/keyboards/wekey/we27/we27.c
new file mode 100644
index 000000000..2765e6f3b
--- /dev/null
+++ b/keyboards/wekey/we27/we27.c
@@ -0,0 +1,58 @@
1/* Copyright 2021 @wekey
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 "we27.h"
18#include "encoder_actions.h"
19
20#ifdef RGB_MATRIX_ENABLE
21
22#define __ NO_LED
23
24led_config_t g_led_config = { {
25 { 0, 1, 2, 3, 4 },
26 { 9, 8, 7, 6, 5 },
27 { 10, 11, 12, 13, 14 },
28 { 18, 17, 16, 15, __ },
29 { 19, 20, 21, 22, 23 },
30 { 26, 25, __, 24, __ }
31}, {
32 {0,1},{56,1},{112,1},{168,1},{224,1},
33 {0,16},{56,16},{112,16},{168,16},{224,16},
34 {0,28},{56,28},{112,28},{168,28},{224,28},
35 {0,40},{56,40},{112,40},{168,40},
36 {0,52},{56,52},{112,52},{168,52},{224,52},
37 {0,64},{56,64},{168,64}
38}, {
39 1, 1, 1, 1, 1,
40 1, 1, 4, 4, 4,
41 1, 4, 4, 4, 4,
42 1, 4, 4, 4,
43 1, 4, 4, 4, 4,
44 1, 4, 4
45} };
46
47#endif
48
49void matrix_scan_kb(void) {
50 encoder_action_unregister();
51 matrix_scan_user();
52}
53
54bool encoder_update_kb(uint8_t index, bool clockwise) {
55 if (!encoder_update_user(index, clockwise)) { return false; }
56 encoder_action_register(index, clockwise);
57 return true;
58};
diff --git a/keyboards/wekey/we27/we27.h b/keyboards/wekey/we27/we27.h
new file mode 100644
index 000000000..5542a52d2
--- /dev/null
+++ b/keyboards/wekey/we27/we27.h
@@ -0,0 +1,53 @@
1/* Copyright 2021 @wekey
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#pragma once
18
19#include "quantum.h"
20
21#define ___ KC_NO
22
23#define LAYOUT_numpad_6x5( \
24 K00, K01, K02, K03, K04, \
25 K10, K11, K12, K13, K14, \
26 K20, K21, K22, K23, \
27 K30, K31, K32, K33, K24, \
28 K40, K41, K42, K43, \
29 K50, K51, K53, K44 \
30) { \
31 { K00, K01, K02, K03, K04 }, \
32 { K10, K11, K12, K13, K14 }, \
33 { K20, K21, K22, K23, K24 }, \
34 { K30, K31, K32, K33, ___ }, \
35 { K40, K41, K42, K43, K44 }, \
36 { K50, K51, ___, K53, ___ } \
37}
38
39#define LAYOUT_numpad_6x5_encoder( \
40 K00, K01, K02, K03, K04, K34, K54, \
41 K10, K11, K12, K13, K14, \
42 K20, K21, K22, K23, \
43 K30, K31, K32, K33, K24, \
44 K40, K41, K42, K43, \
45 K50, K51, K53, K44 \
46) { \
47 { K00, K01, K02, K03, K04 }, \
48 { K10, K11, K12, K13, K14 }, \
49 { K20, K21, K22, K23, K24 }, \
50 { K30, K31, K32, K33, K34 }, \
51 { K40, K41, K42, K43, K44 }, \
52 { K50, K51, ___, K53, K54 } \
53}