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

Add ErgoStrafer keyboard #21195

Merged
merged 4 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions keyboards/custommk/ergostrafer/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2023 customMK
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

// FRAM configuration
#define EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN B7
#define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR 4 // 48MHz / 4 = 12MHz; max supported by MB85R64 is 20MHz

// SPI configuration
#define SPI_DRIVER SPID1
#define SPI_SCK_PIN B3
#define SPI_SCK_PAL_MODE 5
#define SPI_MOSI_PIN B5
#define SPI_MOSI_PAL_MODE 5
#define SPI_MISO_PIN B4
#define SPI_MISO_PAL_MODE 5

#define TAP_CODE_DELAY 10

// Audio configuration
#define AUDIO_PIN B8
#define AUDIO_PWM_DRIVER PWMD4
#define AUDIO_PWM_CHANNEL 3
#define AUDIO_PWM_PAL_MODE 2
#define AUDIO_STATE_TIMER GPTD5
20 changes: 20 additions & 0 deletions keyboards/custommk/ergostrafer/ergostrafer.h
infinityis marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* Copyright 2023 customMK
*
* 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

#include "quantum.h"
#include "keycodes.h"
30 changes: 30 additions & 0 deletions keyboards/custommk/ergostrafer/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* Copyright 2023 customMK
*
* 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

#define HAL_USE_PWM TRUE

#define HAL_USE_SPI TRUE

#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD

#define SERIAL_BUFFERS_SIZE 256

// This enables interrupt-driven mode
#define SPI_USE_WAIT TRUE

#include_next <halconf.h>
82 changes: 82 additions & 0 deletions keyboards/custommk/ergostrafer/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"manufacturer": "customMK",
"keyboard_name": "ErgoStrafer",
"maintainer": "customMK",
"bootloader": "stm32-dfu",
"diode_direction": "ROW2COL",
"features": {
"bootmagic": true,
"command": false,
"console": false,
"extrakey": true,
"mousekey": true,
"nkro": true,
"encoder": true
infinityis marked this conversation as resolved.
Show resolved Hide resolved
},
"matrix_pins": {
"cols": ["B0", "A1", "A2", "A3", "A6", "B6", "B10"],
"rows": ["C13", "C14", "C15", "B1", "A7", "A5"]
},
"processor": "STM32F411",
"url": "https://shop.custommk.com/collections/ergostrafer/products/ergostrafer",
"usb": {
"device_version": "1.0.0",
"pid": "0xFAB8",
"vid": "0xF35B"
},
"layouts": {
"LAYOUT": {
"layout": [
{ "matrix": [0, 0], "label":"F9", "x":7.5, "y":0 },
{ "matrix": [0, 1], "label":"7", "x":1.5, "y":1.25 },
{ "matrix": [0, 2], "label":"8", "x":2.5, "y":1.25 },
{ "matrix": [0, 3], "label":"9", "x":3.5, "y":1.25 },
{ "matrix": [0, 4], "label":"0", "x":4.5, "y":1.25 },
{ "matrix": [0, 5], "label":"-", "x":5.5, "y":1.25 },
{ "matrix": [0, 6], "label":"T", "x":7.25, "y":3.25, "w":1.5 },

{ "matrix": [1, 0], "label":"PrtScr", "x":7.5, "y":1 },
{ "matrix": [1, 1], "label":"1", "x":1, "y":2.25 },
{ "matrix": [1, 2], "label":"2", "x":2, "y":2.25 },
{ "matrix": [1, 3], "label":"3", "x":3, "y":2.25 },
{ "matrix": [1, 4], "label":"5", "x":5, "y":2.25 },
{ "matrix": [1, 5], "label":"6", "x":6, "y":2.25 },
{ "matrix": [1, 6], "label":"G", "x":7.25, "y":4.25, "w":1.5 },

{ "matrix": [2, 0], "label":"F5", "x":7.5, "y":2 },
{ "matrix": [2, 1], "label":"Tab", "x":1, "y":3.5 },
{ "matrix": [2, 2], "label":"Q", "x":2.5, "y":3.4 },
{ "matrix": [2, 3], "label":"4", "x":4, "y":2.25 },
{ "matrix": [2, 4], "label":"E", "x":4.5, "y":3.4 },
{ "matrix": [2, 5], "label":"R", "x":6, "y":3.3 },
{ "matrix": [2, 6], "label":"B", "x":6.5, "y":5.75, "w":1.5 },

{ "matrix": [3, 0], "label":"Caps Lock", "x":0, "y":3.5 },
{ "matrix": [3, 1], "label":"L Alt", "x":0.25, "y":4.75, "w":1.5 },
{ "matrix": [3, 2], "label":"A", "x":2.5, "y":4.5 },
{ "matrix": [3, 3], "label":"W", "x":3.5, "y":3.4 },
{ "matrix": [3, 4], "label":"D", "x":4.5, "y":4.5 },
{ "matrix": [3, 5], "label":"F", "x":6, "y":4.3 },
{ "matrix": [3, 6], "label":"P", "x":8, "y":5.75 },

{ "matrix": [4, 1], "label":"L Shift", "x":0.25, "y":5.75, "w":1.5 },
{ "matrix": [4, 2], "label":"Z", "x":2.5, "y":5.6 },
{ "matrix": [4, 3], "label":"S", "x":3.5, "y":4.5 },
{ "matrix": [4, 5], "label":"V", "x":5, "y":5.75, "w":1.5 },
{ "matrix": [4, 6], "label":"Space", "x":6.5, "y":6.85, "w":1.75 }

{ "matrix": [5, 1], "label":"L Ctrl Duck", "x":0.25, "y":6.75, "w":1.5 },
{ "matrix": [5, 3], "label":"X", "x":3.5, "y":5.6 },
{ "matrix": [5, 5], "label":"C", "x":4.75, "y":6.85, "w":1.75 },
{ "matrix": [5, 6], "label":"L Ctrl", "x":9.5, "y":5.75 }
]
}
},
"encoder": {
"rotary": [
{ "pin_a": "A8", "pin_b": "A4"},
{ "pin_a": "B12", "pin_b": "B14"},
{ "pin_a": "B15", "pin_b": "A15"}
]
}
}
21 changes: 21 additions & 0 deletions keyboards/custommk/ergostrafer/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 2023 customMK
// SPDX-License-Identifier: GPL-2.0-or-later

