Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added VT-40 keyboard #24706

Merged
merged 10 commits into from
Dec 12, 2024
92 changes: 92 additions & 0 deletions keyboards/vt40/keyboard.json
Original file line number Diff line number Diff line change
@@ -0,0 1,92 @@
{
"manufacturer": "vladantrhlik",
"keyboard_name": "vt40",
"maintainer": "vladantrhlik",
"bootloader": "rp2040",
"diode_direction": "COL2ROW",
"features": {
"bootmagic": true,
"command": false,
"console": false,
"encoder": true,
"extrakey": true,
"mousekey": true,
"nkro": true
},
"matrix_pins": {
"cols": ["GP6", "GP7", "GP8", "GP9", "GP10", "GP11", "GP12",
"GP13", "GP21", "GP20", "GP19", "GP18", "GP22"],
guidoism marked this conversation as resolved.
Show resolved Hide resolved
"rows": ["GP2", "GP3", "GP4", "GP5"]
},
"encoder": {
"rotary": [
{"pin_a": "GP26", "pin_b": "GP16"},
{"pin_a": "GP27", "pin_b": "GP17"},
]
},
"processor": "RP2040",
"url": "https://github.com/vladantrhlik/VT-40",
"usb": {
"device_version": "1.0.0",
"pid": "0x0000",
"vid": "0xFEED"
},
"community_layouts": ["ortho_4x12"],
"layouts": {
"LAYOUT_ortho_4x12": {
"layout": [
{"label": "Tab", "matrix": [0, 0], "x": 0, "y": 0},
{"label": "Q", "matrix": [0, 1], "x": 1, "y": 0},
{"label": "W", "matrix": [0, 2], "x": 2, "y": 0},
{"label": "E", "matrix": [0, 3], "x": 3, "y": 0},
{"label": "R", "matrix": [0, 4], "x": 4, "y": 0},
{"label": "T", "matrix": [0, 5], "x": 5, "y": 0},
{"label": "Y", "matrix": [0, 6], "x": 6, "y": 0},
{"label": "U", "matrix": [0, 7], "x": 7, "y": 0},
{"label": "I", "matrix": [0, 8], "x": 8, "y": 0},
{"label": "O", "matrix": [0, 9], "x": 9, "y": 0},
{"label": "P", "matrix": [0, 10], "x": 10, "y": 0},
{"label": "BackSpace", "matrix": [0, 11], "x": 11, "y": 0},

{"label": "Esc", "matrix": [1, 0], "x": 0, "y": 1},
{"label": "A", "matrix": [1, 1], "x": 1, "y": 1},
{"label": "S", "matrix": [1, 2], "x": 2, "y": 1},
{"label": "D", "matrix": [1, 3], "x": 3, "y": 1},
{"label": "F", "matrix": [1, 4], "x": 4, "y": 1},
{"label": "G", "matrix": [1, 5], "x": 5, "y": 1},
{"label": "H", "matrix": [1, 6], "x": 6, "y": 1},
{"label": "J", "matrix": [1, 7], "x": 7, "y": 1},
{"label": "K", "matrix": [1, 8], "x": 8, "y": 1},
{"label": "L", "matrix": [1, 9], "x": 9, "y": 1},
{"label": ";", "matrix": [1, 10], "x": 10, "y": 1},
{"label": "'", "matrix": [1, 11], "x": 11, "y": 1},

{"label": "Shift", "matrix": [2, 0], "x": 0, "y": 2},
{"label": "Z", "matrix": [2, 1], "x": 1, "y": 2},
{"label": "X", "matrix": [2, 2], "x": 2, "y": 2},
{"label": "C", "matrix": [2, 3], "x": 3, "y": 2},
{"label": "V", "matrix": [2, 4], "x": 4, "y": 2},
{"label": "B", "matrix": [2, 5], "x": 5, "y": 2},
{"label": "N", "matrix": [2, 6], "x": 6, "y": 2},
{"label": "M", "matrix": [2, 7], "x": 7, "y": 2},
{"label": ",", "matrix": [2, 8], "x": 8, "y": 2},
{"label": ".", "matrix": [2, 9], "x": 9, "y": 2},
{"label": "/", "matrix": [2, 10], "x": 10, "y": 2},
{"label": "Return", "matrix": [2, 11], "x": 11, "y": 2},

{"matrix": [3, 0], "x": 0, "y": 3},
{"label": "Ctrl", "matrix": [3, 1], "x": 1, "y": 3},
{"label": "Alt", "matrix": [3, 2], "x": 2, "y": 3},
{"label": "Super", "matrix": [3, 3], "x": 3, "y": 3},
{"label": "⇓", "matrix": [3, 4], "x": 4, "y": 3},
{"matrix": [3, 5], "x": 5, "y": 3},
{"matrix": [3, 6], "x": 6, "y": 3},
{"label": "⇑", "matrix": [3, 7], "x": 7, "y": 3},
{"label": "←", "matrix": [3, 8], "x": 8, "y": 3},
{"label": "↓", "matrix": [3, 9], "x": 9, "y": 3},
{"label": "↑", "matrix": [3, 10], "x": 10, "y": 3},
{"label": "→", "matrix": [3, 11], "x": 11, "y": 3}
]
}
}
}
274 changes: 274 additions & 0 deletions keyboards/vt40/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 1,274 @@
// Copyright 2023 QMK
// SPDX-License-Identifier: GPL-2.0-or-later

