From e837a32b2b4d6eb96ffacad0022699d67c0f8f1e Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 19 Feb 2023 18:55:12 +1100 Subject: Move layouts for direct_pins boards to data driven (#19872) --- keyboards/winry/winry315/info.json | 144 ++++++++++++++++++------------------ keyboards/winry/winry315/winry315.h | 60 --------------- 2 files changed, 72 insertions(+), 132 deletions(-) (limited to 'keyboards/winry') diff --git a/keyboards/winry/winry315/info.json b/keyboards/winry/winry315/info.json index 5abc92a455..1b550c3122 100644 --- a/keyboards/winry/winry315/info.json +++ b/keyboards/winry/winry315/info.json @@ -21,90 +21,90 @@ "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/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 -- cgit v1.2.3