Skip to content

Commit

Permalink
Durgod K310/K320 Refactor (qmk#18224)
Browse files Browse the repository at this point in the history
  • Loading branch information
noroadsleft authored and ramonimbao committed Nov 28, 2022
1 parent bcf3d82 commit f14a376
Show file tree
Hide file tree
Showing 55 changed files with 492 additions and 390 deletions.
56 changes: 56 additions & 0 deletions keyboards/durgod/k310/base/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/* Copyright 2021 kuenhlee, Don Kjer, Tyler Tidman
* Copyright 2021 Simon Arlott
*
* 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 "config_common.h"

#define WAIT_US_TIMER GPTD3

/* key matrix size */
#define MATRIX_ROWS 8
#define MATRIX_COLS 16

#define MATRIX_ROW_PINS { A0, A1, A2, A3, A4, A5, A6, A7 }
#define MATRIX_COL_PINS { C4, C5, B0, B1, B2, B10, B11, B12, B13, B14, B15, C6, C7, C10, C11, C12 }

/* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION ROW2COL

// Dynamic EEPROM
// Something sensible or else VIA may crash
// Users may enable more if they wish
#define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 4095

/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5

/* Bootmagic Lite key configuration */
#define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE
#define BOOTMAGIC_LITE_ROW 0
#define BOOTMAGIC_LITE_COLUMN 0

/* LED indicator pins */
#define LED_NUM_LOCK_PIN C8
#define LED_CAPS_LOCK_PIN C9
#define LED_SCROLL_LOCK_PIN A8
#define LED_WIN_LOCK_PIN A9
#define LED_MR_LOCK_PIN A10
#define LED_PIN_ON_STATE 0

/* Original hardware "reset" button on pin D2 */
#define HARDWARE_RESET_PIN D2
6 changes: 0 additions & 6 deletions keyboards/durgod/k310/base/readme.md

This file was deleted.

24 changes: 23 additions & 1 deletion keyboards/durgod/k310/base/rules.mk
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
DEFAULT_FOLDER=durgod/k3x0/k310/base
# MCU name
# Actually F070, but close enough
MCU = STM32F072
BOARD = DURGOD_STM32_F070

# Bootloader selection
BOOTLOADER = stm32-dfu

# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = no # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = yes # Enable N-Key Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
LTO_ENABLE = yes

LAYOUTS = fullsize_ansi fullsize_iso
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "k3x0.h"
#include "k310.h"
#include <ch.h>
#include <hal.h>

Expand Down
22 changes: 22 additions & 0 deletions keyboards/durgod/k3x0/k310/k310.h → keyboards/durgod/k310/k310.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

#pragma once

#include "quantum.h"

#define XXX KC_NO

// This a shortcut to help you visually see your layout.
Expand Down Expand Up @@ -76,3 +78,23 @@
{ XXX, XXX, XXX, XXX, XXX, XXX, XXX, K77, K78, K79, K7A, K7B, K7C, K7D, K7E, K7F } \
}


#ifndef WINLOCK_DISABLED
// Define the TGUI key here so it is available in QMK configurator
enum K3x0_keycodes {
#ifdef VIA_ENABLE
KC_TGUI = USER00, // Toggle between GUI Lock or Unlock
NEW_SAFE_RANGE = SAFE_RANGE
#else
KC_TGUI = SAFE_RANGE, // Toggle between GUI Lock or Unlock
NEW_SAFE_RANGE
#endif
};

#undef SAFE_RANGE
#define SAFE_RANGE NEW_SAFE_RANGE
#endif /* WINLOCK_DISABLED */

