aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/gkeyboard/gkb_m16/config.h151
-rw-r--r--keyboards/gkeyboard/gkb_m16/gkb_m16.c17
-rw-r--r--keyboards/gkeyboard/gkb_m16/gkb_m16.h40
-rw-r--r--keyboards/gkeyboard/gkb_m16/info.json29
-rw-r--r--keyboards/gkeyboard/gkb_m16/keymaps/default/keymap.c73
-rw-r--r--keyboards/gkeyboard/gkb_m16/keymaps/default/readme.md1
-rw-r--r--keyboards/gkeyboard/gkb_m16/keymaps/via/keymap.c44
-rw-r--r--keyboards/gkeyboard/gkb_m16/keymaps/via/readme.md1
-rw-r--r--keyboards/gkeyboard/gkb_m16/keymaps/via/rules.mk2
-rw-r--r--keyboards/gkeyboard/gkb_m16/readme.md19
-rw-r--r--keyboards/gkeyboard/gkb_m16/rules.mk22
11 files changed, 399 insertions, 0 deletions
diff --git a/keyboards/gkeyboard/gkb_m16/config.h b/keyboards/gkeyboard/gkb_m16/config.h
new file mode 100644
index 000000000..be1861b90
--- /dev/null
+++ b/keyboards/gkeyboard/gkb_m16/config.h
@@ -0,0 +1,151 @@
1/*
2Copyright 2020 gkeyboard
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#pragma once
19
20#include "config_common.h"
21
22/* USB Device descriptor parameter */
23#define VENDOR_ID 0x474B // "GK"
24#define PRODUCT_ID 0x4201
25#define DEVICE_VER 0x0001
26#define MANUFACTURER gkeyboard
27#define PRODUCT GKB-M16
28/* key matrix size */
29#define MATRIX_ROWS 4
30#define MATRIX_COLS 4
31
32/*
33 * Keyboard Matrix Assignments
34 *
35 * Change this to how you wired your keyboard
36 * COLS: AVR pins used for columns, left to right
37 * ROWS: AVR pins used for rows, top to bottom
38 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
39 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
40 *
41 */
42#define MATRIX_ROW_PINS { D4, D5, D6, D7 }
43#define MATRIX_COL_PINS { F4, F5, F6, F7 }
44#define UNUSED_PINS
45
46/* COL2ROW, ROW2COL */
47#define DIODE_DIRECTION COL2ROW
48
49/*
50 * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
51 */
52//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
53
54//#define LED_NUM_LOCK_PIN B0
55//#define LED_CAPS_LOCK_PIN B1
56//#define LED_SCROLL_LOCK_PIN B2
57//#define LED_COMPOSE_PIN B3
58//#define LED_KANA_PIN B4
59
60//#define BACKLIGHT_PIN B7
61//#define BACKLIGHT_LEVELS 3
62//#define BACKLIGHT_BREATHING
63
64#define RGB_DI_PIN F1
65#ifdef RGB_DI_PIN
66 #define RGBLED_NUM 4
67 #define RGBLIGHT_HUE_STEP 8
68 #define RGBLIGHT_SAT_STEP 8
69 #define RGBLIGHT_VAL_STEP 8
70 #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
71 #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
72/*== all animations enable ==*/
73 #define RGBLIGHT_ANIMATIONS
74/*== or choose animations ==*/
75//# define RGBLIGHT_EFFECT_BREATHING
76//# define RGBLIGHT_EFFECT_RAINBOW_MOOD
77//# define RGBLIGHT_EFFECT_RAINBOW_SWIRL
78//# define RGBLIGHT_EFFECT_SNAKE
79//# define RGBLIGHT_EFFECT_KNIGHT
80//# define RGBLIGHT_EFFECT_CHRISTMAS
81//# define RGBLIGHT_EFFECT_STATIC_GRADIENT
82//# define RGBLIGHT_EFFECT_RGB_TEST
83//# define RGBLIGHT_EFFECT_ALTERNATING
84/*== customize breathing effect ==*/
85/*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
86//# define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
87/*==== use exp() and sin() ====*/
88//# define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
89//# define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
90#endif
91
92/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
93#define DEBOUNCE 5
94
95/* define if matrix has ghost (lacks anti-ghosting diodes) */
96//#define MATRIX_HAS_GHOST
97
98/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
99#define LOCKING_SUPPORT_ENABLE
100/* Locking resynchronize hack */
101#define LOCKING_RESYNC_ENABLE
102
103/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
104 * This is useful for the Windows task manager shortcut (ctrl+shift+esc).
105 */
106//#define GRAVE_ESC_CTRL_OVERRIDE
107
108/*
109 * Force NKRO
110 *
111 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
112 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
113 * makefile for this to work.)
114 *
115 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
116 * until the next keyboard reset.
117 *
118 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
119 * fully operational during normal computer usage.
120 *
121 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
122 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
123 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
124 * power-up.
125 *
126 */
127//#define FORCE_NKRO
128
129/*
130 * Feature disable options
131 * These options are also useful to firmware size reduction.
132 */
133
134/* disable debug print */
135//#define NO_DEBUG
136
137/* disable print */
138//#define NO_PRINT
139
140/* disable action features */
141//#define NO_ACTION_LAYER
142//#define NO_ACTION_TAPPING
143//#define NO_ACTION_ONESHOT
144
145/* disable these deprecated features by default */
146#define NO_ACTION_MACRO
147#define NO_ACTION_FUNCTION
148
149/* Bootmagic Lite key configuration */
150//#define BOOTMAGIC_LITE_ROW 0
151//#define BOOTMAGIC_LITE_COLUMN 0
diff --git a/keyboards/gkeyboard/gkb_m16/gkb_m16.c b/keyboards/gkeyboard/gkb_m16/gkb_m16.c
new file mode 100644
index 000000000..5a1f7f13e
--- /dev/null
+++ b/keyboards/gkeyboard/gkb_m16/gkb_m16.c
@@ -0,0 +1,17 @@
1/* Copyright 2020 gkeyboard
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "gkb_m16.h"
diff --git a/keyboards/gkeyboard/gkb_m16/gkb_m16.h b/keyboards/gkeyboard/gkb_m16/gkb_m16.h
new file mode 100644
index 000000000..8477f4cda
--- /dev/null
+++ b/keyboards/gkeyboard/gkb_m16/gkb_m16.h
@@ -0,0 +1,40 @@
1/* Copyright 2020 gkeyboard
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19#include "quantum.h"
20
21/* This is a shortcut to help you visually see your layout.
22 *
23 * The first section contains all of the arguments representing the physical
24 * layout of the board and position of the keys.
25 *
26 * The second converts the arguments into a two-dimensional array which
27 * represents the switch matrix.
28 */
29#define LAYOUT_ortho_4x4( \
30 K01, K02, K03, K04, \
31 K11, K12, K13, K14, \
32 K21, K22, K23, K24, \
33 K31, K32, K33, K34 \
34) \
35{ \
36 { K01, K02, K03, K04 }, \
37 { K11, K12, K13, K14 }, \
38 { K21, K22, K23, K24 }, \
39 { K31, K32, K33, K34 } \
40}
diff --git a/keyboards/gkeyboard/gkb_m16/info.json b/keyboards/gkeyboard/gkb_m16/info.json
new file mode 100644
index 000000000..a9263a3cd
--- /dev/null
+++ b/keyboards/gkeyboard/gkb_m16/info.json
@@ -0,0 +1,29 @@
1{
2 "keyboard_name": "gkb_m16",
3 "url": "",
4 "maintainer": "gkeyboard",
5 "width": 4,
6 "height": 4,
7 "layouts": {
8 "LAYOUT_ortho_4x4": {
9 "layout": [
10 {"x":0, "y":0},
11 {"x":1, "y":0},
12 {"x":2, "y":0},
13 {"x":3, "y":0},
14 {"x":0, "y":1},
15 {"x":1, "y":1},
16 {"x":2, "y":1},
17 {"x":3, "y":1},
18 {"x":0, "y":2},
19 {"x":1, "y":2},
20 {"x":2, "y":2},
21 {"x":3, "y":2},
22 {"x":0, "y":3},
23 {"x":1, "y":3},
24 {"x":2, "y":3},
25 {"x":3, "y":3}
26 ]
27 }
28 }
29 }
diff --git a/keyboards/gkeyboard/gkb_m16/keymaps/default/keymap.c b/keyboards/gkeyboard/gkb_m16/keymaps/default/keymap.c
new file mode 100644
index 000000000..4fcde1b55
--- /dev/null
+++ b/keyboards/gkeyboard/gkb_m16/keymaps/default/keymap.c
@@ -0,0 +1,73 @@
1/* Copyright 2020 gkeyboard
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18enum layers {
19 _BASE = 0,
20 _FN1,
21 _FN2,
22};
23
24// Defines the keycodes used by our macros in process_record_user
25enum custom_keycodes {
26 QMKBEST = SAFE_RANGE,
27 QMKURL
28};
29
30const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
31
32 [_BASE] = LAYOUT_ortho_4x4(
33 KC_PGUP, KC_HOME, KC_UP, KC_END ,
34 KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT,
35 MO(_FN2), KC_VOLU, KC_MPLY, KC_MPRV,
36 MO(_FN1), KC_VOLD, KC_MUTE, KC_MNXT
37 ),
38 [_FN1] = LAYOUT_ortho_4x4(
39 KC_ESC, KC_P7, KC_P8, KC_P9,
40 KC_TAB, KC_P4, KC_P5, KC_P6,
41 KC_ENT, KC_P1, KC_P2, KC_P3,
42 _______, KC_P0, KC_P0, KC_DOT
43 ),
44 [_FN2] = LAYOUT_ortho_4x4(
45 RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI,
46 RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD,
47 _______, _______, _______, RESET,
48 RGB_TOG, _______, QMKBEST, QMKURL
49 )
50
51};
52
53bool process_record_user(uint16_t keycode, keyrecord_t *record) {
54 switch (keycode) {
55 case QMKBEST:
56 if (record->event.pressed) {
57 // when keycode QMKBEST is pressed
58 SEND_STRING("QMK is the best thing ever!");
59 } else {
60 // when keycode QMKBEST is released
61 }
62 break;
63 case QMKURL:
64 if (record->event.pressed) {
65 // when keycode QMKURL is pressed
66 SEND_STRING("https://qmk.fm/\n");
67 } else {
68 // when keycode QMKURL is released
69 }
70 break;
71 }
72 return true;
73}
diff --git a/keyboards/gkeyboard/gkb_m16/keymaps/default/readme.md b/keyboards/gkeyboard/gkb_m16/keymaps/default/readme.md
new file mode 100644
index 000000000..7e4960124
--- /dev/null
+++ b/keyboards/gkeyboard/gkb_m16/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default keymap for GKB-M16
diff --git a/keyboards/gkeyboard/gkb_m16/keymaps/via/keymap.c b/keyboards/gkeyboard/gkb_m16/keymaps/via/keymap.c
new file mode 100644
index 000000000..7d43c3308
--- /dev/null
+++ b/keyboards/gkeyboard/gkb_m16/keymaps/via/keymap.c
@@ -0,0 +1,44 @@
1/* Copyright 2020 gkeyboard
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
18
19 [0] = LAYOUT_ortho_4x4(
20 KC_PGUP, KC_HOME, KC_UP, KC_END ,
21 KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT,
22 KC_DOT, KC_VOLU, KC_MPLY, KC_MPRV,
23 MO(1), KC_VOLD, KC_MUTE, KC_MNXT
24 ),
25 [1] = LAYOUT_ortho_4x4(
26 RESET, KC_TRNS, KC_TRNS, KC_TRNS,
27 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
28 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
29 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
30 ),
31 [2] = LAYOUT_ortho_4x4(
32 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
33 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
34 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
35 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
36 ),
37
38 [3] = LAYOUT_ortho_4x4(
39 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
40 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
41 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
42 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
43 )
44};
diff --git a/keyboards/gkeyboard/gkb_m16/keymaps/via/readme.md b/keyboards/gkeyboard/gkb_m16/keymaps/via/readme.md
new file mode 100644
index 000000000..b04d2f4a3
--- /dev/null
+++ b/keyboards/gkeyboard/gkb_m16/keymaps/via/readme.md
@@ -0,0 +1 @@
# Via keymap for GKB-M16
diff --git a/keyboards/gkeyboard/gkb_m16/keymaps/via/rules.mk b/keyboards/gkeyboard/gkb_m16/keymaps/via/rules.mk
new file mode 100644
index 000000000..36b7ba9cb
--- /dev/null
+++ b/keyboards/gkeyboard/gkb_m16/keymaps/via/rules.mk
@@ -0,0 +1,2 @@
1VIA_ENABLE = yes
2LTO_ENABLE = yes
diff --git a/keyboards/gkeyboard/gkb_m16/readme.md b/keyboards/gkeyboard/gkb_m16/readme.md
new file mode 100644
index 000000000..40b945743
--- /dev/null
+++ b/keyboards/gkeyboard/gkb_m16/readme.md
@@ -0,0 +1,19 @@
1# GKB-M16
2
3![GKB-M16](https://i.imgur.com/LP5I5ZQ.png)
4
54x4 Custom Macro Pad, with USB Type-C, RGB underglow.
6
7* Keyboard Maintainer: [gkeyboard](https://github.com/gkeyboard)
8* Hardware Supported: GKB-M16 PCB
9* Hardware Availability: http://www.mltelectronic.com
10
11Make example for this keyboard (after setting up your build environment):
12
13 make gkeyboard/gkb_m16:default
14
15Flashing example for this keyboard:
16
17 make gkeyboard/gkb_m16:default:flash
18
19See 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).
diff --git a/keyboards/gkeyboard/gkb_m16/rules.mk b/keyboards/gkeyboard/gkb_m16/rules.mk
new file mode 100644
index 000000000..f49426d51
--- /dev/null
+++ b/keyboards/gkeyboard/gkb_m16/rules.mk
@@ -0,0 +1,22 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5BOOTLOADER = atmel-dfu
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
11MOUSEKEY_ENABLE = yes # Mouse keys
12EXTRAKEY_ENABLE = yes # Audio control and System control
13CONSOLE_ENABLE = no # Console for debug
14COMMAND_ENABLE = no # Commands for debug and configuration
15# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
16SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
18NKRO_ENABLE = yes # USB Nkey Rollover
19BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
20RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
21BLUETOOTH_ENABLE = no # Enable Bluetooth
22AUDIO_ENABLE = no # Audio output