mirror of https://github.com/qmk/qmk_firmware
Merge 2e933d34ef
into 85a7627641
commit
017e4125d0
|
@ -0,0 +1,7 @@
|
|||
// Copyright 2023 Mathias Andersson (@Wraul)
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#pragma once
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_COLS 16
|
||||
#define MATRIX_ROWS 5
|
|
@ -0,0 +1,166 @@
|
|||
{
|
||||
"manufacturer": "YDKB",
|
||||
"keyboard_name": "Mountain Keyboard",
|
||||
"maintainer": "Wraul",
|
||||
"bootloader": "lufa-ms",
|
||||
"features": {
|
||||
"bootmagic": true,
|
||||
"command": false,
|
||||
"console": false,
|
||||
"extrakey": true,
|
||||
"mousekey": true,
|
||||
"nkro": true
|
||||
},
|
||||
"indicators": {
|
||||
"caps_lock": "D5"
|
||||
},
|
||||
"processor": "atmega32u4",
|
||||
"url": "https://kbdfans.com/products/ic-kbdfans-mountain-ergo-keyboard-kit",
|
||||
"usb": {
|
||||
"device_version": "0.0.1",
|
||||
"pid": "0x2163",
|
||||
"vid": "0x5945"
|
||||
},
|
||||
"layout_aliases": {
|
||||
"LAYOUT_all": "LAYOUT_split_bs"
|
||||
},
|
||||
"layouts": {
|
||||
"LAYOUT": {
|
||||
"layout": [
|
||||
{"label": "Esc", "matrix": [0, 0], "x": 0.5, "y": 0.1},
|
||||
{"label": "1", "matrix": [0, 1], "x": 1.5, "y": 0.1},
|
||||
{"label": "2", "matrix": [0, 2], "x": 2.7, "y": 0, "r": 10},
|
||||
{"label": "3", "matrix": [0, 3], "x": 3.7, "y": 0.2, "r": 10},
|
||||
{"label": "4", "matrix": [0, 4], "x": 4.7, "y": 0.4, "r": 10},
|
||||
{"label": "5", "matrix": [0, 5], "x": 5.7, "y": 0.6, "r": 10},
|
||||
{"label": "6", "matrix": [0, 6], "x": 6.7, "y": 0.8, "r": 10},
|
||||
{"label": "7", "matrix": [4, 9], "x": 9.05, "y": 0.7, "r": -10, "rx": 10.05},
|
||||
{"label": "8", "matrix": [4, 10], "x": 10.05, "y": 0.5, "r": -10, "rx": 11.05},
|
||||
{"label": "9", "matrix": [4, 11], "x": 11.05, "y": 0.3, "r": -10, "rx": 12.05},
|
||||
{"label": "0", "matrix": [4, 12], "x": 12.05, "y": 0.1, "r": -10, "rx": 13.05},
|
||||
{"label": "-", "matrix": [4, 13], "x": 13.25, "y": 0.1},
|
||||
{"label": "+", "matrix": [4, 14], "x": 14.25, "y": 0.1},
|
||||
{"label": "BS", "matrix": [4, 8], "x": 15.25, "y": 0.1, "w": 2},
|
||||
{"label": "Tab", "matrix": [0, 7], "x": 0.25, "y": 1.1, "w": 1.5},
|
||||
{"label": "Q", "matrix": [1, 0], "x": 1.75, "y": 1.1},
|
||||
{"label": "W", "matrix": [1, 1], "x": 2.95, "y": 1.05, "r": 10},
|
||||
{"label": "E", "matrix": [1, 2], "x": 3.95, "y": 1.25, "r": 10},
|
||||
{"label": "R", "matrix": [1, 3], "x": 4.95, "y": 1.45, "r": 10},
|
||||
{"label": "T", "matrix": [1, 4], "x": 5.95, "y": 1.65, "r": 10},
|
||||
{"label": "Y", "matrix": [3, 9], "x": 8.85, "y": 1.75, "r": -10, "rx": 9.85},
|
||||
{"label": "U", "matrix": [3, 10], "x": 9.85, "y": 1.55, "r": -10, "rx": 10.85},
|
||||
{"label": "I", "matrix": [3, 11], "x": 10.85, "y": 1.35, "r": -10, "rx": 11.85},
|
||||
{"label": "O", "matrix": [3, 12], "x": 11.85, "y": 1.15, "r": -10, "rx": 12.85},
|
||||
{"label": "P", "matrix": [3, 13], "x": 13, "y": 1.1},
|
||||
{"label": "[{", "matrix": [3, 14], "x": 14, "y": 1.1},
|
||||
{"label": "]}", "matrix": [3, 15], "x": 15, "y": 1.1},
|
||||
{"label": "\\|", "matrix": [3, 8], "x": 16, "y": 1.1, "w": 1.5},
|
||||
{"label": "Caps", "matrix": [1, 7], "x": 0.15, "y": 2.1, "w": 1.75},
|
||||
{"label": "A", "matrix": [2, 0], "x": 1.9, "y": 2.1},
|
||||
{"label": "S", "matrix": [2, 1], "x": 3.1, "y": 2.1, "r": 10},
|
||||
{"label": "D", "matrix": [2, 2], "x": 4.1, "y": 2.3, "r": 10},
|
||||
{"label": "F", "matrix": [1, 6], "x": 5.1, "y": 2.5, "r": 10},
|
||||
{"label": "G", "matrix": [1, 5], "x": 6.1, "y": 2.7, "r": 10},
|
||||
{"label": "H", "matrix": [2, 9], "x": 9.3, "y": 2.7, "r": -10, "rx": 10.3},
|
||||
{"label": "J", "matrix": [2, 10], "x": 10.3, "y": 2.5, "r": -10, "rx": 11.3},
|
||||
{"label": "K", "matrix": [2, 11], "x": 11.3, "y": 2.3, "r": -10, "rx": 12.3},
|
||||
{"label": "L", "matrix": [2, 12], "x": 12.3, "y": 2.1, "r": -10, "rx": 13.3},
|
||||
{"label": ";:", "matrix": [2, 13], "x": 13.5, "y": 2.1},
|
||||
{"label": "'\"", "matrix": [2, 14], "x": 14.5, "y": 2.1},
|
||||
{"label": "Enter", "matrix": [2, 8], "x": 15.5, "y": 2.1, "w": 2.25},
|
||||
{"label": "Shift", "matrix": [2, 7], "x": 0, "y": 3.1, "w": 2.25},
|
||||
{"label": "Z", "matrix": [3, 1], "x": 2.25, "y": 3.1},
|
||||
{"label": "X", "matrix": [2, 6], "x": 3.45, "y": 3.2, "r": 10},
|
||||
{"label": "C", "matrix": [2, 5], "x": 4.45, "y": 3.4, "r": 10},
|
||||
{"label": "V", "matrix": [2, 4], "x": 5.45, "y": 3.6, "r": 10},
|
||||
{"label": "B", "matrix": [2, 3], "x": 6.45, "y": 3.8, "r": 10},
|
||||
{"label": "b", "matrix": [1, 9], "x": 9.05, "y": 3.8, "r": -10, "rx": 10.05},
|
||||
{"label": "N", "matrix": [1, 10], "x": 10.05, "y": 3.6, "r": -10, "rx": 11.05},
|
||||
{"label": "M", "matrix": [1, 11], "x": 11.05, "y": 3.4, "r": -10, "rx": 12.05},
|
||||
{"label": ",<", "matrix": [1, 12], "x": 12.05, "y": 3.2, "r": -10, "rx": 13.05},
|
||||
{"label": ".>", "matrix": [1, 13], "x": 13.25, "y": 3.1},
|
||||
{"label": "/?", "matrix": [1, 14], "x": 14.25, "y": 3.1},
|
||||
{"label": "RShift", "matrix": [1, 15], "x": 15.25, "y": 3.1, "w": 1.75},
|
||||
{"label": "Fn", "matrix": [1, 8], "x": 17, "y": 3.1},
|
||||
{"label": "Ctrl", "matrix": [3, 7], "x": 0, "y": 4.1, "w": 1.5},
|
||||
{"label": "Alt", "matrix": [3, 5], "x": 2.75, "y": 4.2, "w": 1.5, "r": 11},
|
||||
{"label": "LFn1", "matrix": [3, 4], "x": 4.25, "y": 4.4, "w": 2, "r": 11},
|
||||
{"label": "LFn2", "matrix": [3, 3], "x": 6.25, "y": 4.8, "r": 10},
|
||||
{"label": "Space", "matrix": [0, 10], "x": 9.25, "y": 4.65, "w": 2.75, "r": -11, "rx": 11},
|
||||
{"label": "RAlt", "matrix": [0, 11], "x": 12, "y": 4.4, "w": 1.25, "r": -11, "rx": 12.25},
|
||||
{"label": "RWin", "matrix": [0, 12], "x": 14.25, "y": 4.1, "w": 1.25},
|
||||
{"label": "Menu", "matrix": [0, 14], "x": 15.5, "y": 4.1, "w": 1.25},
|
||||
{"label": "RCtl", "matrix": [0, 8], "x": 16.75, "y": 4.1, "w": 1.25}
|
||||
]
|
||||
},
|
||||
"LAYOUT_split_bs": {
|
||||
"layout": [
|
||||
{"label": "Esc", "matrix": [0, 0], "x": 0.5, "y": 0.1},
|
||||
{"label": "1", "matrix": [0, 1], "x": 1.5, "y": 0.1},
|
||||
{"label": "2", "matrix": [0, 2], "x": 2.7, "y": 0, "r": 10},
|
||||
{"label": "3", "matrix": [0, 3], "x": 3.7, "y": 0.2, "r": 10},
|
||||
{"label": "4", "matrix": [0, 4], "x": 4.7, "y": 0.4, "r": 10},
|
||||
{"label": "5", "matrix": [0, 5], "x": 5.7, "y": 0.6, "r": 10},
|
||||
{"label": "6", "matrix": [0, 6], "x": 6.7, "y": 0.8, "r": 10},
|
||||
{"label": "7", "matrix": [4, 9], "x": 9.05, "y": 0.7, "r": -10, "rx": 10.05},
|
||||
{"label": "8", "matrix": [4, 10], "x": 10.05, "y": 0.5, "r": -10, "rx": 11.05},
|
||||
{"label": "9", "matrix": [4, 11], "x": 11.05, "y": 0.3, "r": -10, "rx": 12.05},
|
||||
{"label": "0", "matrix": [4, 12], "x": 12.05, "y": 0.1, "r": -10, "rx": 13.05},
|
||||
{"label": "-", "matrix": [4, 13], "x": 13.25, "y": 0.1},
|
||||
{"label": "+", "matrix": [4, 14], "x": 14.25, "y": 0.1},
|
||||
{"label": "`", "matrix": [4, 8], "x": 15.25, "y": 0.1},
|
||||
{"label": "BS", "matrix": [4, 15], "x": 16.25, "y": 0.1},
|
||||
{"label": "Tab", "matrix": [0, 7], "x": 0.25, "y": 1.1, "w": 1.5},
|
||||
{"label": "Q", "matrix": [1, 0], "x": 1.75, "y": 1.1},
|
||||
{"label": "W", "matrix": [1, 1], "x": 2.95, "y": 1.05, "r": 10},
|
||||
{"label": "E", "matrix": [1, 2], "x": 3.95, "y": 1.25, "r": 10},
|
||||
{"label": "R", "matrix": [1, 3], "x": 4.95, "y": 1.45, "r": 10},
|
||||
{"label": "T", "matrix": [1, 4], "x": 5.95, "y": 1.65, "r": 10},
|
||||
{"label": "Y", "matrix": [3, 9], "x": 8.85, "y": 1.75, "r": -10, "rx": 9.85},
|
||||
{"label": "U", "matrix": [3, 10], "x": 9.85, "y": 1.55, "r": -10, "rx": 10.85},
|
||||
{"label": "I", "matrix": [3, 11], "x": 10.85, "y": 1.35, "r": -10, "rx": 11.85},
|
||||
{"label": "O", "matrix": [3, 12], "x": 11.85, "y": 1.15, "r": -10, "rx": 12.85},
|
||||
{"label": "P", "matrix": [3, 13], "x": 13, "y": 1.1},
|
||||
{"label": "[{", "matrix": [3, 14], "x": 14, "y": 1.1},
|
||||
{"label": "]}", "matrix": [3, 15], "x": 15, "y": 1.1},
|
||||
{"label": "\\|", "matrix": [3, 8], "x": 16, "y": 1.1, "w": 1.5},
|
||||
{"label": "Caps", "matrix": [1, 7], "x": 0.15, "y": 2.1, "w": 1.75},
|
||||
{"label": "A", "matrix": [2, 0], "x": 1.9, "y": 2.1},
|
||||
{"label": "S", "matrix": [2, 1], "x": 3.1, "y": 2.1, "r": 10},
|
||||
{"label": "D", "matrix": [2, 2], "x": 4.1, "y": 2.3, "r": 10},
|
||||
{"label": "F", "matrix": [1, 6], "x": 5.1, "y": 2.5, "r": 10},
|
||||
{"label": "G", "matrix": [1, 5], "x": 6.1, "y": 2.7, "r": 10},
|
||||
{"label": "H", "matrix": [2, 9], "x": 9.3, "y": 2.7, "r": -10, "rx": 10.3},
|
||||
{"label": "J", "matrix": [2, 10], "x": 10.3, "y": 2.5, "r": -10, "rx": 11.3},
|
||||
{"label": "K", "matrix": [2, 11], "x": 11.3, "y": 2.3, "r": -10, "rx": 12.3},
|
||||
{"label": "L", "matrix": [2, 12], "x": 12.3, "y": 2.1, "r": -10, "rx": 13.3},
|
||||
{"label": ";:", "matrix": [2, 13], "x": 13.5, "y": 2.1},
|
||||
{"label": "'\"", "matrix": [2, 14], "x": 14.5, "y": 2.1},
|
||||
{"label": "Enter", "matrix": [2, 8], "x": 15.5, "y": 2.1, "w": 2.25},
|
||||
{"label": "Shift", "matrix": [2, 7], "x": 0, "y": 3.1, "w": 2.25},
|
||||
{"label": "Z", "matrix": [3, 1], "x": 2.25, "y": 3.1},
|
||||
{"label": "X", "matrix": [2, 6], "x": 3.45, "y": 3.2, "r": 10},
|
||||
{"label": "C", "matrix": [2, 5], "x": 4.45, "y": 3.4, "r": 10},
|
||||
{"label": "V", "matrix": [2, 4], "x": 5.45, "y": 3.6, "r": 10},
|
||||
{"label": "B", "matrix": [2, 3], "x": 6.45, "y": 3.8, "r": 10},
|
||||
{"label": "b", "matrix": [1, 9], "x": 9.05, "y": 3.8, "r": -10, "rx": 10.05},
|
||||
{"label": "N", "matrix": [1, 10], "x": 10.05, "y": 3.6, "r": -10, "rx": 11.05},
|
||||
{"label": "M", "matrix": [1, 11], "x": 11.05, "y": 3.4, "r": -10, "rx": 12.05},
|
||||
{"label": ",<", "matrix": [1, 12], "x": 12.05, "y": 3.2, "r": -10, "rx": 13.05},
|
||||
{"label": ".>", "matrix": [1, 13], "x": 13.25, "y": 3.1},
|
||||
{"label": "/?", "matrix": [1, 14], "x": 14.25, "y": 3.1},
|
||||
{"label": "RShift", "matrix": [1, 15], "x": 15.25, "y": 3.1, "w": 1.75},
|
||||
{"label": "Fn", "matrix": [1, 8], "x": 17, "y": 3.1},
|
||||
{"label": "Ctrl", "matrix": [3, 7], "x": 0, "y": 4.1, "w": 1.5},
|
||||
{"label": "Alt", "matrix": [3, 5], "x": 2.75, "y": 4.2, "w": 1.5, "r": 11},
|
||||
{"label": "LFn1", "matrix": [3, 4], "x": 4.25, "y": 4.4, "w": 2, "r": 11},
|
||||
{"label": "LFn2", "matrix": [3, 3], "x": 6.25, "y": 4.8, "r": 10},
|
||||
{"label": "Space", "matrix": [0, 10], "x": 9.25, "y": 4.65, "w": 2.75, "r": -11, "rx": 11},
|
||||
{"label": "RAlt", "matrix": [0, 11], "x": 12, "y": 4.4, "w": 1.25, "r": -11, "rx": 12.25},
|
||||
{"label": "RWin", "matrix": [0, 12], "x": 14.25, "y": 4.1, "w": 1.25},
|
||||
{"label": "Menu", "matrix": [0, 14], "x": 15.5, "y": 4.1, "w": 1.25},
|
||||
{"label": "RCtl", "matrix": [0, 8], "x": 16.75, "y": 4.1, "w": 1.25}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"keyboard": "ydkb/mountain",
|
||||
"keymap": "default",
|
||||
"layout": "LAYOUT",
|
||||
"layers": [
|
||||
[
|
||||
"KC_ESC", "KC_1", "KC_2", "KC_3", "KC_4", "KC_5", "KC_6", "KC_7", "KC_8", "KC_9", "KC_0", "KC_MINS", "KC_EQL", "KC_BSPC",
|
||||
"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_RBRC", "KC_BSLS",
|
||||
"KC_CAPS", "KC_A", "KC_S", "KC_D", "KC_F", "KC_G", "KC_H", "KC_J", "KC_K", "KC_L", "KC_SCLN", "KC_QUOT", "KC_ENT",
|
||||
"KC_LSFT", "KC_Z", "KC_X", "KC_C", "KC_V", "KC_B", "KC_B", "KC_N", "KC_M", "KC_COMM", "KC_DOT", "KC_SLSH", "KC_RSFT", "MO(1)",
|
||||
"KC_LCTL", "KC_LALT", "KC_SPC", "KC_LGUI", "KC_SPC", "KC_RALT", "KC_RGUI", "KC_APP", "KC_RCTL"
|
||||
],
|
||||
[
|
||||
"KC_GRV", "KC_F1", "KC_F2", "KC_F3", "KC_F4", "KC_F5", "KC_F6", "KC_F7", "KC_F8", "KC_F9", "KC_F10", "KC_F11", "KC_F12", "KC_DEL",
|
||||
"KC_TRNS", "KC_TRNS", "KC_UP", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_PSCR", "KC_SCRL", "KC_PAUS", "KC_TRNS",
|
||||
"KC_TRNS", "KC_LEFT", "KC_DOWN", "KC_RGHT", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_HOME", "KC_PGUP", "KC_TRNS",
|
||||
"KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_END", "KC_PGDN", "KC_TRNS", "KC_TRNS",
|
||||
"KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"
|
||||
]
|
||||
],
|
||||
"author": "Wraul",
|
||||
"notes": "",
|
||||
"version": 1
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
// Copyright 2023 Mathias Andersson (@Wraul)
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#include "matrix.h"
|
||||
#include "wait.h"
|
||||
|
||||
void pulse_registers(void) {
|
||||
gpio_write_pin_high(B1);
|
||||
asm("nop");
|
||||
gpio_write_pin_low(B1);
|
||||
}
|
||||
|
||||
void matrix_read_mode(void) {
|
||||
gpio_set_pin_input_high(B3);
|
||||
wait_us(5);
|
||||
}
|
||||
|
||||
void matrix_write_mode(void) {
|
||||
gpio_set_pin_output(B3);
|
||||
}
|
||||
|
||||
void reset_registers(void) {
|
||||
matrix_write_mode();
|
||||
for (uint8_t i = 0; i < 40; i++) {
|
||||
gpio_write_pin_high(B3);
|
||||
pulse_registers();
|
||||
}
|
||||
gpio_write_pin_low(B3);
|
||||
pulse_registers();
|
||||
matrix_read_mode();
|
||||
}
|
||||
|
||||
void shift_registers(void) {
|
||||
matrix_write_mode();
|
||||
gpio_write_pin_high(B3);
|
||||
pulse_registers();
|
||||
matrix_read_mode();
|
||||
}
|
||||
|
||||
void matrix_init_custom(void) {
|
||||
gpio_set_pin_output(B1);
|
||||
gpio_set_pin_input_high(B2);
|
||||
gpio_set_pin_output(B3);
|
||||
|
||||
gpio_write_pin_high(B1);
|
||||
gpio_write_pin_high(B3);
|
||||
}
|
||||
|
||||
bool matrix_scan_custom(matrix_row_t current_matrix[]) {
|
||||
bool matrix_has_changed = false;
|
||||
matrix_row_t current_row_value;
|
||||
|
||||
reset_registers();
|
||||
|
||||
for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
|
||||
current_row_value = 0;
|
||||
|
||||
for (uint8_t current_col = 0; current_col < MATRIX_COLS / 2; current_col++) {
|
||||
/* Left hand scan (Bank U1) */
|
||||
if (!gpio_read_pin(B3)) {
|
||||
current_row_value |= (matrix_row_t)1 << current_col;
|
||||
}
|
||||
/* Right hand scan (Bank U2) */
|
||||
if (!gpio_read_pin(B2)) {
|
||||
current_row_value |= (matrix_row_t)1 << (current_col + 8);
|
||||
}
|
||||
shift_registers();
|
||||
}
|
||||
|
||||
if (current_matrix[current_row] != current_row_value) {
|
||||
current_matrix[current_row] = current_row_value;
|
||||
matrix_has_changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
return matrix_has_changed;
|
||||
}
|
|
@ -0,0 +1,227 @@
|
|||
# ydkb/mountain
|
||||
|
||||
![ydkb/mountain](https://i.imgur.com/wUxh5Cfh.jpg)
|
||||
|
||||
An ergo keyboard designed by Wei and sold by [KBDfans](https://kbdfans.com)
|
||||
|
||||
- Keyboard Maintainer: [Wraul](https://github.com/Wraul)
|
||||
- Hardware Supported: The YDKB compatible PCB provided as part of the initial
|
||||
batch sold by KBDfans.
|
||||
initial batch. It is most likely also compatible with the hot-swappable PCB,
|
||||
but this is unverified.
|
||||
- Hardware Availability: [KBDfans](https://kbdfans.com/products/ic-kbdfans-mountain-ergo-keyboard-kit)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make ydkb/mountain:default
|
||||
|
||||
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
|
||||
|
||||
The keyboard comes with a custom Mass Storage Device bootloader and a TMK based firmware from [ydkb.io](https://ydkb.io/).
|
||||
Some more information about the bootloader can be found in the [YDKB
|
||||
documentation](https://ydkb.io/help/#/en/bootloader/msd-bootloader).
|
||||
|
||||
Enter the bootloader in 3 ways:
|
||||
|
||||
- **Bootmagic reset**: Hold down the escape key and plug in the keyboard
|
||||
- **Physical reset button**: The PCB does not have a physical reset button,
|
||||
but it is possible to short the GND and RESET manually. The pins are mapped
|
||||
to two of the unsoldered pads on the controller PCB
|
||||
- **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available
|
||||
|
||||
### Flashing on Linux
|
||||
|
||||
Flashing a firmware can be done on Linux by entering the bootloader and using
|
||||
`dd` as described below.
|
||||
|
||||
The storage device can differ between systems, so make sure to specify the correct device.
|
||||
To list available devices `lsblk` can be used.
|
||||
|
||||
```
|
||||
dd if=./ydkb_mountain_{LAYOUT}.bin of=/dev/sd{X} seek=4 && sync
|
||||
```
|
||||
|
||||
When flashing using this method I have at multiple times encountered some form
|
||||
of corruption. Once this happens, further flash attempts will silently fail.
|
||||
|
||||
I was able to fix the corruption by switching to Windows and doing the flash using
|
||||
the file explorer. Make sure to first remove the existing `.bin` file before
|
||||
adding the new firmware file to the mounted drive.
|
||||
|
||||
## Matrix
|
||||
|
||||
The matrix of this keyboard is a bit unusual. Not only is the PCB split into two
|
||||
halves, it uses multiple 74HC595 bit shift registers to scan each key
|
||||
individually.
|
||||
|
||||
The 74HC595 bit shift registers appears to be some kind of off-brand version
|
||||
that uses open-drain outputs instead of the expected push-pull output.
|
||||
|
||||
The chips are marked with the following
|
||||
|
||||
```
|
||||
SM74HC595A
|
||||
BRAFUJDB13
|
||||
```
|
||||
|
||||
### Pins
|
||||
|
||||
The following two pins are used to control the 74HC595 bit shift registers.
|
||||
|
||||
| ATmega Pin | 74HC595 Pin |
|
||||
| ---------- | ----------- |
|
||||
| `B1` | `SRCLK` |
|
||||
| `B3` | `SER` |
|
||||
|
||||
The following two pins are used to read the state of the matrix.
|
||||
|
||||
| ATmega Pin | Function |
|
||||
| ---------- | ---------- |
|
||||
| `B2` | Right half |
|
||||
| `B3` | Left half |
|
||||
|
||||
As shown above the pin `B3` is used both to control the 74HC595 and to read the
|
||||
state of the matrix. Thus it has to be switch between output and input modes
|
||||
between the two phases.
|
||||
|
||||
### 74HC595 Bit Shift Registers
|
||||
|
||||
The PCB uses two banks of 74HC595 bit shift registers. The two banks are set up
|
||||
in parallel.
|
||||
|
||||
#### Bank U1
|
||||
|
||||
Bank U1 is responsible for the left half of the board.
|
||||
This bank consists of 4 74HC595 chips for a total of 32 bits.
|
||||
|
||||
The chips are linked in the following order
|
||||
|
||||
`U10 -> U11 -> U12 -> U13`
|
||||
|
||||
##### U10
|
||||
|
||||
| Chip Bit | Bank Bit | Key |
|
||||
| -------- | -------- | --- |
|
||||
| 0 | 0 | Esc |
|
||||
| 1 | 1 | 1 |
|
||||
| 2 | 2 | 2 |
|
||||
| 3 | 3 | 3 |
|
||||
| 4 | 4 | 4 |
|
||||
| 5 | 5 | 5 |
|
||||
| 6 | 6 | 6 |
|
||||
| 7 | 7 | Tab |
|
||||
|
||||
##### U11
|
||||
|
||||
| Chip Bit | Bank Bit | Key |
|
||||
| -------- | -------- | ---- |
|
||||
| 0 | 8 | Q |
|
||||
| 1 | 9 | W |
|
||||
| 2 | 10 | E |
|
||||
| 3 | 11 | R |
|
||||
| 4 | 12 | T |
|
||||
| 5 | 13 | G |
|
||||
| 6 | 14 | F |
|
||||
| 7 | 15 | Caps |
|
||||
|
||||
##### U12
|
||||
|
||||
| Chip Bit | Bank Bit | Key |
|
||||
| -------- | -------- | ----- |
|
||||
| 0 | 16 | A |
|
||||
| 1 | 17 | S |
|
||||
| 2 | 18 | D |
|
||||
| 3 | 19 | B |
|
||||
| 4 | 20 | V |
|
||||
| 5 | 21 | C |
|
||||
| 6 | 22 | X |
|
||||
| 7 | 23 | Shift |
|
||||
|
||||
##### U13
|
||||
|
||||
| Chip Bit | Bank Bit | Key |
|
||||
| -------- | -------- | ---- |
|
||||
| 0 | 24 | |
|
||||
| 1 | 25 | Z |
|
||||
| 2 | 26 | |
|
||||
| 3 | 27 | LFn2 |
|
||||
| 4 | 28 | LFn1 |
|
||||
| 5 | 29 | Alt |
|
||||
| 6 | 30 | |
|
||||
| 7 | 31 | Ctrl |
|
||||
|
||||
#### Bank U2
|
||||
|
||||
Bank U2 is responsible for the right half of the board.
|
||||
This bank consists of 5 74HC595 chips for a total of 40 bits.
|
||||
|
||||
The chips are linked in the following order
|
||||
|
||||
`U24 -> U23 -> U22 -> U21 -> U20`
|
||||
|
||||
##### U24
|
||||
|
||||
| Chip Bit | Bank Bit | Key |
|
||||
| -------- | -------- | ----- |
|
||||
| 0 | 0 | RCtrl |
|
||||
| 1 | 1 | |
|
||||
| 2 | 2 | Space |
|
||||
| 3 | 3 | RAlt |
|
||||
| 4 | 4 | RWin |
|
||||
| 5 | 5 | |
|
||||
| 6 | 6 | Menu |
|
||||
| 7 | 7 | |
|
||||
|
||||
##### U23
|
||||
|
||||
| Chip Bit | Bank Bit | Key |
|
||||
| -------- | -------- | ------ |
|
||||
| 0 | 8 | Fn |
|
||||
| 1 | 9 | b |
|
||||
| 2 | 10 | N |
|
||||
| 3 | 11 | M |
|
||||
| 4 | 12 | ,< |
|
||||
| 5 | 13 | .> |
|
||||
| 6 | 14 | /? |
|
||||
| 7 | 15 | RShift |
|
||||
|
||||
##### U22
|
||||
|
||||
| Chip Bit | Bank Bit | Key |
|
||||
| -------- | -------- | ----- |
|
||||
| 0 | 16 | Enter |
|
||||
| 1 | 17 | H |
|
||||
| 2 | 18 | J |
|
||||
| 3 | 19 | K |
|
||||
| 4 | 20 | L |
|
||||
| 5 | 21 | ;: |
|
||||
| 6 | 22 | '" |
|
||||
| 7 | 23 | |
|
||||
|
||||
##### U21
|
||||
|
||||
| Chip Bit | Bank Bit | Key |
|
||||
| -------- | -------- | --- |
|
||||
| 0 | 24 | \ |
|
||||
| 1 | 25 | Y |
|
||||
| 2 | 26 | U |
|
||||
| 3 | 27 | I |
|
||||
| 4 | 28 | O |
|
||||
| 5 | 29 | P |
|
||||
| 6 | 30 | [{ |
|
||||
| 7 | 31 | ]} |
|
||||
|
||||
##### U20
|
||||
|
||||
| Chip Bit | Bank Bit | Key |
|
||||
| -------- | -------- | --- |
|
||||
| 0 | 32 | BS |
|
||||
| 1 | 33 | 7 |
|
||||
| 2 | 34 | 8 |
|
||||
| 3 | 35 | 9 |
|
||||
| 4 | 36 | 0 |
|
||||
| 5 | 37 | - |
|
||||
| 6 | 38 | + |
|
||||
| 7 | 39 | BS2 |
|
|
@ -0,0 +1,4 @@
|
|||
F_CPU = 8000000
|
||||
|
||||
CUSTOM_MATRIX = lite
|
||||
SRC += matrix.c
|
Loading…
Reference in New Issue