aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/ymdk/sp64/config.h45
-rw-r--r--keyboards/ymdk/sp64/info.json79
-rw-r--r--keyboards/ymdk/sp64/keymaps/daed/keymap.c140
-rw-r--r--keyboards/ymdk/sp64/keymaps/default/keymap.c74
-rw-r--r--keyboards/ymdk/sp64/keymaps/walston/keymap.c94
-rw-r--r--keyboards/ymdk/sp64/keymaps/walston/rules.mk1
-rw-r--r--keyboards/ymdk/sp64/matrix.c169
-rw-r--r--keyboards/ymdk/sp64/readme.md17
-rw-r--r--keyboards/ymdk/sp64/rules.mk32
-rw-r--r--keyboards/ymdk/sp64/sp64.c93
-rw-r--r--keyboards/ymdk/sp64/sp64.h84
11 files changed, 828 insertions, 0 deletions
diff --git a/keyboards/ymdk/sp64/config.h b/keyboards/ymdk/sp64/config.h
new file mode 100644
index 000000000..fc3e2d7dc
--- /dev/null
+++ b/keyboards/ymdk/sp64/config.h
@@ -0,0 +1,45 @@
1/*
2Copyright 2019 Neil Kettle
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#define VENDOR_ID 0x594D
23#define PRODUCT_ID 0x5364
24#define DEVICE_VER 0x0200
25#define MANUFACTURER YMDK
26#define PRODUCT SP64
27#define DESCRIPTION YMDK Split 64
28
29#define MATRIX_ROWS 6
30#define MATRIX_COLS 15
31
32#define RIGHT_HALF
33
34/* disable these deprecated features by default */
35#define NO_ACTION_MACRO
36#define NO_ACTION_FUNCTION
37
38/* RGB underglow */
39#define RGBLED_NUM 12
40#define RGBLIGHT_HUE_STEP 8
41#define RGBLIGHT_SAT_STEP 8
42#define RGBLIGHT_VAL_STEP 8
43#define RGBLIGHT_LIMIT_VAL 250 /* The maximum brightness level */
44#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
45#define RGBLIGHT_ANIMATIONS
diff --git a/keyboards/ymdk/sp64/info.json b/keyboards/ymdk/sp64/info.json
new file mode 100644
index 000000000..798124d84
--- /dev/null
+++ b/keyboards/ymdk/sp64/info.json
@@ -0,0 +1,79 @@
1{
2 "keyboard_name": "YMDK_SP64",
3 "url": "",
4 "maintainer": "walston",
5 "width": 16,
6 "height": 5,
7 "layouts": {
8 "LAYOUT": {
9 "layout": [
10 {"label":"~", "x":0, "y":0},
11 {"label":"!", "x":1, "y":0},
12 {"label":"@", "x":2, "y":0},
13 {"label":"#", "x":3, "y":0},
14 {"label":"$", "x":4, "y":0},
15 {"label":"%", "x":5, "y":0},
16 {"label":"^", "x":6, "y":0},
17 {"label":"&", "x":8, "y":0},
18 {"label":"*", "x":9, "y":0},
19 {"label":"(", "x":10, "y":0},
20 {"label":")", "x":11, "y":0},
21 {"label":"_", "x":12, "y":0},
22 {"label":"+", "x":13, "y":0},
23 {"label":"Backspace", "x":14, "y":0, "w":2},
24 {"label":"Tab", "x":0, "y":1, "w":1.5},
25 {"label":"Q", "x":1.5, "y":1},
26 {"label":"W", "x":2.5, "y":1},
27 {"label":"E", "x":3.5, "y":1},
28 {"label":"R", "x":4.5, "y":1},
29 {"label":"T", "x":5.5, "y":1},
30 {"label":"Y", "x":7.5, "y":1},
31 {"label":"U", "x":8.5, "y":1},
32 {"label":"I", "x":9.5, "y":1},
33 {"label":"O", "x":10.5, "y":1},
34 {"label":"P", "x":11.5, "y":1},
35 {"label":"{ ", "x":12.5, "y":1},
36 {"label":"}", "x":13.5, "y":1},
37 {"label":"|", "x":14.5, "y":1, "w":1.5},
38 {"label":"Caps Lock", "x":0, "y":2, "w":1.75},
39 {"label":"A", "x":1.75, "y":2},
40 {"label":"S", "x":2.75, "y":2},
41 {"label":"D", "x":3.75, "y":2},
42 {"label":"F", "x":4.75, "y":2},
43 {"label":"G", "x":5.75, "y":2},
44 {"label":"H", "x":7.75, "y":2},
45 {"label":"J", "x":8.75, "y":2},
46 {"label":"K", "x":9.75, "y":2},
47 {"label":"L", "x":10.75, "y":2},
48 {"label":":", "x":11.75, "y":2},
49 {"label":"\"", "x":12.75, "y":2},
50 {"label":"Enter", "x":13.75, "y":2, "w":2.25},
51 {"label":"Shift", "x":0, "y":3, "w":2},
52 {"label":"Z", "x":2, "y":3},
53 {"label":"X", "x":3, "y":3},
54 {"label":"C", "x":4, "y":3},
55 {"label":"V", "x":5, "y":3},
56 {"label":"B", "x":6, "y":3},
57 {"label":"N", "x":8, "y":3},
58 {"label":"M", "x":9, "y":3},
59 {"label":"<", "x":10, "y":3},
60 {"label":">", "x":11, "y":3},
61 {"label":"?", "x":12, "y":3},
62 {"label":"Shift", "x":13, "y":3},
63 {"label":"Up", "x":14, "y":3},
64 {"label":"F3", "x":15, "y":3},
65 {"label":"Ctrl", "x":0, "y":4, "w":1.25},
66 {"label":"Win", "x":1.25, "y":4},
67 {"label":"Alt", "x":2.25, "y":4, "w":1.25},
68 {"label":"Space", "x":3.5, "y":4, "w":2.25},
69 {"label":"Fn", "x":5.75, "y":4},
70 {"label":"Space", "x":7.75, "y":4, "w":2.75},
71 {"label":"Alt", "x":10.5, "y":4, "w":1.25},
72 {"label":"Win", "x":11.75, "y":4, "w":1.25},
73 {"label":"Left", "x":13, "y":4},
74 {"label":"Down", "x":14, "y":4},
75 {"label":"Right", "x":15, "y":4}
76 ]
77 }
78 }
79}
diff --git a/keyboards/ymdk/sp64/keymaps/daed/keymap.c b/keyboards/ymdk/sp64/keymaps/daed/keymap.c
new file mode 100644
index 000000000..7174c108b
--- /dev/null
+++ b/keyboards/ymdk/sp64/keymaps/daed/keymap.c
@@ -0,0 +1,140 @@
1#include QMK_KEYBOARD_H
2
3enum layer_names {
4 _BASE,
5 _GAMER,
6 _FN,
7 _RAISE,
8 _MODE,
9 _GACROS,
10};
11
12const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
13/* Keymap 0: Basic layer
14 *
15 * ┌-----┬-----┬-----┬-----┬-----┬-----┬-----┐ ┌-----┬-----┬-----┬-----┬-----┬-----┬----------┐
16 * │ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ │ 7 │ 8 │ 9 │ 0 │ - │ = │ BkSp │
17 * ├-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┘ ┌--┴-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬-------┤
18 * │ Tab │ Q │ W │ E │ R │ T │ │ Y │ U │ I │ O │ P │ [ │ ] │ \ │
19 * ├--------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴-------┤
20 * │ Ctrl │ A │ S │ D │ F │ G │ │ H │ J │ K │ L │ ; │ ' │ Enter │
21 * ├---------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬-----┬-----┤
22 * │ LShift │ Z │ X │ C │ V │ B │ │ N │ M │ < │ > │ ? │ Sft │ Up │ _MO │
23 * ├------┬---┴-┬---┴--┬--┴-----┴----┬┴----┬┘ ┌┴-----┴-----┴--┬--┴----┬┴-----┼-----┼-----┼-----┤
24 * │ _FN │ Win │ Alt │ │ _RA │ │ │ Alt │ Win │ Lft │ Dwn │ Rgt │
25 * └------┴-----┴------┴-------------┴-----┘ └---------------┴-------┴------┴-----┴-----┴-----┘
26 */
27[_BASE] = LAYOUT(
28 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQUAL, KC_BSPACE,
29 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRACKET, KC_RBRACKET, KC_BSLS,
30 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOTE, KC_ENTER,
31 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, MO(_MODE),
32 MO(_FN), KC_LGUI, KC_LALT, KC_SPACE, MO(_RAISE), KC_SPACE, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT
33 ),
34/* Keymap 1: Gamer layer
35 *
36 * ┌-----┬-----┬-----┬-----┬-----┬-----┬-----┐ ┌-----┬-----┬-----┬-----┬-----┬-----┬----------┐
37 * │ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ │ 7 │ 8 │ 9 │ 0 │ - │ = │ BkSp │
38 * ├-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┘ ┌--┴-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬-------┤
39 * │ Tab │ Q │ W │ E │ R │ T │ │ Y │ U │ I │ O │ P │ [ │ ] │ \ │
40 * ├--------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴-------┤
41 * │ Ctrl │ A │ S │ D │ F │ G │ │ H │ J │ K │ L │ ; │ ' │ Enter │
42 * ├---------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬-----┬-----┤
43 * │ LShift │ Z │ X │ C │ V │ B │ │ N │ M │ < │ > │ ? │ Sft │ Up │ _MO │
44 * ├------┬---┴-┬---┴--┬--┴-----┴----┬┴----┬┘ ┌┴-----┴-----┴--┬--┴----┬┴-----┼-----┼-----┼-----┤
45 * │ _FN │ F13 │ Alt │ │ _GA │ │ │ Alt │ Win │ Lft │ Dwn │ Rgt │
46 * └------┴-----┴------┴-------------┴-----┘ └---------------┴-------┴------┴-----┴-----┴-----┘
47 */
48[_GAMER] = LAYOUT(
49 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQUAL, KC_BSPACE,
50 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRACKET, KC_RBRACKET, KC_BSLS,
51 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOTE, KC_ENTER,
52 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, MO(_MODE),
53 MO(_FN), KC_F13, KC_LALT, KC_SPACE, MO(_GACROS), KC_SPACE, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT
54 ),
55
56/* Keymap 2: Function
57 *
58 * ┌-----┬-----┬-----┬-----┬-----┬-----┬-----┐ ┌-----┬-----┬-----┬-----┬-----┬-----┬----------┐
59 * │ ` │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ │
60 * ├-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┘ ┌--┴-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬-------┤
61 * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
62 * ├--------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴-------┤
63 * │ │ │ │ │ │ │ │Left │ Up │Down │Right│ │ │ │
64 * ├---------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬-----┬-----┤
65 * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
66 * ├------┬---┴-┬---┴--┬--┴-----┴----┬┴----┬┘ ┌┴-----┴-----┴--┬--┴----┬┴-----┼-----┼-----┼-----┤
67 * │ │ │ │ │ │ │ │ │ │ │ │ │
68 * └------┴-----┴------┴-------------┴-----┘ └---------------┴-------┴------┴-----┴-----┴-----┘
69 */
70[_FN] = LAYOUT(
71 KC_GRAVE, 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_DEL,
72 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
73 KC_CAPS, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, _______,
74 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______,
75 _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END
76 ),
77/* Keymap 3: Raise / Quality of life
78 *
79 * ┌-----┬-----┬-----┬-----┬-----┬-----┬-----┐ ┌-----┬-----┬-----┬-----┬-----┬-----┬----------┐
80 * │ ` │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ │
81 * ├-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┘ ┌--┴-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬-------┤
82 * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
83 * ├--------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴-------┤
84 * │ │ │ │ │ │ │ │Left │ Up │Down │Right│ │ │ │
85 * ├---------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬-----┬-----┤
86 * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
87 * ├------┬---┴-┬---┴--┬--┴-----┴----┬┴----┬┘ ┌┴-----┴-----┴--┬--┴----┬┴-----┼-----┼-----┼-----┤
88 * │ │ │ │ │ │ │ │ │ │ │ │ │
89 * └------┴-----┴------┴-------------┴-----┘ └---------------┴-------┴------┴-----┴-----┴-----┘
90 */
91[_RAISE] = LAYOUT(
92 KC_GRAVE, 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_DEL,
93 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
94 KC_CAPS, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, _______,
95 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______,
96 _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END
97 ),
98/* Keymap 4: Mode switching
99 *
100 * ┌-----┬-----┬-----┬-----┬-----┬-----┬-----┐ ┌-----┬-----┬-----┬-----┬-----┬-----┬----------┐
101 * │ ` │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ │
102 * ├-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┘ ┌--┴-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬-------┤
103 * │ RGB 0/1│RGBM-│RGBB+│RGBM+│ │ │ │ │ │ │ │ │ │ │ Reset │
104 * ├--------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴-------┤
105 * │ │RGBS-│RGBB-│RGBS+│ │ │ │Left │ Up │Down │Right│ │ │ │
106 * ├---------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬-----┬-----┤
107 * │ │ │ │ │ │ │ │ │ │ │ GAME| BASE│ │ │ │
108 * ├------┬---┴-┬---┴--┬--┴-----┴----┬┴----┬┘ ┌┴-----┴-----┴--┬--┴----┬┴-----┼-----┼-----┼-----┤
109 * │ │ │ │ │ │ │ │ │ │ │ │ │
110 * └------┴-----┴------┴-------------┴-----┘ └---------------┴-------┴------┴-----┴-----┴-----┘
111 */
112[_MODE] = LAYOUT(
113 KC_GRAVE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,
114 RGB_TOG, RGB_RMOD, RGB_VAI, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET,
115 _______, RGB_SPD, RGB_VAD, RGB_SPI, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, _______,
116 _______, _______, _______, _______, _______, _______, _______, _______, _______, TO(_GAMER), TO(_BASE), _______, _______, _______,
117 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
118 ),
119/* Keymap 5: Gaming macros
120 *
121 * ┌-----┬-----┬-----┬-----┬-----┬-----┬-----┐ ┌-----┬-----┬-----┬-----┬-----┬-----┬----------┐
122 * │ ` │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ │
123 * ├-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┘ ┌--┴-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬-------┤
124 * │ │ │ PUSH│ │ │ │ │ │ │ │ │ │ │ │ │
125 * ├--------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴-------┤
126 * │ │ │ FALL│ │ │ │ │Left │ Up │Down │Right│ │ │ │
127 * ├---------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬-----┬-----┤
128 * │ │ │ CAP │ │ │ │ │ │ │ │ GAME| BASE│ │ │ │
129 * ├------┬---┴-┬---┴--┬--┴-----┴----┬┴----┬┘ ┌┴-----┴-----┴--┬--┴----┬┴-----┼-----┼-----┼-----┤
130 * │ │ │ │ │ │ │ │ │ │ │ │ │
131 * └------┴-----┴------┴-------------┴-----┘ └---------------┴-------┴------┴-----┴-----┴-----┘
132 */
133[_GACROS] = LAYOUT(
134 KC_GRAVE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,
135 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
136 _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, _______,
137 _______, _______, _______, _______, _______, _______, _______, _______, _______, TO(_GAMER), TO(_BASE), _______, _______, _______,
138 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
139 ),
140};
diff --git a/keyboards/ymdk/sp64/keymaps/default/keymap.c b/keyboards/ymdk/sp64/keymaps/default/keymap.c
new file mode 100644
index 000000000..e988d6e91
--- /dev/null
+++ b/keyboards/ymdk/sp64/keymaps/default/keymap.c
@@ -0,0 +1,74 @@
1#include QMK_KEYBOARD_H
2
3enum layer_names {
4 BASE, // default layer
5 _FN, // function layer
6 _FX // media keys
7};
8
9const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
10/* Keymap 0: Basic layer
11 *
12 * ┌-----┬-----┬-----┬-----┬-----┬-----┬-----┐ ┌-----┬-----┬-----┬-----┬-----┬-----┬----------┐
13 * │ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ │ 7 │ 8 │ 9 │ 0 │ - │ = │ BkSp │
14 * ├-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┘ ┌--┴-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬-------┤
15 * │ Tab │ Q │ W │ E │ R │ T │ │ Y │ U │ I │ O │ P │ [ │ ] │ \ │
16 * ├--------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴-------┤
17 * │ Caps │ A │ S │ D │ F │ G │ │ H │ J │ K │ L │ ; │ ' │ Enter │
18 * ├---------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬-----┬-----┤
19 * │ LShift │ Z │ X │ C │ V │ B │ │ N │ M │ < │ > │ ? │ Sft │ Up │ Fn │
20 * ├------┬---┴-┬---┴--┬--┴-----┴----┬┴----┬┘ ┌┴-----┴-----┴--┬--┴----┬┴-----┼-----┼-----┼-----┤
21 * │ Ctrl │ Win │ Alt │ │ Fn │ │ │ Alt │ Win │ Lft │ Dwn │ Rgt │
22 * └------┴-----┴------┴-------------┴-----┘ └---------------┴-------┴------┴-----┴-----┴-----┘
23 */
24[BASE] = LAYOUT(
25 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQUAL, KC_BSPACE,
26 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRACKET, KC_RBRACKET, KC_BSLS,
27 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOTE, KC_ENTER,
28 KC_LSFT, 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_F3,
29 KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, MO(_FN), KC_SPACE, KC_RALT, KC_RGUI, KC_LEFT, KC_DOWN, KC_RIGHT
30 ),
31/* Function
32 *
33 * ┌-----┬-----┬-----┬-----┬-----┬-----┬-----┐ ┌-----┬-----┬-----┬-----┬-----┬-----┬----------┐
34 * │ │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ │
35 * ├-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┘ ┌--┴-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬-------┤
36 * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
37 * ├--------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴-------┤
38 * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
39 * ├---------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬-----┬-----┤
40 * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
41 * ├------┬---┴-┬---┴--┬--┴-----┴----┬┴----┬┘ ┌┴-----┴-----┴--┬--┴----┬┴-----┼-----┼-----┼-----┤
42 * │ │ │ │ │ │ │ │ │ │ │ │ │
43 * └------┴-----┴------┴-------------┴-----┘ └---------------┴-------┴------┴-----┴-----┴-----┘
44 */
45[_FN] = LAYOUT(
46 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,
47 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
48 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
49 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
50 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
51 ),
52/* Media
53 *
54 * ┌-----┬-----┬-----┬-----┬-----┬-----┬-----┐ ┌-----┬-----┬-----┬-----┬-----┬-----┬----------┐
55 * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
56 * ├-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┘ ┌--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬-------┤
57 * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
58 * ├--------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴-------┤
59 * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
60 * ├---------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬-----┬-----┤
61 * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
62 * ├------┬---┴-┬---┴--┬--┴-----┴----┬┴----┬┘ ┌┴-----┴-----┴--┬--┴----┬┴-----┼-----┼-----┼-----┤
63 * │ │ │ │ │ │ │ │ │ │ │ │ │
64 * └------┴-----┴------┴-------------┴-----┘ └---------------┴-------┴------┴-----┴-----┴-----┘
65 */
66[_FX] = LAYOUT(
67 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
68 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
69 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
70 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
71 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
72 ),
73};
74
diff --git a/keyboards/ymdk/sp64/keymaps/walston/keymap.c b/keyboards/ymdk/sp64/keymaps/walston/keymap.c
new file mode 100644
index 000000000..ada3073fb
--- /dev/null
+++ b/keyboards/ymdk/sp64/keymaps/walston/keymap.c
@@ -0,0 +1,94 @@
1#include QMK_KEYBOARD_H
2enum layer_names {
3 BASE, // default layer
4 _FUN, // function layer
5 _NUMPAD, // num-pad
6 _MEDIA // media keys
7};
8
9const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
10/* Keymap 0: Basic layer
11 *
12 * ┌-----┬-----┬-----┬-----┬-----┬-----┬-----┐ ┌-----┬-----┬-----┬-----┬-----┬-----┬----------┐
13 * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ │ 7 │ 8 │ 9 │ 0 │ - │ = │ BkSp │
14 * ├-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┘ ┌--┴-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬-------┤
15 * │ Tab │ Q │ W │ E │ R │ T │ │ Y │ U │ I │ O │ P │ [ │ ] │ \ │
16 * ├--------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴-------┤
17 * │ Ctrl │ A │ S │ D │ F │ G │ │ H │ J │ K │ L │ ; │ ' │ Enter │
18 * ├---------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬-----┬-----┤
19 * │ LShift │ Z │ X │ C │ V │ B │ │ N │ M │ < │ > │ ? │ Sft │ Up │_MED │
20 * ├------┬---┴-┬---┴--┬--┴-----┴----┬┴----┬┘ ┌┴-----┴-----┴--┬--┴----┬┴-----┼-----┼-----┼-----┤
21 * │ _NUM │_MED │ Alt │ Cmd │ Spc │ │ Space │ Cmd │ Alt │ Lft │ Dwn │ Rgt │
22 * └------┴-----┴------┴-------------┴-----┘ └---------------┴-------┴------┴-----┴-----┴-----┘
23 */
24[BASE] = LAYOUT(
25 MT(RESET, KC_GRAVE), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQUAL, KC_BSPACE,
26 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRACKET, KC_RBRACKET, KC_BSLS,
27 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOTE, KC_ENTER,
28 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, OSL(_MEDIA),
29 LT(_NUMPAD, KC_CAPS), TT(_MEDIA), KC_LALT, KC_LGUI, LT(_FUN, KC_SPACE), KC_SPACE, KC_RGUI, KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT
30 ),
31/* Keymap 1: Function Layer / Vim Arrows
32 *
33 * ┌-----┬-----┬-----┬-----┬-----┬-----┬-----┐ ┌-----┬-----┬-----┬-----┬-----┬-----┬----------┐
34 * │ Esc │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ │
35 * ├-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┘ ┌--┴-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬-------┤
36 * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
37 * ├--------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴-------┤
38 * │ │ │ │ │ │ │ │ │Left │ Up │Down │Right│ │ │
39 * ├---------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬-----┬-----┤
40 * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
41 * ├------┬---┴-┬---┴--┬--┴-----┴----┬┴----┬┘ ┌┴-----┴-----┴--┬--┴----┬┴-----┼-----┼-----┼-----┤
42 * │ │ │ │ │ │ │ │ │ │ │ │ │
43 * └------┴-----┴------┴-------------┴-----┘ └---------------┴-------┴------┴-----┴-----┴-----┘
44 */
45[_FUN] = LAYOUT(
46 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, _______,
47 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
48 _______, _______, _______, _______, _______, _______, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, _______, _______, _______,
49 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
50 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
51 ),
52/* Keymap 2: NumPad
53 *
54 * ┌-----┬-----┬-----┬-----┬-----┬-----┬-----┐ ┌-----┬-----┬-----┬-----┬-----┬-----┬----------┐
55 * │ │ │ │ │ │ │ │ │ 7 │ 8 │ 9 │ │ Vol-│ Vol+│ Mute │
56 * ├-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┘ ┌--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬-------┤
57 * │ │ │ │ │ │ │ │ │ 4 │ 5 │ 6 │ │ |<< │ >>| │ >|| │
58 * ├--------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴-------┤
59 * │ │ │ │ │ │ │ │ │ 1 │ 2 │ 3 │ │ │ │
60 * ├---------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬-----┬-----┤
61 * │ │ │ │ │ │ │ │ │ 0 │ │ │ │ │ │ │
62 * ├------┬---┴-┬---┴--┬--┴-----┴----┬┴----┬┘ ┌┴-----┴-----┴--┬--┴----┬┴-----┼-----┼-----┼-----┤
63 * │ │ │ │ │ │ │ │ │ │ │ │ │
64 * └------┴-----┴------┴-------------┴-----┘ └---------------┴-------┴------┴-----┴-----┴-----┘
65 */
66[_NUMPAD] = LAYOUT(
67 _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, _______, KC_VOLD, KC_VOLU, KC_MUTE,
68 _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, _______, KC_MPRV, KC_MNXT, KC_MPLY,
69 _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, _______, _______, _______,
70 _______, _______, _______, _______, _______, _______, _______, KC_P0, _______, _______, _______, _______, _______, _______,
71 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
72 ),
73/* Keymap 3: Media
74 *
75 * ┌-----┬-----┬-----┬-----┬-----┬-----┬-----┐ ┌-----┬-----┬-----┬-----┬-----┬-----┬----------┐
76 * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
77 * ├-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┘ ┌--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬-------┤
78 * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
79 * ├--------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴-------┤
80 * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
81 * ├---------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬-----┬-----┤
82 * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
83 * ├------┬---┴-┬---┴--┬--┴-----┴----┬┴----┬┘ ┌┴-----┴-----┴--┬--┴----┬┴-----┼-----┼-----┼-----┤
84 * │ │ │ │ Backlight │ │ │ │ │ │ │ │ │
85 * └------┴-----┴------┴-------------┴-----┘ └---------------┴-------┴------┴-----┴-----┴-----┘
86 */
87[_MEDIA] = LAYOUT(
88 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
89 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
90 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
91 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
92 _______, _______, _______, RGB_TOG, _______, _______, _______, _______, _______, _______, _______
93 ),
94};
diff --git a/keyboards/ymdk/sp64/keymaps/walston/rules.mk b/keyboards/ymdk/sp64/keymaps/walston/rules.mk
new file mode 100644
index 000000000..a6c5cfa18
--- /dev/null
+++ b/keyboards/ymdk/sp64/keymaps/walston/rules.mk
@@ -0,0 +1 @@
COMMAND_ENABLE = no
diff --git a/keyboards/ymdk/sp64/matrix.c b/keyboards/ymdk/sp64/matrix.c
new file mode 100644
index 000000000..8dd2bb8d7
--- /dev/null
+++ b/keyboards/ymdk/sp64/matrix.c
@@ -0,0 +1,169 @@
1/*
2Copyright 2013 Oleg Kostyuk <cub.uanic@gmail.com>
3This program is free software: you can redistribute it and/or modify
4it under the terms of the GNU General Public License as published by
5the Free Software Foundation, either version 2 of the License, or
6(at your option) any later version.
7This program is distributed in the hope that it will be useful,
8but WITHOUT ANY WARRANTY; without even the implied warranty of
9MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10GNU General Public License for more details.
11You should have received a copy of the GNU General Public License
12along with this program. If not, see <http://www.gnu.org/licenses/>.
13*/
14
15#include "matrix.h"
16#include <stdint.h>
17#include <stdbool.h>
18#include <avr/io.h>
19#include "wait.h"
20#include "action_layer.h"
21#include "print.h"
22#include "debug.h"
23#include "util.h"
24#include "sp64.h"
25#include "debounce.h"
26
27/* matrix state(1:on, 0:off) */
28static matrix_row_t matrix[MATRIX_ROWS];
29
30// Debouncing: store for each key the number of scans until it's eligible to
31// change. When scanning the matrix, ignore any changes in keys that have
32// already changed in the last DEBOUNCE scans.
33static matrix_row_t matrix_debouncing[MATRIX_ROWS];
34
35static void matrix_select_row(uint8_t row);
36
37#ifdef RIGHT_HALF
38static uint8_t mcp23018_reset_loop = 0;
39#endif
40
41void matrix_init(void)
42{
43 // all outputs for rows high
44 DDRB = 0xFF;
45 PORTB = 0xFF;
46 // all inputs for columns
47 DDRA = 0x00;
48 DDRC &= ~(0x111111<<2);
49 DDRD &= ~(1<<PIND7);
50 // all columns are pulled-up
51 PORTA = 0xFF;
52 PORTC |= (0b111111<<2);
53 PORTD |= (1<<PIND7);
54
55#ifdef RIGHT_HALF
56 // initialize row and col
57 mcp23018_status = init_mcp23018();
58#endif
59
60 // initialize matrix state: all keys off
61 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
62 matrix[row] = 0;
63 matrix_debouncing[row] = 0;
64 }
65 debounce_init(MATRIX_ROWS);
66 matrix_init_quantum();
67}
68
69uint8_t matrix_scan(void)
70{
71#ifdef RIGHT_HALF
72 // Then the keyboard
73 if (mcp23018_status != I2C_STATUS_SUCCESS) {
74 if (++mcp23018_reset_loop == 0) {
75 // if (++mcp23018_reset_loop >= 1300) {
76 // since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans
77 // this will be approx bit more frequent than once per second
78 print("trying to reset mcp23018\n");
79 mcp23018_status = init_mcp23018();
80 if (mcp23018_status) {
81 print("left side not responding\n");
82 } else {
83 print("left side attached\n");
84 }
85 }
86 }
87#endif
88 bool changed = false;
89 for (uint8_t row = 0; row < MATRIX_ROWS; row++)
90 {
91 matrix_row_t cols;
92
93 matrix_select_row(row);
94#ifndef RIGHT_HALF
95 _delay_us(5);
96#endif
97
98 cols = (
99 // cols 0..7, PORTA 0 -> 7
100 (~PINA) & 0xFF
101 );
102
103#ifdef RIGHT_HALF
104 uint8_t data = 0x7F;
105 // Receive the columns from right half
106 i2c_receive(I2C_ADDR_WRITE, &data, 1, MCP23018_I2C_TIMEOUT);
107 cols |= ((~(data) & 0x7F) << 7);
108#endif
109
110 if (matrix_debouncing[row] != cols) {
111 matrix_debouncing[row] = cols;
112 //debouncing = DEBOUNCE;
113 changed = true;
114 }
115 }
116
117 debounce(matrix_debouncing, matrix, MATRIX_ROWS, changed);
118
119 matrix_scan_quantum();
120
121#ifdef DEBUG_MATRIX
122 for (uint8_t c = 0; c < MATRIX_COLS; c++)
123 for (uint8_t r = 0; r < MATRIX_ROWS; r++)
124 if (matrix_is_on(r, c)) xprintf("r:%d c:%d \n", r, c);
125#endif
126
127 return (uint8_t)changed;
128}
129
130inline
131matrix_row_t matrix_get_row(uint8_t row)
132{
133 return matrix[row];
134}
135
136void matrix_print(void)
137{
138 print("\nr/c 0123456789ABCDEF\n");
139 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
140 phex(row); print(": ");
141 pbin_reverse16(matrix_get_row(row));
142 print("\n");
143 }
144}
145
146uint8_t matrix_key_count(void)
147{
148 uint8_t count = 0;
149 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
150 count += bitpop16(matrix[i]);
151 }
152 return count;
153}
154
155static void matrix_select_row(uint8_t row)
156{
157#ifdef RIGHT_HALF
158 uint8_t txdata[3];
159
160 //Set the remote row on port A
161 txdata[0] = GPIOA;
162 txdata[1] = 0xFF & ~(1<<row);
163 mcp23018_status = i2c_transmit(I2C_ADDR_WRITE, (uint8_t *)txdata, 2, MCP23018_I2C_TIMEOUT);
164#endif
165
166 // select other half
167 DDRB = (1 << row);
168 PORTB = ~(1 << row);
169}
diff --git a/keyboards/ymdk/sp64/readme.md b/keyboards/ymdk/sp64/readme.md
new file mode 100644
index 000000000..ce547f1e0
--- /dev/null
+++ b/keyboards/ymdk/sp64/readme.md
@@ -0,0 +1,17 @@
1# YMDK SP64
2
3* Keyboard Maintainer: [Nathan Walston](https://github.com/walston)
4* Hardware Supported: YMDK SP64 with the ATmega32a chip.
5* Hardware Availability: [Aliexpress](https://www.aliexpress.com/item/4000074426801.html?spm=a2g0o.productlist.0.0.13a043a4NuWRUc&algo_pvid=d2e1c7f2-710a-47be-98be-c2ee4c35e205&algo_expid=d2e1c7f2-710a-47be-98be-c2ee4c35e205-1&btsid=7eeb6dd6-e91f-4ecc-b94c-0ce4b1d089e0&ws_ab_test=searchweb0_0,searchweb201602_9,searchweb201603_53)
6
7Make example for this keyboard (after setting up your build environment):
8
9 make ymdk/sp64:default
10
11Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](https://docs.qmk.fm/#/flashing_bootloadhid))
12
13 make ymdk/sp64:default:flash
14
15**Reset Key**: Hold down the key located at top left on the left hand board, commonly programmed as _ESC_ while plugging in the keyboard. (NOTE: If this doesn't work, try the lower left key on the lower left board, commonly programmed as _Control_. There might be a different version of the board that uses that key as the reset.)
16
17See 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/ymdk/sp64/rules.mk b/keyboards/ymdk/sp64/rules.mk
new file mode 100644
index 000000000..91dc8ab74
--- /dev/null
+++ b/keyboards/ymdk/sp64/rules.mk
@@ -0,0 +1,32 @@
1# MCU name
2MCU = atmega32a
3
4# Bootloader selection
5# Teensy halfkay
6# Pro Micro caterina
7# Atmel DFU atmel-dfu
8# LUFA DFU lufa-dfu
9# QMK DFU qmk-dfu
10# ATmega32A bootloadHID
11# ATmega328P USBasp
12BOOTLOADER = bootloadHID
13
14# Build Options
15# change yes to no to disable
16#
17BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
18MOUSEKEY_ENABLE = no # Mouse keys
19EXTRAKEY_ENABLE = yes # Audio control and System control
20CONSOLE_ENABLE = no # Console for debug
21COMMAND_ENABLE = yes # Commands for debug and configuration
22# NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
23#BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
24AUDIO_ENABLE = no # There is no speaker on this PCB
25RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
26CUSTOM_MATRIX = yes
27
28# Needed for underglow
29WS2812_DRIVER = i2c
30
31SRC += matrix.c
32QUANTUM_LIB_SRC += i2c_master.c
diff --git a/keyboards/ymdk/sp64/sp64.c b/keyboards/ymdk/sp64/sp64.c
new file mode 100644
index 000000000..568735ad7
--- /dev/null
+++ b/keyboards/ymdk/sp64/sp64.c
@@ -0,0 +1,93 @@
1/* Copyright 2019 Neil Kettle
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 "sp64.h"
18
19#ifdef RIGHT_HALF
20bool i2c_initialized = 0;
21i2c_status_t mcp23018_status = I2C_STATUS_ERROR;
22
23uint8_t init_mcp23018(void)
24{
25 uint8_t data[3];
26 mcp23018_status = I2C_STATUS_ERROR;
27
28 // I2C subsystem
29 if (i2c_initialized == 0) {
30 i2c_init(); // on pins D(1,0)
31 i2c_initialized = true;
32 _delay_ms(1000);
33 }
34
35 // set pin direction
36 // - unused : input : 1
37 // - input : input : 1
38 // - driving : output :
39 data[0] = IODIRA;
40 data[1] = 0b00000000;
41 data[2] = 0b11111111;
42 mcp23018_status = i2c_transmit(I2C_ADDR_WRITE, (uint8_t *)data, 3, MCP23018_I2C_TIMEOUT);
43 if (mcp23018_status != I2C_STATUS_SUCCESS)
44 goto out;
45
46 // set pull-up
47 // - unused : on : 1
48 // - input : on : 1
49 // - driving : off : 0
50 data[0] = GPPUA;
51 data[1] = 0b00000000;
52 data[2] = 0b11111111;
53 mcp23018_status = i2c_transmit(I2C_ADDR_WRITE, (uint8_t *)data, 3, MCP23018_I2C_TIMEOUT);
54 if (mcp23018_status != I2C_STATUS_SUCCESS)
55 goto out;
56
57 // set logical value (doesn't matter on inputs)
58 // - unused : hi-Z : 1
59 // - input : hi-Z : 1
60 // - driving : hi-Z : 1
61 data[0] = OLATA;
62 data[1] = 0b11111111;
63 data[2] = 0b11111111;
64 mcp23018_status = i2c_transmit(I2C_ADDR_WRITE, (uint8_t *)data, 3, MCP23018_I2C_TIMEOUT);
65
66out:
67 return (mcp23018_status);
68}
69#endif
70
71// Optional override functions below.
72// You can leave any or all of these undefined.
73// These are only required if you want to perform custom actions.
74
75__attribute__ ((weak))
76void matrix_init_user(void) {}
77
78void matrix_init_kb(void) {
79 // put your keyboard start-up code here
80 // runs once when the firmware starts up
81
82 matrix_init_user();
83}
84
85__attribute__ ((weak))
86void matrix_scan_user(void) {}
87
88void matrix_scan_kb(void) {
89 // put your looping keyboard code here
90 // runs every cycle (a lot)
91
92 matrix_scan_user();
93}
diff --git a/keyboards/ymdk/sp64/sp64.h b/keyboards/ymdk/sp64/sp64.h
new file mode 100644
index 000000000..63620f0c3
--- /dev/null
+++ b/keyboards/ymdk/sp64/sp64.h
@@ -0,0 +1,84 @@
1/* Copyright 2019 Neil Kettle
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#ifdef RIGHT_HALF
22# include <stdint.h>
23# include "i2c_master.h"
24
25// I2C aliases and register addresses (see "mcp23018.md")
26# define I2C_ADDR 0b0100000
27# define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE )
28# define I2C_ADDR_READ ( (I2C_ADDR<<1) | I2C_READ )
29# define IODIRA 0x00 // i/o direction register
30# define IODIRB 0x01
31# define GPPUA 0x0C // GPIO pull-up resistor register
32# define GPPUB 0x0D
33# define GPIOA 0x12 // general purpose i/o port register (write modifies OLAT)
34# define GPIOB 0x13
35# define OLATA 0x14 // output latch register
36# define OLATB 0x15
37
38extern i2c_status_t mcp23018_status;
39# define MCP23018_I2C_TIMEOUT 100
40
41uint8_t init_mcp23018(void);
42#endif
43
44#define ___ KC_NO
45#define XXX KC_NO
46
47/* This is a shortcut to help you visually see your layout.
48 *
49 * The first section contains all of the arguments representing the physical
50 * layout of the board and position of the keys.
51 *
52 * The second converts the arguments into a two-dimensional array which
53 * represents the switch matrix.
54 *
55 * LEFT HAND RIGHT HAND
56 * ┌-----┬-----┬-----┬-----┬-----┬-----┬-----┐ ┌-----┬-----┬-----┬-----┬-----┬-----┬----------┐
57 * │ L00 │ L01 │ L02 │ L03 │ L04 │ L05 │ L06 │ │ R07 │ R08 │ R09 │ R0A │ R0B │ R0C │ R0D │
58 * ├-----┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┘ ┌--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬--┴--┬-------┤
59 * │ L10 │ L11 │ L12 │ L13 │ L14 │ L15 │ │ R16 │ R17 │ R18 │ R19 │ R1A │ R1B │ R1C │ R1D │
60 * ├--------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴-------┤
61 * │ L20 │ L21 │ L22 │ L23 │ L24 │ L25 │ │ R26 │ R27 │ R28 │ R29 │ R2A │ R2B │ R2C │
62 * ├---------┴┬----┴┬----┴┬----┴┬----┴┬----┴┐ └┬----┴┬----┴┬----┴┬----┴┬----┴┬----┴┬-----┬-----┤
63 * │ L30 │ L31 │ L32 │ L33 │ L34 │ L35 │ │ R36 │ R37 │ R38 │ R39 │ R3A │ R3B │ R3C │ R3D │
64 * ├------┬---┴-┬---┴--┬--┴-----┴----┬┴----┬┘ ┌┴-----┴-----┴--┬--┴----┬┴-----┼-----┼-----┼-----┤
65 * │ L40 │ L41 │ L42 │ L43 │ L45 │ │ R46 │ R48 │ R4A │ R4B │ R4C │ R4D │
66 * └------┴-----┴------┴-------------┴-----┘ └---------------┴-------┴------┴-----┴-----┴-----┘
67 */
68#define LAYOUT( \
69 L00, L01, L02, L03, L04, L05, L06, R07, R08, R09, R0A, R0B, R0C, R0D, \
70 L10, L11, L12, L13, L14, L15, R16, R17, R18, R19, R1A, R1B, R1C, R1D, \
71 L20, L21, L22, L23, L24, L25, R26, R27, R28, R29, R2A, R2B, R2C, \
72 L30, L31, L32, L33, L34, L35, R36, R37, R38, R39, R3A, R3B, R3C, R3D, \
73 L40, L41, L42, L43, L45, R46, R48, R4A, R4B, R4C, R4D \
74 ) \
75 /* matrix positions */ \
76 { \
77 { ___, ___, ___, ___, ___, ___, ___, R46, R48, R4A, R4B, R4C, R4D, R3D }, \
78 { L40, L41, L42, L43, L45, L06, ___, R36, R37, R38, R39, R3A, R3B, R3C }, \
79 { L30, L31, L32, L33, L34, L35, ___, R26, R27, R28, R29, R2A, R2B, R2C }, \
80 { L20, L21, L22, L23, L24, L25, ___, R17, R18, R19, R1A, R1B, R1C, R1D }, \
81 { L10, L11, L12, L13, L14, L15, ___, R07, R08, R09, R0A, R0B, R0C, R0D }, \
82 { L00, L01, L02, L03, L04, L05, ___, R16, ___, ___, ___, ___, ___, ___ } \
83 }
84