From f03aec28fb6932bc8ab0b08a0007116a33419b9a Mon Sep 17 00:00:00 2001 From: Will Winder Date: Sat, 2 Jul 2022 08:07:35 -0400 Subject: [Keyboard] Add Avalanche v4 (#17288) Co-authored-by: Drashna Jaelre --- keyboards/avalanche/avalanche.h | 2 + keyboards/avalanche/v4/config.h | 76 +++++++++++++ keyboards/avalanche/v4/info.json | 79 ++++++++++++++ keyboards/avalanche/v4/keymaps/default/keymap.c | 49 +++++++++ keyboards/avalanche/v4/keymaps/winder/config.h | 12 +++ keyboards/avalanche/v4/keymaps/winder/images.h | 69 ++++++++++++ keyboards/avalanche/v4/keymaps/winder/keymap.c | 135 ++++++++++++++++++++++++ keyboards/avalanche/v4/keymaps/winder/rules.mk | 1 + keyboards/avalanche/v4/rules.mk | 23 ++++ keyboards/avalanche/v4/v4.c | 18 ++++ keyboards/avalanche/v4/v4.h | 31 ++++++ 11 files changed, 495 insertions(+) create mode 100644 keyboards/avalanche/v4/config.h create mode 100644 keyboards/avalanche/v4/info.json create mode 100644 keyboards/avalanche/v4/keymaps/default/keymap.c create mode 100644 keyboards/avalanche/v4/keymaps/winder/config.h create mode 100644 keyboards/avalanche/v4/keymaps/winder/images.h create mode 100644 keyboards/avalanche/v4/keymaps/winder/keymap.c create mode 100644 keyboards/avalanche/v4/keymaps/winder/rules.mk create mode 100644 keyboards/avalanche/v4/rules.mk create mode 100644 keyboards/avalanche/v4/v4.c create mode 100644 keyboards/avalanche/v4/v4.h (limited to 'keyboards/avalanche') diff --git a/keyboards/avalanche/avalanche.h b/keyboards/avalanche/avalanche.h index c3f431f315..916019f0d0 100644 --- a/keyboards/avalanche/avalanche.h +++ b/keyboards/avalanche/avalanche.h @@ -9,6 +9,8 @@ #include "v2.h" #elif KEYBOARD_avalanche_v3 #include "v3.h" +#elif KEYBOARD_avalanche_v4 + #include "v4.h" #endif #include "quantum.h" diff --git a/keyboards/avalanche/v4/config.h b/keyboards/avalanche/v4/config.h new file mode 100644 index 0000000000..d2082635d8 --- /dev/null +++ b/keyboards/avalanche/v4/config.h @@ -0,0 +1,76 @@ +// Copyright 2022 Will Winder (@winder) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define VENDOR_ID 0xCEE2 +#define PRODUCT_ID 0x0003 +#define DEVICE_VER 0x0004 +#define MANUFACTURER vitvlkv +#define PRODUCT Avalanche + +#define MATRIX_ROWS 10 +#define MATRIX_COLS 7 + +#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 } +#define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6 } + +#define DIODE_DIRECTION COL2ROW + +#define SOFT_SERIAL_PIN D2 + + +#define ENCODERS_PAD_A { B5 } +#define ENCODERS_PAD_B { F4 } +#define ENCODER_RESOLUTION 2 + +#ifdef RGBLIGHT_ENABLE +# define RGB_DI_PIN D3 +# define RGBLED_NUM 64 +# define RGBLED_SPLIT { 32, 32 } +# define RGBLIGHT_SPLIT +# define RGBLIGHT_LIMIT_VAL 100 // LED Brightness, high power draw may exceed the USB limitations of 0.6A and cause a crash. +# define RGBLIGHT_HUE_STEP 10 +# define RGBLIGHT_SAT_STEP 17 +# define RGBLIGHT_VAL_STEP 17 + +# define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_SWIRL+2 + +# define RGBLIGHT_EFFECT_ALTERNATING +# define RGBLIGHT_EFFECT_RGB_TEST +# define RGBLIGHT_EFFECT_RAINBOW_MOOD +# define RGBLIGHT_EFFECT_STATIC_GRADIENT +# define RGBLIGHT_EFFECT_RAINBOW_SWIRL +# define RGBLIGHT_EFFECT_BREATHING +# define RGBLIGHT_EFFECT_KNIGHT +# define RGBLIGHT_EFFECT_SNAKE +# define RGBLIGHT_EFFECT_CHRISTMAS + + +// RGB LED Conversion macro from physical array to electric array. This results in better looking animated effects. +# define LED_LAYOUT( \ + /* LED matrix */ \ + L01, L02, L03, L04, L05, L06, L011, L012, L013, L014, L015, L016, \ + L11, L12, L13, L14, L15, L16, L111, L112, L113, L114, L115, L116, \ + L20, L21, L22, L23, L24, L25, L26, L211, L212, L213, L214, L215, L216, L217, \ + L31, L32, L33, L34, L35, L36, L37, L38, L39, L310, L311, L312, L313, L314, L315, L316, \ + L44, L45, L46, L47, L48, L49, L410, L411, L412, L413 )\ + { \ + /* left half - electrical wiring order */ \ + L47,L48,L38,L37,L36,L26,L16,L06,L05,L15,L25,L35,L46,L45,L34,L24,L14,L04,L03,L13,L23,L33,L44,L32,L22,L12,L02,L01,L11,L21,L31,L20, \ + /* right half - electrical wiring order */ \ + L410,L49,L39,L310,L311,L211,L111,L011,L012,L112,L212,L312,L411,L412,L313,L213,L113,L013,L014,L114,L214,L314,L413,L315,L215,L115,L015,L016,L116,L216,L316,L217 \ + } +# define RGBLIGHT_LED_MAP LED_LAYOUT( \ + /* animation order. */ \ + 4, 8, 12, 17, 22, 27, 40, 45, 50, 54, 58, 62, \ + 3, 7, 11, 16, 21, 26, 39, 44, 49, 53, 57, 61, \ + 0, 2, 6, 10, 15, 20, 25, 38, 43, 48, 52, 56, 60, 63, \ + 1, 5, 9, 14, 19, 24, 29, 31, 33, 35, 37, 42, 47, 51, 55, 59, \ + 13, 18, 23, 28, 30, 32, 34, 36, 41, 46 ) +#endif + +#ifdef OLED_ENABLE +# define OLED_DISPLAY_128X64 +# define OLED_TIMEOUT 30000 +#endif diff --git a/keyboards/avalanche/v4/info.json b/keyboards/avalanche/v4/info.json new file mode 100644 index 0000000000..53e227bcf1 --- /dev/null +++ b/keyboards/avalanche/v4/info.json @@ -0,0 +1,79 @@ +{ + "keyboard_name": "Avalanche v4", + "url": "https://github.com/vlkv/avalanche", + "maintainer": "vlkv", + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"L00", "x":1, "y":0.75}, + {"label":"L01", "x":2, "y":0.75}, + {"label":"L02", "x":3, "y":0.25}, + {"label":"L03", "x":4, "y":0}, + {"label":"L04", "x":5, "y":0.25}, + {"label":"L05", "x":6, "y":0.35}, + {"label":"R05", "x":12, "y":0.35}, + {"label":"R04", "x":13, "y":0.25}, + {"label":"R03", "x":14, "y":0}, + {"label":"R02", "x":15, "y":0.25}, + {"label":"R01", "x":16, "y":0.75}, + {"label":"R00", "x":17, "y":0.75}, + + {"label":"L10", "x":1, "y":1.75}, + {"label":"L11", "x":2, "y":1.75}, + {"label":"L12", "x":3, "y":1.25}, + {"label":"L13", "x":4, "y":1}, + {"label":"L14", "x":5, "y":1.25}, + {"label":"L15", "x":6, "y":1.35}, + {"label":"R15", "x":12, "y":1.35}, + {"label":"R14", "x":13, "y":1.25}, + {"label":"R13", "x":14, "y":1}, + {"label":"R12", "x":15, "y":1.25}, + {"label":"R11", "x":16, "y":1.75}, + {"label":"R10", "x":17, "y":1.75}, + + {"label":"L40", "x":0, "y":2.85}, + {"label":"L20", "x":1, "y":2.75}, + {"label":"L21", "x":2, "y":2.75}, + {"label":"L22", "x":3, "y":2.25}, + {"label":"L23", "x":4, "y":2}, + {"label":"L24", "x":5, "y":2.25}, + {"label":"L25", "x":6, "y":2.35}, + {"label":"R25", "x":12, "y":2.35}, + {"label":"R24", "x":13, "y":2.25}, + {"label":"R23", "x":14, "y":2}, + {"label":"R22", "x":15, "y":2.25}, + {"label":"R21", "x":16, "y":2.75}, + {"label":"R20", "x":17, "y":2.75}, + {"label":"R40", "x":18, "y":2.85}, + + {"label":"L30", "x":1, "y":3.75}, + {"label":"L31", "x":2, "y":3.75}, + {"label":"L32", "x":3, "y":3.25}, + {"label":"L33", "x":4, "y":3}, + {"label":"L34", "x":5, "y":3.25}, + {"label":"L35", "x":6, "y":3.35}, + {"label":"L36", "x":7, "y":3.7}, + {"label":"L26", "x":8, "y":4.05}, + {"label":"R26", "x":10, "y":4.05}, + {"label":"R36", "x":11, "y":3.7}, + {"label":"R35", "x":12, "y":3.35}, + {"label":"R34", "x":13, "y":3.25}, + {"label":"R33", "x":14, "y":3}, + {"label":"R32", "x":15, "y":3.25}, + {"label":"R31", "x":16, "y":3.75}, + {"label":"R30", "x":17, "y":3.75}, + + {"label":"L42", "x":3.4, "y":4.55}, + {"label":"L43", "x":4.6, "y":4.45}, + {"label":"L44", "x":5.8, "y":4.4}, + {"label":"L45", "x":7, "y":4.7}, + {"label":"L46", "x":8, "y":5.05}, + {"label":"R46", "x":10, "y":5.05}, + {"label":"R45", "x":11, "y":4.7}, + {"label":"R44", "x":12.2, "y":4.4}, + {"label":"R43", "x":13.4, "y":4.45}, + {"label":"R42", "x":14.6, "y":4.55} + ] + } + } +} diff --git a/keyboards/avalanche/v4/keymaps/default/keymap.c b/keyboards/avalanche/v4/keymaps/default/keymap.c new file mode 100644 index 0000000000..7239091ca2 --- /dev/null +++ b/keyboards/avalanche/v4/keymaps/default/keymap.c @@ -0,0 +1,49 @@ +// Copyright 2022 Viatly Volkov (@vlkv) +// SPDX-License-Identifier: GPL-2.0-or-later + +/* +qmk compile -kb avalanche/v4 -km default +qmk flash -kb avalanche/v4 -km default +*/ + +#include QMK_KEYBOARD_H + +enum layer { + LAYER_0, + LAYER_1, + LAYER_2, +}; + +#define FN_1 MO(LAYER_1) +#define LFN_2 LT(LAYER_2, KC_GRV) +#define RFN_2 MO(LAYER_2) +#define LFN_3 LSFT_T(KC_EQL) +#define RFN_3 RSFT_T(KC_MINS) +#define EN_LALT LALT_T(KC_ENT) +#define EN_RALT RALT_T(KC_ENT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [LAYER_0] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_BSLS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + KC_CAPS, KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_RBRC, + KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_DEL, KC_LGUI, KC_INS, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RCTL, + KC__MUTE,LFN_2, LFN_3, KC_SPC, EN_LALT, EN_RALT, FN_1, RFN_3, RFN_2, KC_PSCR + ), + [LAYER_1] = LAYOUT( + _______, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F11, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, KC_DEL, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX, + _______, _______, KC_APP, XXXXXXX, XXXXXXX, XXXXXXX, KC_DEL, KC_BSPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, KC_F12, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, XXXXXXX, KC_PGUP, KC_PGDN, XXXXXXX, XXXXXXX, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [LAYER_2] = LAYOUT( + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, KC_0, KC_1, KC_2, KC_3, KC_BSPC, KC_DEL, KC_EXLM, KC_AT, KC_HASH, XXXXXXX, KC_LPRN, + _______, _______, KC_0, KC_4, KC_5, KC_6, KC_DEL, KC_BSPC, KC_DLR, KC_PERC, KC_CIRC, XXXXXXX, XXXXXXX, KC_RPRN, + _______, KC_0, KC_7, KC_8, KC_9, KC_DOT, _______, _______, _______, _______, XXXXXXX, KC_AMPR, KC_ASTR, XXXXXXX, XXXXXXX, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; + + diff --git a/keyboards/avalanche/v4/keymaps/winder/config.h b/keyboards/avalanche/v4/keymaps/winder/config.h new file mode 100644 index 0000000000..ca4b822f1b --- /dev/null +++ b/keyboards/avalanche/v4/keymaps/winder/config.h @@ -0,0 +1,12 @@ +// Copyright 2022 Will Winder (@winder) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#undef RGBLIGHT_EFFECT_BREATHING +#undef RGBLIGHT_EFFECT_KNIGHT +#undef RGBLIGHT_EFFECT_SNAKE +#undef RGBLIGHT_EFFECT_CHRISTMAS +#undef RGBLIGHT_EFFECT_RGB_TEST +#undef RGBLIGHT_EFFECT_STATIC_GRADIENT +#undef RGBLIGHT_EFFECT_ALTERNATING diff --git a/keyboards/avalanche/v4/keymaps/winder/images.h b/keyboards/avalanche/v4/keymaps/winder/images.h new file mode 100644 index 0000000000..2202e31574 --- /dev/null +++ b/keyboards/avalanche/v4/keymaps/winder/images.h @@ -0,0 +1,69 @@ +// Copyright 2022 Will Winder (@winder) +// SPDX-License-Identifier: GPL-2.0-or-later + +static const char display [] PROGMEM = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0x7f, 0x3f, 0x9f, 0xcf, 0x8f, 0x1f, 0x3f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0x7f, 0x7f, 0x3f, 0x3f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x1f, 0xcf, 0xef, +0xe7, 0xcf, 0x8f, 0x1e, 0x3f, 0x7f, 0xff, 0xff, 0xff, 0xfe, 0xfc, 0xf8, 0xf1, 0xe3, 0xf7, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x3f, 0xbf, 0x9f, 0x1f, 0x3f, +0x7b, 0xf0, 0xfe, 0xff, 0xff, 0xfe, 0x7c, 0x78, 0x71, 0x03, 0x87, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0x3f, 0xff, 0xf3, 0xe3, 0xd7, 0xef, 0xdf, 0x9c, 0x39, 0x73, +0xe7, 0xef, 0xcf, 0xcf, 0xce, 0xe0, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xdf, 0x9f, 0xbf, 0x3f, 0x1f, 0xc8, 0xe1, 0xc7, 0x9f, 0x3f, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0x7f, 0x7f, 0x7f, 0xe7, 0xc7, 0x9f, 0x3f, 0x7d, 0xf0, 0xe3, 0xc7, 0x8f, 0x9f, 0x3e, +0x3c, 0xb8, 0x81, 0xc3, 0xff, 0xff, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xbf, 0x1f, 0x3f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdf, 0xcf, 0xe7, +0xf3, 0xf9, 0x71, 0x03, 0x87, 0x8f, 0x1e, 0x3c, 0x79, 0xf3, 0xee, 0x9d, 0xfb, 0xf3, 0xf7, 0xfe, +0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xe7, 0xf3, +0xf9, 0xfc, 0xf9, 0xf3, 0xe7, 0xcf, 0x9f, 0x3f, 0x7e, 0xfe, 0xfc, 0xfd, 0xf9, 0xf8, 0xf8, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdf, 0x9f, 0x3f, 0x7f, +0xff, 0xfe, 0xfe, 0xfc, 0xf0, 0xe6, 0xcd, 0x9d, 0x3b, 0x7a, 0xf0, 0xf1, 0xe1, 0xf3, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0x47, 0x1f, +0x3d, 0xf9, 0xf9, 0xf3, 0x83, 0x30, 0x78, 0x78, 0x71, 0x23, 0x87, 0xcf, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xe7, 0xef, 0xcf, 0x0e, 0x0c, 0xe1, 0xe3, 0xe7, 0xcf, +0x1f, 0x3e, 0x7e, 0xff, 0xef, 0xe7, 0xf3, 0xf8, 0xfc, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xf9, 0xf3, 0xe7, 0xcf, 0x9f, 0x3f, 0x7f, +0x7f, 0x3f, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xbf, 0x9f, 0xbf, 0x3f, 0x3b, 0x33, 0x87, 0x8f, 0x9f, 0x3f, 0x7f, 0xff, 0xfe, +0xfc, 0xb9, 0x83, 0xc7, 0xe7, 0xf3, 0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xbf, 0x9f, 0xcf, 0xc7, 0x33, 0x7f, 0xfe, 0xfc, 0xfc, 0xf9, 0xf8, 0xf6, 0xe7, +0xee, 0xc8, 0x83, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfc, 0xf9, 0xf9, 0xf9, 0xf9, +0xfc, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xf8, 0xfc, +0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0x07, 0x73, +0xfb, 0xfb, 0xf3, 0xe7, 0xcf, 0x9f, 0x3f, 0xf8, 0xf0, 0xe7, 0xe7, 0xe7, 0xe7, 0xf0, 0xf8, 0xfd, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x87, 0x33, +0x3b, 0x39, 0x3b, 0x9f, 0x9f, 0x9f, 0x3f, 0x7f, 0xfe, 0xfc, 0xd9, 0xc3, 0xe3, 0xf3, 0xf9, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xdf, 0xdf, 0xdf, 0xbf, 0x7f, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xe7, 0xf3, 0xf9, 0xf8, 0xf1, 0xe3, 0xc7, 0x8f, 0x1f, 0x3e, +0x7c, 0xf9, 0xf3, 0xf3, 0xf3, 0xf3, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xf3, 0xf9, 0xfc, 0xbe, 0x9c, 0xc1, 0xe3, 0xe7, 0xcf, +0x1f, 0x3f, 0xff, 0xf3, 0xf3, 0xfb, 0xf8, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xbf, +0xff, 0xff, 0xe7, 0xdb, 0xbb, 0x7b, 0xf7, 0xee, 0xdc, 0xbd, 0xff, 0xf7, 0xf7, 0xf6, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, +0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xf9, 0xfc, +0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfc, +0xf9, 0xf3, 0xa7, 0xcf, 0xef, 0xff, 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff +}; diff --git a/keyboards/avalanche/v4/keymaps/winder/keymap.c b/keyboards/avalanche/v4/keymaps/winder/keymap.c new file mode 100644 index 0000000000..75de2f11a8 --- /dev/null +++ b/keyboards/avalanche/v4/keymaps/winder/keymap.c @@ -0,0 +1,135 @@ +// Copyright 2022 Viatly Volkov (@vlkv) +// SPDX-License-Identifier: GPL-2.0-or-later + +/* +qmk compile -kb avalanche/v4 -km default +qmk flash -kb avalanche/v4 -km default +*/ + +#include QMK_KEYBOARD_H + +enum layer { + _QWERTY, + _LOWER, + _RAISE, +}; + +#define FN_1 MO(_LOWER) +#define FN_2 MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_DEL , + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSPC, + KC_ESC , KC_LCTL, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_UNDS, + KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_DEL , KC_LGUI, /**/ KC_INS , KC_BSPC, KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, + KC_LGUI, KC_LALT, KC_LGUI, FN_1 , KC_ENT , /**/ FN_2 , KC_SPC , KC_BSPC, KC_RALT, KC_RGUI + ), + [_LOWER] = LAYOUT( + _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , + KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_DEL , + _______ , KC_TILD, KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, _______, + _______, KC_EQL , KC_MINS, KC_PLUS, KC_LCBR, KC_RCBR, _______, _______, /**/ _______, _______, KC_LBRC, KC_RBRC, KC_SCLN, KC_COLN, KC_BSLS, _______, + _______, _______, _______, _______, _______, /**/ _______, _______, _______, _______, _______ + ), + [_RAISE] = LAYOUT( + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLD, KC_VOLU, KC_MUTE, XXXXXXX, XXXXXXX, XXXXXXX, + _______, KC_0, KC_1, KC_2, KC_3, KC_BSPC, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, KC_0, KC_4, KC_5, KC_6, KC_DEL, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, + _______, KC_0, KC_7, KC_8, KC_9, KC_DOT, _______, _______, /**/ _______, _______, KC_PGDN, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, _______, _______, _______, _______, /**/ _______, _______, _______, _______, _______ + ), +}; + +#ifdef OLED_ENABLE + +#include "images.h" + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_0; +} + +void shiftright(char* buf, int size, int num) { + for (int i = size-1; i > 0; i--) { + buf[i] >>= 1; + if (buf[i-1] & 0x01) { + buf[i] |= 0x80; + } + } + buf[0] >>= 1; +} + +// right to left, 8 bit vertical strips. +void mask(char* enable) { + char rowenable[3]; + const char* data = display; + int i = 0; + char blockmask[2] = { 0x00, 0x00 }; + + while (i < sizeof(display)) { + if (i % 128 == 0) { + // shift enable-mask right 1 at each row, reinitialize row copy + if (i != 0) { + shiftright(enable, 3, 2); + } + rowenable[0] = enable[0]; + rowenable[1] = enable[1]; + rowenable[2] = enable[2]; + } + + if (i % 8 == 0) { + if (rowenable[2] & 0x01) { + blockmask[1] = 0xff; + } else { + blockmask[1] = 0x00; + } + + if (rowenable[2] & 0x02) { + blockmask[0] = 0xff; + } else { + blockmask[0] = 0x00; + } + shiftright(rowenable, 3, 2); + } + + uint8_t c = pgm_read_byte(data++); + oled_write_raw_byte(c & blockmask[1], i++); + shiftright(blockmask, 2, 1); + } +} + +void setmask(char* mask) { + mask[0] = 0x00; + mask[1] = 0x00; + mask[2] = 0x00; + + uint8_t mod = get_mods() | get_oneshot_mods(); + if (mod & MOD_MASK_CTRL) { + mask[1] |= 0xf0; + } + if (mod & MOD_MASK_ALT) { + mask[1] |= 0x0f; + } + if (mod & MOD_MASK_GUI) { + mask[0] |= 0xf0; + } + + switch (get_highest_layer(layer_state)) { + case _LOWER: + mask[2] |= 0xf0; + break; + case _RAISE: + mask[0] |= 0x0f; + break; + } +} + +bool oled_task_user(void) { + char m[3]; + setmask(m); + mask(m); + return false; +} + +#endif + diff --git a/keyboards/avalanche/v4/keymaps/winder/rules.mk b/keyboards/avalanche/v4/keymaps/winder/rules.mk new file mode 100644 index 0000000000..1e3cebb145 --- /dev/null +++ b/keyboards/avalanche/v4/keymaps/winder/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes diff --git a/keyboards/avalanche/v4/rules.mk b/keyboards/avalanche/v4/rules.mk new file mode 100644 index 0000000000..370dc1a6a8 --- /dev/null +++ b/keyboards/avalanche/v4/rules.mk @@ -0,0 +1,23 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = caterina + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +ENCODER_ENABLE = yes +OLED_ENABLE = yes +OLED_DRIVER = SSD1306 + +SPLIT_KEYBOARD = yes diff --git a/keyboards/avalanche/v4/v4.c b/keyboards/avalanche/v4/v4.c new file mode 100644 index 0000000000..69c64fc53c --- /dev/null +++ b/keyboards/avalanche/v4/v4.c @@ -0,0 +1,18 @@ +// Copyright 2022 Vitaly Volkov (@vlkv) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "avalanche.h" + +#ifdef OLED_ENABLE +oled_rotation_t oled_init_kb(oled_rotation_t rotation) { + return OLED_ROTATION_180; +} + +bool oled_task_kb(void) { + if (!oled_task_user()) { + return false; + } + oled_write_P(PSTR("Avalanche\nVersion 4"), false); + return true; +} +#endif diff --git a/keyboards/avalanche/v4/v4.h b/keyboards/avalanche/v4/v4.h new file mode 100644 index 0000000000..fde80607b2 --- /dev/null +++ b/keyboards/avalanche/v4/v4.h @@ -0,0 +1,31 @@ +// Copyright 2022 Vitaly Volkov (@vlkv) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "avalanche.h" + +#include "quantum.h" + +#define L__ KC_NO +#define R__ KC_NO + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, R00, \ + L10, L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, R10, \ + L40, L20, L21, L22, L23, L24, L25, R25, R24, R23, R22, R21, R20, R40, \ + L30, L31, L32, L33, L34, L35, L36, L26, R26, R36, R35, R34, R33, R32, R31, R30, \ + L42, L43, L44, L45, L46, R46, R45, R44, R43, R42 \ +) \ +{ \ + { L00, L01, L02, L03, L04, L05, L__}, \ + { L10, L11, L12, L13, L14, L15, L__}, \ + { L20, L21, L22, L23, L24, L25, L26}, \ + { L30, L31, L32, L33, L34, L35, L36}, \ + { L40, L__, L42, L43, L44, L45, L46}, \ + { R00, R01, R02, R03, R04, R05, R__}, \ + { R10, R11, R12, R13, R14, R15, R__}, \ + { R20, R21, R22, R23, R24, R25, R26}, \ + { R30, R31, R32, R33, R34, R35, R36}, \ + { R40, R__, R42, R43, R44, R45, R46} \ +} -- cgit v1.2.3