Skip to content

Commit

Permalink
[Keyboard] Add avalanche (#16407)
Browse files Browse the repository at this point in the history
* [Keyboard] Add avalanche

* PR feedback

* Update keyboards/avalanche/v1/config.h

* Update keyboards/avalanche/v1/v1.h

* Update keyboards/avalanche/v2/config.h

* Update keyboards/avalanche/v2/v2.h

* Update keyboards/avalanche/v3/config.h

* Update keyboards/avalanche/v3/v3.h

* Apply suggestions from code review

* Remove rules.mk comment and fix other comments.

* Shared encoder code, follow conventions in rules.mk files.

* Remove config files which do not change defaul behavior.
  • Loading branch information
winder authored Apr 14, 2022
1 parent b9e1125 commit 8de4065
Show file tree
Hide file tree
Showing 19 changed files with 473 additions and 0 deletions.
25 changes: 25 additions & 0 deletions keyboards/avalanche/avalanche.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2022 Vitaly Volkov (@vlkv)
// SPDX-License-Identifier: GPL-2.0-or-later

#include "avalanche.h"

#ifdef ENCODER_ENABLE
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_user(index, clockwise)) { return false; }
if (index == 0) {
if (clockwise) {
tap_code_delay(KC_VOLU, 10);
} else {
tap_code_delay(KC_VOLD, 10);
}
} else if (index == 1) { /* Second encoder */
if (clockwise) {
tap_code(KC_PGUP);
} else {
tap_code(KC_PGDOWN);
}
}
return true;
}
#endif

14 changes: 14 additions & 0 deletions keyboards/avalanche/avalanche.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright 2022 Vitaly Volkov (@vlkv)
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#ifdef KEYBOARD_avalanche_v1
#include "v1.h"
#elif KEYBOARD_avalanche_v2
#include "v2.h"
#elif KEYBOARD_avalanche_v3
#include "v3.h"
#endif

#include "quantum.h"
6 changes: 6 additions & 0 deletions keyboards/avalanche/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright 2022 Vitaly Volkov (@vlkv)
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include "config_common.h"
27 changes: 27 additions & 0 deletions keyboards/avalanche/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Avalanche

![Avalanche v3.0](https://github.com/vlkv/avalanche/blob/master/images/avalanche_v3-0.jpg)

An open source ergonomic split keyboard with removable keys to support 40% and 60% configurations.

* Keyboard Maintainer: [Vitaly Volkov](https://github.com/vlkv)
* Hardware Supported: Avalanche PCB v1, v2, v3, Pro Micro 5V/16MHz and compatible.
* Hardware Availability: [Avalanche](https://github.com/vlkv/avalanche).

Make example for this keyboard (after setting up your build environment):

make avalanche/v1:default # for v1 PCBs
make avalanche/v2:default # for v2 PCBs
make avalanche/v3:default # for v3 PCBs

Flashing example for this keyboard:

make avalanche/v1:default:flash # for v1 PCBs
make avalanche/v2:default:flash # for v2 PCBs
make avalanche/v3:default:flash # for v3 PCBs

See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).

## Bootloader

Briefly press the button along the inner edge of the PCB next to the microcontroller.
22 changes: 22 additions & 0 deletions keyboards/avalanche/v1/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright 2022 Vitaly Volkov (@vlkv)
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#define VENDOR_ID 0xCEE2
#define PRODUCT_ID 0x0001
#define DEVICE_VER 0x0001
#define MANUFACTURER vitvlkv
#define PRODUCT Avalanche

#define MATRIX_ROWS 10
#define MATRIX_COLS 8

#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 }
#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6 }

#define DIODE_DIRECTION COL2ROW

#define SOFT_SERIAL_PIN D2

#define BACKLIGHT_PIN B0
48 changes: 48 additions & 0 deletions keyboards/avalanche/v1/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Copyright 2022 Vitaly Volkov (@vlkv)
// SPDX-License-Identifier: GPL-2.0-or-later

/*
qmk compile -kb avalanche/v1 -km default
qmk flash -kb avalanche/v1 -km default
*/

#include QMK_KEYBOARD_H

enum layer {
LAYER_0,
LAYER_1,
LAYER_2,
};

#define FN_1 MO(LAYER_1)
#define FN_2 LT(LAYER_2, KC_SPC)
#define LFN_3 LSFT_T(KC_EQL)
#define RFN_3 RSFT_T(KC_MINS)
#define KC_QTSH RSFT_T(KC_QUOT)
#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_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, 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_LGUI, KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_CAPS, KC_LSCR, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QTSH, KC_RBRC,
KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_DEL, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RCTL,
KC_GRV, LFN_3, FN_2, EN_LALT, EN_RALT, FN_1, RFN_3, KC_INS
),
[LAYER_1] = LAYOUT(
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, KC_PGUP, KC_PSCR, _______,
_______, _______, KC_APP, XXXXXXX, KC_HOME, KC_END, KC_DEL, _______, _______, KC_BSPC, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, _______, KC_F12,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PAUS, _______, _______, KC_HOME, KC_END, XXXXXXX, KC_PGDN, XXXXXXX, _______,
_______, _______, _______, _______, _______, _______, _______, _______
),
[LAYER_2] = LAYOUT(
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
_______, KC_BSPC, KC_1, KC_2, KC_3, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, KC_PGUP, XXXXXXX, XXXXXXX,
_______, _______, KC_BSPC, KC_4, KC_5, KC_6, KC_DEL, _______, _______, KC_BSPC, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, _______, KC_F12,
_______, KC_BSPC, KC_7, KC_8, KC_9, KC_0, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGDN, XXXXXXX, _______,
_______, _______, _______, _______, _______, _______, _______, _______
),
};

