Skip to content

Commit

Permalink
Merge pull request qmk#4 from nomis/k3x0_changes
Browse files Browse the repository at this point in the history
Changes for K320
  • Loading branch information
dkjer authored Mar 19, 2021
2 parents 36baaa9 + 287fdaf commit 814e09f
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 13 deletions.
6 changes: 2 additions & 4 deletions keyboards/durgod/k3x0/config.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Copyright 2021 Don Kjer and 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
Expand All @@ -18,11 +19,9 @@

#include "config_common.h"

/* key matrix size */
#define MATRIX_ROWS 8
/* key matrix size (rows in specific keyboard variant) */
#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*/
Expand All @@ -42,7 +41,6 @@
#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
Expand Down
9 changes: 9 additions & 0 deletions keyboards/durgod/k3x0/k310/config.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Copyright 2021 Don Kjer and 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
Expand All @@ -24,3 +25,11 @@
#define DEVICE_VER 0x0001
#define MANUFACTURER Hoksi Technology
#define PRODUCT DURGOD Taurus K310 (QMK)

/* key matrix size (cols in generic keyboard config) */
#define MATRIX_ROWS 8

#define MATRIX_ROW_PINS { A0, A1, A2, A3, A4, A5, A6, A7 }

/* LED indicator pins */
#define LED_NUM_LOCK_PIN C8
6 changes: 6 additions & 0 deletions keyboards/durgod/k3x0/k320/config.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Copyright 2021 Don Kjer and 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
Expand All @@ -24,3 +25,8 @@
#define DEVICE_VER 0x0001
#define MANUFACTURER Hoksi Technology
#define PRODUCT DURGOD Taurus K320 (QMK)

/* key matrix size (cols in generic keyboard config) */
#define MATRIX_ROWS 7

#define MATRIX_ROW_PINS { A0, A1, A2, A3, A4, A5, A6 }
7 changes: 7 additions & 0 deletions keyboards/durgod/k3x0/k3x0.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Copyright 2021 Don Kjer and 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
Expand All @@ -18,15 +19,19 @@

/* Private Functions */
void off_all_leds(void) {
#ifdef LED_NUM_LOCK_PIN
writePinHigh(LED_NUM_LOCK_PIN);
#endif
writePinHigh(LED_CAPS_LOCK_PIN);
writePinHigh(LED_SCROLL_LOCK_PIN);
writePinHigh(LED_WIN_LOCK_PIN);
writePinHigh(LED_MR_LOCK_PIN);
}

