summaryrefslogtreecommitdiff
path: root/keyboards/winry
diff options
context:
space:
mode:
authorSergey Vlasov <sigprof@gmail.com>2022-03-08 06:45:30 +0300
committerGitHub <noreply@github.com>2022-03-07 19:45:30 -0800
commit249bc3a5c58607d71534cb538a8c76565557849a (patch)
tree254e1ba6731762341765bf1f862791c455164c5f /keyboards/winry
parent86966fce69369fe4f82efcab9540805b26632967 (diff)
[Keyboard] Add Winry315 keyboard (#15894)
Diffstat (limited to 'keyboards/winry')
-rw-r--r--keyboards/winry/winry315/config.h138
-rw-r--r--keyboards/winry/winry315/info.json104
-rw-r--r--keyboards/winry/winry315/keymaps/default/keymap.c79
-rw-r--r--keyboards/winry/winry315/keymaps/default/readme.md1
-rw-r--r--keyboards/winry/winry315/keymaps/left_numpad/config.h6
-rw-r--r--keyboards/winry/winry315/keymaps/left_numpad/keymap.c81
-rw-r--r--keyboards/winry/winry315/keymaps/left_numpad/readme.md3
-rw-r--r--keyboards/winry/winry315/keymaps/via/config.h15
-rw-r--r--keyboards/winry/winry315/keymaps/via/encoder_actions.c85
-rw-r--r--keyboards/winry/winry315/keymaps/via/encoder_actions.h21
-rw-r--r--keyboards/winry/winry315/keymaps/via/keymap.c44
-rw-r--r--keyboards/winry/winry315/keymaps/via/rules.mk4
-rw-r--r--keyboards/winry/winry315/readme.md45
-rw-r--r--keyboards/winry/winry315/rules.mk21
-rw-r--r--keyboards/winry/winry315/winry315.c262
-rw-r--r--keyboards/winry/winry315/winry315.h86
16 files changed, 995 insertions, 0 deletions
diff --git a/keyboards/winry/winry315/config.h b/keyboards/winry/winry315/config.h
new file mode 100644
index 0000000000..1a9617c1e3
--- /dev/null
+++ b/keyboards/winry/winry315/config.h
@@ -0,0 +1,138 @@
1// Copyright 2022 Sergey Vlasov (@sigprof)
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include "config_common.h"
7
8// Key matrix size.
9#define MATRIX_ROWS 1
10#define MATRIX_COLS 24
11
12// Key pins (including encoder press switches).
13// The NO_PIN entries are reserved for encoder rotation mappings.
14#define DIRECT_PINS \
15 { \
16 { F4, C7, D4, D5, D1, F5, C6, D6, D3, D2, F6, B6, D7, B4, B5, B2, D0, E6, NO_PIN, NO_PIN, NO_PIN, NO_PIN, NO_PIN, NO_PIN } \
17 }
18
19// clang-format off
20
21// Encoder pins.
22// Encoder numbering (assuming the default board orientation with encoders on
23// the top side):
24// 0 - left
25// 1 - center (with a longer shaft and a larger knob)
26// 2 - right
27#define ENCODERS_PAD_A { F1, B0, B3 }
28#define ENCODERS_PAD_B { F0, B1, B7 }
29#define ENCODER_RESOLUTION 4
30
31// Encoder mappings (used for VIA).
32#define ENCODERS 3
33#define ENCODERS_CW_KEY { { 22, 0 }, { 18, 0 }, { 20, 0 } }
34#define ENCODERS_CCW_KEY { { 23, 0 }, { 19, 0 }, { 21, 0 } }
35
36// clang-format on
37
38// RGB LED parameters.
39// This PCB uses a single chain of WS2812-compatible addressable RGB LEDs for
40// per-key backlight and underglow.
41#define RGB_DI_PIN F7
42#define RGBLED_NUM 27
43#define RGBLIGHT_LIMIT_VAL 150
44
45// RGB Lighting configuration. This mode is used by the vendor firmware, and
46// can be chosen if the full RGB Matrix support is not desired for some reason.
47#ifdef RGBLIGHT_ENABLE
48# define RGBLIGHT_HUE_STEP 8
49# define RGBLIGHT_SAT_STEP 8
50# define RGBLIGHT_VAL_STEP 8
51# define RGBLIGHT_SLEEP
52# define RGBLIGHT_EFFECT_BREATHING
53# define RGBLIGHT_EFFECT_RAINBOW_MOOD
54# define RGBLIGHT_EFFECT_RAINBOW_SWIRL
55# define RGBLIGHT_EFFECT_SNAKE
56# define RGBLIGHT_EFFECT_KNIGHT
57# define RGBLIGHT_EFFECT_CHRISTMAS
58# define RGBLIGHT_EFFECT_STATIC_GRADIENT
59# define RGBLIGHT_EFFECT_RGB_TEST
60# define RGBLIGHT_EFFECT_ALTERNATING
61#endif
62
63// RGB Matrix configuration.
64#ifdef RGB_MATRIX_ENABLE
65# define DRIVER_LED_TOTAL RGBLED_NUM
66# define RGB_MATRIX_MAXIMUM_BRIGHTNESS RGBLIGHT_LIMIT_VAL
67
68# define RGB_MATRIX_CENTER \
69 { 35, 35 }
70
71# define RGB_DISABLE_WHEN_USB_SUSPENDED
72
73// This option is required for the TYPING_HEATMAP and DIGITAL_RAIN effects,
74// both of which are disabled below, so the common support for those effects is
75// disabled too.
76# undef RGB_MATRIX_FRAMEBUFFER_EFFECTS
77
78// This option is required for reactive effects; disabling this option will
79// implicitly disable all of them.
80# define RGB_MATRIX_KEYPRESSES
81
82# define ENABLE_RGB_MATRIX_ALPHAS_MODS
83# define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
84# define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
85# define ENABLE_RGB_MATRIX_BREATHING
86# define ENABLE_RGB_MATRIX_BAND_SAT
87# define ENABLE_RGB_MATRIX_BAND_VAL
88# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
89# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
90# define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
91# define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
92# define ENABLE_RGB_MATRIX_CYCLE_ALL
93# define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
94# define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
95# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
96# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN
97# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
98# define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
99# define ENABLE_RGB_MATRIX_CYCLE_SPIRAL
100# define ENABLE_RGB_MATRIX_DUAL_BEACON
101# define ENABLE_RGB_MATRIX_RAINBOW_BEACON
102# define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
103# define ENABLE_RGB_MATRIX_RAINDROPS
104# define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
105# define ENABLE_RGB_MATRIX_HUE_BREATHING
106# define ENABLE_RGB_MATRIX_HUE_PENDULUM
107# define ENABLE_RGB_MATRIX_HUE_WAVE
108# define ENABLE_RGB_MATRIX_PIXEL_RAIN
109// The PIXEL_FRACTAL effect does not work properly when the matrix layout is
110// different from the physical layout; it also has problems when underglow
111// LEDs are present, or when multiple LEDs are associated with the same key.
112# undef ENABLE_RGB_MATRIX_PIXEL_FRACTAL
113
114// Framebuffer effects; can be enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS
115// is defined. Both of these effects currently don't work properly when the
116// key matrix does not match the physical layout, so they are disabled.
117# undef ENABLE_RGB_MATRIX_TYPING_HEATMAP
118# undef ENABLE_RGB_MATRIX_DIGITAL_RAIN
119
120// Reactive effects; can be enabled only if at least one of
121// RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined.
122# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
123# define ENABLE_RGB_MATRIX_SOLID_REACTIVE
124# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
125# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
126# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
127# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
128# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
129# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
130# define ENABLE_RGB_MATRIX_SPLASH
131# define ENABLE_RGB_MATRIX_MULTISPLASH
132# define ENABLE_RGB_MATRIX_SOLID_SPLASH
133# define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
134
135#endif
136
137// Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed.
138#define DEBOUNCE 5
diff --git a/keyboards/winry/winry315/info.json b/keyboards/winry/winry315/info.json
new file mode 100644
index 0000000000..6410c6222f
--- /dev/null
+++ b/keyboards/winry/winry315/info.json
@@ -0,0 +1,104 @@
1{
2 "manufacturer": "Winry",
3 "keyboard_name": "Winry315",
4 "maintainer": "sigprof",
5 "url": "",
6 "usb": {
7 "device_version": "0.0.1",
8 "pid": "0x0315",
9 "vid": "0xF1F1"
10 },
11 "layout_aliases": {
12 "LAYOUT_all": "LAYOUT_top"
13 },
14 "layouts": {
15 "LAYOUT_top": {
16 "layout": [
17 { "label": "E0", "x": 0.5, "y": 0.25 },
18 { "label": "E1", "x": 1.75, "y": 0, "h": 1.5, "w": 1.5 },
19 { "label": "E2", "x": 3.5, "y": 0.25 },
20 { "label": "0", "x": 0, "y": 1.75 },
21 { "label": "1", "x": 1, "y": 1.75 },
22 { "label": "2", "x": 2, "y": 1.75 },
23 { "label": "3", "x": 3, "y": 1.75 },
24 { "label": "4", "x": 4, "y": 1.75 },
25 { "label": "5", "x": 0, "y": 2.75 },
26 { "label": "6", "x": 1, "y": 2.75 },
27 { "label": "7", "x": 2, "y": 2.75 },
28 { "label": "8", "x": 3, "y": 2.75 },
29 { "label": "9", "x": 4, "y": 2.75 },
30 { "label": "10", "x": 0, "y": 3.75 },
31 { "label": "11", "x": 1, "y": 3.75 },
32 { "label": "12", "x": 2, "y": 3.75 },
33 { "label": "13", "x": 3, "y": 3.75 },
34 { "label": "14", "x": 4, "y": 3.75 }
35 ]
36 },
37 "LAYOUT_left": {
38 "layout": [
39 { "label": "E2", "x": 0.25, "y": 0.5 },
40 { "label": "4", "x": 1.75, "y": 0 },
41 { "label": "9", "x": 2.75, "y": 0 },
42 { "label": "14", "x": 3.75, "y": 0 },
43 { "label": "3", "x": 1.75, "y": 1 },
44 { "label": "8", "x": 2.75, "y": 1 },
45 { "label": "13", "x": 3.75, "y": 1 },
46 { "label": "E1", "x": 0, "y": 1.75, "h": 1.5, "w": 1.5 },
47 { "label": "2", "x": 1.75, "y": 2 },
48 { "label": "7", "x": 2.75, "y": 2 },
49 { "label": "12", "x": 3.75, "y": 2 },
50 { "label": "1", "x": 1.75, "y": 3 },
51 { "label": "6", "x": 2.75, "y": 3 },
52 { "label": "11", "x": 3.75, "y": 3 },
53 { "label": "E0", "x": 0.25, "y": 3.5 },
54 { "label": "0", "x": 1.75, "y": 4 },
55 { "label": "5", "x": 2.75, "y": 4 },
56 { "label": "10", "x": 3.75, "y": 4 }
57 ]
58 },
59 "LAYOUT_right": {
60 "layout": [
61 { "label": "10", "x": 0, "y": 0 },
62 { "label": "5", "x": 1, "y": 0 },
63 { "label": "0", "x": 2, "y": 0 },
64 { "label": "E0", "x": 3.5, "y": 0.5 },
65 { "label": "11", "x": 0, "y": 1 },
66 { "label": "6", "x": 1, "y": 1 },
67 { "label": "1", "x": 2, "y": 1 },
68 { "label": "12", "x": 0, "y": 2 },
69 { "label": "7", "x": 1, "y": 2 },
70 { "label": "2", "x": 2, "y": 2 },
71 { "label": "E1", "x": 3.25, "y": 1.75, "h": 1.5, "w": 1.5 },
72 { "label": "13", "x": 0, "y": 3 },
73 { "label": "8", "x": 1, "y": 3 },
74 { "label": "3", "x": 2, "y": 3 },
75 { "label": "14", "x": 0, "y": 4 },
76 { "label": "9", "x": 1, "y": 4 },
77 { "label": "4", "x": 2, "y": 4 },
78 { "label": "E2", "x": 3.5, "y": 3.5 }
79 ]
80 },
81 "LAYOUT_bottom": {
82 "layout": [
83 { "label": "14", "x": 0, "y": 0 },
84 { "label": "13", "x": 1, "y": 0 },
85 { "label": "12", "x": 2, "y": 0 },
86 { "label": "11", "x": 3, "y": 0 },
87 { "label": "10", "x": 4, "y": 0 },
88 { "label": "9", "x": 0, "y": 1 },
89 { "label": "8", "x": 1, "y": 1 },
90 { "label": "7", "x": 2, "y": 1 },
91 { "label": "6", "x": 3, "y": 1 },
92 { "label": "5", "x": 4, "y": 1 },
93 { "label": "4", "x": 0, "y": 2 },
94 { "label": "3", "x": 1, "y": 2 },
95 { "label": "2", "x": 2, "y": 2 },
96 { "label": "1", "x": 3, "y": 2 },
97 { "label": "0", "x": 4, "y": 2 },
98 { "label": "E2", "x": 0.5, "y": 3.5 },
99 { "label": "E1", "x": 1.75, "y": 3.25, "h": 1.5, "w": 1.5 },
100 { "label": "E0", "x": 3.5, "y": 3.5 }
101 ]
102 }
103 }
104}
diff --git a/keyboards/winry/winry315/keymaps/default/keymap.c b/keyboards/winry/winry315/keymaps/default/keymap.c
new file mode 100644
index 0000000000..a0bc2706ca
--- /dev/null
+++ b/keyboards/winry/winry315/keymaps/default/keymap.c
@@ -0,0 +1,79 @@
1// Copyright 2022 Sergey Vlasov (@sigprof)
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include QMK_KEYBOARD_H
5
6// Defines names for use in layer keycodes and the keymap
7enum layer_names {
8 _BASE,
9 _RGB,
10};
11
12// Shorter defines for some QMK keycodes (to keep the keymap aligned)
13#define U_LTESC LT(_RGB, KC_ESC)
14
15// clang-format off
16const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
17 // Base
18 [_BASE] = LAYOUT_top(
19 KC_HOME, KC_MUTE, KC_MPLY,
20 KC_1, KC_2, KC_3, KC_4, KC_5,
21 KC_6, KC_7, KC_8, KC_9, KC_0,
22 U_LTESC, KC_TAB, KC_SPC, KC_BSPC, KC_ENT
23 ),
24
25 // RGB configuration
26 [_RGB] = LAYOUT_top(
27 RGB_M_P, RGB_M_B, RGB_M_R,
28 RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI,
29 RGB_RMOD,RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD,
30 KC_TRNS, RGB_TOG, RGB_M_P, RGB_M_B, RGB_M_R
31 ),
32};
33// clang-format on
34
35bool encoder_update_user(uint8_t index, bool clockwise) {
36 uint8_t layer = get_highest_layer(layer_state | default_layer_state);
37
38 switch (index) {
39 case 0:
40 // Left encoder
41 if (layer == _RGB) {
42 if (clockwise) {
43 rgblight_increase_hue();
44 } else {
45 rgblight_decrease_hue();
46 }
47 } else {
48 tap_code(clockwise ? KC_PGDN : KC_PGUP);
49 }
50 break;
51
52 case 1:
53 // Center encoder
54 if (layer == _RGB) {
55 if (clockwise) {
56 rgblight_increase_sat();
57 } else {
58 rgblight_decrease_sat();
59 }
60 } else {
61 tap_code_delay(clockwise ? KC_VOLU : KC_VOLD, 10);
62 }
63 break;
64
65 case 2:
66 // Right encoder
67 if (layer == _RGB) {
68 if (clockwise) {
69 rgblight_increase_val();
70 } else {
71 rgblight_decrease_val();
72 }
73 } else {
74 tap_code_delay(clockwise ? KC_MNXT : KC_MPRV, 10);
75 }
76 break;
77 }
78 return false;
79}
diff --git a/keyboards/winry/winry315/keymaps/default/readme.md b/keyboards/winry/winry315/keymaps/default/readme.md
new file mode 100644
index 0000000000..685bea5767
--- /dev/null
+++ b/keyboards/winry/winry315/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default keymap for Winry315
diff --git a/keyboards/winry/winry315/keymaps/left_numpad/config.h b/keyboards/winry/winry315/keymaps/left_numpad/config.h
new file mode 100644
index 0000000000..acb72b5bb4
--- /dev/null
+++ b/keyboards/winry/winry315/keymaps/left_numpad/config.h
@@ -0,0 +1,6 @@
1// Copyright 2022 Sergey Vlasov (@sigprof)
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#define WINRY315_DEFAULT_ORIENTATION WINRY315_ORIENTATION_LEFT
diff --git a/keyboards/winry/winry315/keymaps/left_numpad/keymap.c b/keyboards/winry/winry315/keymaps/left_numpad/keymap.c
new file mode 100644
index 0000000000..8864b1b45a
--- /dev/null
+++ b/keyboards/winry/winry315/keymaps/left_numpad/keymap.c
@@ -0,0 +1,81 @@
1// Copyright 2022 Sergey Vlasov (@sigprof)
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include QMK_KEYBOARD_H
5
6// Defines names for use in layer keycodes and the keymap
7enum layer_names {
8 _BASE,
9 _RGB,
10};
11
12// Shorter defines for some QMK keycodes (to keep the keymap aligned)
13#define U_LTESC LT(_RGB, KC_ESC)
14
15// clang-format off
16const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
17 /* Base */
18 [_BASE] = LAYOUT_left(
19 KC_MPLY, U_LTESC, KC_BSPC, KC_PENT,
20 KC_P7, KC_P8, KC_P9,
21 KC_MUTE, KC_P4, KC_P5, KC_P6,
22 KC_P1, KC_P2, KC_P3,
23 KC_HOME, KC_P0, KC_P0, KC_PDOT
24 ),
25
26 /* RGB configuration */
27 [_RGB] = LAYOUT_left(
28 RGB_M_R, KC_TRNS, RGB_SPD, RGB_SPI,
29 RGB_TOG, RGB_HUD, RGB_HUI,
30 RGB_M_B, RGB_M_P, RGB_SAD, RGB_SAI,
31 KC_NO, RGB_VAD, RGB_VAI,
32 RGB_M_P, KC_NLCK, RGB_RMOD,RGB_MOD
33 ),
34};
35// clang-format on
36
37bool encoder_update_user(uint8_t index, bool clockwise) {
38 uint8_t layer = get_highest_layer(layer_state | default_layer_state);
39
40 switch (index) {
41 case 0:
42 // Bottom encoder (left in the default orientation)
43 if (layer == _RGB) {
44 if (clockwise) {
45 rgblight_increase_val();
46 } else {
47 rgblight_decrease_val();
48 }
49 } else {
50 tap_code(clockwise ? KC_PGDN : KC_PGUP);
51 }
52 break;
53
54 case 1:
55 // Center encoder
56 if (layer == _RGB) {
57 if (clockwise) {
58 rgblight_increase_sat();
59 } else {
60 rgblight_decrease_sat();
61 }
62 } else {
63 tap_code_delay(clockwise ? KC_VOLU : KC_VOLD, 10);
64 }
65 break;
66
67 case 2:
68 // Top encoder (right in the default orientation)
69 if (layer == _RGB) {
70 if (clockwise) {
71 rgblight_increase_hue();
72 } else {
73 rgblight_decrease_hue();
74 }
75 } else {
76 tap_code_delay(clockwise ? KC_MNXT : KC_MPRV, 10);
77 }
78 break;
79 }
80 return false;
81}
diff --git a/keyboards/winry/winry315/keymaps/left_numpad/readme.md b/keyboards/winry/winry315/keymaps/left_numpad/readme.md
new file mode 100644
index 0000000000..9562c2fc19
--- /dev/null
+++ b/keyboards/winry/winry315/keymaps/left_numpad/readme.md
@@ -0,0 +1,3 @@
1# The “Left Numpad” keymap for Winry315
2
3This is a keymap example for the Winry315 board in the “left” orientation (the board is rotated so that the encoders are on the left side, and the keys are in 5 rows of 3 keys). The `LAYOUT_left` macro is used for this orientation, and `WINRY315_DEFAULT_ORIENTATION` is redefined in `config.h` to change the behavior of RGB Matrix effects.
diff --git a/keyboards/winry/winry315/keymaps/via/config.h b/keyboards/winry/winry315/keymaps/via/config.h
new file mode 100644
index 0000000000..5fc0e02531
--- /dev/null
+++ b/keyboards/winry/winry315/keymaps/via/config.h
@@ -0,0 +1,15 @@
1// Copyright 2022 Sergey Vlasov (@sigprof)
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#define DYNAMIC_KEYMAP_LAYER_COUNT 8
7
8// Enable a limited form of RGB Matrix support in VIA (requires redefining the
9// effect list in the VIA JSON, which then becomes not 100% compatible with the
10// RGBLIGHT firmwares).
11#define VIA_QMK_RGBLIGHT_ENABLE
12
13// Enable the workaround for the speed parameter mismatch between RGBLIGHT and
14// RGB Matrix, so that the speed slider in VIA behaves in a more useful way.
15#define VIA_CUSTOM_LIGHTING_ENABLE
diff --git a/keyboards/winry/winry315/keymaps/via/encoder_actions.c b/keyboards/winry/winry315/keymaps/via/encoder_actions.c
new file mode 100644
index 0000000000..96dfe74bca
--- /dev/null
+++ b/keyboards/winry/winry315/keymaps/via/encoder_actions.c
@@ -0,0 +1,85 @@
1/* Copyright 2020 Neil Brian Ramirez
2 * Copyright 2021 drashna jael're (@drashna)
3 * Copyright 2022 Sergey Vlasov (@sigprof)
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#if defined(VIA_ENABLE) && defined(ENCODER_ENABLE)
22
23# ifndef ENCODER_TAP_DURATION_MS
24# define ENCODER_TAP_DURATION_MS 10
25# endif
26
27# define ENCODER_STATE_CW 0x01
28# define ENCODER_STATE_CCW 0x02
29
30# ifdef ENCODERS
31static uint8_t encoder_state[ENCODERS] = {0};
32static uint16_t encoder_timer[ENCODERS] = {0};
33static keypos_t encoder_cw[ENCODERS] = ENCODERS_CW_KEY;
34static keypos_t encoder_ccw[ENCODERS] = ENCODERS_CCW_KEY;
35
36static void exec_encoder_action(uint8_t index, bool clockwise, bool pressed) {
37 // clang-format off
38 keyevent_t encoder_event = (keyevent_t) {
39 .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
40 .pressed = pressed,
41 .time = (timer_read() | 1)
42 };
43 // clang-format on
44 action_exec(encoder_event);
45}
46# endif
47
48void encoder_action_unregister(void) {
49# ifdef ENCODERS
50 for (int index = 0; index < ENCODERS; ++index) {
51 if (encoder_state[index] && (timer_elapsed(encoder_timer[index]) >= ENCODER_TAP_DURATION_MS)) {
52 bool clockwise = !!(encoder_state[index] & ENCODER_STATE_CW);
53 encoder_state[index] = 0;
54 exec_encoder_action(index, clockwise, false);
55 }
56 }
57# endif
58}
59
60void encoder_action_register(uint8_t index, bool clockwise) {
61# ifdef ENCODERS
62 if (encoder_state[index]) {
63 bool was_clockwise = !!(encoder_state[index] & ENCODER_STATE_CW);
64 encoder_state[index] = 0;
65 exec_encoder_action(index, was_clockwise, false);
66 }
67 encoder_state[index] = clockwise ? ENCODER_STATE_CW : ENCODER_STATE_CCW;
68 encoder_timer[index] = timer_read();
69 exec_encoder_action(index, clockwise, true);
70# endif
71}
72
73void matrix_scan_kb(void) {
74 encoder_action_unregister();
75 matrix_scan_user();
76}
77
78bool encoder_update_kb(uint8_t index, bool clockwise) {
79 encoder_action_register(index, clockwise);
80 // don't return user actions, because they are in the keymap
81 // encoder_update_user(index, clockwise);
82 return true;
83};
84
85#endif
diff --git a/keyboards/winry/winry315/keymaps/via/encoder_actions.h b/keyboards/winry/winry315/keymaps/via/encoder_actions.h
new file mode 100644
index 0000000000..2484af52ae
--- /dev/null
+++ b/keyboards/winry/winry315/keymaps/via/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/winry/winry315/keymaps/via/keymap.c b/keyboards/winry/winry315/keymaps/via/keymap.c
new file mode 100644
index 0000000000..67598ac337
--- /dev/null
+++ b/keyboards/winry/winry315/keymaps/via/keymap.c
@@ -0,0 +1,44 @@
1// Copyright 2022 Sergey Vlasov (@sigprof)
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include QMK_KEYBOARD_H
5
6// clang-format off
7
8#define LAYOUT_via( \
9 k17, k15, k16, \
10 k23,k22, k19,k18, k21,k20, \
11 k00, k01, k02, k03, k04, \
12 k05, k06, k07, k08, k09, \
13 k10, k11, k12, k13, k14 \
14) { \
15 { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23 } \
16}
17
18#define U_LTESC LT(1, KC_ESC)
19
20const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
21 [0] = LAYOUT_via(
22 KC_HOME, KC_MUTE, KC_MPLY,
23 KC_PGUP, KC_PGDN, KC_VOLD, KC_VOLU, KC_MPRV, KC_MNXT,
24 KC_1, KC_2, KC_3, KC_4, KC_5,
25 KC_6, KC_7, KC_8, KC_9, KC_0,
26 U_LTESC, KC_TAB, KC_SPC, KC_BSPC, KC_ENT
27 ),
28 [1] = LAYOUT_via(
29 RGB_M_P, RGB_M_B, RGB_M_R,
30 RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI,
31 RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI,
32 RGB_RMOD,RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD,
33 KC_TRNS, RGB_TOG, RGB_M_P, RGB_M_B, RGB_M_R
34 ),
35 [2 ... 7] = LAYOUT_via(
36 KC_TRNS, KC_TRNS, KC_TRNS,
37 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
38 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
39 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
40 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
41 ),
42};
43
44// clang-format on
diff --git a/keyboards/winry/winry315/keymaps/via/rules.mk b/keyboards/winry/winry315/keymaps/via/rules.mk
new file mode 100644
index 0000000000..6098ef3ad8
--- /dev/null
+++ b/keyboards/winry/winry315/keymaps/via/rules.mk
@@ -0,0 +1,4 @@
1VIA_ENABLE = yes
2LTO_ENABLE = yes
3
4SRC += encoder_actions.c
diff --git a/keyboards/winry/winry315/readme.md b/keyboards/winry/winry315/readme.md
new file mode 100644
index 0000000000..099e6b42b4
--- /dev/null
+++ b/keyboards/winry/winry315/readme.md
@@ -0,0 +1,45 @@
1# Winry315
2
3![Winry315](https://i.imgur.com/nWE5mbXh.jpeg)
4
5Winry315 is a macropad with 3 rotary encoders and 15 keys (arranged as 3 rows of 5 keys).
6
7This board may also be known as “YD3xn15mx”, “YD315” or “YD 3x15m”. Boards sold by the [SpiderIsland shop on AliExpress](https://www.aliexpress.com/store/5241107) may have “DEBROGLIE” on the bottom side of the case.
8
9More photos can be found [in this Imgur album](https://imgur.com/a/0xf9pju).
10
11* Keyboard Maintainer: [Sergey Vlasov](https://github.com/sigprof)
12* Hardware Supported: Winry315 PCB
13* Hardware Availability: [Taobao](https://world.taobao.com/item/657924681898.htm), [AliExpress](https://www.aliexpress.com/item/1005003500083583.html)
14
15Make example for this keyboard (after setting up your build environment):
16
17 make winry/winry315:default
18
19Flashing example for this keyboard:
20
21 make winry/winry315:default:flash
22
23See 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).
24
25## Bootloader
26
27Enter the bootloader in 3 ways:
28
29* **Bootmagic reset**: Hold down the top left key (not the encoder) and plug in the keyboard. This apparently also works with the vendor VIA firmware.
30 * Note that the bootmagic key does not change with the board orientation configured using `WINRY315_DEFAULT_ORIENTATION` — the “top left” key position in the default orientation (encoders on the top side) is always used.
31* **Physical reset button**: Briefly press the button on the back of the PCB (the acrylic bottom cover should have a hole to access that button).
32* **Keycode in layout**: Press the key mapped to `RESET` if it is available (the default keymap does not have that keycode assigned to any key, but you can use that keycode in your custom keymap if you want to have easier access to the bootloader).
33
34## Orientation
35
36Although the normal orientation of this macropad is with the encoders on the “top” side (away from the user), you may prefer using it in a sideways orientation (with the encoders on the left or right side). There are extra layout macros (`LAYOUT_left`, `LAYOUT_right` and even `LAYOUT_bottom` for completeness) which you can use in the keymap; however, just using one of those macros won't change the behavior of RGB Matrix effects. If you want to change the orientation of various RGB Matrix effects too, you can specify the desired orientation in the `config.h` file for your custom keymap by using one of the following defines:
37
38 #define WINRY315_DEFAULT_ORIENTATION WINRY315_ORIENTATION_TOP
39 #define WINRY315_DEFAULT_ORIENTATION WINRY315_ORIENTATION_LEFT
40 #define WINRY315_DEFAULT_ORIENTATION WINRY315_ORIENTATION_RIGHT
41 #define WINRY315_DEFAULT_ORIENTATION WINRY315_ORIENTATION_BOTTOM
42
43The VIA firmware changes the orientation for RGB Matrix effects automatically when the “Encoder Side” layout option is changed.
44
45Note that stems of MX switches are not symmetrical with respect to 90° rotation, so you may have some difficulties when putting the keycaps on switches if you choose one of sideways orientations.
diff --git a/keyboards/winry/winry315/rules.mk b/keyboards/winry/winry315/rules.mk
new file mode 100644
index 0000000000..c10a9d570a
--- /dev/null
+++ b/keyboards/winry/winry315/rules.mk
@@ -0,0 +1,21 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5BOOTLOADER = atmel-dfu
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
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
15NKRO_ENABLE = no # Enable N-Key Rollover
16BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
17RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
18AUDIO_ENABLE = no # Audio output
19ENCODER_ENABLE = yes
20RGB_MATRIX_ENABLE = yes
21RGB_MATRIX_DRIVER = WS2812
diff --git a/keyboards/winry/winry315/winry315.c b/keyboards/winry/winry315/winry315.c
new file mode 100644
index 0000000000..c741ffeb74
--- /dev/null
+++ b/keyboards/winry/winry315/winry315.c
@@ -0,0 +1,262 @@
1// Copyright 2022 Sergey Vlasov (@sigprof)
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include "winry315.h"
5
6#include "via.h"
7
8#if !defined(WINRY315_DEFAULT_ORIENTATION)
9# define WINRY315_DEFAULT_ORIENTATION WINRY315_ORIENTATION_TOP
10#endif
11
12#if !defined(VIA_ENABLE) && defined(ENCODER_ENABLE)
13# ifndef MEDIA_KEY_DELAY
14# define MEDIA_KEY_DELAY 10
15# endif
16bool encoder_update_kb(uint8_t index, bool clockwise) {
17 if (!encoder_update_user(index, clockwise)) {
18 return false;
19 }
20 if (index == 0) {
21 // Left encoder (assuming the default "top" orientation)
22 if (clockwise) {
23 tap_code(KC_PGDN);
24 } else {
25 tap_code(KC_PGUP);
26 }
27 } else if (index == 1) {
28 // Center encoder
29 if (clockwise) {
30 tap_code_delay(KC_VOLU, MEDIA_KEY_DELAY);
31 } else {
32 tap_code_delay(KC_VOLD, MEDIA_KEY_DELAY);
33 }
34 } else if (index == 2) {
35 // Right encoder
36 if (clockwise) {
37 tap_code_delay(KC_MNXT, MEDIA_KEY_DELAY);
38 } else {
39 tap_code_delay(KC_MPRV, MEDIA_KEY_DELAY);
40 }
41 }
42 return true;
43}
44#endif // !defined(VIA_ENABLE) && defined(ENCODER_ENABLE)
45
46#if defined(RGB_MATRIX_ENABLE)
47
48// LED mapping (assuming the default "top" orientation):
49// 0 - right encoder, top right
50// 1 - right encoder, top left
51// 2 - center encoder, top right
52// 3 - center encoder, top left
53// 4 - left encoder, top right
54// 5 - left encoder, top left
55// 6 - row 0, column 0
56// 7 - row 1, column 0
57// 8 - row 2, column 0
58// 9 - row 2, column 1
59// 10 - row 1, column 1
60// 11 - row 0, column 1
61// 12 - row 0, column 2
62// 13 - row 1, column 2
63// 14 - row 2, column 2
64// 15 - row 2, column 3
65// 16 - row 1, column 3
66// 17 - row 0, column 3
67// 18 - row 0, column 4
68// 19 - row 1, column 4
69// 20 - row 2, column 4
70// 21 - underglow, right bottom
71// 22 - underglow, left bottom
72// 23 - underglow, left middle
73// 24 - underglow, left top
74// 25 - underglow, right top
75// 26 - underglow, right middle
76
77# define X_MM_MIN (-42)
78# define X_MM_MAX 42
79# define Y_MM_MIN (-40) // actually -35, but adjusted to get height = width
80# define Y_MM_MAX 44 // actually 40, but adjusted to get height = width
81# define WIDTH_MM (X_MM_MAX - X_MM_MIN)
82# define HEIGHT_MM (Y_MM_MAX - Y_MM_MIN)
83# define WIDTH_UNITS (35 * 2) // needs to match RGB_MATRIX_CENTER
84# define HEIGHT_UNITS (35 * 2) // needs to match RGB_MATRIX_CENTER
85
86// Convert the LED physical coordinates from millimeters with the origin at the
87// PCB center to the form expected by the RGB Matrix code.
88# define LED(x_mm, y_mm) \
89 { ((x_mm - X_MM_MIN) * WIDTH_UNITS + WIDTH_MM / 2) / WIDTH_MM, ((Y_MM_MAX - y_mm) * HEIGHT_UNITS + HEIGHT_MM / 2) / HEIGHT_MM }
90
91// clang-format off
92static const led_config_t PROGMEM initial_led_config = {
93 {
94 { 6, 11, 12, 17, 18, 7, 10, 13, 16, 19, 8, 9, 14, 15, 20, 2, 0, 4, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }
95 },
96 {
97 LED( 35, 36),
98 LED( 21, 36),
99 LED( 8, 34),
100 LED(-8, 34),
101 LED(-21, 36),
102 LED(-35, 36),
103 LED(-38, 5),
104 LED(-38, -14),
105 LED(-38, -33),
106 LED(-19, -33),
107 LED(-19, -14),
108 LED(-19, 5),
109 LED( 0, 5),
110 LED( 0, -14),
111 LED( 0, -33),
112 LED( 19, -33),
113 LED( 19, -14),
114 LED( 19, 5),
115 LED( 38, 5),
116 LED( 38, -14),
117 LED( 38, -33),
118 LED( 28, -35),
119 LED(-28, -35),
120 LED(-37, -9),
121 LED(-42, 40),
122 LED( 42, 40),
123 LED( 37, -9)
124 },
125 {
126 1, 1, 1, 1, 1, 1, // encoders (colored as modifiers)
127 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // regular keys
128 2, 2, 2, 2, 2, 2 // underglow
129 }
130};
131// clang-format on
132
133led_config_t g_led_config;
134
135void keyboard_pre_init_kb(void) {
136 // To be safe against any possible changes to rgb_matrix_init(),
137 // g_led_config should be initialized before rgb_matrix_init() is called;
138 // matrix_init_kb() would be too late, so keyboard_pre_init_kb() is used.
139 memcpy_P(&g_led_config, &initial_led_config, sizeof(g_led_config));
140 winry315_set_orientation(WINRY315_DEFAULT_ORIENTATION);
141
142 keyboard_pre_init_user();
143}
144
145// Encoders have two associated LEDs on this board; supporting more than one
146// LED per key requires defining rgb_matrix_map_row_column_to_led_kb() to
147// report any extra LEDs.
148uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) {
149 if (row == 0) {
150 switch (column) {
151 case 15: // center encoder
152 led_i[0] = 3;
153 return 1;
154
155 case 16: // right encoder
156 led_i[0] = 1;
157 return 1;
158
159 case 17: // left encoder
160 led_i[0] = 5;
161 return 1;
162 }
163 }
164 return 0;
165}
166
167# if defined(VIA_ENABLE) && defined(VIA_CUSTOM_LIGHTING_ENABLE)
168
169// VIA supports only 4 discrete values for effect speed; map these to some
170// useful speed values for RGB Matrix.
171enum speed_values {
172 RGBLIGHT_SPEED_0 = UINT8_MAX / 16, // not 0 to avoid really slow effects
173 RGBLIGHT_SPEED_1 = UINT8_MAX / 4,
174 RGBLIGHT_SPEED_2 = UINT8_MAX / 2, // matches the default value
175 RGBLIGHT_SPEED_3 = UINT8_MAX / 4 * 3, // UINT8_MAX is really fast
176};
177
178static uint8_t speed_from_rgblight(uint8_t rgblight_speed) {
179 switch (rgblight_speed) {
180 case 0:
181 return RGBLIGHT_SPEED_0;
182 case 1:
183 return RGBLIGHT_SPEED_1;
184 case 2:
185 default:
186 return RGBLIGHT_SPEED_2;
187 case 3:
188 return RGBLIGHT_SPEED_3;
189 }
190}
191
192static uint8_t speed_to_rgblight(uint8_t rgb_matrix_speed) {
193 if (rgb_matrix_speed < ((RGBLIGHT_SPEED_0 + RGBLIGHT_SPEED_1) / 2)) {
194 return 0;
195 } else if (rgb_matrix_speed < ((RGBLIGHT_SPEED_1 + RGBLIGHT_SPEED_2) / 2)) {
196 return 1;
197 } else if (rgb_matrix_speed < ((RGBLIGHT_SPEED_2 + RGBLIGHT_SPEED_3) / 2)) {
198 return 2;
199 } else {
200 return 3;
201 }
202}
203
204void raw_hid_receive_kb(uint8_t *data, uint8_t length) {
205 switch (data[0]) {
206 case id_lighting_get_value:
207 if (data[1] == id_qmk_rgblight_effect_speed) {
208 data[2] = speed_to_rgblight(rgb_matrix_get_speed());
209 }
210 break;
211 case id_lighting_set_value:
212 if (data[1] == id_qmk_rgblight_effect_speed) {
213 rgb_matrix_set_speed_noeeprom(speed_from_rgblight(data[2]));
214 }
215 break;
216 }
217}
218
219# endif // defined(VIA_ENABLE) && defined(VIA_CUSTOM_LIGHTING_ENABLE)
220
221#endif // defined(RGB_MATRIX_ENABLE)
222
223void winry315_set_orientation(uint8_t orientation) {
224 (void)orientation;
225#if defined(RGB_MATRIX_ENABLE)
226 for (uint8_t i = 0; i < DRIVER_LED_TOTAL; ++i) {
227 led_point_t * dst_point = &g_led_config.point[i];
228 const led_point_t *src_point = &initial_led_config.point[i];
229 uint8_t x = pgm_read_byte(&src_point->x);
230 uint8_t y = pgm_read_byte(&src_point->y);
231
232 switch (orientation) {
233 case WINRY315_ORIENTATION_TOP:
234 default:
235 dst_point->x = x;
236 dst_point->y = y;
237 break;
238
239 case WINRY315_ORIENTATION_LEFT:
240 dst_point->x = y;
241 dst_point->y = WIDTH_UNITS - x;
242 break;
243
244 case WINRY315_ORIENTATION_RIGHT:
245 dst_point->x = HEIGHT_UNITS - y;
246 dst_point->y = x;
247 break;
248
249 case WINRY315_ORIENTATION_BOTTOM:
250 dst_point->x = WIDTH_UNITS - x;
251 dst_point->y = HEIGHT_UNITS - y;
252 break;
253 }
254 }
255#endif // defined(RGB_MATRIX_ENABLE)
256}
257
258#if defined(VIA_ENABLE)
259void via_set_layout_options_kb(uint32_t value) {
260 winry315_set_orientation(value & 0x03);
261}
262#endif // defined(VIA_ENABLE)
diff --git a/keyboards/winry/winry315/winry315.h b/keyboards/winry/winry315/winry315.h
new file mode 100644
index 0000000000..4796089003
--- /dev/null
+++ b/keyboards/winry/winry315/winry315.h
@@ -0,0 +1,86 @@
1// Copyright 2022 Sergey Vlasov (@sigprof)
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include "quantum.h"
7
8// Supported orientations of the board. The enum values must match the layout
9// option values used by VIA.
10enum winry315_orientation {
11 WINRY315_ORIENTATION_TOP, // Encoders at the top side (default)
12 WINRY315_ORIENTATION_LEFT, // Encoders at the left side
13 WINRY315_ORIENTATION_RIGHT, // Encoders at the right side
14 WINRY315_ORIENTATION_BOTTOM // Encoders at the bottom side
15};
16
17// Set the orientation of the board (changes the RGB Matrix effect behavior to
18// match the new orientation).
19//
20// This function is intended to be used in the `via` keymap, where the board
21// orientation is configured dynamically using a VIA layout option. If you are
22// making a custom keymap for one specific orientation, it is better to set the
23// orientation in config.h (e.g., `#define WINRY315_DEFAULT_ORIENTATION
24// WINRY315_ORIENTATION_LEFT`) instead of adding custom code that calls this
25// function.
26void winry315_set_orientation(uint8_t orientation);
27
28// clang-format off
29
30// This is a shortcut to help you visually see your layout.
31//
32// The first section contains all of the arguments representing the physical
33// layout of the board and position of the keys.
34//
35// The second converts the arguments into a two-dimensional array which
36// represents the switch matrix.
37//
38// For this board multiple layouts are defined to make it easier to use the
39// board in a sideways orientation; the actual PCB supports only a single
40// layout (LAYOUT_top).
41
42// Default layout: encoders at the top side (WINRY315_ORIENTATION_TOP).
43#define LAYOUT_top( \
44 k17, k15, k16, \
45 k00, k01, k02, k03, k04, \
46 k05, k06, k07, k08, k09, \
47 k10, k11, k12, k13, k14 \
48) { \
49 { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, k12, k13, k14, k15, k16, k17, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \
50}
51
52// Encoders at the left side (WINRY315_ORIENTATION_LEFT).
53#define LAYOUT_left( \
54 k16, k04, k09, k14, \
55 k03, k08, k13, \
56 k15, k02, k07, k12, \
57 k01, k06, k11, \
58 k17, k00, k05, k10 \
59) { \
60 { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, k12, k13, k14, k15, k16, k17, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \
61}
62
63// Encoders at the right side (WINRY315_ORIENTATION_RIGHT).
64#define LAYOUT_right( \
65 k10, k05, k00, k17, \
66 k11, k06, k01, \
67 k12, k07, k02, k15, \
68 k13, k08, k03, \
69 k14, k09, k04, k16 \
70) { \
71 { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, k12, k13, k14, k15, k16, k17, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \
72}
73
74// Encoders at the bottom side (WINRY315_ORIENTATION_BOTTOM).
75#define LAYOUT_bottom( \
76 k14, k13, k12, k11, k10, \
77 k09, k08, k07, k06, k05, \
78 k04, k03, k02, k01, k00, \
79 k16, k15, k17 \
80) { \
81 { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, k12, k13, k14, k15, k16, k17, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \
82}
83
84#define LAYOUT_all LAYOUT_top
85
86// clang-format on