diff options
Diffstat (limited to 'keyboards/winry')
-rw-r--r-- | keyboards/winry/winry25tc/config.h | 4 | ||||
-rw-r--r-- | keyboards/winry/winry25tc/info.json | 2 | ||||
-rw-r--r-- | keyboards/winry/winry25tc/rules.mk | 6 | ||||
-rw-r--r-- | keyboards/winry/winry315/config.h | 29 | ||||
-rw-r--r-- | keyboards/winry/winry315/info.json | 158 | ||||
-rw-r--r-- | keyboards/winry/winry315/keymaps/via/encoder_actions.c | 16 | ||||
-rw-r--r-- | keyboards/winry/winry315/rules.mk | 6 | ||||
-rw-r--r-- | keyboards/winry/winry315/winry315.h | 60 |
8 files changed, 93 insertions, 188 deletions
diff --git a/keyboards/winry/winry25tc/config.h b/keyboards/winry/winry25tc/config.h index 4b6364f58b..f67f725ef6 100644 --- a/keyboards/winry/winry25tc/config.h +++ b/keyboards/winry/winry25tc/config.h @@ -16,10 +16,6 @@ #pragma once -#include "config_common.h" - -#define MATRIX_ROWS 5 -#define MATRIX_COLS 5 #define MATRIX_ROW_PINS { E6, F0, D6, D2, B6 } #define MATRIX_COL_PINS { F5, C7, B7, B2, B4 } diff --git a/keyboards/winry/winry25tc/info.json b/keyboards/winry/winry25tc/info.json index 6adc2dbba7..4cbb746408 100644 --- a/keyboards/winry/winry25tc/info.json +++ b/keyboards/winry/winry25tc/info.json @@ -8,6 +8,8 @@ "pid": "0x0000", "device_version": "0.0.1" }, + "processor": "atmega32u4", + "bootloader": "atmel-dfu", "layouts": { "LAYOUT": { "layout": [ diff --git a/keyboards/winry/winry25tc/rules.mk b/keyboards/winry/winry25tc/rules.mk index 53a67bd4ae..e1908949b3 100644 --- a/keyboards/winry/winry25tc/rules.mk +++ b/keyboards/winry/winry25tc/rules.mk @@ -1,9 +1,3 @@ -# MCU name -MCU = atmega32u4 - -# Bootloader selection -BOOTLOADER = atmel-dfu - # Build Options # change yes to no to disable # diff --git a/keyboards/winry/winry315/config.h b/keyboards/winry/winry315/config.h index 3d0921590e..620a7f6e6b 100644 --- a/keyboards/winry/winry315/config.h +++ b/keyboards/winry/winry315/config.h @@ -3,33 +3,7 @@ #pragma once -#include "config_common.h" - -// Key matrix size. -#define MATRIX_ROWS 1 -#define MATRIX_COLS 24 - -// Key pins (including encoder press switches). -// The NO_PIN entries are reserved for encoder rotation mappings. -#define DIRECT_PINS \ - { \ - { 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 } \ - } - -// clang-format off - -// Encoder pins. -// Encoder numbering (assuming the default board orientation with encoders on -// the top side): -// 0 - left -// 1 - center (with a longer shaft and a larger knob) -// 2 - right -#define ENCODERS_PAD_A { F1, B0, B3 } -#define ENCODERS_PAD_B { F0, B1, B7 } -#define ENCODER_RESOLUTION 4 - // Encoder mappings (used for VIA). -#define ENCODERS 3 #define ENCODERS_CW_KEY { { 22, 0 }, { 18, 0 }, { 20, 0 } } #define ENCODERS_CCW_KEY { { 23, 0 }, { 19, 0 }, { 21, 0 } } @@ -133,6 +107,3 @@ # define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH #endif - -// Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed. -#define DEBOUNCE 5 diff --git a/keyboards/winry/winry315/info.json b/keyboards/winry/winry315/info.json index 6410c6222f..4039d5aaf5 100644 --- a/keyboards/winry/winry315/info.json +++ b/keyboards/winry/winry315/info.json @@ -8,96 +8,110 @@ "pid": "0x0315", "vid": "0xF1F1" }, + "encoder": { + "rotary": [ + {"pin_a": "F1", "pin_b": "F0"}, + {"pin_a": "B0", "pin_b": "B1"}, + {"pin_a": "B3", "pin_b": "B7"} + ] + }, + "processor": "atmega32u4", + "bootloader": "atmel-dfu", + "matrix_pins": { + "direct": [ + ["F4", "C7", "D4", "D5", "D1", "F5", "C6", "D6", "D3", "D2", "F6", "B6", "D7", "B4", "B5", "B2", "D0", "E6", null, null, null, null, null, null] + ] + }, "layout_aliases": { "LAYOUT_all": "LAYOUT_top" }, "layouts": { "LAYOUT_top": { "layout": [ - { "label": "E0", "x": 0.5, "y": 0.25 }, - { "label": "E1", "x": 1.75, "y": 0, "h": 1.5, "w": 1.5 }, - { "label": "E2", "x": 3.5, "y": 0.25 }, - { "label": "0", "x": 0, "y": 1.75 }, - { "label": "1", "x": 1, "y": 1.75 }, - { "label": "2", "x": 2, "y": 1.75 }, - { "label": "3", "x": 3, "y": 1.75 }, - { "label": "4", "x": 4, "y": 1.75 }, - { "label": "5", "x": 0, "y": 2.75 }, - { "label": "6", "x": 1, "y": 2.75 }, - { "label": "7", "x": 2, "y": 2.75 }, - { "label": "8", "x": 3, "y": 2.75 }, - { "label": "9", "x": 4, "y": 2.75 }, - { "label": "10", "x": 0, "y": 3.75 }, - { "label": "11", "x": 1, "y": 3.75 }, - { "label": "12", "x": 2, "y": 3.75 }, - { "label": "13", "x": 3, "y": 3.75 }, - { "label": "14", "x": 4, "y": 3.75 } + { "x": 0.5, "y": 0.25, "matrix": [0, 17] }, + { "x": 1.75, "y": 0, "h": 1.5, "w": 1.5, "matrix": [0, 15] }, + { "x": 3.5, "y": 0.25, "matrix": [0, 16] }, + { "x": 0, "y": 1.75, "matrix": [0, 0] }, + { "x": 1, "y": 1.75, "matrix": [0, 1] }, + { "x": 2, "y": 1.75, "matrix": [0, 2] }, + { "x": 3, "y": 1.75, "matrix": [0, 3] }, + { "x": 4, "y": 1.75, "matrix": [0, 4] }, + { "x": 0, "y": 2.75, "matrix": [0, 5] }, + { "x": 1, "y": 2.75, "matrix": [0, 6] }, + { "x": 2, "y": 2.75, "matrix": [0, 7] }, + { "x": 3, "y": 2.75, "matrix": [0, 8] }, + { "x": 4, "y": 2.75, "matrix": [0, 9] }, + { "x": 0, "y": 3.75, "matrix": [0, 10] }, + { "x": 1, "y": 3.75, "matrix": [0, 11] }, + { "x": 2, "y": 3.75, "matrix": [0, 12] }, + { "x": 3, "y": 3.75, "matrix": [0, 13] }, + { "x": 4, "y": 3.75, "matrix": [0, 14] } ] }, "LAYOUT_left": { "layout": [ - { "label": "E2", "x": 0.25, "y": 0.5 }, - { "label": "4", "x": 1.75, "y": 0 }, - { "label": "9", "x": 2.75, "y": 0 }, - { "label": "14", "x": 3.75, "y": 0 }, - { "label": "3", "x": 1.75, "y": 1 }, - { "label": "8", "x": 2.75, "y": 1 }, - { "label": "13", "x": 3.75, "y": 1 }, - { "label": "E1", "x": 0, "y": 1.75, "h": 1.5, "w": 1.5 }, - { "label": "2", "x": 1.75, "y": 2 }, - { "label": "7", "x": 2.75, "y": 2 }, - { "label": "12", "x": 3.75, "y": 2 }, - { "label": "1", "x": 1.75, "y": 3 }, - { "label": "6", "x": 2.75, "y": 3 }, - { "label": "11", "x": 3.75, "y": 3 }, - { "label": "E0", "x": 0.25, "y": 3.5 }, - { "label": "0", "x": 1.75, "y": 4 }, - { "label": "5", "x": 2.75, "y": 4 }, - { "label": "10", "x": 3.75, "y": 4 } + { "x": 0.25, "y": 0.5, "matrix": [0, 16] }, + { "x": 1.75, "y": 0, "matrix": [0, 4] }, + { "x": 2.75, "y": 0, "matrix": [0, 9] }, + { "x": 3.75, "y": 0, "matrix": [0, 14] }, + { "x": 1.75, "y": 1, "matrix": [0, 3] }, + { "x": 2.75, "y": 1, "matrix": [0, 8] }, + { "x": 3.75, "y": 1, "matrix": [0, 13] }, + { "x": 0, "y": 1.75, "h": 1.5, "w": 1.5, "matrix": [0, 15] }, + { "x": 1.75, "y": 2, "matrix": [0, 2] }, + { "x": 2.75, "y": 2, "matrix": [0, 7] }, + { "x": 3.75, "y": 2, "matrix": [0, 12] }, + { "x": 1.75, "y": 3, "matrix": [0, 1] }, + { "x": 2.75, "y": 3, "matrix": [0, 6] }, + { "x": 3.75, "y": 3, "matrix": [0, 11] }, + { "x": 0.25, "y": 3.5, "matrix": [0, 17] }, + { "x": 1.75, "y": 4, "matrix": [0, 0] }, + { "x": 2.75, "y": 4, "matrix": [0, 5] }, + { "x": 3.75, "y": 4, "matrix": [0, 10] } ] }, "LAYOUT_right": { "layout": [ - { "label": "10", "x": 0, "y": 0 }, - { "label": "5", "x": 1, "y": 0 }, - { "label": "0", "x": 2, "y": 0 }, - { "label": "E0", "x": 3.5, "y": 0.5 }, - { "label": "11", "x": 0, "y": 1 }, - { "label": "6", "x": 1, "y": 1 }, - { "label": "1", "x": 2, "y": 1 }, - { "label": "12", "x": 0, "y": 2 }, - { "label": "7", "x": 1, "y": 2 }, - { "label": "2", "x": 2, "y": 2 }, - { "label": "E1", "x": 3.25, "y": 1.75, "h": 1.5, "w": 1.5 }, - { "label": "13", "x": 0, "y": 3 }, - { "label": "8", "x": 1, "y": 3 }, - { "label": "3", "x": 2, "y": 3 }, - { "label": "14", "x": 0, "y": 4 }, - { "label": "9", "x": 1, "y": 4 }, - { "label": "4", "x": 2, "y": 4 }, - { "label": "E2", "x": 3.5, "y": 3.5 } + { "x": 0, "y": 0, "matrix": [0, 10] }, + { "x": 1, "y": 0, "matrix": [0, 5] }, + { "x": 2, "y": 0, "matrix": [0, 0] }, + { "x": 3.5, "y": 0.5, "matrix": [0, 17] }, + { "x": 0, "y": 1, "matrix": [0, 11] }, + { "x": 1, "y": 1, "matrix": [0, 6] }, + { "x": 2, "y": 1, "matrix": [0, 1] }, + { "x": 0, "y": 2, "matrix": [0, 12] }, + { "x": 1, "y": 2, "matrix": [0, 7] }, + { "x": 2, "y": 2, "matrix": [0, 2] }, + { "x": 3.25, "y": 1.75, "h": 1.5, "w": 1.5, "matrix": [0, 15] }, + { "x": 0, "y": 3, "matrix": [0, 13] }, + { "x": 1, "y": 3, "matrix": [0, 8] }, + { "x": 2, "y": 3, "matrix": [0, 3] }, + { "x": 0, "y": 4, "matrix": [0, 14] }, + { "x": 1, "y": 4, "matrix": [0, 9] }, + { "x": 2, "y": 4, "matrix": [0, 4] }, + { "x": 3.5, "y": 3.5, "matrix": [0, 16] } ] }, "LAYOUT_bottom": { "layout": [ - { "label": "14", "x": 0, "y": 0 }, - { "label": "13", "x": 1, "y": 0 }, - { "label": "12", "x": 2, "y": 0 }, - { "label": "11", "x": 3, "y": 0 }, - { "label": "10", "x": 4, "y": 0 }, - { "label": "9", "x": 0, "y": 1 }, - { "label": "8", "x": 1, "y": 1 }, - { "label": "7", "x": 2, "y": 1 }, - { "label": "6", "x": 3, "y": 1 }, - { "label": "5", "x": 4, "y": 1 }, - { "label": "4", "x": 0, "y": 2 }, - { "label": "3", "x": 1, "y": 2 }, - { "label": "2", "x": 2, "y": 2 }, - { "label": "1", "x": 3, "y": 2 }, - { "label": "0", "x": 4, "y": 2 }, - { "label": "E2", "x": 0.5, "y": 3.5 }, - { "label": "E1", "x": 1.75, "y": 3.25, "h": 1.5, "w": 1.5 }, - { "label": "E0", "x": 3.5, "y": 3.5 } + { "x": 0, "y": 0, "matrix": [0, 14] }, + { "x": 1, "y": 0, "matrix": [0, 13] }, + { "x": 2, "y": 0, "matrix": [0, 12] }, + { "x": 3, "y": 0, "matrix": [0, 11] }, + { "x": 4, "y": 0, "matrix": [0, 10] }, + { "x": 0, "y": 1, "matrix": [0, 9] }, + { "x": 1, "y": 1, "matrix": [0, 8] }, + { "x": 2, "y": 1, "matrix": [0, 7] }, + { "x": 3, "y": 1, "matrix": [0, 6] }, + { "x": 4, "y": 1, "matrix": [0, 5] }, + { "x": 0, "y": 2, "matrix": [0, 4] }, + { "x": 1, "y": 2, "matrix": [0, 3] }, + { "x": 2, "y": 2, "matrix": [0, 2] }, + { "x": 3, "y": 2, "matrix": [0, 1] }, + { "x": 4, "y": 2, "matrix": [0, 0] }, + { "x": 0.5, "y": 3.5, "matrix": [0, 16] }, + { "x": 1.75, "y": 3.25, "h": 1.5, "w": 1.5, "matrix": [0, 15] }, + { "x": 3.5, "y": 3.5, "matrix": [0, 17] } ] } } diff --git a/keyboards/winry/winry315/keymaps/via/encoder_actions.c b/keyboards/winry/winry315/keymaps/via/encoder_actions.c index 96dfe74bca..9a9092effd 100644 --- a/keyboards/winry/winry315/keymaps/via/encoder_actions.c +++ b/keyboards/winry/winry315/keymaps/via/encoder_actions.c @@ -27,11 +27,10 @@ # define ENCODER_STATE_CW 0x01 # define ENCODER_STATE_CCW 0x02 -# ifdef ENCODERS -static uint8_t encoder_state[ENCODERS] = {0}; -static uint16_t encoder_timer[ENCODERS] = {0}; -static keypos_t encoder_cw[ENCODERS] = ENCODERS_CW_KEY; -static keypos_t encoder_ccw[ENCODERS] = ENCODERS_CCW_KEY; +static uint8_t encoder_state[NUM_ENCODERS] = {0}; +static uint16_t encoder_timer[NUM_ENCODERS] = {0}; +static keypos_t encoder_cw[NUM_ENCODERS] = ENCODERS_CW_KEY; +static keypos_t encoder_ccw[NUM_ENCODERS] = ENCODERS_CCW_KEY; static void exec_encoder_action(uint8_t index, bool clockwise, bool pressed) { // clang-format off @@ -43,22 +42,18 @@ static void exec_encoder_action(uint8_t index, bool clockwise, bool pressed) { // clang-format on action_exec(encoder_event); } -# endif void encoder_action_unregister(void) { -# ifdef ENCODERS - for (int index = 0; index < ENCODERS; ++index) { + for (int index = 0; index < NUM_ENCODERS; ++index) { if (encoder_state[index] && (timer_elapsed(encoder_timer[index]) >= ENCODER_TAP_DURATION_MS)) { bool clockwise = !!(encoder_state[index] & ENCODER_STATE_CW); encoder_state[index] = 0; exec_encoder_action(index, clockwise, false); } } -# endif } void encoder_action_register(uint8_t index, bool clockwise) { -# ifdef ENCODERS if (encoder_state[index]) { bool was_clockwise = !!(encoder_state[index] & ENCODER_STATE_CW); encoder_state[index] = 0; @@ -67,7 +62,6 @@ void encoder_action_register(uint8_t index, bool clockwise) { encoder_state[index] = clockwise ? ENCODER_STATE_CW : ENCODER_STATE_CCW; encoder_timer[index] = timer_read(); exec_encoder_action(index, clockwise, true); -# endif } void matrix_scan_kb(void) { diff --git a/keyboards/winry/winry315/rules.mk b/keyboards/winry/winry315/rules.mk index c10a9d570a..d5f501196c 100644 --- a/keyboards/winry/winry315/rules.mk +++ b/keyboards/winry/winry315/rules.mk @@ -1,9 +1,3 @@ -# MCU name -MCU = atmega32u4 - -# Bootloader selection -BOOTLOADER = atmel-dfu - # Build Options # change yes to no to disable # diff --git a/keyboards/winry/winry315/winry315.h b/keyboards/winry/winry315/winry315.h index 4796089003..8129c9d6e0 100644 --- a/keyboards/winry/winry315/winry315.h +++ b/keyboards/winry/winry315/winry315.h @@ -24,63 +24,3 @@ enum winry315_orientation { // WINRY315_ORIENTATION_LEFT`) instead of adding custom code that calls this // function. void winry315_set_orientation(uint8_t orientation); - -// clang-format off - -// This is a shortcut to help you visually see your layout. -// -// The first section contains all of the arguments representing the physical -// layout of the board and position of the keys. -// -// The second converts the arguments into a two-dimensional array which -// represents the switch matrix. -// -// For this board multiple layouts are defined to make it easier to use the -// board in a sideways orientation; the actual PCB supports only a single -// layout (LAYOUT_top). - -// Default layout: encoders at the top side (WINRY315_ORIENTATION_TOP). -#define LAYOUT_top( \ - k17, k15, k16, \ - k00, k01, k02, k03, k04, \ - k05, k06, k07, k08, k09, \ - k10, k11, k12, k13, k14 \ -) { \ - { 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 } \ -} - -// Encoders at the left side (WINRY315_ORIENTATION_LEFT). -#define LAYOUT_left( \ - k16, k04, k09, k14, \ - k03, k08, k13, \ - k15, k02, k07, k12, \ - k01, k06, k11, \ - k17, k00, k05, k10 \ -) { \ - { 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 } \ -} - -// Encoders at the right side (WINRY315_ORIENTATION_RIGHT). -#define LAYOUT_right( \ - k10, k05, k00, k17, \ - k11, k06, k01, \ - k12, k07, k02, k15, \ - k13, k08, k03, \ - k14, k09, k04, k16 \ -) { \ - { 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 } \ -} - -// Encoders at the bottom side (WINRY315_ORIENTATION_BOTTOM). -#define LAYOUT_bottom( \ - k14, k13, k12, k11, k10, \ - k09, k08, k07, k06, k05, \ - k04, k03, k02, k01, k00, \ - k16, k15, k17 \ -) { \ - { 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 } \ -} - -#define LAYOUT_all LAYOUT_top - -// clang-format on |