void on_all_leds(void) {
#ifdef LED_NUM_LOCK_PIN
writePinLow(LED_NUM_LOCK_PIN);
#endif
writePinLow(LED_CAPS_LOCK_PIN);
writePinLow(LED_SCROLL_LOCK_PIN);
writePinLow(LED_WIN_LOCK_PIN);
Expand All @@ -35,7 +40,9 @@ void on_all_leds(void) {

/* WinLock and MR LEDs are non-standard. Need to override led init */
void led_init_ports(void) {
#ifdef LED_NUM_LOCK_PIN
setPinOutput(LED_NUM_LOCK_PIN);
#endif
setPinOutput(LED_CAPS_LOCK_PIN);
setPinOutput(LED_SCROLL_LOCK_PIN);
setPinOutput(LED_WIN_LOCK_PIN);
Expand Down
24 changes: 19 additions & 5 deletions keyboards/durgod/k3x0/k3x0.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Copyright 2021 Don Kjer and 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
Expand Down Expand Up @@ -34,6 +35,14 @@ void on_all_leds(void);

#define XXX KC_NO

/* Omit row 8 if it's not physically present */
#if MATRIX_ROWS < 8
# define K3x0_ROW_8(X70, X71, X72, X73, X74, X75, X76, X77, X78, X79, X7A, X7B, X7C, X7D, X7E, X7F)
#else
# define K3x0_ROW_8(X70, X71, X72, X73, X74, X75, X76, X77, X78, X79, X7A, X7B, X7C, X7D, X7E, X7F) \
{ X70, X71, X72, X73, X74, X75, X76, X77, X78, X79, X7A, X7B, X7C, X7D, X7E, X7F }
#endif

// This a shortcut to help you visually see your layout.
#define LAYOUT_fullsize_ansi( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \
Expand All @@ -50,7 +59,8 @@ void on_all_leds(void);
{ K40, XXX, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, XXX, K4D, K4E, K4F }, \
{ K50, K51, K52, XXX, XXX, XXX, K56, XXX, XXX, XXX, K5A, K5B, K5C, K5D, K5E, K5F }, \
{ XXX, XXX, XXX, XXX, XXX, XXX, XXX, K67, K68, K69, K6A, K6B, K6C, K6D, K6E, K6F }, \
{ XXX, XXX, XXX, XXX, XXX, XXX, XXX, K77, K78, K79, K7A, K7B, K7C, K7D, K7E, K7F } \
K3x0_ROW_8( \
XXX, XXX, XXX, XXX, XXX, XXX, XXX, K77, K78, K79, K7A, K7B, K7C, K7D, K7E, K7F) \
}

// This a shortcut to help you visually see your layout.
Expand All @@ -69,7 +79,8 @@ void on_all_leds(void);
{ K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, XXX, K4D, K4E, K4F }, \
{ K50, K51, K52, XXX, XXX, XXX, K56, XXX, XXX, XXX, K5A, K5B, K5C, K5D, K5E, K5F }, \
{ XXX, XXX, XXX, XXX, XXX, XXX, XXX, K67, K68, K69, K6A, K6B, K6C, K6D, K6E, K6F }, \
{ XXX, XXX, XXX, XXX, XXX, XXX, XXX, K77, K78, K79, K7A, K7B, K7C, K7D, K7E, K7F } \
K3x0_ROW_8( \
XXX, XXX, XXX, XXX, XXX, XXX, XXX, K77, K78, K79, K7A, K7B, K7C, K7D, K7E, K7F) \
}

// This a shortcut to help you visually see your layout.
Expand All @@ -88,7 +99,8 @@ void on_all_leds(void);
{ K40, XXX, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, XXX, K4D, K4E, K4F }, \
{ K50, K51, K52, XXX, XXX, XXX, K56, XXX, XXX, XXX, K5A, K5B, K5C, K5D, K5E, K5F }, \
{ XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, K6F }, \
{ XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX } \
K3x0_ROW_8( \
XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX) \
}

// This a shortcut to help you visually see your layout.
Expand All @@ -107,7 +119,8 @@ void on_all_leds(void);
{ K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, XXX, K4D, K4E, K4F }, \
{ K50, K51, K52, XXX, XXX, XXX, K56, XXX, XXX, XXX, K5A, K5B, K5C, K5D, K5E, K5F }, \
{ XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, K6F }, \
{ XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX } \
K3x0_ROW_8( \
XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX) \
}

// This a shortcut to help you visually see your layout.
Expand All @@ -126,5 +139,6 @@ void on_all_leds(void);
{ K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, XXX, K4D, K4E, K4F }, \
{ K50, K51, K52, XXX, XXX, XXX, K56, XXX, XXX, XXX, K5A, K5B, K5C, K5D, K5E, K5F }, \
{ XXX, XXX, XXX, XXX, XXX, XXX, XXX, K67, K68, K69, K6A, K6B, K6C, K6D, K6E, K6F }, \
{ XXX, XXX, XXX, XXX, XXX, XXX, XXX, K77, K78, K79, K7A, K7B, K7C, K7D, K7E, K7F } \
K3x0_ROW_8( \
XXX, XXX, XXX, XXX, XXX, XXX, XXX, K77, K78, K79, K7A, K7B, K7C, K7D, K7E, K7F) \
}
1 change: 0 additions & 1 deletion keyboards/durgod/k3x0/keymaps/via/rules.mk
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
4 changes: 1 addition & 3 deletions keyboards/durgod/k3x0/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ MCU = STM32F072

BOARD = DURGOD_STM32_F070

# Do not put the microcontroller into power saving mode
OPT_DEFS += -DNO_SUSPEND_POWER_DOWN

# Build Options
# change yes to no to disable
#
Expand All @@ -26,5 +23,6 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
BLUETOOTH_ENABLE = no # Enable Bluetooth
AUDIO_ENABLE = no # Audio output
LTO_ENABLE = yes

LAYOUTS = fullsize_ansi fullsize_iso tkl_ansi tkl_iso

0 comments on commit 814e09f

Please sign in to comment.