/* Function Prototype */
void off_all_leds(void);
void on_all_leds(void);
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"keyboard": "durgod/k3x0",
"keyboard": "durgod/k310/base",
"keymap": "default",
"layout": "LAYOUT_all",
"layers": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"keyboard": "durgod/k3x0",
"keyboard": "durgod/k310/base",
"keymap": "default_mac",
"layout": "LAYOUT_all",
"layers": [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
29 changes: 27 additions & 2 deletions keyboards/durgod/k310/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
# K310
# Taurus K310

See: [K310](../k3x0/k310/readme.md)
This code is shared between all K310 variants. Currently only the base model with no backlight is supported.

This is a standard off-the-shelf Durgod Taurus K310 full-sized 104/105-key
keyboard without backlight. This supports both the ANSI and ISO variants.

* Keyboard Maintainers: [dkjer](https://github.com/dkjer) and [tylert](https://github.com/tylert)
* Hardware Supported: [Durgod Taurus K310 board with STM32F070RBT6](https://www.durgod.com/page9?product_id=53&_l=en "Durgod.com Product Page")
* Hardware Availability: [Amazon.com](https://www.amazon.com/Durgod-Taurus-K310-Mechanical-Keyboard/dp/B07TXB4XF3)

## Instructions

### Build

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

make durgod/k310/base:default

Flashing example for this keyboard:

make durgod/k310/base: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).

### Initial Flash

Instructions for Flashing from initial Stock Firmware:
* [Initial Flashing](../k3x0/readme.md#initial-flash)
1 change: 0 additions & 1 deletion keyboards/durgod/k310/rules.mk

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@

#define WAIT_US_TIMER GPTD3

/* key matrix size (rows in specific keyboard variant) */
/* key matrix size */
#define MATRIX_ROWS 7
#define MATRIX_COLS 16

#define MATRIX_ROW_PINS { A0, A1, A2, A3, A4, A5, A6 }
#define MATRIX_COL_PINS { C4, C5, B0, B1, B2, B10, B11, B12, B13, B14, B15, C6, C7, C10, C11, C12 }

/* COL2ROW, ROW2COL*/
Expand Down
6 changes: 0 additions & 6 deletions keyboards/durgod/k320/base/readme.md

This file was deleted.

24 changes: 23 additions & 1 deletion keyboards/durgod/k320/base/rules.mk
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
DEFAULT_FOLDER=durgod/k3x0/k320/base
# MCU name
# Actually F070, but close enough
MCU = STM32F072
BOARD = DURGOD_STM32_F070

# Bootloader selection
BOOTLOADER = stm32-dfu

# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = no # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = yes # Enable N-Key Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
LTO_ENABLE = yes

LAYOUTS = tkl_ansi tkl_iso
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2021 Don Kjer
/* Copyright 2021 Simon Arlott
*
* 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
Expand All @@ -16,4 +16,9 @@

#pragma once

#include "config_common.h"
#define HAL_USE_PAL TRUE
#define PAL_USE_CALLBACKS TRUE

#define HAL_USE_GPT TRUE

#include_next <halconf.h>
Original file line number Diff line number Diff line change
Expand Up @@ -202,104 +202,6 @@
{ "label": "\u2192", "x": 17.25, "y": 5.5 }
]
},
"LAYOUT_tkl": {
"layout": [
{ "label": "Esc", "x": 0, "y": 0 },
{ "label": "F1", "x": 2, "y": 0 },
{ "label": "F2", "x": 3, "y": 0 },
{ "label": "F3", "x": 4, "y": 0 },
{ "label": "F4", "x": 5, "y": 0 },
{ "label": "F5", "x": 6.5, "y": 0 },
{ "label": "F6", "x": 7.5, "y": 0 },
{ "label": "F7", "x": 8.5, "y": 0 },
{ "label": "F8", "x": 9.5, "y": 0 },
{ "label": "F9", "x": 11, "y": 0 },
{ "label": "F10", "x": 12, "y": 0 },
{ "label": "F11", "x": 13, "y": 0 },
{ "label": "F12", "x": 14, "y": 0 },
{ "label": "PrtSc", "x": 15.25, "y": 0 },
{ "label": "Scroll Lock", "x": 16.25, "y": 0 },
{ "label": "Pause", "x": 17.25, "y": 0 },

{ "label": "~", "x": 0, "y": 1.5 },
{ "label": "!", "x": 1, "y": 1.5 },
{ "label": "@", "x": 2, "y": 1.5 },
{ "label": "#", "x": 3, "y": 1.5 },
{ "label": "$", "x": 4, "y": 1.5 },
{ "label": "%", "x": 5, "y": 1.5 },
{ "label": "^", "x": 6, "y": 1.5 },
{ "label": "&", "x": 7, "y": 1.5 },
{ "label": "*", "x": 8, "y": 1.5 },
{ "label": "(", "x": 9, "y": 1.5 },
{ "label": ")", "x": 10, "y": 1.5 },
{ "label": "_", "x": 11, "y": 1.5 },
{ "label": "+", "x": 12, "y": 1.5 },
{ "label": "Backspace", "x": 13, "y": 1.5, "w": 2 },
{ "label": "Insert", "x": 15.25, "y": 1.5 },
{ "label": "Home", "x": 16.25, "y": 1.5 },
{ "label": "PgUp", "x": 17.25, "y": 1.5 },

{ "label": "Tab", "x": 0, "y": 2.5, "w": 1.5 },
{ "label": "Q", "x": 1.5, "y": 2.5 },
{ "label": "W", "x": 2.5, "y": 2.5 },
{ "label": "E", "x": 3.5, "y": 2.5 },
{ "label": "R", "x": 4.5, "y": 2.5 },
{ "label": "T", "x": 5.5, "y": 2.5 },
{ "label": "Y", "x": 6.5, "y": 2.5 },
{ "label": "U", "x": 7.5, "y": 2.5 },
{ "label": "I", "x": 8.5, "y": 2.5 },
{ "label": "O", "x": 9.5, "y": 2.5 },
{ "label": "P", "x": 10.5, "y": 2.5 },
{ "label": "{", "x": 11.5, "y": 2.5 },
{ "label": "}", "x": 12.5, "y": 2.5 },
{ "label": "|", "x": 13.5, "y": 2.5, "w": 1.5 },
{ "label": "Delete", "x": 15.25, "y": 2.5 },
{ "label": "End", "x": 16.25, "y": 2.5 },
{ "label": "PgDn", "x": 17.25, "y": 2.5 },

{ "label": "Caps Lock", "x": 0, "y": 3.5, "w": 1.75 },
{ "label": "A", "x": 1.75, "y": 3.5 },
{ "label": "S", "x": 2.75, "y": 3.5 },
{ "label": "D", "x": 3.75, "y": 3.5 },
{ "label": "F", "x": 4.75, "y": 3.5 },
{ "label": "G", "x": 5.75, "y": 3.5 },
{ "label": "H", "x": 6.75, "y": 3.5 },
{ "label": "J", "x": 7.75, "y": 3.5 },
{ "label": "K", "x": 8.75, "y": 3.5 },
{ "label": "L", "x": 9.75, "y": 3.5 },
{ "label": ":", "x": 10.75, "y": 3.5 },
{ "label": "\"", "x": 11.75, "y": 3.5 },
{ "label": "#", "x": 12.75, "y": 3.5 },
{ "label": "Enter", "x": 13.75, "y": 3.5, "w": 1.25 },

{ "label": "Shift", "x": 0, "y": 4.5, "w": 1.25 },
{ "label": "\\", "x": 1.25, "y": 4.5 },
{ "label": "Z", "x": 2.25, "y": 4.5 },
{ "label": "X", "x": 3.25, "y": 4.5 },
{ "label": "C", "x": 4.25, "y": 4.5 },
{ "label": "V", "x": 5.25, "y": 4.5 },
{ "label": "B", "x": 6.25, "y": 4.5 },
{ "label": "N", "x": 7.25, "y": 4.5 },
{ "label": "M", "x": 8.25, "y": 4.5 },
{ "label": "<", "x": 9.25, "y": 4.5 },
{ "label": ">", "x": 10.25, "y": 4.5 },
{ "label": "?", "x": 11.25, "y": 4.5 },
{ "label": "Shift", "x": 12.25, "y": 4.5, "w": 2.75 },
{ "label": "\u2191", "x": 16.25, "y": 4.5 },

{ "label": "Ctrl", "x": 0, "y": 5.5, "w": 1.25 },
{ "label": "Win", "x": 1.25, "y": 5.5, "w": 1.25 },
{ "label": "Alt", "x": 2.5, "y": 5.5, "w": 1.25 },
{ "x": 3.75, "y": 5.5, "w": 6.25 },
{ "label": "Alt", "x": 10, "y": 5.5, "w": 1.25 },
{ "label": "Fn", "x": 11.25, "y": 5.5, "w": 1.25 },
{ "label": "Menu", "x": 12.5, "y": 5.5, "w": 1.25 },
{ "label": "Ctrl", "x": 13.75, "y": 5.5, "w": 1.25 },
{ "label": "\u2190", "x": 15.25, "y": 5.5 },
{ "label": "\u2193", "x": 16.25, "y": 5.5 },
{ "label": "\u2192", "x": 17.25, "y": 5.5 }
]
},
"LAYOUT_all": {
"layout": [
{ "label": "Esc", "x": 0, "y": 0 },
Expand Down Expand Up @@ -336,10 +238,6 @@
{ "label": "Insert", "x": 15.25, "y": 1.5 },
{ "label": "Home", "x": 16.25, "y": 1.5 },
{ "label": "PgUp", "x": 17.25, "y": 1.5 },
{ "label": "Num Lock", "x": 18.5, "y": 1.5 },
{ "label": "/", "x": 19.5, "y": 1.5 },
{ "label": "*", "x": 20.5, "y": 1.5 },
{ "label": "-", "x": 21.5, "y": 1.5 },

{ "label": "Tab", "x": 0, "y": 2.5, "w": 1.5 },
{ "label": "Q", "x": 1.5, "y": 2.5 },
Expand All @@ -358,10 +256,6 @@
{ "label": "Delete", "x": 15.25, "y": 2.5 },
{ "label": "End", "x": 16.25, "y": 2.5 },
{ "label": "PgDn", "x": 17.25, "y": 2.5 },
{ "label": "7", "x": 18.5, "y": 2.5 },
{ "label": "8", "x": 19.5, "y": 2.5 },
{ "label": "9", "x": 20.5, "y": 2.5 },
{ "label": "+", "x": 21.5, "y": 2.5, "h": 2 },

{ "label": "Caps Lock", "x": 0, "y": 3.5, "w": 1.75 },
{ "label": "A", "x": 1.75, "y": 3.5 },
Expand All @@ -377,9 +271,6 @@
{ "label": "\"", "x": 11.75, "y": 3.5 },
{ "label": "#", "x": 12.75, "y": 3.5 },
{ "label": "Enter", "x": 13.75, "y": 3.5, "w": 1.25 },
{ "label": "4", "x": 18.5, "y": 3.5 },
{ "label": "5", "x": 19.5, "y": 3.5 },
{ "label": "6", "x": 20.5, "y": 3.5 },

{ "label": "Shift", "x": 0, "y": 4.5, "w": 1.25 },
{ "label": "\\", "x": 1.25, "y": 4.5 },
Expand All @@ -395,10 +286,6 @@
{ "label": "?", "x": 11.25, "y": 4.5 },
{ "label": "Shift", "x": 12.25, "y": 4.5, "w": 2.75 },
{ "label": "\u2191", "x": 16.25, "y": 4.5 },
{ "label": "1", "x": 18.5, "y": 4.5 },
{ "label": "2", "x": 19.5, "y": 4.5 },
{ "label": "3", "x": 20.5, "y": 4.5 },
{ "label": "Enter", "x": 21.5, "y": 4.5, "h": 2 },

{ "label": "Ctrl", "x": 0, "y": 5.5, "w": 1.25 },
{ "label": "Win", "x": 1.25, "y": 5.5, "w": 1.25 },
Expand All @@ -410,9 +297,7 @@
{ "label": "Ctrl", "x": 13.75, "y": 5.5, "w": 1.25 },
{ "label": "\u2190", "x": 15.25, "y": 5.5 },
{ "label": "\u2193", "x": 16.25, "y": 5.5 },
{ "label": "\u2192", "x": 17.25, "y": 5.5 },
{ "label": "0", "x": 18.5, "y": 5.5, "w": 2 },
{ "label": ".", "x": 20.5, "y": 5.5 }
{ "label": "\u2192", "x": 17.25, "y": 5.5 }
]
}
}
Expand Down
Loading

0 comments on commit f14a376

Please sign in to comment.