summaryrefslogtreecommitdiff
path: root/keyboards/avalanche
diff options
context:
space:
mode:
authorWill Winder <wwinder.unh@gmail.com>2022-07-02 08:07:35 -0400
committerGitHub <noreply@github.com>2022-07-02 22:07:35 +1000
commitf03aec28fb6932bc8ab0b08a0007116a33419b9a (patch)
tree537c260b32d6c84d9c17aef5d866e37220a4e929 /keyboards/avalanche
parentc3ef70b9a6a7123fe25fb89973070088a15ad69f (diff)
[Keyboard] Add Avalanche v4 (#17288)
Co-authored-by: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'keyboards/avalanche')
-rw-r--r--keyboards/avalanche/avalanche.h2
-rw-r--r--keyboards/avalanche/v4/config.h76
-rw-r--r--keyboards/avalanche/v4/info.json79
-rw-r--r--keyboards/avalanche/v4/keymaps/default/keymap.c49
-rw-r--r--keyboards/avalanche/v4/keymaps/winder/config.h12
-rw-r--r--keyboards/avalanche/v4/keymaps/winder/images.h69
-rw-r--r--keyboards/avalanche/v4/keymaps/winder/keymap.c135
-rw-r--r--keyboards/avalanche/v4/keymaps/winder/rules.mk1
-rw-r--r--keyboards/avalanche/v4/rules.mk23
-rw-r--r--keyboards/avalanche/v4/v4.c18
-rw-r--r--keyboards/avalanche/v4/v4.h31
11 files changed, 495 insertions, 0 deletions
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 @@
9 #include "v2.h" 9 #include "v2.h"
10#elif KEYBOARD_avalanche_v3 10#elif KEYBOARD_avalanche_v3
11 #include "v3.h" 11 #include "v3.h"
12#elif KEYBOARD_avalanche_v4
13 #include "v4.h"
12#endif 14#endif
13 15
14#include "quantum.h" 16#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 @@
1// Copyright 2022 Will Winder (@winder)
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#define VENDOR_ID 0xCEE2
7#define PRODUCT_ID 0x0003
8#define DEVICE_VER 0x0004
9#define MANUFACTURER vitvlkv
10#define PRODUCT Avalanche
11
12#define MATRIX_ROWS 10
13#define MATRIX_COLS 7
14
15#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 }
16#define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6 }
17
18#define DIODE_DIRECTION COL2ROW
19
20#define SOFT_SERIAL_PIN D2
21
22
23#define ENCODERS_PAD_A { B5 }
24#define ENCODERS_PAD_B { F4 }
25#define ENCODER_RESOLUTION 2
26
27#ifdef RGBLIGHT_ENABLE
28# define RGB_DI_PIN D3
29# define RGBLED_NUM 64
30# define RGBLED_SPLIT { 32, 32 }
31# define RGBLIGHT_SPLIT
32# define RGBLIGHT_LIMIT_VAL 100 // LED Brightness, high power draw may exceed the USB limitations of 0.6A and cause a crash.
33# define RGBLIGHT_HUE_STEP 10
34# define RGBLIGHT_SAT_STEP 17
35# define RGBLIGHT_VAL_STEP 17
36
37# define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_SWIRL+2
38
39# define RGBLIGHT_EFFECT_ALTERNATING
40# define RGBLIGHT_EFFECT_RGB_TEST
41# define RGBLIGHT_EFFECT_RAINBOW_MOOD
42# define RGBLIGHT_EFFECT_STATIC_GRADIENT
43# define RGBLIGHT_EFFECT_RAINBOW_SWIRL
44# define RGBLIGHT_EFFECT_BREATHING
45# define RGBLIGHT_EFFECT_KNIGHT
46# define RGBLIGHT_EFFECT_SNAKE
47# define RGBLIGHT_EFFECT_CHRISTMAS
48
49
50// RGB LED Conversion macro from physical array to electric array. This results in better looking animated effects.
51# define LED_LAYOUT( \
52 /* LED matrix */ \
53 L01, L02, L03, L04, L05, L06, L011, L012, L013, L014, L015, L016, \
54 L11, L12, L13, L14, L15, L16, L111, L112, L113, L114, L115, L116, \
55 L20, L21, L22, L23, L24, L25, L26, L211, L212, L213, L214, L215, L216, L217, \
56 L31, L32, L33, L34, L35, L36, L37, L38, L39, L310, L311, L312, L313, L314, L315, L316, \
57 L44, L45, L46, L47, L48, L49, L410, L411, L412, L413 )\
58 { \
59 /* left half - electrical wiring order */ \
60 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, \
61 /* right half - electrical wiring order */ \
62 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 \
63 }
64# define RGBLIGHT_LED_MAP LED_LAYOUT( \
65 /* animation order. */ \
66 4, 8, 12, 17, 22, 27, 40, 45, 50, 54, 58, 62, \
67 3, 7, 11, 16, 21, 26, 39, 44, 49, 53, 57, 61, \
68 0, 2, 6, 10, 15, 20, 25, 38, 43, 48, 52, 56, 60, 63, \
69 1, 5, 9, 14, 19, 24, 29, 31, 33, 35, 37, 42, 47, 51, 55, 59, \
70 13, 18, 23, 28, 30, 32, 34, 36, 41, 46 )
71#endif
72
73#ifdef OLED_ENABLE
74# define OLED_DISPLAY_128X64
75# define OLED_TIMEOUT 30000
76#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 @@
1{
2 "keyboard_name": "Avalanche v4",
3 "url": "https://github.com/vlkv/avalanche",
4 "maintainer": "vlkv",
5 "layouts": {
6 "LAYOUT": {
7 "layout": [
8 {"label":"L00", "x":1, "y":0.75},
9 {"label":"L01", "x":2, "y":0.75},
10 {"label":"L02", "x":3, "y":0.25},
11 {"label":"L03", "x":4, "y":0},
12 {"label":"L04", "x":5, "y":0.25},
13 {"label":"L05", "x":6, "y":0.35},
14 {"label":"R05", "x":12, "y":0.35},
15 {"label":"R04", "x":13, "y":0.25},
16 {"label":"R03", "x":14, "y":0},
17 {"label":"R02", "x":15, "y":0.25},
18 {"label":"R01", "x":16, "y":0.75},
19 {"label":"R00", "x":17, "y":0.75},
20
21 {"label":"L10", "x":1, "y":1.75},
22 {"label":"L11", "x":2, "y":1.75},
23 {"label":"L12", "x":3, "y":1.25},
24 {"label":"L13", "x":4, "y":1},
25 {"label":"L14", "x":5, "y":1.25},
26 {"label":"L15", "x":6, "y":1.35},
27 {"label":"R15", "x":12, "y":1.35},
28 {"label":"R14", "x":13, "y":1.25},
29 {"label":"R13", "x":14, "y":1},
30 {"label":"R12", "x":15, "y":1.25},
31 {"label":"R11", "x":16, "y":1.75},
32 {"label":"R10", "x":17, "y":1.75},
33
34 {"label":"L40", "x":0, "y":2.85},
35 {"label":"L20", "x":1, "y":2.75},
36 {"label":"L21", "x":2, "y":2.75},
37 {"label":"L22", "x":3, "y":2.25},
38 {"label":"L23", "x":4, "y":2},
39 {"label":"L24", "x":5, "y":2.25},
40 {"label":"L25", "x":6, "y":2.35},
41 {"label":"R25", "x":12, "y":2.35},
42 {"label":"R24", "x":13, "y":2.25},
43 {"label":"R23", "x":14, "y":2},
44 {"label":"R22", "x":15, "y":2.25},
45 {"label":"R21", "x":16, "y":2.75},
46 {"label":"R20", "x":17, "y":2.75},
47 {"label":"R40", "x":18, "y":2.85},
48
49 {"label":"L30", "x":1, "y":3.75},
50 {"label":"L31", "x":2, "y":3.75},
51 {"label":"L32", "x":3, "y":3.25},
52 {"label":"L33", "x":4, "y":3},
53 {"label":"L34", "x":5, "y":3.25},
54 {"label":"L35", "x":6, "y":3.35},
55 {"label":"L36", "x":7, "y":3.7},
56 {"label":"L26", "x":8, "y":4.05},
57 {"label":"R26", "x":10, "y":4.05},
58 {"label":"R36", "x":11, "y":3.7},
59 {"label":"R35", "x":12, "y":3.35},
60 {"label":"R34", "x":13, "y":3.25},
61 {"label":"R33", "x":14, "y":3},
62 {"label":"R32", "x":15, "y":3.25},
63 {"label":"R31", "x":16, "y":3.75},
64 {"label":"R30", "x":17, "y":3.75},
65
66 {"label":"L42", "x":3.4, "y":4.55},
67 {"label":"L43", "x":4.6, "y":4.45},
68 {"label":"L44", "x":5.8, "y":4.4},
69 {"label":"L45", "x":7, "y":4.7},
70 {"label":"L46", "x":8, "y":5.05},
71 {"label":"R46", "x":10, "y":5.05},
72 {"label":"R45", "x":11, "y":4.7},
73 {"label":"R44", "x":12.2, "y":4.4},
74 {"label":"R43", "x":13.4, "y":4.45},
75 {"label":"R42", "x":14.6, "y":4.55}
76 ]
77 }
78 }
79}
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 @@
1// Copyright 2022 Viatly Volkov (@vlkv)
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4/*
5qmk compile -kb avalanche/v4 -km default
6qmk flash -kb avalanche/v4 -km default
7*/
8
9#include QMK_KEYBOARD_H
10
11enum layer {
12 LAYER_0,
13 LAYER_1,
14 LAYER_2,
15};
16
17#define FN_1 MO(LAYER_1)
18#define LFN_2 LT(LAYER_2, KC_GRV)
19#define RFN_2 MO(LAYER_2)
20#define LFN_3 LSFT_T(KC_EQL)
21#define RFN_3 RSFT_T(KC_MINS)
22#define EN_LALT LALT_T(KC_ENT)
23#define EN_RALT RALT_T(KC_ENT)
24
25const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
26 [LAYER_0] = LAYOUT(
27 KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_BSLS,
28 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
29 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,
30 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,
31 KC__MUTE,LFN_2, LFN_3, KC_SPC, EN_LALT, EN_RALT, FN_1, RFN_3, RFN_2, KC_PSCR
32 ),
33 [LAYER_1] = LAYOUT(
34 _______, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F11,
35 _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, KC_DEL, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX,
36 _______, _______, KC_APP, XXXXXXX, XXXXXXX, XXXXXXX, KC_DEL, KC_BSPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, KC_F12,
37 _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, XXXXXXX, KC_PGUP, KC_PGDN, XXXXXXX, XXXXXXX, _______,
38 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
39 ),
40 [LAYER_2] = LAYOUT(
41 _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
42 _______, KC_0, KC_1, KC_2, KC_3, KC_BSPC, KC_DEL, KC_EXLM, KC_AT, KC_HASH, XXXXXXX, KC_LPRN,
43 _______, _______, KC_0, KC_4, KC_5, KC_6, KC_DEL, KC_BSPC, KC_DLR, KC_PERC, KC_CIRC, XXXXXXX, XXXXXXX, KC_RPRN,
44 _______, KC_0, KC_7, KC_8, KC_9, KC_DOT, _______, _______, _______, _______, XXXXXXX, KC_AMPR, KC_ASTR, XXXXXXX, XXXXXXX, _______,
45 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
46 ),
47};
48
49
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 @@
1// Copyright 2022 Will Winder (@winder)
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#undef RGBLIGHT_EFFECT_BREATHING
7#undef RGBLIGHT_EFFECT_KNIGHT
8#undef RGBLIGHT_EFFECT_SNAKE
9#undef RGBLIGHT_EFFECT_CHRISTMAS
10#undef RGBLIGHT_EFFECT_RGB_TEST
11#undef RGBLIGHT_EFFECT_STATIC_GRADIENT
12#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 @@
1// Copyright 2022 Will Winder (@winder)
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4static const char display [] PROGMEM = {
50xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
60xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
70xff, 0xff, 0xff, 0x7f, 0x3f, 0x9f, 0xcf, 0x8f, 0x1f, 0x3f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff,
80xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
90xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
100xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
110xff, 0xff, 0x7f, 0x7f, 0x3f, 0x3f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
120xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
130xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
140xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x1f, 0xcf, 0xef,
150xe7, 0xcf, 0x8f, 0x1e, 0x3f, 0x7f, 0xff, 0xff, 0xff, 0xfe, 0xfc, 0xf8, 0xf1, 0xe3, 0xf7, 0xff,
160xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
170xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
180xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x3f, 0xbf, 0x9f, 0x1f, 0x3f,
190x7b, 0xf0, 0xfe, 0xff, 0xff, 0xfe, 0x7c, 0x78, 0x71, 0x03, 0x87, 0xff, 0xff, 0xff, 0xff, 0xff,
200xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
210xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
220xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0x3f, 0xff, 0xf3, 0xe3, 0xd7, 0xef, 0xdf, 0x9c, 0x39, 0x73,
230xe7, 0xef, 0xcf, 0xcf, 0xce, 0xe0, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
240xff, 0xff, 0xff, 0xff, 0xdf, 0x9f, 0xbf, 0x3f, 0x1f, 0xc8, 0xe1, 0xc7, 0x9f, 0x3f, 0xff, 0xff,
250xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
260xff, 0xff, 0x7f, 0x7f, 0x7f, 0xe7, 0xc7, 0x9f, 0x3f, 0x7d, 0xf0, 0xe3, 0xc7, 0x8f, 0x9f, 0x3e,
270x3c, 0xb8, 0x81, 0xc3, 0xff, 0xff, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
280xff, 0xff, 0xff, 0xbf, 0x1f, 0x3f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
290xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdf, 0xcf, 0xe7,
300xf3, 0xf9, 0x71, 0x03, 0x87, 0x8f, 0x1e, 0x3c, 0x79, 0xf3, 0xee, 0x9d, 0xfb, 0xf3, 0xf7, 0xfe,
310xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xe7, 0xf3,
320xf9, 0xfc, 0xf9, 0xf3, 0xe7, 0xcf, 0x9f, 0x3f, 0x7e, 0xfe, 0xfc, 0xfd, 0xf9, 0xf8, 0xf8, 0xff,
330xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdf, 0x9f, 0x3f, 0x7f,
340xff, 0xfe, 0xfe, 0xfc, 0xf0, 0xe6, 0xcd, 0x9d, 0x3b, 0x7a, 0xf0, 0xf1, 0xe1, 0xf3, 0xff, 0xff,
350xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0x47, 0x1f,
360x3d, 0xf9, 0xf9, 0xf3, 0x83, 0x30, 0x78, 0x78, 0x71, 0x23, 0x87, 0xcf, 0xff, 0xff, 0xff, 0xff,
370xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xe7, 0xef, 0xcf, 0x0e, 0x0c, 0xe1, 0xe3, 0xe7, 0xcf,
380x1f, 0x3e, 0x7e, 0xff, 0xef, 0xe7, 0xf3, 0xf8, 0xfc, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
390xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xf9, 0xf3, 0xe7, 0xcf, 0x9f, 0x3f, 0x7f,
400x7f, 0x3f, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
410xff, 0xff, 0xff, 0xbf, 0x9f, 0xbf, 0x3f, 0x3b, 0x33, 0x87, 0x8f, 0x9f, 0x3f, 0x7f, 0xff, 0xfe,
420xfc, 0xb9, 0x83, 0xc7, 0xe7, 0xf3, 0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
430xff, 0xff, 0xff, 0xbf, 0x9f, 0xcf, 0xc7, 0x33, 0x7f, 0xfe, 0xfc, 0xfc, 0xf9, 0xf8, 0xf6, 0xe7,
440xee, 0xc8, 0x83, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
450xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfc, 0xf9, 0xf9, 0xf9, 0xf9,
460xfc, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
470xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xf8, 0xfc,
480xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0x07, 0x73,
490xfb, 0xfb, 0xf3, 0xe7, 0xcf, 0x9f, 0x3f, 0xf8, 0xf0, 0xe7, 0xe7, 0xe7, 0xe7, 0xf0, 0xf8, 0xfd,
500xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x87, 0x33,
510x3b, 0x39, 0x3b, 0x9f, 0x9f, 0x9f, 0x3f, 0x7f, 0xfe, 0xfc, 0xd9, 0xc3, 0xe3, 0xf3, 0xf9, 0xff,
520xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xdf, 0xdf, 0xdf, 0xbf, 0x7f, 0xff, 0xff, 0xff,
530xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
540xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
550xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
560xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xe7, 0xf3, 0xf9, 0xf8, 0xf1, 0xe3, 0xc7, 0x8f, 0x1f, 0x3e,
570x7c, 0xf9, 0xf3, 0xf3, 0xf3, 0xf3, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
580xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xf3, 0xf9, 0xfc, 0xbe, 0x9c, 0xc1, 0xe3, 0xe7, 0xcf,
590x1f, 0x3f, 0xff, 0xf3, 0xf3, 0xfb, 0xf8, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xbf,
600xff, 0xff, 0xe7, 0xdb, 0xbb, 0x7b, 0xf7, 0xee, 0xdc, 0xbd, 0xff, 0xf7, 0xf7, 0xf6, 0xff, 0xff,
610xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
620xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
630xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
640xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,
650xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
660xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xf9, 0xfc,
670xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfc,
680xf9, 0xf3, 0xa7, 0xcf, 0xef, 0xff, 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
69};
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 @@
1// Copyright 2022 Viatly Volkov (@vlkv)
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4/*
5qmk compile -kb avalanche/v4 -km default
6qmk flash -kb avalanche/v4 -km default
7*/
8
9#include QMK_KEYBOARD_H
10
11enum layer {
12 _QWERTY,
13 _LOWER,
14 _RAISE,
15};
16
17#define FN_1 MO(_LOWER)
18#define FN_2 MO(_RAISE)
19
20const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
21 [_QWERTY] = LAYOUT(
22 KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_DEL ,
23 KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSPC,
24 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,
25 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,
26 KC_LGUI, KC_LALT, KC_LGUI, FN_1 , KC_ENT , /**/ FN_2 , KC_SPC , KC_BSPC, KC_RALT, KC_RGUI
27 ),
28 [_LOWER] = LAYOUT(
29 _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 ,
30 KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_DEL ,
31 _______ , KC_TILD, KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, _______,
32 _______, KC_EQL , KC_MINS, KC_PLUS, KC_LCBR, KC_RCBR, _______, _______, /**/ _______, _______, KC_LBRC, KC_RBRC, KC_SCLN, KC_COLN, KC_BSLS, _______,
33 _______, _______, _______, _______, _______, /**/ _______, _______, _______, _______, _______
34 ),
35 [_RAISE] = LAYOUT(
36 _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLD, KC_VOLU, KC_MUTE, XXXXXXX, XXXXXXX, XXXXXXX,
37 _______, KC_0, KC_1, KC_2, KC_3, KC_BSPC, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
38 _______, _______, KC_0, KC_4, KC_5, KC_6, KC_DEL, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX,
39 _______, KC_0, KC_7, KC_8, KC_9, KC_DOT, _______, _______, /**/ _______, _______, KC_PGDN, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
40 _______, _______, _______, _______, _______, /**/ _______, _______, _______, _______, _______
41 ),
42};
43
44#ifdef OLED_ENABLE
45
46#include "images.h"
47
48oled_rotation_t oled_init_user(oled_rotation_t rotation) {
49 return OLED_ROTATION_0;
50}
51
52void shiftright(char* buf, int size, int num) {
53 for (int i = size-1; i > 0; i--) {
54 buf[i] >>= 1;
55 if (buf[i-1] & 0x01) {
56 buf[i] |= 0x80;
57 }
58 }
59 buf[0] >>= 1;
60}
61
62// right to left, 8 bit vertical strips.
63void mask(char* enable) {
64 char rowenable[3];
65 const char* data = display;
66 int i = 0;
67 char blockmask[2] = { 0x00, 0x00 };
68
69 while (i < sizeof(display)) {
70 if (i % 128 == 0) {
71 // shift enable-mask right 1 at each row, reinitialize row copy
72 if (i != 0) {
73 shiftright(enable, 3, 2);
74 }
75 rowenable[0] = enable[0];
76 rowenable[1] = enable[1];
77 rowenable[2] = enable[2];
78 }
79
80 if (i % 8 == 0) {
81 if (rowenable[2] & 0x01) {
82 blockmask[1] = 0xff;
83 } else {
84 blockmask[1] = 0x00;
85 }
86
87 if (rowenable[2] & 0x02) {
88 blockmask[0] = 0xff;
89 } else {
90 blockmask[0] = 0x00;
91 }
92 shiftright(rowenable, 3, 2);
93 }
94
95 uint8_t c = pgm_read_byte(data++);
96 oled_write_raw_byte(c & blockmask[1], i++);
97 shiftright(blockmask, 2, 1);
98 }
99}
100
101void setmask(char* mask) {
102 mask[0] = 0x00;
103 mask[1] = 0x00;
104 mask[2] = 0x00;
105
106 uint8_t mod = get_mods() | get_oneshot_mods();
107 if (mod & MOD_MASK_CTRL) {
108 mask[1] |= 0xf0;
109 }
110 if (mod & MOD_MASK_ALT) {
111 mask[1] |= 0x0f;
112 }
113 if (mod & MOD_MASK_GUI) {
114 mask[0] |= 0xf0;
115 }
116
117 switch (get_highest_layer(layer_state)) {
118 case _LOWER:
119 mask[2] |= 0xf0;
120 break;
121 case _RAISE:
122 mask[0] |= 0x0f;
123 break;
124 }
125}
126
127bool oled_task_user(void) {
128 char m[3];
129 setmask(m);
130 mask(m);
131 return false;
132}
133
134#endif
135
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 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5BOOTLOADER = caterina
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 = yes # 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
20OLED_ENABLE = yes
21OLED_DRIVER = SSD1306
22
23SPLIT_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 @@
1// Copyright 2022 Vitaly Volkov (@vlkv)
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include "avalanche.h"
5
6#ifdef OLED_ENABLE
7oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
8 return OLED_ROTATION_180;
9}
10
11bool oled_task_kb(void) {
12 if (!oled_task_user()) {
13 return false;
14 }
15 oled_write_P(PSTR("Avalanche\nVersion 4"), false);
16 return true;
17}
18#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 @@
1// Copyright 2022 Vitaly Volkov (@vlkv)
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include "avalanche.h"
7
8#include "quantum.h"
9
10#define L__ KC_NO
11#define R__ KC_NO
12
13#define LAYOUT( \
14 L00, L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, R00, \
15 L10, L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, R10, \
16 L40, L20, L21, L22, L23, L24, L25, R25, R24, R23, R22, R21, R20, R40, \
17 L30, L31, L32, L33, L34, L35, L36, L26, R26, R36, R35, R34, R33, R32, R31, R30, \
18 L42, L43, L44, L45, L46, R46, R45, R44, R43, R42 \
19) \
20{ \
21 { L00, L01, L02, L03, L04, L05, L__}, \
22 { L10, L11, L12, L13, L14, L15, L__}, \
23 { L20, L21, L22, L23, L24, L25, L26}, \
24 { L30, L31, L32, L33, L34, L35, L36}, \
25 { L40, L__, L42, L43, L44, L45, L46}, \
26 { R00, R01, R02, R03, R04, R05, R__}, \
27 { R10, R11, R12, R13, R14, R15, R__}, \
28 { R20, R21, R22, R23, R24, R25, R26}, \
29 { R30, R31, R32, R33, R34, R35, R36}, \
30 { R40, R__, R42, R43, R44, R45, R46} \
31}