#include QMK_KEYBOARD_H

/*
enum custom_keycodes {
KC_P00 = SAFE_RANGE
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
KC_PMNS,
KC_P7, KC_P8, KC_P9, KC_PPLS,
KC_P4, KC_P5, KC_P6, KC_PERC,
KC_P1, KC_P2, KC_P3, KC_EQL,
KC_P0, KC_P00, KC_PDOT, KC_PENT
)
};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
switch(keycode) {
case KC_P00:
tap_code(KC_P0);
tap_code(KC_P0);
return false;
}
}
return true;
}

#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[0] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN) }
};
#endif
*/
guidoism marked this conversation as resolved.
Show resolved Hide resolved

enum planck_layers {
guidoism marked this conversation as resolved.
Show resolved Hide resolved
_QWERTY,
_COLEMAK,
_DVORAK,
_LOWER,
_RAISE,
_PLOVER,
_ADJUST
};

enum planck_keycodes {
PLOVER = SAFE_RANGE,
LOWER,
RAISE,
BACKLIT,
EXT_PLV
};
waffle87 marked this conversation as resolved.
Show resolved Hide resolved

#define QWERTY PDF(_QWERTY)
#define COLEMAK PDF(_COLEMAK)
#define DVORAK PDF(_DVORAK)

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
* |------ ------ ------ ------ ------ ------------- ------ ------ ------ ------ ------|
* | Esc | A | S | D | F | G | H | J | K | L | ; | " |
* |------ ------ ------ ------ ------ ------|------ ------ ------ ------ ------ ------|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
* |------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------|
* | Brite| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = LAYOUT_ortho_4x12(
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_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
),