20 changes: 20 additions & 0 deletions keyboards/avalanche/v1/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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

SPLIT_KEYBOARD = yes
4 changes: 4 additions & 0 deletions keyboards/avalanche/v1/v1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright 2022 Vitaly Volkov (@vlkv)
// SPDX-License-Identifier: GPL-2.0-or-later

#include "avalanche.h"
31 changes: 31 additions & 0 deletions keyboards/avalanche/v1/v1.h
Original file line number Diff line number Diff line change
@@ -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( \
L01, L02, L03, L04, L05, L06, R06, R05, R04, R03, R02, R01, \
L11, L12, L13, L14, L15, L16, R16, R15, R14, R13, R12, R11, \
L20, L21, L22, L23, L24, L25, L26, L27, R27, R26, R25, R24, R23, R22, R21, R20, \
L31, L32, L33, L34, L35, L36, L37, R37, R36, R35, R34, R33, R32, R31, \
L44, L45, L46, L47, R47, R46, R45, R44 \
) \
{ \
{ L__, L01, L02, L03, L04, L05, L06, L__}, \
{ L__, L11, L12, L13, L14, L15, L16, L__}, \
{ L20, L21, L22, L23, L24, L25, L26, L27}, \
{ L__, L31, L32, L33, L34, L35, L36, L37}, \
{ L__, L__, L__, L__, L44, L45, L46, L47}, \
{ R__, R01, R02, R03, R04, R05, R06, R__}, \
{ R__, R11, R12, R13, R14, R15, R16, R__}, \
{ R20, R21, R22, R23, R24, R25, R26, R27}, \
{ R__, R31, R32, R33, R34, R35, R36, R37}, \
{ R__, R__, R__, R__, R44, R45, R46, R47} \
}
30 changes: 30 additions & 0 deletions keyboards/avalanche/v2/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2022 Vitaly Volkov (@vlkv)
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#define VENDOR_ID 0xCEE2
#define PRODUCT_ID 0x0002
#define DEVICE_VER 0x0002
#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 RGB_DI_PIN D3

#define RGBLED_NUM 12
#define RGBLED_SPLIT { 6, 6 }
#define RGBLIGHT_SPLIT

#define ENCODERS_PAD_A { B5 }
#define ENCODERS_PAD_B { F4 }
#define ENCODER_RESOLUTION 2
56 changes: 56 additions & 0 deletions keyboards/avalanche/v2/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Copyright 2022 Vitaly Volkov (@vlkv)
// SPDX-License-Identifier: GPL-2.0-or-later

/*
qmk compile -kb avalanche/v2 -km default
qmk flash -kb avalanche/v2 -km default
*/

#include QMK_KEYBOARD_H

enum layer {
LAYER_0,
LAYER_1,
LAYER_2,
LAYER_3,
};

#define FN_1 MO(LAYER_1)
#define FN_2 LT(LAYER_2, KC_SPC)
#define FN_3 LT(LAYER_3, KC_INS)
#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_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, 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_LGUI, KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, XXXXXXX, XXXXXXX, 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_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RCTL,
KC__MUTE,KC_GRV, LFN_3, FN_2, EN_LALT, EN_RALT, FN_1, RFN_3, FN_3, KC_LSCR
),
[LAYER_1] = LAYOUT(
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
_______, KC_0, KC_1, KC_2, KC_3, XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX,
_______, _______, KC_APP, KC_4, KC_5, KC_6, KC_DEL, _______, _______, KC_BSPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, KC_F12,
_______, KC_PSCR, KC_7, KC_8, KC_9, KC_0, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
[LAYER_2] = LAYOUT(
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, KC_PGUP, KC_HOME, KC_UP, KC_END, XXXXXXX, XXXXXXX, KC_EXLM, KC_AT, KC_HASH, XXXXXXX, KC_LPRN,
_______, _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, _______, _______, KC_BSPC, KC_DLR, KC_PERC, KC_CIRC, XXXXXXX, XXXXXXX, KC_RPRN,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, KC_AMPR, KC_ASTR, XXXXXXX, XXXXXXX, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
[LAYER_3] = LAYOUT(
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, _______, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
};

21 changes: 21 additions & 0 deletions keyboards/avalanche/v2/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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 = yes # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
ENCODER_ENABLE = yes

SPLIT_KEYBOARD = yes
4 changes: 4 additions & 0 deletions keyboards/avalanche/v2/v2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright 2022 Vitaly Volkov (@vlkv)
// SPDX-License-Identifier: GPL-2.0-or-later

#include "avalanche.h"
31 changes: 31 additions & 0 deletions keyboards/avalanche/v2/v2.h
Original file line number Diff line number Diff line change
@@ -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, L26, R26, R25, R24, R23, R22, R21, R20, R40, \
L30, L31, L32, L33, L34, L35, L36, 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} \
}
30 changes: 30 additions & 0 deletions keyboards/avalanche/v3/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2022 Vitaly Volkov (@vlkv)
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#define VENDOR_ID 0xCEE2
#define PRODUCT_ID 0x0003
#define DEVICE_VER 0x0003
#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 RGB_DI_PIN D3

#define RGBLED_NUM 12
#define RGBLED_SPLIT { 7, 7 }
#define RGBLIGHT_SPLIT

#define ENCODERS_PAD_A { B5 }
#define ENCODERS_PAD_B { F4 }
#define ENCODER_RESOLUTION 2
Loading

0 comments on commit 8de4065

Please sign in to comment.