mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-11-21 19:09:25 +00:00
Merge 7f24d37bd0
into 9bea332a21
This commit is contained in:
commit
25f798772f
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
|
Loading…
Reference in New Issue
Block a user