mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-11-22 03:19:24 +00:00
Compare commits
28 Commits
bd4d23bd37
...
25f798772f
Author | SHA1 | Date | |
---|---|---|---|
|
25f798772f | ||
|
9bea332a21 | ||
|
8cbcdcac62 | ||
|
7f24d37bd0 | ||
|
94cb0f5d52 | ||
|
9372b64053 | ||
|
1bab176d34 | ||
|
e893ffc4e2 | ||
|
a02afe1325 | ||
|
35752bf3b9 | ||
|
f3a49bfa4e | ||
|
84501d402c | ||
|
b02e5ef704 | ||
|
9c1107a9e8 | ||
|
1b33602a75 | ||
|
4427654f82 | ||
|
64d0472b34 | ||
|
8376687e8d | ||
|
44b44fe738 | ||
|
2176bdbbc1 | ||
|
6018ccbe55 | ||
|
027bfb62dc | ||
|
59417f834d | ||
|
de2be95e25 | ||
|
582f97a2b4 | ||
|
6881a52206 | ||
|
fe6f784a18 | ||
|
0ac27d516b |
29
keyboards/sthlmkb/storre/config.h
Normal file
29
keyboards/sthlmkb/storre/config.h
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
Copyright 2024 mohoyt
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 6
|
||||
#define MATRIX_COLS 16
|
||||
#define MATRIX_MUX_COLS 4
|
||||
|
||||
#define MATRIX_ROW_PINS { D2, B6, B2, B3, B1, F7 }
|
||||
#define MATRIX_COL_PINS { }
|
||||
#define MATRIX_COL_MUX_PINS { D7, E6, B4, B5 }
|
||||
|
1275
keyboards/sthlmkb/storre/keyboard.json
Normal file
1275
keyboards/sthlmkb/storre/keyboard.json
Normal file
File diff suppressed because it is too large
Load Diff
43
keyboards/sthlmkb/storre/keymaps/default/keymap.c
Normal file
43
keyboards/sthlmkb/storre/keymaps/default/keymap.c
Normal file
@ -0,0 +1,43 @@
|
||||
/* Copyright 2024 mohoyt
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT_all(
|
||||
KC_MPLY, KC_MUTE,
|
||||
KC_ESC, 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_F13,
|
||||
KC_GRV, 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_DEL, KC_HOME,
|
||||
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_END,
|
||||
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_NUHS, KC_ENT, KC_PGUP,
|
||||
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT ),
|
||||
|
||||
[1] = LAYOUT_all(
|
||||
_______, _______,
|
||||
QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ),
|
||||
};
|
||||
|
||||
#if defined(ENCODER_MAP_ENABLE)
|
||||
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
|
||||
[0] = { ENCODER_CCW_CW(KC_MPRV, KC_MNXT), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
|
||||
[1] = { ENCODER_CCW_CW(KC_MPRV, KC_MNXT), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }
|
||||
};
|
||||
#endif
|
1
keyboards/sthlmkb/storre/keymaps/default/rules.mk
Normal file
1
keyboards/sthlmkb/storre/keymaps/default/rules.mk
Normal file
@ -0,0 +1 @@
|
||||
ENCODER_MAP_ENABLE = yes
|
95
keyboards/sthlmkb/storre/matrix.c
Normal file
95
keyboards/sthlmkb/storre/matrix.c
Normal file
@ -0,0 +1,95 @@
|
||||
/* Copyright 2024 mohoyt
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "matrix.h"
|
||||
|
||||
#define COL_SHIFTER ((uint32_t)1)
|
||||
|
||||
// Column pins
|
||||
static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
||||
static const uint8_t col_pins[MATRIX_MUX_COLS] = MATRIX_COL_MUX_PINS;
|
||||
|
||||
// Internal functions
|
||||
|
||||
static void init_pins(void) {
|
||||
// Set cols to outputs, low
|
||||
for (uint8_t pin = 0; pin < MATRIX_MUX_COLS; pin++) {
|
||||
gpio_set_pin_output(col_pins[pin]);
|
||||
}
|
||||
|
||||
// Unselect cols
|
||||
for (uint8_t bit = 0; bit < MATRIX_MUX_COLS; bit++) {
|
||||
gpio_write_pin_low(col_pins[bit]);
|
||||
}
|
||||
|
||||
// Set rows to input, pullup
|
||||
for (uint8_t pin = 0; pin < MATRIX_ROWS; pin++) {
|
||||
gpio_set_pin_input_high(row_pins[pin]);
|
||||
}
|
||||
}
|
||||
|
||||
static void select_col(uint8_t col)
|
||||
{
|
||||
for (uint8_t bit = 0; bit < MATRIX_MUX_COLS; bit++) {
|
||||
uint8_t state = (col & (0b1 << bit)) >> bit;
|
||||
gpio_write_pin(col_pins[bit], state);
|
||||
}
|
||||
}
|
||||
|
||||
static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
|
||||
{
|
||||
bool matrix_changed = false;
|
||||
select_col(current_col);
|
||||
wait_us(5);
|
||||
|
||||
// Read each row sequentially
|
||||
for(uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++)
|
||||
{
|
||||
matrix_row_t last_row_value = current_matrix[row_index];
|
||||
|
||||
if (!gpio_read_pin(row_pins[row_index]))
|
||||
{
|
||||
current_matrix[row_index] |= (COL_SHIFTER << current_col);
|
||||
}
|
||||
else
|
||||
{
|
||||
current_matrix[row_index] &= ~(COL_SHIFTER << current_col);
|
||||
}
|
||||
|
||||
if ((last_row_value != current_matrix[row_index]) && !(matrix_changed))
|
||||
{
|
||||
matrix_changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
return matrix_changed;
|
||||
}
|
||||
|
||||
// Matrix scan functions
|
||||
|
||||
void matrix_init_custom(void) {
|
||||
init_pins();
|
||||
}
|
||||
|
||||
bool matrix_scan_custom(matrix_row_t current_matrix[]) {
|
||||
bool changed = false;
|
||||
|
||||
//Set col, read rows
|
||||
for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
|
||||
changed |= read_rows_on_col(current_matrix, current_col);
|
||||
}
|
||||
|
||||
return (uint8_t)changed;
|
||||
}
|
26
keyboards/sthlmkb/storre/readme.md
Normal file
26
keyboards/sthlmkb/storre/readme.md
Normal file
@ -0,0 +1,26 @@
|
||||
# storre
|
||||
|
||||
![Storre](https://i.imgur.com/xxb9p5yh.jpeg)
|
||||
|
||||
Större is an easy to build 75%ish keyboard using only through hole components. It utilises a Pro Micro footprint development board to enable flexible connectivity and simplify the soldering experience (no more tricksy USB ports).
|
||||
|
||||
* Keyboard Maintainer: [mohoyt](https://github.com/mohoyt)
|
||||
* Hardware Supported: större, development board with Pro Micro footprint (e.g. Pro Micro, Elite-C, Nice!Nano, SparkFun Pro Micro RP2040)
|
||||
* Hardware Availability: [sthlm kb](https://sthlmkb.com)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make sthlmkb/storre:default
|
||||
|
||||
Flashing example for this keyboard:
|
||||
|
||||
make sthlmkb/storre: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 2 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
|
||||
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available
|
2
keyboards/sthlmkb/storre/rules.mk
Normal file
2
keyboards/sthlmkb/storre/rules.mk
Normal file
@ -0,0 +1,2 @@
|
||||
CUSTOM_MATRIX = lite
|
||||
SRC += matrix.c
|
50
keyboards/sthlmkb/storre/storre.c
Normal file
50
keyboards/sthlmkb/storre/storre.c
Normal file
@ -0,0 +1,50 @@
|
||||
/* Copyright 2024 mohoyt
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "quantum.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(KC_MNXT);
|
||||
} else {
|
||||
tap_code(KC_MPRV);
|
||||
}
|
||||
} else if (index == 1) {
|
||||
if (clockwise) {
|
||||
tap_code_delay(KC_VOLU, 10);
|
||||
} else {
|
||||
tap_code_delay(KC_VOLD, 10);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
bool oled_task_kb(void) {
|
||||
if (!oled_task_user()) {
|
||||
return false;
|
||||
}
|
||||
led_t led_state = host_keyboard_led_state();
|
||||
oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
|
||||
oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
|
||||
oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
@ -1,5 +1,6 @@
|
||||
"""This script automates the copying of the default keymap into your own keymap.
|
||||
"""
|
||||
import re
|
||||
import shutil
|
||||
|
||||
from milc import cli
|
||||
@ -13,6 +14,13 @@ from qmk.keyboard import keyboard_completer, keyboard_folder
|
||||
from qmk.userspace import UserspaceDefs
|
||||
|
||||
|
||||
def validate_keymap_name(name):
|
||||
"""Returns True if the given keymap name contains only a-z, 0-9 and underscore characters.
|
||||
"""
|
||||
regex = re.compile(r'^[a-zA-Z0-9][a-zA-Z0-9_]+$')
|
||||
return bool(regex.match(name))
|
||||
|
||||
|
||||
def prompt_keyboard():
|
||||
prompt = """{fg_yellow}Select Keyboard{style_reset_all}
|
||||
If you`re unsure you can view a full list of supported keyboards with {fg_yellow}qmk list-keyboards{style_reset_all}.
|
||||
@ -60,6 +68,10 @@ def new_keymap(cli):
|
||||
cli.log.error(f'Default keymap {{fg_cyan}}{keymap_path_default}{{fg_reset}} does not exist!')
|
||||
return False
|
||||
|
||||
if not validate_keymap_name(user_name):
|
||||
cli.log.error('Keymap names must contain only {fg_cyan}a-z{fg_reset}, {fg_cyan}0-9{fg_reset} and {fg_cyan}_{fg_reset}! Please choose a different name.')
|
||||
return False
|
||||
|
||||
if keymap_path_new.exists():
|
||||
cli.log.error(f'Keymap {{fg_cyan}}{user_name}{{fg_reset}} already exists! Please choose a different name.')
|
||||
return False
|
||||
|
@ -29,6 +29,7 @@ def _convert_macros(via_macros):
|
||||
if len(via_macros) == 0:
|
||||
return list()
|
||||
split_regex = re.compile(r'(}\,)|(\,{)')
|
||||
macro_group_regex = re.compile(r'({.+?})')
|
||||
macros = list()
|
||||
for via_macro in via_macros:
|
||||
# Split VIA macro to its elements
|
||||
@ -38,13 +39,28 @@ def _convert_macros(via_macros):
|
||||
macro_data = list()
|
||||
for m in macro:
|
||||
if '{' in m or '}' in m:
|
||||
# Found keycode(s)
|
||||
keycodes = m.split(',')
|
||||
# Remove whitespaces and curly braces from around keycodes
|
||||
keycodes = list(map(lambda s: s.strip(' {}'), keycodes))
|
||||
# Remove the KC prefix
|
||||
keycodes = list(map(lambda s: s.replace('KC_', ''), keycodes))
|
||||
macro_data.append({"action": "tap", "keycodes": keycodes})
|
||||
# Split macro groups
|
||||
macro_groups = macro_group_regex.findall(m)
|
||||
for macro_group in macro_groups:
|
||||
# Remove whitespaces and curly braces from around group
|
||||
macro_group = macro_group.strip(' {}')
|
||||
|
||||
macro_action = 'tap'
|
||||
macro_keycodes = []
|
||||
|
||||
if macro_group[0] == '+':
|
||||
macro_action = 'down'
|
||||
macro_keycodes.append(macro_group[1:])
|
||||
elif macro_group[0] == '-':
|
||||
macro_action = 'up'
|
||||
macro_keycodes.append(macro_group[1:])
|
||||
else:
|
||||
macro_keycodes.extend(macro_group.split(',') if ',' in macro_group else [macro_group])
|
||||
|
||||
# Remove the KC prefixes
|
||||
macro_keycodes = list(map(lambda s: s.replace('KC_', ''), macro_keycodes))
|
||||
|
||||
macro_data.append({"action": macro_action, "keycodes": macro_keycodes})
|
||||
else:
|
||||
# Found text
|
||||
macro_data.append(m)
|
||||
@ -54,13 +70,13 @@ def _convert_macros(via_macros):
|
||||
|
||||
|
||||
def _fix_macro_keys(keymap_data):
|
||||
macro_no = re.compile(r'MACRO0?([0-9]{1,2})')
|
||||
macro_no = re.compile(r'MACRO0?\(([0-9]{1,2})\)')
|
||||
for i in range(0, len(keymap_data)):
|
||||
for j in range(0, len(keymap_data[i])):
|
||||
kc = keymap_data[i][j]
|
||||
m = macro_no.match(kc)
|
||||
if m:
|
||||
keymap_data[i][j] = f'MACRO_{m.group(1)}'
|
||||
keymap_data[i][j] = f'MC_{m.group(1)}'
|
||||
return keymap_data
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user