#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
KC_F9, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_T,
KC_PSCR, KC_1, KC_2, KC_3, KC_5, KC_6, KC_G,
KC_F5, KC_TAB, KC_Q, KC_4, KC_E, KC_R, KC_B,
KC_CAPS, KC_LALT, KC_A, KC_W, KC_D, KC_F, KC_P,
KC_LSFT, KC_Z, KC_S, KC_V, KC_SPC,
KC_LCTL, KC_X, KC_C, KC_LCTL
)
};

#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }
};
#endif
1 change: 1 addition & 0 deletions keyboards/custommk/ergostrafer/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ENCODER_MAP_ENABLE = yes
13 changes: 13 additions & 0 deletions keyboards/custommk/ergostrafer/keymaps/via/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright 2023 customMK
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

// With 8k FRAM, max out dynamic keymap layers and macros
// 7x6 matrix (84 bytes) and three encoders (12 bytes) consume 96 bytes per layer
// 32 layers consumes 3072 bytes
#define DYNAMIC_KEYMAP_LAYER_COUNT 32

// Most of the remaining space can be used for macros
// QMK Macro keycode range allows up to 128 macros
#define DYNAMIC_KEYMAP_MACRO_COUNT 128
21 changes: 21 additions & 0 deletions keyboards/custommk/ergostrafer/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 2023 customMK
// SPDX-License-Identifier: GPL-2.0-or-later

#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
KC_F9, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_T,
KC_PSCR, KC_1, KC_2, KC_3, KC_5, KC_6, KC_G,
KC_F5, KC_TAB, KC_Q, KC_4, KC_E, KC_R, KC_B,
KC_CAPS, KC_LALT, KC_A, KC_W, KC_D, KC_F, KC_P,
KC_LSFT, KC_Z, KC_S, KC_V, KC_SPC,
KC_LCTL, KC_X, KC_C, KC_LCTL
)
};

//#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }
};
//#endif
2 changes: 2 additions & 0 deletions keyboards/custommk/ergostrafer/keymaps/via/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes
27 changes: 27 additions & 0 deletions keyboards/custommk/ergostrafer/mcuconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* Copyright 2023 customMK
*
* 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

#include_next <mcuconf.h>

// Used for audio (?)
#undef STM32_PWM_USE_TIM4 //timer 4 channel ?
infinityis marked this conversation as resolved.
Show resolved Hide resolved
#define STM32_PWM_USE_TIM4 TRUE

// Used for FRAM
#undef STM32_SPI_USE_SPI1
#define STM32_SPI_USE_SPI1 TRUE
23 changes: 23 additions & 0 deletions keyboards/custommk/ergostrafer/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# ergostrafer

![ergostrafer](https://i.imgur.com/ncJgD3j.jpeg)
infinityis marked this conversation as resolved.
Show resolved Hide resolved

ErgoStrafer is a gaming mechanical keyboard that reproduces the layout of the discontinued SteelSeries Merc Stealth a.k.a. Zboard.

* Keyboard Maintainer: [customMK](https://github.com/customMK)
* Hardware Supported: ErgoStrafer
* Hardware Availability: [customMK](https://shop.custommk.com/collections/ergostrafer/products/ergostrafer)

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

make custommk/ergostrafer:default
infinityis marked this conversation as resolved.
Show resolved Hide resolved

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 (the "Load" key in the top right corner) and plug in the keyboard
* **Physical reset button**: Briefly press the button on the back of the PCB
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available
4 changes: 4 additions & 0 deletions keyboards/custommk/ergostrafer/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
EEPROM_DRIVER = spi

AUDIO_ENABLE = yes # Audio output
infinityis marked this conversation as resolved.
Show resolved Hide resolved
AUDIO_DRIVER = pwm_hardware