/* Colemak
* ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
* |------ ------ ------ ------ ------ ------------- ------ ------ ------ ------ ------|
* | Esc | A | R | S | T | D | H | N | E | I | O | " |
* |------ ------ ------ ------ ------ ------|------ ------ ------ ------ ------ ------|
* | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
* |------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------|
* | Brite| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_COLEMAK] = LAYOUT_ortho_4x12(
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
),

/* Dvorak
* ,-----------------------------------------------------------------------------------.
* | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
* |------ ------ ------ ------ ------ ------------- ------ ------ ------ ------ ------|
* | Esc | A | O | E | U | I | D | H | T | N | S | / |
* |------ ------ ------ ------ ------ ------|------ ------ ------ ------ ------ ------|
* | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
* |------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------|
* | Brite| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_DVORAK] = LAYOUT_ortho_4x12(
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC,
KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH,
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT ,
BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
),

/* Lower
* ,-----------------------------------------------------------------------------------.
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
* |------ ------ ------ ------ ------ ------------- ------ ------ ------ ------ ------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | | { | } | | |
* |------ ------ ------ ------ ------ ------|------ ------ ------ ------ ------ ------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | |
* |------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------|
* | | | | | | | | | Next | Vol- | Vol | Play |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = LAYOUT_ortho_4x12(
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______,
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
),

/* Raise
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------ ------ ------ ------ ------ ------------- ------ ------ ------ ------ ------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
* |------ ------ ------ ------ ------ ------|------ ------ ------ ------ ------ ------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | |
* |------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------|
* | | | | | | | | | Next | Vol- | Vol | Play |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = LAYOUT_ortho_4x12(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______,
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
),

/* Plover layer (http://opensteno.org)
* ,-----------------------------------------------------------------------------------.
* | # | # | # | # | # | # | # | # | # | # | # | # |
* |------ ------ ------ ------ ------ ------------- ------ ------ ------ ------ ------|
* | | S | T | P | H | * | * | F | P | L | T | D |
* |------ ------ ------ ------ ------ ------|------ ------ ------ ------ ------ ------|
* | | S | K | W | R | * | * | R | B | G | S | Z |
* |------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------|
* | Exit | | | A | O | | | E | U | | | |
* `-----------------------------------------------------------------------------------'
*/

[_PLOVER] = LAYOUT_ortho_4x12(
KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 ,
XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX
),

/* Adjust (Lower Raise)
* ,-----------------------------------------------------------------------------------.
* | | Reset| | | | | | | | | | Del |
* |------ ------ ------ ------ ------ ------------- ------ ------ ------ ------ ------|
* | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| |
* |------ ------ ------ ------ ------ ------|------ ------ ------ ------ ------ ------|
* | |Voice-|Voice |Mus on|Musoff|MIDIon|MIDIof| | | | | |
* |------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = LAYOUT_ortho_4x12(
waffle87 marked this conversation as resolved.
Show resolved Hide resolved
_______, QK_BOOT, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL ,
_______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______,
_______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
)

};


#ifdef AUDIO_ENABLE
float plover_song[][2] = SONG(PLOVER_SOUND);
float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND);
#endif

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case BACKLIT:
if (record->event.pressed) {
register_code(KC_RSFT);
#ifdef BACKLIGHT_ENABLE
backlight_step();
#endif
} else {
unregister_code(KC_RSFT);
}
return false;
break;
case PLOVER:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
stop_all_notes();
PLAY_SONG(plover_song);
#endif
layer_off(_RAISE);
layer_off(_LOWER);
layer_off(_ADJUST);
layer_on(_PLOVER);
if (!eeconfig_is_enabled()) {
eeconfig_init();
}
keymap_config.raw = eeconfig_read_keymap();
keymap_config.nkro = 1;
eeconfig_update_keymap(keymap_config.raw);
}
return false;
break;
case EXT_PLV:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(plover_gb_song);
#endif
layer_off(_PLOVER);
}
return false;
break;
}
return true;
}

#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[0] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[1] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[2] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[3] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[4] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[5] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[6] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }
guidoism marked this conversation as resolved.
Show resolved Hide resolved
};
#endif
1 change: 1 addition & 0 deletions keyboards/vt40/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
ENCODER_MAP_ENABLE = yes
24 changes: 24 additions & 0 deletions keyboards/vt40/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 1,24 @@
# VT-40

* Keyboard Maintainer: [Guido Bartolucci](https://github.com/guidoism)
* Hardware Supported: Raspberry Pi Pico (RP2040)
* Hardware Availability: https://github.com/vladantrhlik/VT-40

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

make vt40:default

Flashing example for this keyboard:

make vt40:default:flash

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

Enter the bootloader in 3 ways:

* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard
* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available

Loading