diff options
author | Dane Skalski <daneski13@gmail.com> | 2023-04-05 01:06:24 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-05 18:06:24 +1000 |
commit | 1d045e854b7adbe8a60ce5aeb16438c4652949da (patch) | |
tree | 904c0314403569c311420dec5054bfa6551a94c3 /keyboards/junco/rev1 | |
parent | f7176f070fd2b1cd6df25774f4de842200a7a342 (diff) |
Add Junco Keyboard (#19516)
Diffstat (limited to 'keyboards/junco/rev1')
-rw-r--r-- | keyboards/junco/rev1/config.h | 43 | ||||
-rw-r--r-- | keyboards/junco/rev1/post_config.h | 15 | ||||
-rw-r--r-- | keyboards/junco/rev1/rev1.c | 126 | ||||
-rw-r--r-- | keyboards/junco/rev1/rules.mk | 3 |
4 files changed, 187 insertions, 0 deletions
diff --git a/keyboards/junco/rev1/config.h b/keyboards/junco/rev1/config.h new file mode 100644 index 0000000000..d9c0556cdf --- /dev/null +++ b/keyboards/junco/rev1/config.h @@ -0,0 +1,43 @@ +// Copyright 2022 Dane Skalski (@Daneski13) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +// Electrical Wiring Stuff +#define MATRIX_ROW_PINS \ + { GP8, GP9, GP10, GP11, GP12 } +#define MATRIX_COL_PINS \ + { GP2, GP3, GP4, GP5, GP6, GP7 } +#define DIODE_DIRECTION COL2ROW + +// Split Keyboard Stuff +#define EE_HANDS // Sets the keyboard’s handedness using EEPROM +#define SERIAL_USART_FULL_DUPLEX // Use full duplex communication (TRRS) +#define SERIAL_USART_TX_PIN GP0 // USART TX pin +#define SERIAL_USART_RX_PIN GP1 // USART RX pin + +/* RGB Stuff */ +#ifdef RGB_MATRIX_ENABLE + +# define RGB_DI_PIN GP15 // Pin for RGB logic +# define RGB_MATRIX_LED_COUNT 74 +# define RGB_MATRIX_SPLIT \ + { 37, 37 } // 37 LEDs on each side + +#endif + +/* Rotary Encoders Definition */ +// Indexing goes from physical leftmost to rightmost +// 0: left-half left | 1: left-half right | 2: right-half left | 3: right-half right +#ifdef ENCODER_ENABLE + +# define ENCODERS_PAD_A \ + { GP16, GP14 } +# define ENCODERS_PAD_B \ + { GP17, GP13 } +# define ENCODERS_PAD_A_RIGHT \ + { GP14, GP16 } +# define ENCODERS_PAD_B_RIGHT \ + { GP13, GP17 } + +#endif diff --git a/keyboards/junco/rev1/post_config.h b/keyboards/junco/rev1/post_config.h new file mode 100644 index 0000000000..bcc15a941a --- /dev/null +++ b/keyboards/junco/rev1/post_config.h @@ -0,0 +1,15 @@ +// Copyright 2022 Dane Skalski (@Daneski13) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +/* Default Bootmagic lite */ +// Top left for left side is default in core + +// Top right for right side +#ifndef BOOTMAGIC_LITE_ROW_RIGHT +# define BOOTMAGIC_LITE_ROW_RIGHT 5 +#endif +#ifndef BOOTMAGIC_LITE_COLUMN_RIGHT +# define BOOTMAGIC_LITE_COLUMN_RIGHT 0 +#endif diff --git a/keyboards/junco/rev1/rev1.c b/keyboards/junco/rev1/rev1.c new file mode 100644 index 0000000000..d1346b82e2 --- /dev/null +++ b/keyboards/junco/rev1/rev1.c @@ -0,0 +1,126 @@ +// Copyright 2022 Dane Skalski (@Daneski13) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "quantum.h" + +// Hand swap +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + // Left + {{0, 5}, {1, 5}, {2, 5}, {3, 5}, {4, 5}, {5, 5}, {6, 5}}, + {{0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}, {6, 6}}, + {{0, 7}, {1, 7}, {2, 7}, {3, 7}, {4, 7}, {5, 7}, {6, 7}}, + {{0, 8}, {1, 8}, {2, 8}, {3, 8}, {4, 8}, {5, 8}, {6, 8}}, + {{0, 9}, {1, 9}, {2, 9}, {3, 9}, {4, 9}, {5, 9}, {6, 9}}, + // Right + {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {6, 0}}, + {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}, {6, 1}}, + {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}, {6, 2}}, + {{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}, {6, 3}}, + {{0, 4}, {1, 4}, {2, 4}, {3, 4}, {4, 4}, {5, 4}, {6, 4}} +}; +#endif + +/* RGB LED matrix */ +#ifdef RGB_MATRIX_ENABLE +/* + Key Matrix Physical + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, + L30, L31, L32, L33, L34, L35, L45, R40, R30, R31, R32, R33, R34, R35, + L40, L41, L42, L43, L44, R42, R41, R43, R44, R45 + + Key Electrical + Left: + { L00, L01, L02, L03, L04, L05 }, + { L10, L11, L12, L13, L14, L15 }, + { L20, L21, L22, L23, L24, L25 }, + { L30, L31, L32, L33, L34, L35 }, + { L40, L41, L42, L43, L44, L45 }, + Right: + { R05, R04, R03, R02, R01, R00 }, + { R15, R14, R13, R12, R11, R10 }, + { R25, R24, R23, R22, R21, R20 }, + { R35, R34, R33, R32, R31, R30 }, + { R45, R44, R43, R42, R41, R40 } + + Key matrix physical filled with LED electrical indexes, count starting at 1 + + Col + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 Row + + 14 13 12 11 10 9 46 47 48 49 50 51 0 + 6 7 8 45 44 43 + 15 16 17 18 19 20 57 56 55 54 53 52 1 + + 26 25 24 23 22 21 58 59 60 61 62 63 2 + 5 4 3 40 41 42 + 27 28 29 30 31 32 NO NO 69 68 67 66 65 64 3 + + 37 36 35 34 33 70 71 72 73 74 4 + 2 1 38 39 +*/ + +// clang-format off +led_config_t g_led_config = { + { // Key Electrical Matrix to LED Index (count start at 0, so 8 is the first non-underglow key) + + // Left Half + { 13, 12, 11, 10, 9, 8 }, + { 14, 15, 16, 17, 18, 19 }, + { 25, 24, 23, 22, 21, 20 }, + { 26, 27, 28, 29, 30, 31 }, + { 36, 35, 34, 33, 32, NO_LED }, + + // Right Half + { 50, 49, 48, 47, 46, 45 }, + { 51, 52, 53, 54, 55, 56 }, + { 62, 61, 60, 59, 58, 57 }, + { 63, 64, 65, 66, 67, 68 }, + { 73, 72, 71, 70, 69, NO_LED } + }, + { // LED Index to LED Physical Position (mirrored on right half) + + // Left Underglow (indicies 1 - 8) + { 95, 72 }, { 52, 72 }, { 86, 40 }, { 52, 40 }, { 9, 40 }, { 9, 8 }, { 52, 8 }, { 86, 8 }, + // Left Matrix (indicies 9 - 37) + { 86, 0 }, { 69, 0 }, { 52, 0 }, { 34, 0 }, { 17, 0 }, { 0, 0 }, + { 0, 16 }, { 17, 16 }, { 34, 16 }, { 52, 16 }, { 69, 16 }, { 86, 16 }, + { 86, 32 }, { 69, 32 }, { 52, 32 }, { 34, 32 }, { 17, 32 }, { 0, 32 }, + { 0, 48 }, { 17, 48 }, { 34, 48 }, { 52, 48 }, { 69, 48 }, { 86, 48 }, /* No Led */ + { 103, 64 }, { 86, 64 }, { 69, 64 }, { 52, 64 }, { 34, 64 }, + + // Right Underglow (indicies 38 - 45) + { 129, 72 }, { 172, 72 }, { 138, 40 }, { 172, 40 }, { 215, 40 }, { 215, 8 }, { 172, 8 }, { 138, 8 }, + // Right Matrix (indicies 46 - 74) + { 138, 0 }, { 155, 0 }, { 172, 0 }, { 190, 0 }, { 207, 0 }, { 224, 0 }, + { 224, 16 }, { 207, 16 }, { 190, 16 }, { 172, 16 }, { 155, 16 }, { 138, 16 }, + { 138, 32 }, { 155, 32 }, { 172, 32 }, { 190, 32 }, { 207, 32 }, { 224, 32 }, + /* No Led */ { 224, 48 }, { 207, 48 }, { 190, 48 }, { 172, 48 }, { 155, 48 }, { 138, 48 }, + { 121, 64 }, { 138, 64 }, { 155, 64 }, { 172, 64 }, { 190, 64 } + }, + { // LED Index to Flag (2 - Underglow, 4 - Key Backlight) + + // Left Underglow + 2, 2, 2, 2, 2, 2, 2, 2, + // Left Matrix + 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, + + // Right Underglow + 2, 2, 2, 2, 2, 2, 2, 2, + // Right Matrix + 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4 + } +}; + +#endif diff --git a/keyboards/junco/rev1/rules.mk b/keyboards/junco/rev1/rules.mk new file mode 100644 index 0000000000..feb836dbe1 --- /dev/null +++ b/keyboards/junco/rev1/rules.mk @@ -0,0 +1,3 @@ +# RGB Stuff +RGB_MATRIX_DRIVER = WS2812 +WS2812_DRIVER = vendor |