aboutsummaryrefslogtreecommitdiff
path: root/keyboards/dm9records
diff options
context:
space:
mode:
authorJames Young <18669334+noroadsleft@users.noreply.github.com>2020-05-30 13:14:59 -0700
committerGitHub <noreply@github.com>2020-05-30 13:14:59 -0700
commitfced377ac007d27f2650ccffbe0b18abcdcfe23d (patch)
treebd5b141987394a5a16cfc416bfe2b9efdb14d067 /keyboards/dm9records
parent7b8a013826ad90714a05ea522de53adf964ab3b9 (diff)
downloadqmk_firmware-fced377ac007d27f2650ccffbe0b18abcdcfe23d.tar.gz
qmk_firmware-fced377ac007d27f2650ccffbe0b18abcdcfe23d.zip
2020 May 30 Breaking Changes Update (#9215)
* Branch point for 2020 May 30 Breaking Change * Migrate `ACTION_LAYER_TOGGLE` to `TG()` (#8954) * Migrate `ACTION_MODS_ONESHOT` to `OSM()` (#8957) * Migrate `ACTION_DEFAULT_LAYER_SET` to `DF()` (#8958) * Migrate `ACTION_LAYER_MODS` to `LM()` (#8959) * Migrate `ACTION_MODS_TAP_KEY` to `MT()` (#8968) * Convert V-USB usbdrv to a submodule (#8321) * Unify Tap Hold functions and documentation (#8348) * Changing board names to prevent confusion (#8412) * Move the Keyboardio Model01 to a keyboardio/ subdir (#8499) * Move spaceman keyboards (#8830) * Migrate miscellaneous `fn_actions` entries (#8977) * Migrate `ACTION_MODS_KEY` to chained mod keycodes (#8979) * Organizing my keyboards (plaid, tartan, ergoinu) (#8537) * Refactor Lily58 to use split_common (#6260) * Refactor zinc to use split_common (#7114) * Add a message if bin/qmk doesn't work (#9000) * Fix conflicting types for 'tfp_printf' (#8269) * Fixed RGB_DISABLE_AFTER_TIMEOUT to be seconds based & small internals cleanup (#6480) * Refactor and updates to TKC1800 code (#8472) * Switch to qmk forks for everything (#9019) * audio refactor: replace deprecated PLAY_NOTE_ARRAY (#8484) * Audio enable corrections (2/3) (#8903) * Split HHKB to ANSI and JP layouts and Add VIA support for each (#8582) * Audio enable corrections (Part 4) (#8974) * Fix typo from PR7114 (#9171) * Augment future branch Changelogs (#8978) * Revert "Branch point for 2020 May 30 Breaking Change"
Diffstat (limited to 'keyboards/dm9records')
-rw-r--r--keyboards/dm9records/ergoinu/config.h109
-rw-r--r--keyboards/dm9records/ergoinu/ergoinu.c5
-rw-r--r--keyboards/dm9records/ergoinu/ergoinu.h44
-rw-r--r--keyboards/dm9records/ergoinu/info.json87
-rw-r--r--keyboards/dm9records/ergoinu/keymaps/default/config.h24
-rw-r--r--keyboards/dm9records/ergoinu/keymaps/default/keymap.c101
-rw-r--r--keyboards/dm9records/ergoinu/keymaps/default/rules.mk29
-rw-r--r--keyboards/dm9records/ergoinu/keymaps/default_jis/config.h24
-rw-r--r--keyboards/dm9records/ergoinu/keymaps/default_jis/keymap.c101
-rw-r--r--keyboards/dm9records/ergoinu/keymaps/default_jis/rules.mk29
-rw-r--r--keyboards/dm9records/ergoinu/matrix.c292
-rw-r--r--keyboards/dm9records/ergoinu/readme.md21
-rw-r--r--keyboards/dm9records/ergoinu/rules.mk49
-rw-r--r--keyboards/dm9records/ergoinu/serial.c295
-rw-r--r--keyboards/dm9records/ergoinu/serial.h24
-rw-r--r--keyboards/dm9records/ergoinu/serial_config.h11
-rw-r--r--keyboards/dm9records/ergoinu/split_util.c56
-rw-r--r--keyboards/dm9records/ergoinu/split_util.h12
-rw-r--r--keyboards/dm9records/plaid/config.h248
-rw-r--r--keyboards/dm9records/plaid/info.json113
-rw-r--r--keyboards/dm9records/plaid/keymaps/brickbots/config.h19
-rw-r--r--keyboards/dm9records/plaid/keymaps/brickbots/keymap.c411
-rw-r--r--keyboards/dm9records/plaid/keymaps/brickbots/readme.md36
-rw-r--r--keyboards/dm9records/plaid/keymaps/default/config.h19
-rw-r--r--keyboards/dm9records/plaid/keymaps/default/keymap.c410
-rw-r--r--keyboards/dm9records/plaid/keymaps/default/readme.md35
-rw-r--r--keyboards/dm9records/plaid/keymaps/thehalfdeafchef/config.h19
-rw-r--r--keyboards/dm9records/plaid/keymaps/thehalfdeafchef/keymap.c182
-rw-r--r--keyboards/dm9records/plaid/keymaps/thehalfdeafchef/readme.md5
-rw-r--r--keyboards/dm9records/plaid/plaid.c43
-rw-r--r--keyboards/dm9records/plaid/plaid.h68
-rw-r--r--keyboards/dm9records/plaid/readme.md23
-rw-r--r--keyboards/dm9records/plaid/rules.mk36
-rw-r--r--keyboards/dm9records/tartan/config.h246
-rw-r--r--keyboards/dm9records/tartan/info.json34
-rw-r--r--keyboards/dm9records/tartan/keymaps/default/keymap.c34
-rw-r--r--keyboards/dm9records/tartan/keymaps/default/readme.md1
-rw-r--r--keyboards/dm9records/tartan/readme.md25
-rw-r--r--keyboards/dm9records/tartan/rules.mk36
-rw-r--r--keyboards/dm9records/tartan/tartan.c16
-rw-r--r--keyboards/dm9records/tartan/tartan.h111
41 files changed, 3483 insertions, 0 deletions
diff --git a/keyboards/dm9records/ergoinu/config.h b/keyboards/dm9records/ergoinu/config.h
new file mode 100644
index 000000000..dfc8a5293
--- /dev/null
+++ b/keyboards/dm9records/ergoinu/config.h
@@ -0,0 +1,109 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3Copyright 2015 Jack Humbert
4Copyright 2018 Takuya Urakawa<twitter:@hsgw>
5
6This program is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation, either version 2 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
22#include "config_common.h"
23#include <serial_config.h>
24
25/* USB Device descriptor parameter
26 VID & PID are lisenced from microchip sublisence program, Don't use other project! */
27#define VENDOR_ID 0x04D8
28#define PRODUCT_ID 0xEE60
29#define DEVICE_VER 0x0001
30#define MANUFACTURER Dm9Records
31#define PRODUCT ergoinu
32#define DESCRIPTION An (Not Portable But Small) Ergonomic split keyboard
33
34#define TAPPING_FORCE_HOLD
35#define TAPPING_TERM 100
36
37#define USE_SERIAL
38
39/* Select hand configuration */
40#define MASTER_LEFT
41// #define MASTER_RIGHT
42// #define EE_HANDS
43
44/* key matrix size */
45// Rows are doubled-up
46#define MATRIX_ROWS 10
47#define MATRIX_ROW_PINS { F6, F7, B1, B3, B2 }
48
49// wiring of each half
50#define MATRIX_COLS 7
51#define MATRIX_COL_PINS { B4, E6, D7, C6, D4, F5, F4 }
52
53/* define if matrix has ghost */
54//#define MATRIX_HAS_GHOST
55
56/* number of backlight levels */
57// #define BACKLIGHT_LEVELS 3
58
59/* Set 0 if debouncing isn't needed */
60#define DEBOUNCE 5
61
62/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
63//#define LOCKING_SUPPORT_ENABLE
64/* Locking resynchronize hack */
65//#define LOCKING_RESYNC_ENABLE
66
67/* ws2812 RGB LED */
68#define RGB_DI_PIN B6
69
70#define RGBLED_NUM 7
71
72#ifndef IOS_DEVICE_ENABLE
73 #if RGBLED_NUM <= 7
74 #define RGBLIGHT_LIMIT_VAL 255
75 #define RGBLIGHT_VAL_STEP 17
76 #endif
77#else
78 #define RGBLIGHT_LIMIT_VAL 90
79 #define RGBLIGHT_VAL_STEP 4
80#endif
81
82#define RGBLIGHT_HUE_STEP 10
83#define RGBLIGHT_SAT_STEP 17
84
85#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE)
86 #define USB_MAX_POWER_CONSUMPTION 500
87#else
88 // fix iPhone and iPad power adapter issue
89 // iOS device need lessthan 100
90 #define USB_MAX_POWER_CONSUMPTION 100
91#endif
92
93/*
94 * Feature disable options
95 * These options are also useful to firmware size reduction.
96 */
97
98/* disable debug print */
99// #define NO_DEBUG
100
101/* disable print */
102// #define NO_PRINT
103
104/* disable action features */
105//#define NO_ACTION_LAYER
106//#define NO_ACTION_TAPPING
107//#define NO_ACTION_ONESHOT
108//#define NO_ACTION_MACRO
109//#define NO_ACTION_FUNCTION
diff --git a/keyboards/dm9records/ergoinu/ergoinu.c b/keyboards/dm9records/ergoinu/ergoinu.c
new file mode 100644
index 000000000..b43ab17c8
--- /dev/null
+++ b/keyboards/dm9records/ergoinu/ergoinu.c
@@ -0,0 +1,5 @@
1#include "ergoinu.h"
2
3void matrix_init_kb(void) {
4 matrix_init_user();
5};
diff --git a/keyboards/dm9records/ergoinu/ergoinu.h b/keyboards/dm9records/ergoinu/ergoinu.h
new file mode 100644
index 000000000..43249a844
--- /dev/null
+++ b/keyboards/dm9records/ergoinu/ergoinu.h
@@ -0,0 +1,44 @@
1/*
2Copyright 2018 Takuya Urakawa<twitter:@hsgw>
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 "quantum.h"
21
22#ifdef RGBLIGHT_ENABLE
23#include "ws2812.h"
24#endif
25
26#define LAYOUT( \
27 L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \
28 L07, L08, L09, L10, L11, L12, L13, R07, R08, R09, R10, R11, R12, R13, \
29 L14, L15, L16, L17, L18, L19, R14, R15, R16, R17, R18, R19, R20, \
30 L20, L21, L22, L23, L24, L25, R21, R22, R23, R24, R25, R26, R27,\
31 L26, L27, L28, L29, L30, R28, R29, R30, R31, R32 \
32 ) { \
33 { L00, L01, L02, L03, L04, L05, L06 }, \
34 { L07, L08, L09, L10, L11, L12, L13 }, \
35 { L14, KC_NO, L15, L16, L17, L18, L19 }, \
36 { L20, KC_NO, L21, L22, L23, L24, L25 }, \
37 { KC_NO, KC_NO, L26, L27, L28, L29, L30}, \
38 { R06, R05, R04, R03, R02, R01, R00 }, \
39 { R13, R12, R11, R10, R09, R08, R07 }, \
40 { R20, R19, R18, R17, R16, R15, R14 }, \
41 { R27, R26, R25, R24, R23, R22, R21 }, \
42 { KC_NO, KC_NO, R32, R31, R30, R29, R28 } \
43 }
44
diff --git a/keyboards/dm9records/ergoinu/info.json b/keyboards/dm9records/ergoinu/info.json
new file mode 100644
index 000000000..3627049a5
--- /dev/null
+++ b/keyboards/dm9records/ergoinu/info.json
@@ -0,0 +1,87 @@
1{
2 "keyboard_name": "Ergoinu",
3 "url": "",
4 "maintainer": "hsgw(Takuya Urakawa)",
5 "width": 18,
6 "height": 5.4,
7 "layouts": {
8 "LAYOUT": {
9 "key_count": 64,
10 "layout": [
11 { "x": 0, "y": 0.6, "label": "ESC" },
12 { "x": 1, "y": 0.4, "label": "1" },
13 { "x": 2, "y": 0.4, "label": "2" },
14 { "x": 3, "y": 0.25, "label": "3" },
15 { "x": 4, "y": 0, "label": "4" },
16 { "x": 5, "y": 0.25, "label": "5" },
17 { "x": 6, "y": 0.4, "label": "6" },
18
19 { "x": 11, "y": 0.4, "label": "7" },
20 { "x": 12, "y": 0.25, "label": "8" },
21 { "x": 13, "y": 0, "label": "9" },
22 { "x": 14, "y": 0.25, "label": "0" },
23 { "x": 15, "y": 0.4, "label": "MINUS" },
24 { "x": 16, "y": 0.4, "label": "EQUAL" },
25 { "x": 17, "y": 0.6, "label": "BACKSLASH" },
26
27 { "x": 0, "y": 1.6, "label": "DELETE" },
28 { "x": 1, "y": 1.4, "label": "TAB" },
29 { "x": 2, "y": 1.4, "label": "Q" },
30 { "x": 3, "y": 1.25, "label": "W" },
31 { "x": 4, "y": 1, "label": "E" },
32 { "x": 5, "y": 1.25, "label": "R" },
33 { "x": 6, "y": 1.4, "label": "T" },
34
35 { "x": 11, "y": 1.4, "label": "Y" },
36 { "x": 12, "y": 1.25, "label": "U" },
37 { "x": 13, "y": 1, "label": "I" },
38 { "x": 14, "y": 1.25, "label": "O" },
39 { "x": 15, "y": 1.4, "label": "P" },
40 { "x": 16, "y": 1.4, "label": "LBRACKET" },
41 { "x": 17, "y": 1.6, "label": "RBRACKET" },
42
43 { "x": 0.25, "y": 2.6, "w": 1.75, "label": "LCTRL" },
44 { "x": 2, "y": 2.4, "label": "A" },
45 { "x": 3, "y": 2.25, "label": "S" },
46 { "x": 4, "y": 2, "label": "D" },
47 { "x": 5, "y": 2.25, "label": "F" },
48 { "x": 6, "y": 2.4, "label": "G" },
49
50 { "x": 11, "y": 2.4, "label": "H" },
51 { "x": 12, "y": 2.25, "label": "J" },
52 { "x": 13, "y": 2, "label": "K" },
53 { "x": 14, "y": 2.25, "label": "L" },
54 { "x": 15, "y": 2.4, "label": "SEMICOLON" },
55 { "x": 16, "y": 2.4, "label": "QUOTE" },
56 { "x": 17, "y": 2.6, "label": "GRAVE" },
57
58 { "x": 0.25, "y": 3.6, "w": 1.75, "label": "LSHIFT" },
59 { "x": 2, "y": 3.4, "label": "Z" },
60 { "x": 3, "y": 3.25, "label": "X" },
61 { "x": 4, "y": 3, "label": "C" },
62 { "x": 5, "y": 3.25, "label": "V" },
63 { "x": 6, "y": 3.4, "label": "B" },
64
65 { "x": 11, "y": 3.4, "label": "N" },
66 { "x": 12, "y": 3.25, "label": "M" },
67 { "x": 13, "y": 3, "label": "COMMA" },
68 { "x": 14, "y": 3.25, "label": "DOT" },
69 { "x": 15, "y": 3.4, "label": "SLASH" },
70 { "x": 16, "y": 3.4, "label": "RSHIFT" },
71 { "x": 17, "y": 3.6, "label": "RSHIFT" },
72
73 { "x": 3, "y": 4.25, "label": "MO(META)" },
74 { "x": 4, "y": 4, "label": "LALT" },
75 { "x": 5, "y": 4.25, "label": "LGUI" },
76 { "x": 6, "y": 4.4, "label": "ENT" },
77 { "x": 7, "y": 4.4, "w": 1.5, "label": "SPACE" },
78
79 { "x": 9.5, "y": 4.4, "w": 1.5, "label": "ENTER" },
80 { "x": 11, "y": 4.4, "label": "BACKSPACE" },
81 { "x": 12, "y": 4.25, "label": "RGUI" },
82 { "x": 13, "y": 4, "label": "RALT" },
83 { "x": 14, "y": 4.25, "label": "MO(META)" }
84 ]
85 }
86 }
87}
diff --git a/keyboards/dm9records/ergoinu/keymaps/default/config.h b/keyboards/dm9records/ergoinu/keymaps/default/config.h
new file mode 100644
index 000000000..bb266f25e
--- /dev/null
+++ b/keyboards/dm9records/ergoinu/keymaps/default/config.h
@@ -0,0 +1,24 @@
1/*
2This is the c configuration file for the keymap
3
4Copyright 2012 Jun Wako <wakojun@gmail.com>
5Copyright 2015 Jack Humbert
6Copyright 2018 Takuya Urakawa <Twitter:@hsgw>
7
8This program is free software: you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation, either version 2 of the License, or
11(at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with this program. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22#pragma once
23
24#define RGBLIGHT_ANIMATIONS
diff --git a/keyboards/dm9records/ergoinu/keymaps/default/keymap.c b/keyboards/dm9records/ergoinu/keymaps/default/keymap.c
new file mode 100644
index 000000000..7f1be4796
--- /dev/null
+++ b/keyboards/dm9records/ergoinu/keymaps/default/keymap.c
@@ -0,0 +1,101 @@
1#include QMK_KEYBOARD_H
2
3#ifdef RGBLIGHT_ENABLE
4//Following line allows macro to read current RGB settings
5extern rgblight_config_t rgblight_config;
6#endif
7
8#define JA_CLON KC_QUOT // : and +
9#define JA_AT KC_LBRC // @ and `
10#define JA_HAT KC_EQL // ^ and ~
11#define JA_ENUN KC_RO // \ and _ (EN mark and UNder score)
12#define JA_ENVL KC_JYEN // \ and | (EN mark and Vertical Line)
13#define JA_LBRC KC_RBRC // [ and {
14#define JA_RBRC KC_BSLS // ] and }
15
16enum LAYER_NO {
17 BASE = 0,
18 META,
19 CONF
20};
21
22enum CUSTOM_KEYCODES {
23 RGB_RST = SAFE_RANGE,
24 RGB_TYPE,
25};
26
27// Fillers to make layering more clear
28#define ______ KC_TRNS
29#define XXXXXX KC_NO
30
31const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
32
33 [BASE] = LAYOUT( \
34 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, \
35 KC_DEL, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, \
36 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_GRV, \
37 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_RSFT, \
38 MO(META),KC_LALT, KC_LGUI, KC_ENT, KC_SPC, KC_ENT, KC_BSPC, KC_RGUI, KC_RALT, MO(META) \
39 ),
40
41 [META] = LAYOUT( \
42 MO(CONF),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_INS, \
43 ______, KC_CAPS, ______, ______, ______, ______, ______, ______, ______, ______, KC_SLCK, KC_PSCR, KC_HOME, KC_END, \
44 ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_PAUS, KC_PGUP, KC_UP, KC_PGDN, \
45 ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_LEFT, KC_DOWN, KC_RGHT, \
46 ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ \
47 ),
48 [CONF] = LAYOUT( \
49 ______, RGB_TYPE,RGB_MOD, RGB_VAI, RGB_HUI, RGB_HUI, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \
50 RGB_RST, RGB_TOG, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_HUD, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \
51 XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \
52 XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \
53 XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX \
54 )
55};
56
57bool enableLEDTypeAnime = false;
58
59bool process_record_user(uint16_t keycode, keyrecord_t *record) {
60 switch(keycode) {
61 case RGB_RST:
62 #ifdef RGBLIGHT_ENABLE
63 if (record->event.pressed) {
64 eeconfig_update_rgblight_default();
65 rgblight_enable();
66 }
67 #endif
68 break;
69 case RGB_MOD:
70 #ifdef RGBLIGHT_ENABLE
71 if (record->event.pressed) {
72 enableLEDTypeAnime = false;
73 rgblight_step();
74 }
75 #endif
76 return false;
77 case RGB_TYPE:
78 #ifdef RGBLIGHT_ENABLE
79 if (record->event.pressed) {
80 rgblight_enable_noeeprom();
81 rgblight_mode_noeeprom(1);
82 enableLEDTypeAnime = !enableLEDTypeAnime;
83 }
84 #endif
85 return false;
86 default:
87 break;
88 }
89 #ifdef RGBLIGHT_ENABLE
90 if(enableLEDTypeAnime) {
91 rgblight_mode_noeeprom(1);
92 uint16_t hue = (rgblight_config.hue + 5) % 360;
93 rgblight_sethsv_noeeprom(hue, rgblight_config.sat, rgblight_config.val);
94 }
95 #endif
96
97 return true;
98}
99
100void matrix_init_user(void) {
101}
diff --git a/keyboards/dm9records/ergoinu/keymaps/default/rules.mk b/keyboards/dm9records/ergoinu/keymaps/default/rules.mk
new file mode 100644
index 000000000..b2eff12b0
--- /dev/null
+++ b/keyboards/dm9records/ergoinu/keymaps/default/rules.mk
@@ -0,0 +1,29 @@
1
2# Build Options
3# change to "no" to disable the options, or define them in the Makefile in
4# the appropriate keymap folder that will get included automatically
5#
6BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
7MOUSEKEY_ENABLE = no # Mouse keys
8EXTRAKEY_ENABLE = no # Audio control and System control
9CONSOLE_ENABLE = no # Console for debug
10COMMAND_ENABLE = no # Commands for debug and configuration
11NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
12BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
13MIDI_ENABLE = no # MIDI controls
14AUDIO_ENABLE = no # Audio output on port C6
15UNICODE_ENABLE = no # Unicode
16BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
17RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
18SWAP_HANDS_ENABLE = no # Enable one-hand typing
19
20# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
21SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
22
23# ergoinu configs
24DISABLE_PROMICRO_LEDs = yes
25
26# Uncomment these for debugging
27# $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE))
28# $(info -- OPT_DEFS=$(OPT_DEFS))
29# $(info )
diff --git a/keyboards/dm9records/ergoinu/keymaps/default_jis/config.h b/keyboards/dm9records/ergoinu/keymaps/default_jis/config.h
new file mode 100644
index 000000000..bb266f25e
--- /dev/null
+++ b/keyboards/dm9records/ergoinu/keymaps/default_jis/config.h
@@ -0,0 +1,24 @@
1/*
2This is the c configuration file for the keymap
3
4Copyright 2012 Jun Wako <wakojun@gmail.com>
5Copyright 2015 Jack Humbert
6Copyright 2018 Takuya Urakawa <Twitter:@hsgw>
7
8This program is free software: you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation, either version 2 of the License, or
11(at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with this program. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22#pragma once
23
24#define RGBLIGHT_ANIMATIONS
diff --git a/keyboards/dm9records/ergoinu/keymaps/default_jis/keymap.c b/keyboards/dm9records/ergoinu/keymaps/default_jis/keymap.c
new file mode 100644
index 000000000..3a1a88f47
--- /dev/null
+++ b/keyboards/dm9records/ergoinu/keymaps/default_jis/keymap.c
@@ -0,0 +1,101 @@
1#include QMK_KEYBOARD_H
2
3#ifdef RGBLIGHT_ENABLE
4//Following line allows macro to read current RGB settings
5extern rgblight_config_t rgblight_config;
6#endif
7
8#define JA_CLON KC_QUOT // : and +
9#define JA_AT KC_LBRC // @ and `
10#define JA_HAT KC_EQL // ^ and ~
11#define JA_ENUN KC_RO // \ and _ (EN mark and UNder score)
12#define JA_ENVL KC_JYEN // \ and | (EN mark and Vertical Line)
13#define JA_LBRC KC_RBRC // [ and {
14#define JA_RBRC KC_BSLS // ] and }
15
16enum LAYER_NO {
17 BASE = 0,
18 META,
19 CONF
20};
21
22enum CUSTOM_KEYCODES {
23 RGB_RST = SAFE_RANGE,
24 RGB_TYPE,
25};
26
27// Fillers to make layering more clear
28#define ______ KC_TRNS
29#define XXXXXX KC_NO
30
31const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
32
33 [BASE] = LAYOUT( \
34 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, JA_HAT, KC_JYEN, \
35 KC_DEL, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JA_AT, JA_LBRC, \
36 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, JA_CLON, JA_RBRC, \
37 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, \
38 MO(META),KC_LALT, KC_ZKHK, KC_BSPC, KC_SPC, KC_ENT, KC_BSPC, KC_MHEN, KC_KANA, MO(META) \
39 ),
40
41
42 [META] = LAYOUT( \
43 MO(CONF),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_INS, \
44 ______, KC_CAPS, ______, KC_UP, ______, ______, ______, ______, ______, ______, KC_SLCK, KC_PSCR, KC_HOME, KC_END, \
45 ______, KC_LEFT, KC_DOWN, KC_RGHT, ______, ______, ______, ______, ______, KC_PAUS, KC_PGUP, KC_UP, KC_PGDN, \
46 ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_LEFT, KC_DOWN, KC_RGHT, \
47 ______, ______, KC_RGUI, KC_DEL, KC_ENT, ______, KC_DEL, KC_HENK, KC_LGUI, ______ \
48 ),
49 [CONF] = LAYOUT( \
50 ______, RGB_TYPE,RGB_MOD, RGB_VAI, RGB_HUI, RGB_HUI, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \
51 RGB_RST, RGB_TOG, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_HUD, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \
52 XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \
53 XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \
54 XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX \
55 )
56};
57
58bool enableLEDTypeAnime = false;
59
60bool process_record_user(uint16_t keycode, keyrecord_t *record) {
61 switch(keycode) {
62 case RGB_RST:
63 #ifdef RGBLIGHT_ENABLE
64 if (record->event.pressed) {
65 eeconfig_update_rgblight_default();
66 rgblight_enable();
67 }
68 #endif
69 break;
70 case RGB_MOD:
71 #ifdef RGBLIGHT_ENABLE
72 if (record->event.pressed) {
73 enableLEDTypeAnime = false;
74 rgblight_step();
75 }
76 #endif
77 return false;
78 case RGB_TYPE:
79 #ifdef RGBLIGHT_ENABLE
80 if (record->event.pressed) {
81 rgblight_enable_noeeprom();
82 rgblight_mode_noeeprom(1);
83 enableLEDTypeAnime = !enableLEDTypeAnime;
84 }
85 #endif
86 return false;
87 default:
88 break;
89 }
90 #ifdef RGBLIGHT_ENABLE
91 if(enableLEDTypeAnime) {
92 rgblight_mode_noeeprom(1);
93 uint16_t hue = (rgblight_config.hue + 5) % 360;
94 rgblight_sethsv_noeeprom(hue, rgblight_config.sat, rgblight_config.val);
95 }
96 #endif
97 return true;
98}
99
100void matrix_init_user(void) {
101}
diff --git a/keyboards/dm9records/ergoinu/keymaps/default_jis/rules.mk b/keyboards/dm9records/ergoinu/keymaps/default_jis/rules.mk
new file mode 100644
index 000000000..92dde90ff
--- /dev/null
+++ b/keyboards/dm9records/ergoinu/keymaps/default_jis/rules.mk
@@ -0,0 +1,29 @@
1
2# Build Options
3# change to "no" to disable the options, or define them in the Makefile in
4# the appropriate keymap folder that will get included automatically
5#
6BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
7MOUSEKEY_ENABLE = no # Mouse keys(+4700)
8EXTRAKEY_ENABLE = no # Audio control and System control(+450)
9CONSOLE_ENABLE = no # Console for debug(+400)
10COMMAND_ENABLE = no # Commands for debug and configuration
11NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
12BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
13MIDI_ENABLE = no # MIDI controls
14AUDIO_ENABLE = no # Audio output on port C6
15UNICODE_ENABLE = no # Unicode
16BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
17RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
18SWAP_HANDS_ENABLE = no # Enable one-hand typing
19
20# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
21SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
22
23# ergoinu configs
24DISABLE_PROMICRO_LEDs = yes
25
26# Uncomment these for debugging
27# $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE))
28# $(info -- OPT_DEFS=$(OPT_DEFS))
29# $(info )
diff --git a/keyboards/dm9records/ergoinu/matrix.c b/keyboards/dm9records/ergoinu/matrix.c
new file mode 100644
index 000000000..4a80cf9f2
--- /dev/null
+++ b/keyboards/dm9records/ergoinu/matrix.c
@@ -0,0 +1,292 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
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/*
19 * scan matrix
20 */
21#include <stdint.h>
22#include <stdbool.h>
23#include <avr/io.h>
24#include <avr/wdt.h>
25#include <avr/interrupt.h>
26#include <util/delay.h>
27#include "print.h"
28#include "debug.h"
29#include "util.h"
30#include "matrix.h"
31#include "split_util.h"
32#include "quantum.h"
33
34#include "serial.h"
35
36#ifndef DEBOUNCE
37# define DEBOUNCE 5
38#endif
39
40#define ERROR_DISCONNECT_COUNT 5
41
42static uint8_t debouncing = DEBOUNCE;
43static const int ROWS_PER_HAND = MATRIX_ROWS/2;
44static uint8_t error_count = 0;
45uint8_t is_master = 0 ;
46
47static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
48static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
49
50/* matrix state(1:on, 0:off) */
51static matrix_row_t matrix[MATRIX_ROWS];
52static matrix_row_t matrix_debouncing[MATRIX_ROWS];
53
54static matrix_row_t read_cols(void);
55static void init_cols(void);
56static void unselect_rows(void);
57static void select_row(uint8_t row);
58static uint8_t matrix_master_scan(void);
59
60
61__attribute__ ((weak))
62void matrix_init_kb(void) {
63 matrix_init_user();
64}
65
66__attribute__ ((weak))
67void matrix_scan_kb(void) {
68 matrix_scan_user();
69}
70
71__attribute__ ((weak))
72void matrix_init_user(void) {
73}
74
75__attribute__ ((weak))
76void matrix_scan_user(void) {
77}
78
79inline
80uint8_t matrix_rows(void) {
81 return MATRIX_ROWS;
82}
83
84inline
85uint8_t matrix_cols(void) {
86 return MATRIX_COLS;
87}
88
89void matrix_init(void) {
90 debug_enable = true;
91 debug_matrix = true;
92 debug_mouse = true;
93 // initialize row and col
94 unselect_rows();
95 init_cols();
96
97 setPinOutput(B0);
98 setPinOutput(D5);
99
100 #ifdef DISABLE_PROMICRO_LEDs
101 writePinHigh(B0);
102 writePinHigh(D5);
103 #endif
104
105 // initialize matrix state: all keys off
106 for (uint8_t i=0; i < MATRIX_ROWS; i++) {
107 matrix[i] = 0;
108 matrix_debouncing[i] = 0;
109 }
110
111 is_master = has_usb();
112
113 matrix_init_quantum();
114}
115
116uint8_t _matrix_scan(void) {
117 // Right hand is stored after the left in the matirx so, we need to offset it
118 int offset = isLeftHand ? 0 : (ROWS_PER_HAND);
119
120 for (uint8_t i = 0; i < ROWS_PER_HAND; i++) {
121 select_row(i);
122 _delay_us(30); // without this wait read unstable value.
123 matrix_row_t cols = read_cols();
124 if (matrix_debouncing[i+offset] != cols) {
125 matrix_debouncing[i+offset] = cols;
126 debouncing = DEBOUNCE;
127 }
128 unselect_rows();
129 }
130
131 if (debouncing) {
132 if (--debouncing) {
133 _delay_ms(1);
134 } else {
135 for (uint8_t i = 0; i < ROWS_PER_HAND; i++) {
136 matrix[i+offset] = matrix_debouncing[i+offset];
137 }
138 }
139 }
140
141 return 1;
142}
143
144int serial_transaction(void) {
145 int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
146 int ret=serial_update_buffers();
147 if (ret ) {
148#ifndef DISABLE_PROMICRO_LEDs
149 if(ret==2) writePinLow(B0);
150#endif
151 return 1;
152 }
153#ifndef DISABLE_PROMICRO_LEDs
154 writePinHigh(B0);
155#endif
156 for (int i = 0; i < ROWS_PER_HAND; ++i) {
157 matrix[slaveOffset+i] = serial_slave_buffer[i];
158 }
159 return 0;
160}
161
162uint8_t matrix_scan(void) {
163 if (is_master) {
164 matrix_master_scan();
165 }else{
166 matrix_slave_scan();
167
168 int offset = (isLeftHand) ? ROWS_PER_HAND : 0;
169
170 for (int i = 0; i < ROWS_PER_HAND; ++i) {
171 matrix[offset+i] = serial_master_buffer[i];
172 }
173
174 matrix_scan_quantum();
175 }
176 return 1;
177}
178
179
180uint8_t matrix_master_scan(void) {
181
182 int ret = _matrix_scan();
183
184 int offset = (isLeftHand) ? 0 : ROWS_PER_HAND;
185
186 for (int i = 0; i < ROWS_PER_HAND; ++i) {
187 serial_master_buffer[i] = matrix[offset+i];
188 }
189
190 if( serial_transaction() ) {
191#ifndef DISABLE_PROMICRO_LEDs
192 // turn on the indicator led when halves are disconnected
193 writePinLow(D5);
194#endif
195
196 error_count++;
197
198 if (error_count > ERROR_DISCONNECT_COUNT) {
199 // reset other half if disconnected
200 int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
201 for (int i = 0; i < ROWS_PER_HAND; ++i) {
202 matrix[slaveOffset+i] = 0;
203 }
204 }
205 } else {
206#ifndef DISABLE_PROMICRO_LEDs
207 // turn off the indicator led on no error
208 writePinHigh(D5);
209#endif
210 error_count = 0;
211 }
212 matrix_scan_quantum();
213 return ret;
214}
215
216void matrix_slave_scan(void) {
217 _matrix_scan();
218
219 int offset = (isLeftHand) ? 0 : ROWS_PER_HAND;
220
221 for (int i = 0; i < ROWS_PER_HAND; ++i) {
222 serial_slave_buffer[i] = matrix[offset+i];
223 }
224}
225
226bool matrix_is_modified(void)
227{
228 if (debouncing) return false;
229 return true;
230}
231
232inline
233bool matrix_is_on(uint8_t row, uint8_t col)
234{
235 return (matrix[row] & ((matrix_row_t)1<<col));
236}
237
238inline
239matrix_row_t matrix_get_row(uint8_t row)
240{
241 return matrix[row];
242}
243
244void matrix_print(void)
245{
246 print("\nr/c 0123456789ABCDEF\n");
247 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
248 phex(row); print(": ");
249 pbin_reverse16(matrix_get_row(row));
250 print("\n");
251 }
252}
253
254uint8_t matrix_key_count(void)
255{
256 uint8_t count = 0;
257 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
258 count += bitpop16(matrix[i]);
259 }
260 return count;
261}
262
263static void init_cols(void)
264{
265 for(int x = 0; x < MATRIX_COLS; x++) {
266 _SFR_IO8((col_pins[x] >> 4) + 1) &= ~_BV(col_pins[x] & 0xF);
267 _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF);
268 }
269}
270
271static matrix_row_t read_cols(void)
272{
273 matrix_row_t result = 0;
274 for(int x = 0; x < MATRIX_COLS; x++) {
275 result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x);
276 }
277 return result;
278}
279
280static void unselect_rows(void)
281{
282 for(int x = 0; x < ROWS_PER_HAND; x++) {
283 _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF);
284 _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF);
285 }
286}
287
288static void select_row(uint8_t row)
289{
290 _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF);
291 _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF);
292}
diff --git a/keyboards/dm9records/ergoinu/readme.md b/keyboards/dm9records/ergoinu/readme.md
new file mode 100644
index 000000000..de0a1c6c9
--- /dev/null
+++ b/keyboards/dm9records/ergoinu/readme.md
@@ -0,0 +1,21 @@
1ErgoInu
2===
3
4![ergoinu](https://i.imgur.com/4CCM8Vl.jpg)
5
6An (Not Portable But Small) Ergonomic Split Keyboard.
7
8Keyboard Maintainer: [hsgw](https://github.com/hsgw/) [twitter](https://twitter.com/hsgw)
9Hardware Supported: Pro Micro
10Hardware Availability & Repository: [https://github.com/hsgw/ergoinu](https://github.com/hsgw/ergoinu)
11
12Make example for this keyboard (after setting up your build environment):
13
14 make dm9records/ergoinu:default
15
16 (or)
17
18 make dm9records/ergoinu:default_jis
19
20
21See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information.
diff --git a/keyboards/dm9records/ergoinu/rules.mk b/keyboards/dm9records/ergoinu/rules.mk
new file mode 100644
index 000000000..493046ffa
--- /dev/null
+++ b/keyboards/dm9records/ergoinu/rules.mk
@@ -0,0 +1,49 @@
1# MCU name
2MCU = atmega32u4
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 = caterina
13
14# Build Options
15# change to "no" to disable the options, or define them in the Makefile in
16# the appropriate keymap folder that will get included automatically
17#
18BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
19MOUSEKEY_ENABLE = no # Mouse keys
20EXTRAKEY_ENABLE = no # Audio control and System control
21CONSOLE_ENABLE = no # Console for debug
22COMMAND_ENABLE = no # Commands for debug and configuration
23NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
24BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
25MIDI_ENABLE = no # MIDI controls
26AUDIO_ENABLE = no # Audio output on port C6
27UNICODE_ENABLE = no # Unicode
28BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
29RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
30SUBPROJECT_rev1 = no
31USE_I2C = no # i2c is not supported
32# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
33SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
34
35CUSTOM_MATRIX = yes
36SRC += matrix.c serial.c split_util.c
37
38# ergoinu configs
39DISABLE_PROMICRO_LEDs = yes
40
41ifneq ($(strip $(ERGOINU)),)
42 ifeq ($(findstring promicroled, $(ERGOINU)), promicroled)
43 DISABLE_PROMICRO_LEDs = no
44 endif
45endif
46
47ifeq ($(strip $(DISABLE_PROMICRO_LEDs)), yes)
48 OPT_DEFS += -DDISABLE_PROMICRO_LEDs
49endif
diff --git a/keyboards/dm9records/ergoinu/serial.c b/keyboards/dm9records/ergoinu/serial.c
new file mode 100644
index 000000000..591941587
--- /dev/null
+++ b/keyboards/dm9records/ergoinu/serial.c
@@ -0,0 +1,295 @@
1/*
2 * WARNING: be careful changing this code, it is very timing dependent
3 */
4
5#ifndef F_CPU
6#define F_CPU 16000000
7#endif
8
9#include <avr/io.h>
10#include <avr/interrupt.h>
11#include <util/delay.h>
12#include <stdbool.h>
13#include "serial.h"
14
15#ifdef USE_SERIAL
16
17#define _delay_sub_us(x) __builtin_avr_delay_cycles(x)
18
19// Serial pulse period in microseconds.
20#define SELECT_SERIAL_SPEED 1
21#if SELECT_SERIAL_SPEED == 0
22 // Very High speed
23 #define SERIAL_DELAY 4 // micro sec
24 #define READ_WRITE_START_ADJUST 30 // cycles
25 #define READ_WRITE_WIDTH_ADJUST 10 // cycles
26#elif SELECT_SERIAL_SPEED == 1
27 // High speed
28 #define SERIAL_DELAY 6 // micro sec
29 #define READ_WRITE_START_ADJUST 23 // cycles
30 #define READ_WRITE_WIDTH_ADJUST 10 // cycles
31#elif SELECT_SERIAL_SPEED == 2
32 // Middle speed
33 #define SERIAL_DELAY 12 // micro sec
34 #define READ_WRITE_START_ADJUST 25 // cycles
35 #define READ_WRITE_WIDTH_ADJUST 10 // cycles
36#elif SELECT_SERIAL_SPEED == 3
37 // Low speed
38 #define SERIAL_DELAY 24 // micro sec
39 #define READ_WRITE_START_ADJUST 25 // cycles
40 #define READ_WRITE_WIDTH_ADJUST 10 // cycles
41#elif SELECT_SERIAL_SPEED == 4
42 // Very Low speed
43 #define SERIAL_DELAY 50 // micro sec
44 #define READ_WRITE_START_ADJUST 25 // cycles
45 #define READ_WRITE_WIDTH_ADJUST 10 // cycles
46#else
47#error Illegal Serial Speed
48#endif
49
50
51#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2)
52#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2)
53
54#define SLAVE_INT_WIDTH 1
55#define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY
56
57uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0};
58uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0};
59
60#define SLAVE_DATA_CORRUPT (1<<0)
61volatile uint8_t status = 0;
62
63inline static
64void serial_delay(void) {
65 _delay_us(SERIAL_DELAY);
66}
67
68inline static
69void serial_delay_half1(void) {
70 _delay_us(SERIAL_DELAY_HALF1);
71}
72
73inline static
74void serial_delay_half2(void) {
75 _delay_us(SERIAL_DELAY_HALF2);
76}
77
78inline static
79void serial_output(void) {
80 SERIAL_PIN_DDR |= SERIAL_PIN_MASK;
81}
82
83// make the serial pin an input with pull-up resistor
84inline static
85void serial_input_with_pullup(void) {
86 SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK;
87 SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
88}
89
90inline static
91uint8_t serial_read_pin(void) {
92 return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK);
93}
94
95inline static
96void serial_low(void) {
97 SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK;
98}
99
100inline static
101void serial_high(void) {
102 SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
103}
104
105void serial_master_init(void) {
106 serial_output();
107 serial_high();
108}
109
110void serial_slave_init(void) {
111 serial_input_with_pullup();
112
113#if SERIAL_PIN_MASK == _BV(PD0)
114 // Enable INT0
115 EIMSK |= _BV(INT0);
116 // Trigger on falling edge of INT0
117 EICRA &= ~(_BV(ISC00) | _BV(ISC01));
118#elif SERIAL_PIN_MASK == _BV(PD2)
119 // Enable INT2
120 EIMSK |= _BV(INT2);
121 // Trigger on falling edge of INT2
122 EICRA &= ~(_BV(ISC20) | _BV(ISC21));
123#else
124 #error unknown SERIAL_PIN_MASK value
125#endif
126}
127
128// Used by the sender to synchronize timing with the reciver.
129static
130void sync_recv(void) {
131 for (int i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) {
132 }
133 // This shouldn't hang if the slave disconnects because the
134 // serial line will float to high if the slave does disconnect.
135 while (!serial_read_pin());
136}
137
138// Used by the reciver to send a synchronization signal to the sender.
139static
140void sync_send(void) {
141 serial_low();
142 serial_delay();
143 serial_high();
144}
145
146// Reads a byte from the serial line
147static
148uint8_t serial_read_byte(void) {
149 uint8_t byte = 0;
150 _delay_sub_us(READ_WRITE_START_ADJUST);
151 for ( uint8_t i = 0; i < 8; ++i) {
152 serial_delay_half1(); // read the middle of pulses
153 byte = (byte << 1) | serial_read_pin();
154 _delay_sub_us(READ_WRITE_WIDTH_ADJUST);
155 serial_delay_half2();
156 }
157 return byte;
158}
159
160// Sends a byte with MSB ordering
161static
162void serial_write_byte(uint8_t data) {
163 uint8_t b = 1<<7;
164 while( b ) {
165 if(data & b) {
166 serial_high();
167 } else {
168 serial_low();
169 }
170 b >>= 1;
171 serial_delay();
172 }
173 serial_low(); // sync_send() / senc_recv() need raise edge
174}
175
176// interrupt handle to be used by the slave device
177ISR(SERIAL_PIN_INTERRUPT) {
178 serial_output();
179
180 // slave send phase
181 uint8_t checksum = 0;
182 for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) {
183 sync_send();
184 serial_write_byte(serial_slave_buffer[i]);
185 checksum += serial_slave_buffer[i];
186 }
187 sync_send();
188 serial_write_byte(checksum);
189
190 // slave switch to input
191 sync_send(); //0
192 serial_delay_half1(); //1
193 serial_low(); //2
194 serial_input_with_pullup(); //2
195 serial_delay_half1(); //3
196
197 // slave recive phase
198 uint8_t checksum_computed = 0;
199 for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) {
200 sync_recv();
201 serial_master_buffer[i] = serial_read_byte();
202 checksum_computed += serial_master_buffer[i];
203 }
204 sync_recv();
205 uint8_t checksum_received = serial_read_byte();
206
207 if ( checksum_computed != checksum_received ) {
208 status |= SLAVE_DATA_CORRUPT;
209 } else {
210 status &= ~SLAVE_DATA_CORRUPT;
211 }
212
213 sync_recv(); //weit master output to high
214}
215
216inline
217bool serial_slave_DATA_CORRUPT(void) {
218 return status & SLAVE_DATA_CORRUPT;
219}
220
221// Copies the serial_slave_buffer to the master and sends the
222// serial_master_buffer to the slave.
223//
224// Returns:
225// 0 => no error
226// 1 => slave did not respond
227// 2 => checksum error
228int serial_update_buffers(void) {
229 // this code is very time dependent, so we need to disable interrupts
230 cli();
231
232 // signal to the slave that we want to start a transaction
233 serial_output();
234 serial_low();
235 _delay_us(SLAVE_INT_WIDTH);
236
237 // wait for the slaves response
238 serial_input_with_pullup();
239 _delay_us(SLAVE_INT_RESPONSE_TIME);
240
241 // check if the slave is present
242 if (serial_read_pin()) {
243 // slave failed to pull the line low, assume not present
244 serial_output();
245 serial_high();
246 sei();
247 return 1;
248 }
249
250 // master recive phase
251 // if the slave is present syncronize with it
252
253 uint8_t checksum_computed = 0;
254 // receive data from the slave
255 for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) {
256 sync_recv();
257 serial_slave_buffer[i] = serial_read_byte();
258 checksum_computed += serial_slave_buffer[i];
259 }
260 sync_recv();
261 uint8_t checksum_received = serial_read_byte();
262
263 if (checksum_computed != checksum_received) {
264 serial_output();
265 serial_high();
266 sei();
267 return 2;
268 }
269
270 // master switch to output
271 sync_recv(); //0
272 serial_delay(); //1
273 serial_low(); //3
274 serial_output(); // 3
275 serial_delay_half1(); //4
276
277 // master send phase
278 uint8_t checksum = 0;
279
280 for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) {
281 sync_send();
282 serial_write_byte(serial_master_buffer[i]);
283 checksum += serial_master_buffer[i];
284 }
285 sync_send();
286 serial_write_byte(checksum);
287
288 // always, release the line when not in use
289 sync_send();
290
291 sei();
292 return 0;
293}
294
295#endif
diff --git a/keyboards/dm9records/ergoinu/serial.h b/keyboards/dm9records/ergoinu/serial.h
new file mode 100644
index 000000000..67cf06ac6
--- /dev/null
+++ b/keyboards/dm9records/ergoinu/serial.h
@@ -0,0 +1,24 @@
1#pragma once
2
3#include <stdbool.h>
4
5// ////////////////////////////////////////////
6// Need Soft Serial defines in serial_config.h
7// ////////////////////////////////////////////
8// ex.
9// #define SERIAL_PIN_DDR DDRD
10// #define SERIAL_PIN_PORT PORTD
11// #define SERIAL_PIN_INPUT PIND
12// #define SERIAL_PIN_MASK _BV(PD?) ?=0,2
13// #define SERIAL_PIN_INTERRUPT INT?_vect ?=0,2
14// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
15// #define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2
16
17// Buffers for master - slave communication
18extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH];
19extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH];
20
21void serial_master_init(void);
22void serial_slave_init(void);
23int serial_update_buffers(void);
24bool serial_slave_data_corrupt(void);
diff --git a/keyboards/dm9records/ergoinu/serial_config.h b/keyboards/dm9records/ergoinu/serial_config.h
new file mode 100644
index 000000000..a16db684c
--- /dev/null
+++ b/keyboards/dm9records/ergoinu/serial_config.h
@@ -0,0 +1,11 @@
1#pragma once
2
3/* Soft Serial defines */
4#define SERIAL_PIN_DDR DDRD
5#define SERIAL_PIN_PORT PORTD
6#define SERIAL_PIN_INPUT PIND
7#define SERIAL_PIN_MASK _BV(PD2)
8#define SERIAL_PIN_INTERRUPT INT2_vect
9
10#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
11#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2
diff --git a/keyboards/dm9records/ergoinu/split_util.c b/keyboards/dm9records/ergoinu/split_util.c
new file mode 100644
index 000000000..0cbc2c69c
--- /dev/null
+++ b/keyboards/dm9records/ergoinu/split_util.c
@@ -0,0 +1,56 @@
1#include <avr/io.h>
2#include <avr/wdt.h>
3#include <avr/power.h>
4#include <avr/interrupt.h>
5#include <util/delay.h>
6#include <avr/eeprom.h>
7#include "split_util.h"
8#include "matrix.h"
9#include "keyboard.h"
10
11#include "serial.h"
12
13volatile bool isLeftHand = true;
14
15static void setup_handedness(void) {
16 #ifdef EE_HANDS
17 isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS);
18 #else
19 // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c
20 #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT)
21 isLeftHand = !has_usb();
22 #else
23 isLeftHand = has_usb();
24 #endif
25 #endif
26}
27
28static void keyboard_master_setup(void) {
29 serial_master_init();
30}
31
32static void keyboard_slave_setup(void) {
33 serial_slave_init();
34}
35
36bool has_usb(void) {
37 USBCON |= (1 << OTGPADE); //enables VBUS pad
38 _delay_us(5);
39 return (USBSTA & (1<<VBUS)); //checks state of VBUS
40}
41
42void split_keyboard_setup(void) {
43 setup_handedness();
44
45 if (has_usb()) {
46 keyboard_master_setup();
47 } else {
48 keyboard_slave_setup();
49 }
50 sei();
51}
52
53// this code runs before the usb and keyboard is initialized
54void matrix_setup(void) {
55 split_keyboard_setup();
56}
diff --git a/keyboards/dm9records/ergoinu/split_util.h b/keyboards/dm9records/ergoinu/split_util.h
new file mode 100644
index 000000000..11cfd5455
--- /dev/null
+++ b/keyboards/dm9records/ergoinu/split_util.h
@@ -0,0 +1,12 @@
1#pragma once
2
3#include <stdbool.h>
4#include "eeconfig.h"
5
6extern volatile bool isLeftHand;
7
8// slave version of matix scan, defined in matrix.c
9void matrix_slave_scan(void);
10
11void split_keyboard_setup(void);
12bool has_usb(void);
diff --git a/keyboards/dm9records/plaid/config.h b/keyboards/dm9records/plaid/config.h
new file mode 100644
index 000000000..4d7bedee5
--- /dev/null
+++ b/keyboards/dm9records/plaid/config.h
@@ -0,0 +1,248 @@
1/*
2Copyright 2019 Takuya Urakawa (dm9records.com)
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/* VID & PID from vusb project, see tmk_core/protocol/vusb/USB-IDs-for-free.txt"*/
24#define VENDOR_ID 0x16c0
25#define PRODUCT_ID 0x27db
26#define DEVICE_VER 0x0002
27#define MANUFACTURER dm9records
28#define PRODUCT Plaid
29#define DESCRIPTION 12x4 ortholinear keyboard with through hole components
30
31/* key matrix size */
32#define MATRIX_ROWS 4
33#define MATRIX_COLS 12
34
35/*
36 * Keyboard Matrix Assignments
37 *
38 * Change this to how you wired your keyboard
39 * COLS: AVR pins used for columns, left to right
40 * ROWS: AVR pins used for rows, top to bottom
41 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
42 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
43 *
44 */
45#define MATRIX_ROW_PINS { B4, B5, B3, D4 }
46#define MATRIX_COL_PINS { B0, D7, D6, D5, B2, B1, C0, C1, C2, C3, D1, D0 }
47#define UNUSED_PINS
48
49/* COL2ROW, ROW2COL*/
50#define DIODE_DIRECTION COL2ROW
51
52#define USB_MAX_POWER_CONSUMPTION 100
53
54/*
55 * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
56 */
57// #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
58
59// #define BACKLIGHT_PIN B7
60// #define BACKLIGHT_BREATHING
61// #define BACKLIGHT_LEVELS 3
62
63// #define RGB_DI_PIN E2
64// #ifdef RGB_DI_PIN
65// #define RGBLED_NUM 16
66// #define RGBLIGHT_HUE_STEP 8
67// #define RGBLIGHT_SAT_STEP 8
68// #define RGBLIGHT_VAL_STEP 8
69// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
70// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
71// /*== all animations enable ==*/
72// #define RGBLIGHT_ANIMATIONS
73// /*== or choose animations ==*/
74// #define RGBLIGHT_EFFECT_BREATHING
75// #define RGBLIGHT_EFFECT_RAINBOW_MOOD
76// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
77// #define RGBLIGHT_EFFECT_SNAKE
78// #define RGBLIGHT_EFFECT_KNIGHT
79// #define RGBLIGHT_EFFECT_CHRISTMAS
80// #define RGBLIGHT_EFFECT_STATIC_GRADIENT
81// #define RGBLIGHT_EFFECT_RGB_TEST
82// #define RGBLIGHT_EFFECT_ALTERNATING
83// #endif
84
85/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
86#define DEBOUNCE 5
87
88/* define if matrix has ghost (lacks anti-ghosting diodes) */
89//#define MATRIX_HAS_GHOST
90
91/* number of backlight levels */
92
93/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
94#define LOCKING_SUPPORT_ENABLE
95/* Locking resynchronize hack */
96#define LOCKING_RESYNC_ENABLE
97
98/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
99 * This is userful for the Windows task manager shortcut (ctrl+shift+esc).
100 */
101// #define GRAVE_ESC_CTRL_OVERRIDE
102
103/*
104 * Force NKRO
105 *
106 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
107 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
108 * makefile for this to work.)
109 *
110 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
111 * until the next keyboard reset.
112 *
113 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
114 * fully operational during normal computer usage.
115 *
116 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
117 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
118 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
119 * power-up.
120 *
121 */
122//#define FORCE_NKRO
123
124/*
125 * Magic Key Options
126 *
127 * Magic keys are hotkey commands that allow control over firmware functions of
128 * the keyboard. They are best used in combination with the HID Listen program,
129 * found here: https://www.pjrc.com/teensy/hid_listen.html
130 *
131 * The options below allow the magic key functionality to be changed. This is
132 * useful if your keyboard/keypad is missing keys and you want magic key support.
133 *
134 */
135
136/* key combination for magic key command */
137/* defined by default; to change, uncomment and set to the combination you want */
138// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
139
140/* control how magic key switches layers */
141//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
142//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
143//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
144
145/* override magic key keymap */
146//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
147//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
148//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
149//#define MAGIC_KEY_HELP H
150//#define MAGIC_KEY_HELP_ALT SLASH
151//#define MAGIC_KEY_DEBUG D
152//#define MAGIC_KEY_DEBUG_MATRIX X
153//#define MAGIC_KEY_DEBUG_KBD K
154//#define MAGIC_KEY_DEBUG_MOUSE M
155//#define MAGIC_KEY_VERSION V
156//#define MAGIC_KEY_STATUS S
157//#define MAGIC_KEY_CONSOLE C
158//#define MAGIC_KEY_LAYER0 0
159//#define MAGIC_KEY_LAYER0_ALT GRAVE
160//#define MAGIC_KEY_LAYER1 1
161//#define MAGIC_KEY_LAYER2 2
162//#define MAGIC_KEY_LAYER3 3
163//#define MAGIC_KEY_LAYER4 4
164//#define MAGIC_KEY_LAYER5 5
165//#define MAGIC_KEY_LAYER6 6
166//#define MAGIC_KEY_LAYER7 7
167//#define MAGIC_KEY_LAYER8 8
168//#define MAGIC_KEY_LAYER9 9
169//#define MAGIC_KEY_BOOTLOADER B
170//#define MAGIC_KEY_BOOTLOADER_ALT ESC
171//#define MAGIC_KEY_LOCK CAPS
172//#define MAGIC_KEY_EEPROM E
173//#define MAGIC_KEY_EEPROM_CLEAR BSPACE
174//#define MAGIC_KEY_NKRO N
175//#define MAGIC_KEY_SLEEP_LED Z
176
177/*
178 * Feature disable options
179 * These options are also useful to firmware size reduction.
180 */
181
182/* disable debug print */
183//#define NO_DEBUG
184
185/* disable print */
186//#define NO_PRINT
187
188/* disable action features */
189//#define NO_ACTION_LAYER
190//#define NO_ACTION_TAPPING
191//#define NO_ACTION_ONESHOT
192//#define NO_ACTION_MACRO
193//#define NO_ACTION_FUNCTION
194
195/*
196 * MIDI options
197 */
198
199/* Prevent use of disabled MIDI features in the keymap */
200//#define MIDI_ENABLE_STRICT 1
201
202/* enable basic MIDI features:
203 - MIDI notes can be sent when in Music mode is on
204*/
205//#define MIDI_BASIC
206
207/* enable advanced MIDI features:
208 - MIDI notes can be added to the keymap
209 - Octave shift and transpose
210 - Virtual sustain, portamento, and modulation wheel
211 - etc.
212*/
213//#define MIDI_ADVANCED
214
215/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
216//#define MIDI_TONE_KEYCODE_OCTAVES 1
217
218/*
219 * HD44780 LCD Display Configuration
220 */
221/*
222#define LCD_LINES 2 //< number of visible lines of the display
223#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display
224
225#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode
226
227#if LCD_IO_MODE
228#define LCD_PORT PORTB //< port for the LCD lines
229#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0
230#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1
231#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2
232#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3
233#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0
234#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1
235#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2
236#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3
237#define LCD_RS_PORT LCD_PORT //< port for RS line
238#define LCD_RS_PIN 3 //< pin for RS line
239#define LCD_RW_PORT LCD_PORT //< port for RW line
240#define LCD_RW_PIN 2 //< pin for RW line
241#define LCD_E_PORT LCD_PORT //< port for Enable line
242#define LCD_E_PIN 1 //< pin for Enable line
243#endif
244*/
245
246/* Bootmagic Lite key configuration */
247// #define BOOTMAGIC_LITE_ROW 0
248// #define BOOTMAGIC_LITE_COLUMN 0
diff --git a/keyboards/dm9records/plaid/info.json b/keyboards/dm9records/plaid/info.json
new file mode 100644
index 000000000..318154d7d
--- /dev/null
+++ b/keyboards/dm9records/plaid/info.json
@@ -0,0 +1,113 @@
1{
2 "keyboard_name": "Plaid // Through Hole",
3 "keyboard_folder": "dm9records/plaid",
4 "url": "https://github.com/hsgw/plaid",
5 "maintainer": "hsgw(Takuya Urakawa)",
6 "width": 12,
7 "height": 4,
8 "layouts": {
9 "LAYOUT_plaid_mit": {
10 "key_count": 47,
11 "layout": [
12 { "w": 1, "x": 0, "y": 0 },
13 { "w": 1, "x": 1, "y": 0 },
14 { "w": 1, "x": 2, "y": 0 },
15 { "w": 1, "x": 3, "y": 0 },
16 { "w": 1, "x": 4, "y": 0 },
17 { "w": 1, "x": 5, "y": 0 },
18 { "w": 1, "x": 6, "y": 0 },
19 { "w": 1, "x": 7, "y": 0 },
20 { "w": 1, "x": 8, "y": 0 },
21 { "w": 1, "x": 9, "y": 0 },
22 { "w": 1, "x": 10, "y": 0 },
23 { "w": 1, "x": 11, "y": 0 },
24 { "w": 1, "x": 0, "y": 1 },
25 { "w": 1, "x": 1, "y": 1 },
26 { "w": 1, "x": 2, "y": 1 },
27 { "w": 1, "x": 3, "y": 1 },
28 { "w": 1, "x": 4, "y": 1 },
29 { "w": 1, "x": 5, "y": 1 },
30 { "w": 1, "x": 6, "y": 1 },
31 { "w": 1, "x": 7, "y": 1 },
32 { "w": 1, "x": 8, "y": 1 },
33 { "w": 1, "x": 9, "y": 1 },
34 { "w": 1, "x": 10, "y": 1 },
35 { "w": 1, "x": 11, "y": 1 },
36 { "w": 1, "x": 0, "y": 2 },
37 { "w": 1, "x": 1, "y": 2 },
38 { "w": 1, "x": 2, "y": 2 },
39 { "w": 1, "x": 3, "y": 2 },
40 { "w": 1, "x": 4, "y": 2 },
41 { "w": 1, "x": 5, "y": 2 },
42 { "w": 1, "x": 6, "y": 2 },
43 { "w": 1, "x": 7, "y": 2 },
44 { "w": 1, "x": 8, "y": 2 },
45 { "w": 1, "x": 9, "y": 2 },
46 { "w": 1, "x": 10, "y": 2 },
47 { "w": 1, "x": 11, "y": 2 },
48 { "w": 1, "x": 0, "y": 3 },
49 { "w": 1, "x": 1, "y": 3 },
50 { "w": 1, "x": 2, "y": 3 },
51 { "w": 1, "x": 3, "y": 3 },
52 { "w": 1, "x": 4, "y": 3 },
53 { "w": 2, "x": 5, "y": 3 },
54 { "w": 1, "x": 7, "y": 3 },
55 { "w": 1, "x": 8, "y": 3 },
56 { "w": 1, "x": 9, "y": 3 },
57 { "w": 1, "x": 10, "y": 3 },
58 { "w": 1, "x": 11, "y": 3 } ]
59 },
60 "LAYOUT_plaid_grid": {
61 "key_count": 48,
62 "layout": [
63 { "w": 1, "x": 0, "y": 0 },
64 { "w": 1, "x": 1, "y": 0 },
65 { "w": 1, "x": 2, "y": 0 },
66 { "w": 1, "x": 3, "y": 0 },
67 { "w": 1, "x": 4, "y": 0 },
68 { "w": 1, "x": 5, "y": 0 },
69 { "w": 1, "x": 6, "y": 0 },
70 { "w": 1, "x": 7, "y": 0 },
71 { "w": 1, "x": 8, "y": 0 },
72 { "w": 1, "x": 9, "y": 0 },
73 { "w": 1, "x": 10, "y": 0 },
74 { "w": 1, "x": 11, "y": 0 },
75 { "w": 1, "x": 0, "y": 1 },
76 { "w": 1, "x": 1, "y": 1 },
77 { "w": 1, "x": 2, "y": 1 },
78 { "w": 1, "x": 3, "y": 1 },
79 { "w": 1, "x": 4, "y": 1 },
80 { "w": 1, "x": 5, "y": 1 },
81 { "w": 1, "x": 6, "y": 1 },
82 { "w": 1, "x": 7, "y": 1 },
83 { "w": 1, "x": 8, "y": 1 },
84 { "w": 1, "x": 9, "y": 1 },
85 { "w": 1, "x": 10, "y": 1 },
86 { "w": 1, "x": 11, "y": 1 },
87 { "w": 1, "x": 0, "y": 2 },
88 { "w": 1, "x": 1, "y": 2 },
89 { "w": 1, "x": 2, "y": 2 },
90 { "w": 1, "x": 3, "y": 2 },
91 { "w": 1, "x": 4, "y": 2 },
92 { "w": 1, "x": 5, "y": 2 },
93 { "w": 1, "x": 6, "y": 2 },
94 { "w": 1, "x": 7, "y": 2 },
95 { "w": 1, "x": 8, "y": 2 },
96 { "w": 1, "x": 9, "y": 2 },
97 { "w": 1, "x": 10, "y": 2 },
98 { "w": 1, "x": 11, "y": 2 },
99 { "w": 1, "x": 0, "y": 3 },
100 { "w": 1, "x": 1, "y": 3 },
101 { "w": 1, "x": 2, "y": 3 },
102 { "w": 1, "x": 3, "y": 3 },
103 { "w": 1, "x": 4, "y": 3 },
104 { "w": 1, "x": 5, "y": 3 },
105 { "w": 1, "x": 6, "y": 3 },
106 { "w": 1, "x": 7, "y": 3 },
107 { "w": 1, "x": 8, "y": 3 },
108 { "w": 1, "x": 9, "y": 3 },
109 { "w": 1, "x": 10, "y": 3 },
110 { "w": 1, "x": 11, "y": 3 } ]
111 }
112 }
113}
diff --git a/keyboards/dm9records/plaid/keymaps/brickbots/config.h b/keyboards/dm9records/plaid/keymaps/brickbots/config.h
new file mode 100644
index 000000000..5733b9e4b
--- /dev/null
+++ b/keyboards/dm9records/plaid/keymaps/brickbots/config.h
@@ -0,0 +1,19 @@
1/* Copyright 2019 Takuya Urakawa (dm9records.com)
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// place overrides here
diff --git a/keyboards/dm9records/plaid/keymaps/brickbots/keymap.c b/keyboards/dm9records/plaid/keymaps/brickbots/keymap.c
new file mode 100644
index 000000000..20b6eac68
--- /dev/null
+++ b/keyboards/dm9records/plaid/keymaps/brickbots/keymap.c
@@ -0,0 +1,411 @@
1/* Copyright 2019 Takuya Urakawa (dm9records.com)
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 QMK_KEYBOARD_H
18
19extern keymap_config_t keymap_config;
20
21enum plaid_layers {
22 _QWERTY,
23 _COLEMAK,
24 _DVORAK,
25 _LOWER,
26 _RAISE,
27 _PLOVER,
28 _ADJUST
29};
30
31enum plaid_keycodes {
32 QWERTY = SAFE_RANGE,
33 COLEMAK,
34 DVORAK,
35 PLOVER,
36 EXT_PLV,
37 LED_1,
38 LED_2,
39 LED_3,
40 LED_4,
41 LED_5,
42 LED_6,
43 LED_7,
44 LED_8,
45 LED_9,
46 LED_0
47};
48
49#define LOWER MO(_LOWER)
50#define RAISE MO(_RAISE)
51
52// array of keys considered modifiers for led purposes
53const uint16_t modifiers[] = {
54 KC_LCTL,
55 KC_RCTL,
56 KC_LALT,
57 KC_RALT,
58 KC_LSFT,
59 KC_RSFT,
60 KC_LGUI,
61 KC_RGUI,
62 LOWER,
63 RAISE
64};
65
66//Setup consts for LED modes
67#define LEDMODE_ON 1 //always on
68#define LEDMODE_OFF 0 //always off
69#define LEDMODE_MODS 2 //On with modifiers
70#define LEDMODE_BLINKIN 3 //blinkinlights - % chance toggle on keypress
71#define LEDMODE_KEY 4 //On with any keypress, off with key release
72#define LEDMODE_ENTER 5 // On with enter key
73
74const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
75
76/* Qwerty
77 * ,-----------------------------------------------------------------------------------.
78 * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp |
79 * |------+------+------+------+------+-------------+------+------+------+------+------|
80 * | Tab | A | S | D | F | G | H | J | K | L | ; | " |
81 * |------+------+------+------+------+------|------+------+------+------+------+------|
82 * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
83 * |------+------+------+------+------+------+------+------+------+------+------+------|
84 * | Ltrl | Rctl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
85 * `-----------------------------------------------------------------------------------'
86 */
87[_QWERTY] = LAYOUT_plaid_grid(
88 KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
89 KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
90 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
91 KC_LCTL, KC_RCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
92),
93
94/* Colemak
95 * ,-----------------------------------------------------------------------------------.
96 * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
97 * |------+------+------+------+------+-------------+------+------+------+------+------|
98 * | Esc | A | R | S | T | D | H | N | E | I | O | " |
99 * |------+------+------+------+------+------|------+------+------+------+------+------|
100 * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
101 * |------+------+------+------+------+------+------+------+------+------+------+------|
102 * | Ctrl | RAlt | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
103 * `-----------------------------------------------------------------------------------'
104 */
105[_COLEMAK] = LAYOUT_plaid_grid(
106 KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
107 KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
108 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
109 KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
110),
111
112/* Dvorak
113 * ,-----------------------------------------------------------------------------------.
114 * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
115 * |------+------+------+------+------+-------------+------+------+------+------+------|
116 * | Esc | A | O | E | U | I | D | H | T | N | S | / |
117 * |------+------+------+------+------+------|------+------+------+------+------+------|
118 * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
119 * |------+------+------+------+------+------+------+------+------+------+------+------|
120 * | Ctrl | RAlt | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
121 * `-----------------------------------------------------------------------------------'
122 */
123[_DVORAK] = LAYOUT_plaid_grid(
124 KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC,
125 KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH,
126 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT ,
127 KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
128),
129
130/* Lower
131 * ,-----------------------------------------------------------------------------------.
132 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
133 * |------+------+------+------+------+-------------+------+------+------+------+------|
134 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
135 * |------+------+------+------+------+------|------+------+------+------+------+------|
136 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | |
137 * |------+------+------+------+------+------+------+------+------+------+------+------|
138 * | | | | | | | | Next | Vol- | Vol+ | Play |
139 * `-----------------------------------------------------------------------------------'
140 */
141[_LOWER] = LAYOUT_plaid_grid(
142 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
143 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
144 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______,
145 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
146),
147
148/* Raise
149 * ,-----------------------------------------------------------------------------------.
150 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
151 * |------+------+------+------+------+-------------+------+------+------+------+------|
152 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
153 * |------+------+------+------+------+------|------+------+------+------+------+------|
154 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | |
155 * |------+------+------+------+------+------+------+------+------+------+------+------|
156 * | | | | | | | | Next | Vol- | Vol+ | Play |
157 * `-----------------------------------------------------------------------------------'
158 */
159[_RAISE] = LAYOUT_plaid_grid(
160 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
161 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
162 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______,
163 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
164),
165
166/* Plover layer (http://opensteno.org)
167 * ,-----------------------------------------------------------------------------------.
168 * | # | # | # | # | # | # | # | # | # | # | # | # |
169 * |------+------+------+------+------+-------------+------+------+------+------+------|
170 * | | S | T | P | H | * | * | F | P | L | T | D |
171 * |------+------+------+------+------+------|------+------+------+------+------+------|
172 * | | S | K | W | R | * | * | R | B | G | S | Z |
173 * |------+------+------+------+------+------+------+------+------+------+------+------|
174 * | Exit | | | A | O | | E | U | | | |
175 * `-----------------------------------------------------------------------------------'
176 */
177
178[_PLOVER] = LAYOUT_plaid_grid(
179 KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 ,
180 XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
181 XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
182 EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX
183),
184
185/* Adjust (Lower + Raise)
186 * ,-----------------------------------------------------------------------------------.
187 * |Reset | | | | | | | | | | | Del |
188 * |------+------+------+------+------+-------------+------+------+------+------+------|
189 * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| |
190 * |------+------+------+------+------+------|------+------+------+------+------+------|
191 * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
192 * |------+------+------+------+------+------+------+------+------+------+------+------|
193 * | | | | | | | | | | | |
194 * `-----------------------------------------------------------------------------------'
195 */
196[_ADJUST] = LAYOUT_plaid_grid(
197 RESET,LED_1, LED_2, LED_3, LED_4, LED_5,LED_6, LED_7, LED_8, LED_9, LED_0,KC_DEL ,
198 _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______,
199 _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______,
200 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
201)
202
203
204};
205
206//Setup config struct for LED
207typedef union {
208 uint32_t raw;
209 struct {
210 uint8_t red_mode :8;
211 uint8_t green_mode :8;
212 };
213} led_config_t;
214led_config_t led_config;
215
216//Set leds to saved state during powerup
217void keyboard_post_init_user(void) {
218 // Call the post init code.
219 led_config.raw = eeconfig_read_user();
220
221 if(led_config.red_mode == LEDMODE_ON) {
222 writePinHigh(LED_RED);
223 }
224
225 if(led_config.green_mode == LEDMODE_ON) {
226 writePinHigh(LED_GREEN);
227 }
228}
229
230void eeconfig_init_user(void) { // EEPROM is getting reset!
231 led_config.raw = 0;
232 led_config.red_mode = LEDMODE_ON;
233 led_config.green_mode = LEDMODE_MODS;
234 eeconfig_update_user(led_config.raw);
235 eeconfig_update_user(led_config.raw);
236}
237
238uint32_t layer_state_set_user(uint32_t state) {
239 return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
240}
241
242void led_keypress_update(uint8_t led, uint8_t led_mode, uint16_t keycode, keyrecord_t *record) {
243 switch (led_mode) {
244 case LEDMODE_MODS:
245 for (int i=0;i<sizeof(modifiers) / sizeof(modifiers[0]);i++) {
246 if(keycode==modifiers[i]) {
247 if (record->event.pressed) {
248 writePinHigh(led);
249 }
250 else {
251 writePinLow(led);
252 }
253 }
254 }
255 break;
256 case LEDMODE_BLINKIN:
257 if (record->event.pressed) {
258 if(rand() % 2 == 1) {
259 if(rand() % 2 == 0) {
260 writePinLow(led);
261 }
262 else {
263 writePinHigh(led);
264 }
265 }
266 }
267 break;
268 case LEDMODE_KEY:
269 if (record->event.pressed) {
270 writePinHigh(led);
271 return;
272 }
273 else {
274 writePinLow(led);
275 return;
276 }
277 break;
278 case LEDMODE_ENTER:
279 if (keycode==KC_ENT) {
280 writePinHigh(led);
281 }
282 else {
283 writePinLow(led);
284 }
285 break;
286
287 }
288}
289
290bool process_record_user(uint16_t keycode, keyrecord_t *record) {
291 /* If the either led mode is keypressed based, call the led updater
292 then let it fall through the keypress handlers. Just to keep
293 the logic out of this procedure */
294 if (led_config.red_mode >= LEDMODE_MODS && led_config.red_mode <= LEDMODE_ENTER) {
295 led_keypress_update(LED_RED, led_config.red_mode, keycode, record);
296 }
297 if (led_config.green_mode >= LEDMODE_MODS && led_config.green_mode <= LEDMODE_ENTER) {
298 led_keypress_update(LED_GREEN, led_config.green_mode, keycode, record);
299 }
300 switch (keycode) {
301 case QWERTY:
302 if (record->event.pressed) {
303 print("mode just switched to qwerty and this is a huge string\n");
304 set_single_persistent_default_layer(_QWERTY);
305 }
306 return false;
307 break;
308 case COLEMAK:
309 if (record->event.pressed) {
310 set_single_persistent_default_layer(_COLEMAK);
311 }
312 return false;
313 break;
314 case DVORAK:
315 if (record->event.pressed) {
316 set_single_persistent_default_layer(_DVORAK);
317 }
318 return false;
319 break;
320 case PLOVER:
321 if (record->event.pressed) {
322 layer_off(_RAISE);
323 layer_off(_LOWER);
324 layer_off(_ADJUST);
325 layer_on(_PLOVER);
326 if (!eeconfig_is_enabled()) {
327 eeconfig_init();
328 }
329 keymap_config.raw = eeconfig_read_keymap();
330 keymap_config.nkro = 1;
331 eeconfig_update_keymap(keymap_config.raw);
332 }
333 return false;
334 break;
335 case EXT_PLV:
336 if (record->event.pressed) {
337 layer_off(_PLOVER);
338 }
339 return false;
340 break;
341 case LED_1:
342 if (record->event.pressed) {
343 if (led_config.red_mode==LEDMODE_ON) {
344 led_config.red_mode=LEDMODE_OFF;
345 writePinLow(LED_RED);
346 }
347 else {
348 led_config.red_mode=LEDMODE_ON;
349 writePinHigh(LED_RED);
350 }
351 }
352 eeconfig_update_user(led_config.raw);
353 return false;
354 break;
355 case LED_2:
356 if (record->event.pressed) {
357 if (led_config.green_mode==LEDMODE_ON) {
358 led_config.green_mode=LEDMODE_OFF;
359 writePinLow(LED_GREEN);
360 }
361 else {
362 led_config.green_mode=LEDMODE_ON;
363 writePinHigh(LED_GREEN);
364 }
365 }
366 eeconfig_update_user(led_config.raw);
367 return false;
368 break;
369 case LED_3:
370 led_config.red_mode=LEDMODE_MODS;
371 eeconfig_update_user(led_config.raw);
372 return false;
373 break;
374 case LED_4:
375 led_config.green_mode=LEDMODE_MODS;
376 eeconfig_update_user(led_config.raw);
377 return false;
378 break;
379 case LED_5:
380 led_config.red_mode=LEDMODE_BLINKIN;
381 eeconfig_update_user(led_config.raw);
382 return false;
383 break;
384 case LED_6:
385 led_config.green_mode=LEDMODE_BLINKIN;
386 eeconfig_update_user(led_config.raw);
387 return false;
388 break;
389 case LED_7:
390 led_config.red_mode=LEDMODE_KEY;
391 eeconfig_update_user(led_config.raw);
392 return false;
393 break;
394 case LED_8:
395 led_config.green_mode=LEDMODE_KEY;
396 eeconfig_update_user(led_config.raw);
397 return false;
398 break;
399 case LED_9:
400 led_config.red_mode=LEDMODE_ENTER;
401 eeconfig_update_user(led_config.raw);
402 return false;
403 break;
404 case LED_0:
405 led_config.green_mode=LEDMODE_ENTER;
406 eeconfig_update_user(led_config.raw);
407 return false;
408 break;
409 }
410 return true;
411}
diff --git a/keyboards/dm9records/plaid/keymaps/brickbots/readme.md b/keyboards/dm9records/plaid/keymaps/brickbots/readme.md
new file mode 100644
index 000000000..48a12fa8b
--- /dev/null
+++ b/keyboards/dm9records/plaid/keymaps/brickbots/readme.md
@@ -0,0 +1,36 @@
1# Brickbots keymap for plaid
2Original copyright 2019 Takuya Urakawa (dm9records.com)
3LED Support added by Richard Sutherland (rich@brickbots.com)
4
5This layout is based on the Planck layout, with esc/tab swapped and an extra
6ctrl key in the bottom left corner. It includes an adjust layer (6)
7accessible by holding the lower and raise modifiers (MO3 and MO4) together.
8The adjustment layer is used to set the behavior of the two LEDs:
9
10**Modifier Mode:**
11Activates when any modifier (shift, alt, os, MO) key is held
12down. LED turns off when key is release
13
14**Blinkinlights Mode:**
15Random chance of state change on each keystroke.
16
17**Keypress Mode:**
18On for any keypress as long as the key is pressed
19
20**Carriage Mode:**
21Turns on when enter is pressed, turns off when any next key is pressed
22
23To set the behavior of an LED, and save it to eeprom, hold the
24raise/lower keys together to access the adjust layer, then use
25the keys indicated below to set the behaviors
26
27* q = Toggle Red LED state, deactivates any other modes
28* w = Toggle Green LED state, deactivates any other modes
29* e = Set RED LED to modifier mode
30* r = Set GREEN LED to modifier mode
31* t = Set RED LED to Blinkinlights mode
32* y = set GREEN LED to Blinkinlights mode
33* u = set RED LED to Keypress mode
34* i = set GREEN LED to Keypress mode
35* o = set RED LED to Carriage mode
36* p = set GREEN LED to Carriage mode
diff --git a/keyboards/dm9records/plaid/keymaps/default/config.h b/keyboards/dm9records/plaid/keymaps/default/config.h
new file mode 100644
index 000000000..5733b9e4b
--- /dev/null
+++ b/keyboards/dm9records/plaid/keymaps/default/config.h
@@ -0,0 +1,19 @@
1/* Copyright 2019 Takuya Urakawa (dm9records.com)
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// place overrides here
diff --git a/keyboards/dm9records/plaid/keymaps/default/keymap.c b/keyboards/dm9records/plaid/keymaps/default/keymap.c
new file mode 100644
index 000000000..6a858a4a7
--- /dev/null
+++ b/keyboards/dm9records/plaid/keymaps/default/keymap.c
@@ -0,0 +1,410 @@
1/* Copyright 2019 Takuya Urakawa (dm9records.com)
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 QMK_KEYBOARD_H
18
19
20enum plaid_layers {
21 _QWERTY,
22 _COLEMAK,
23 _DVORAK,
24 _LOWER,
25 _RAISE,
26 _PLOVER,
27 _ADJUST
28};
29
30enum plaid_keycodes {
31 QWERTY = SAFE_RANGE,
32 COLEMAK,
33 DVORAK,
34 PLOVER,
35 EXT_PLV,
36 LED_1,
37 LED_2,
38 LED_3,
39 LED_4,
40 LED_5,
41 LED_6,
42 LED_7,
43 LED_8,
44 LED_9,
45 LED_0
46};
47
48#define LOWER MO(_LOWER)
49#define RAISE MO(_RAISE)
50
51// array of keys considered modifiers for led purposes
52const uint16_t modifiers[] = {
53 KC_LCTL,
54 KC_RCTL,
55 KC_LALT,
56 KC_RALT,
57 KC_LSFT,
58 KC_RSFT,
59 KC_LGUI,
60 KC_RGUI,
61 LOWER,
62 RAISE
63};
64
65//Setup consts for LED modes
66#define LEDMODE_ON 1 //always on
67#define LEDMODE_OFF 0 //always off
68#define LEDMODE_MODS 2 //On with modifiers
69#define LEDMODE_BLINKIN 3 //blinkinlights - % chance toggle on keypress
70#define LEDMODE_KEY 4 //On with any keypress, off with key release
71#define LEDMODE_ENTER 5 // On with enter key
72
73const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
74
75/* Qwerty
76 * ,-----------------------------------------------------------------------------------.
77 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
78 * |------+------+------+------+------+-------------+------+------+------+------+------|
79 * | Esc | A | S | D | F | G | H | J | K | L | ; | " |
80 * |------+------+------+------+------+------|------+------+------+------+------+------|
81 * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
82 * |------+------+------+------+------+------+------+------+------+------+------+------|
83 * | Ctrl | RAlt | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
84 * `-----------------------------------------------------------------------------------'
85 */
86[_QWERTY] = LAYOUT_plaid_grid(
87 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
88 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
89 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
90 KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
91),
92
93/* Colemak
94 * ,-----------------------------------------------------------------------------------.
95 * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
96 * |------+------+------+------+------+-------------+------+------+------+------+------|
97 * | Esc | A | R | S | T | D | H | N | E | I | O | " |
98 * |------+------+------+------+------+------|------+------+------+------+------+------|
99 * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
100 * |------+------+------+------+------+------+------+------+------+------+------+------|
101 * | Ctrl | RAlt | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
102 * `-----------------------------------------------------------------------------------'
103 */
104[_COLEMAK] = LAYOUT_plaid_grid(
105 KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
106 KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
107 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
108 KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
109),
110
111/* Dvorak
112 * ,-----------------------------------------------------------------------------------.
113 * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
114 * |------+------+------+------+------+-------------+------+------+------+------+------|
115 * | Esc | A | O | E | U | I | D | H | T | N | S | / |
116 * |------+------+------+------+------+------|------+------+------+------+------+------|
117 * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
118 * |------+------+------+------+------+------+------+------+------+------+------+------|
119 * | Ctrl | RAlt | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
120 * `-----------------------------------------------------------------------------------'
121 */
122[_DVORAK] = LAYOUT_plaid_grid(
123 KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC,
124 KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH,
125 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT ,
126 KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
127),
128
129/* Lower
130 * ,-----------------------------------------------------------------------------------.
131 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
132 * |------+------+------+------+------+-------------+------+------+------+------+------|
133 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
134 * |------+------+------+------+------+------|------+------+------+------+------+------|
135 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | |
136 * |------+------+------+------+------+------+------+------+------+------+------+------|
137 * | | | | | | | | Next | Vol- | Vol+ | Play |
138 * `-----------------------------------------------------------------------------------'
139 */
140[_LOWER] = LAYOUT_plaid_grid(
141 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
142 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
143 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______,
144 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
145),
146
147/* Raise
148 * ,-----------------------------------------------------------------------------------.
149 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
150 * |------+------+------+------+------+-------------+------+------+------+------+------|
151 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
152 * |------+------+------+------+------+------|------+------+------+------+------+------|
153 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | |
154 * |------+------+------+------+------+------+------+------+------+------+------+------|
155 * | | | | | | | | Next | Vol- | Vol+ | Play |
156 * `-----------------------------------------------------------------------------------'
157 */
158[_RAISE] = LAYOUT_plaid_grid(
159 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
160 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
161 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______,
162 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
163),
164
165/* Plover layer (http://opensteno.org)
166 * ,-----------------------------------------------------------------------------------.
167 * | # | # | # | # | # | # | # | # | # | # | # | # |
168 * |------+------+------+------+------+-------------+------+------+------+------+------|
169 * | | S | T | P | H | * | * | F | P | L | T | D |
170 * |------+------+------+------+------+------|------+------+------+------+------+------|
171 * | | S | K | W | R | * | * | R | B | G | S | Z |
172 * |------+------+------+------+------+------+------+------+------+------+------+------|
173 * | Exit | | | A | O | | E | U | | | |
174 * `-----------------------------------------------------------------------------------'
175 */
176
177[_PLOVER] = LAYOUT_plaid_grid(
178 KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 ,
179 XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
180 XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
181 EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX
182),
183
184/* Adjust (Lower + Raise)
185 * ,-----------------------------------------------------------------------------------.
186 * |Reset | | | | | | | | | | | Del |
187 * |------+------+------+------+------+-------------+------+------+------+------+------|
188 * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| |
189 * |------+------+------+------+------+------|------+------+------+------+------+------|
190 * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
191 * |------+------+------+------+------+------+------+------+------+------+------+------|
192 * | | | | | | | | | | | |
193 * `-----------------------------------------------------------------------------------'
194 */
195[_ADJUST] = LAYOUT_plaid_grid(
196 RESET,LED_1, LED_2, LED_3, LED_4, LED_5,LED_6, LED_7, LED_8, LED_9, LED_0,KC_DEL ,
197 _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______,
198 _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______,
199 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
200)
201
202
203};
204
205//Setup config struct for LED
206typedef union {
207 uint32_t raw;
208 struct {
209 uint8_t red_mode :8;
210 uint8_t green_mode :8;
211 };
212} led_config_t;
213led_config_t led_config;
214
215//Set leds to saved state during powerup
216void keyboard_post_init_user(void) {
217 // Call the post init code.
218 led_config.raw = eeconfig_read_user();
219
220 if(led_config.red_mode == LEDMODE_ON) {
221 writePinHigh(LED_RED);
222 }
223
224 if(led_config.green_mode == LEDMODE_ON) {
225 writePinHigh(LED_GREEN);
226 }
227}
228
229void eeconfig_init_user(void) { // EEPROM is getting reset!
230 led_config.raw = 0;
231 led_config.red_mode = LEDMODE_ON;
232 led_config.green_mode = LEDMODE_MODS;
233 eeconfig_update_user(led_config.raw);
234 eeconfig_update_user(led_config.raw);
235}
236
237layer_state_t layer_state_set_user(layer_state_t state) {
238 return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
239}
240
241void led_keypress_update(uint8_t led, uint8_t led_mode, uint16_t keycode, keyrecord_t *record) {
242 switch (led_mode) {
243 case LEDMODE_MODS:
244 for (int i=0;i<sizeof(modifiers) / sizeof(modifiers[0]);i++) {
245 if(keycode==modifiers[i]) {
246 if (record->event.pressed) {
247 writePinHigh(led);
248 }
249 else {
250 writePinLow(led);
251 }
252 }
253 }
254 break;
255 case LEDMODE_BLINKIN:
256 if (record->event.pressed) {
257 if(rand() % 2 == 1) {
258 if(rand() % 2 == 0) {
259 writePinLow(led);
260 }
261 else {
262 writePinHigh(led);
263 }
264 }
265 }
266 break;
267 case LEDMODE_KEY:
268 if (record->event.pressed) {
269 writePinHigh(led);
270 return;
271 }
272 else {
273 writePinLow(led);
274 return;
275 }
276 break;
277 case LEDMODE_ENTER:
278 if (keycode==KC_ENT) {
279 writePinHigh(led);
280 }
281 else {
282 writePinLow(led);
283 }
284 break;
285
286 }
287}
288
289bool process_record_user(uint16_t keycode, keyrecord_t *record) {
290 /* If the either led mode is keypressed based, call the led updater
291 then let it fall through the keypress handlers. Just to keep
292 the logic out of this procedure */
293 if (led_config.red_mode >= LEDMODE_MODS && led_config.red_mode <= LEDMODE_ENTER) {
294 led_keypress_update(LED_RED, led_config.red_mode, keycode, record);
295 }
296 if (led_config.green_mode >= LEDMODE_MODS && led_config.green_mode <= LEDMODE_ENTER) {
297 led_keypress_update(LED_GREEN, led_config.green_mode, keycode, record);
298 }
299 switch (keycode) {
300 case QWERTY:
301 if (record->event.pressed) {
302 print("mode just switched to qwerty and this is a huge string\n");
303 set_single_persistent_default_layer(_QWERTY);
304 }
305 return false;
306 break;
307 case COLEMAK:
308 if (record->event.pressed) {
309 set_single_persistent_default_layer(_COLEMAK);
310 }
311 return false;
312 break;
313 case DVORAK:
314 if (record->event.pressed) {
315 set_single_persistent_default_layer(_DVORAK);
316 }
317 return false;
318 break;
319 case PLOVER:
320 if (record->event.pressed) {
321 layer_off(_RAISE);
322 layer_off(_LOWER);
323 layer_off(_ADJUST);
324 layer_on(_PLOVER);
325 if (!eeconfig_is_enabled()) {
326 eeconfig_init();
327 }
328 keymap_config.raw = eeconfig_read_keymap();
329 keymap_config.nkro = 1;
330 eeconfig_update_keymap(keymap_config.raw);
331 }
332 return false;
333 break;
334 case EXT_PLV:
335 if (record->event.pressed) {
336 layer_off(_PLOVER);
337 }
338 return false;
339 break;
340 case LED_1:
341 if (record->event.pressed) {
342 if (led_config.red_mode==LEDMODE_ON) {
343 led_config.red_mode=LEDMODE_OFF;
344 writePinLow(LED_RED);
345 }
346 else {
347 led_config.red_mode=LEDMODE_ON;
348 writePinHigh(LED_RED);
349 }
350 }
351 eeconfig_update_user(led_config.raw);
352 return false;
353 break;
354 case LED_2:
355 if (record->event.pressed) {
356 if (led_config.green_mode==LEDMODE_ON) {
357 led_config.green_mode=LEDMODE_OFF;
358 writePinLow(LED_GREEN);
359 }
360 else {
361 led_config.green_mode=LEDMODE_ON;
362 writePinHigh(LED_GREEN);
363 }
364 }
365 eeconfig_update_user(led_config.raw);
366 return false;
367 break;
368 case LED_3:
369 led_config.red_mode=LEDMODE_MODS;
370 eeconfig_update_user(led_config.raw);
371 return false;
372 break;
373 case LED_4:
374 led_config.green_mode=LEDMODE_MODS;
375 eeconfig_update_user(led_config.raw);
376 return false;
377 break;
378 case LED_5:
379 led_config.red_mode=LEDMODE_BLINKIN;
380 eeconfig_update_user(led_config.raw);
381 return false;
382 break;
383 case LED_6:
384 led_config.green_mode=LEDMODE_BLINKIN;
385 eeconfig_update_user(led_config.raw);
386 return false;
387 break;
388 case LED_7:
389 led_config.red_mode=LEDMODE_KEY;
390 eeconfig_update_user(led_config.raw);
391 return false;
392 break;
393 case LED_8:
394 led_config.green_mode=LEDMODE_KEY;
395 eeconfig_update_user(led_config.raw);
396 return false;
397 break;
398 case LED_9:
399 led_config.red_mode=LEDMODE_ENTER;
400 eeconfig_update_user(led_config.raw);
401 return false;
402 break;
403 case LED_0:
404 led_config.green_mode=LEDMODE_ENTER;
405 eeconfig_update_user(led_config.raw);
406 return false;
407 break;
408 }
409 return true;
410}
diff --git a/keyboards/dm9records/plaid/keymaps/default/readme.md b/keyboards/dm9records/plaid/keymaps/default/readme.md
new file mode 100644
index 000000000..5a08a1fff
--- /dev/null
+++ b/keyboards/dm9records/plaid/keymaps/default/readme.md
@@ -0,0 +1,35 @@
1# The default keymap for plaid
2Original copyright 2019 Takuya Urakawa (dm9records.com)
3LED Support added by Richard Sutherland (rich@brickbots.com)
4
5This layout is based on the Planck layout, and includes an adjust layer (6)
6accessible by holding the lower and raise modifiers (MO3 and MO4) together.
7The adjustment layer is used to set the behavior of the two LEDs:
8
9**Modifier Mode:**
10Activates when any modifier (shift, alt, os, MO) key is held
11down. LED turns off when key is release
12
13**Blinkinlights Mode:**
14Random chance of state change on each keystroke.
15
16**Keypress Mode:**
17On for any keypress as long as the key is pressed
18
19**Carriage Mode:**
20Turns on when enter is pressed, turns off when any next key is pressed
21
22To set the behavior of an LED, and save it to eeprom, hold the
23raise/lower keys together to access the adjust layer, then use
24the keys indicated below to set the behaviors
25
26* q = Toggle Red LED state, deactivates any other modes
27* w = Toggle Green LED state, deactivates any other modes
28* e = Set RED LED to modifier mode
29* r = Set GREEN LED to modifier mode
30* t = Set RED LED to Blinkinlights mode
31* y = set GREEN LED to Blinkinlights mode
32* u = set RED LED to Keypress mode
33* i = set GREEN LED to Keypress mode
34* o = set RED LED to Carriage mode
35* p = set GREEN LED to Carriage mode
diff --git a/keyboards/dm9records/plaid/keymaps/thehalfdeafchef/config.h b/keyboards/dm9records/plaid/keymaps/thehalfdeafchef/config.h
new file mode 100644
index 000000000..4bcbc6f67
--- /dev/null
+++ b/keyboards/dm9records/plaid/keymaps/thehalfdeafchef/config.h
@@ -0,0 +1,19 @@
1/* Copyright 2019 Ian Canino (ian@thecommittedbug.io)
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// place overrides here
diff --git a/keyboards/dm9records/plaid/keymaps/thehalfdeafchef/keymap.c b/keyboards/dm9records/plaid/keymaps/thehalfdeafchef/keymap.c
new file mode 100644
index 000000000..bdf6c54c3
--- /dev/null
+++ b/keyboards/dm9records/plaid/keymaps/thehalfdeafchef/keymap.c
@@ -0,0 +1,182 @@
1#include QMK_KEYBOARD_H
2
3enum plaid_layers {
4 _QWERTY,
5 _DVORAK,
6 _COLEMAK,
7 _LOWER,
8 _RAISE,
9 _FUNCTION,
10};
11
12enum plaid_keycodes { QWERTY = SAFE_RANGE, COLEMAK, DVORAK, LED };
13
14#define LOWER MO(_LOWER)
15#define RAISE MO(_RAISE)
16
17#define LED_ON 1
18#define LED_OFF 0
19
20const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
21
22 /* Qwerty
23 * ,-----------------------------------------------------------------------------------.
24 * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp |
25 * |------+------+------+------+------+-------------+------+------+------+------+------|
26 * | Tab | A | S | D | F | G | H | J | K | L | ; | " |
27 * |------+------+------+------+------+------|------+------+------+------+------+------|
28 * | LS/( | Z | X | C | V | B | N | M | , | . | / |Enter |
29 * |------+------+------+------+------+------+------+------+------+------+------+------|
30 * | Ctrl | LGUI | Alt | [ |Lower | Space |Raise | ] | RGUI | \ | RS/) |
31 * `-----------------------------------------------------------------------------------'
32 */
33 [_QWERTY] = LAYOUT_planck_mit(KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, KC_LCTL, KC_LGUI, KC_LALT, KC_LBRC, LOWER, KC_SPC, RAISE, KC_RBRC, KC_RGUI, KC_BSLS, KC_RSPC),
34
35 /* Colemak
36 * ,-----------------------------------------------------------------------------------.
37 * | Esc | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
38 * |------+------+------+------+------+-------------+------+------+------+------+------|
39 * | Tab | A | R | S | T | D | H | N | E | I | O | " |
40 * |------+------+------+------+------+------|------+------+------+------+------+------|
41 * | LS/( | Z | X | C | V | B | K | M | , | . | / |Enter |
42 * |------+------+------+------+------+------+------+------+------+------+------+------|
43 * | Ctrl | LGUI | Alt | [ |Lower | Space |Raise | ] | RGUI | \ | RS/) |
44 * `-----------------------------------------------------------------------------------'
45 */
46
47 [_COLEMAK] = LAYOUT_planck_mit(KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_RBRC, KC_RGUI, KC_BSLS, KC_RSPC),
48
49 /* Dvorak
50 * ,-----------------------------------------------------------------------------------.
51 * | Esc | " | , | . | P | Y | F | G | C | R | L | Bksp |
52 * |------+------+------+------+------+-------------+------+------+------+------+------|
53 * | Tab | A | O | E | U | I | D | H | T | N | S | / |
54 * |------+------+------+------+------+------|------+------+------+------+------+------|
55 * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
56 * |------+------+------+------+------+------+------+------+------+------+------+------|
57 * | Ctrl | LGUI | Alt | [ |Lower | Space |Raise | ] | RGUI | \ | RS/) |
58 * `-----------------------------------------------------------------------------------'
59 */
60
61 [_DVORAK] = LAYOUT_planck_mit(KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, KC_LSPO, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT, KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_RBRC, KC_RGUI, KC_BSLS, KC_RSPC),
62
63 /* LOWER
64 * ,----------------------------------------------------------------------------.
65 * | | | MPRV | MPLY | MNXT | | | | PGUP| UP | PGDN|PSCR |
66 * |------+------+------+------+------+-----+-----+-----+-----+-----------+-----+
67 * | | | MUTE | VOLD | VOLU | | | | LEFT| DOWN|RIGHT| |
68 * |------+------+------+------+------+-----+-----+-----+-----+-----+-----+-----+
69 * | | | MAIL | WBAK | WFWD | | | | HOME| | END | |
70 * |------+------+------+------+------+-----+-----+-----+-----+-----------+-----+
71 * | | | | | | DEL | | | | | |
72 * `----------------------------------------------------------------------------'
73 */
74
75 [_LOWER] = LAYOUT_planck_mit(KC_NO, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, KC_MAIL, KC_WBAK, KC_WFWD, KC_NO, KC_NO, KC_NO, KC_HOME, KC_NO, KC_END, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_DEL, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO),
76
77 /* RAISE
78 * ,--------------------------------------------------------------------------------.
79 * | NLCK | 1 | 2 | 3 | - | | | | ! | # | $ | + |
80 * |------+------+------+------+------+-----+-----+-----+------+------+------+------+
81 * | / | 4 | 5 | 6 | + | | | | % | ! | ! | = |
82 * |------+------+------+------+------+-----+-----+-----+------+------+------+------+
83 * | * | 7 | 8 | 9 | , | | | | _ | - | @ | ~ |
84 * |------+------+------+------+------+-----+-----+-----+------+------+------+------+
85 * | | 0 | . | Ent | = | | | | | | ` |
86 * `--------------------------------------------------------------------------------'
87 */
88
89 [_RAISE] = LAYOUT_planck_mit(KC_NLCK, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_NO, KC_NO, KC_NO, KC_EXLM, KC_HASH, KC_DLR, KC_PLUS, KC_PSLS, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_NO, KC_NO, KC_NO, KC_PERC, KC_ASTR, KC_AMPR, KC_EQL, KC_PAST, KC_P7, KC_P8, KC_P9, KC_PCMM, KC_NO, KC_NO, KC_NO, KC_UNDS, KC_MINS, KC_AT, KC_TILDE, KC_NO, KC_P0, KC_PDOT, KC_PENT, KC_PEQL, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_GRV),
90
91 /* Function (Lower + Raise)
92 * ,-----------------------------------------------------------------------------------------------------------------------.
93 * | RESET| LCA_T(F1) | LCA_T(F2) | LCA_T(F3) | LCA_T(F4) | LCA_T(F5) | LCA_T(F6) | LCA_T(F7) | | | | |
94 * |------+------------+-----------+-----------+-----------+-----------+-----------+-----------+------+------+------+------+
95 * | | | | | | QWERTY | DVORAK | COLEMAK | | | | |
96 * |------+------------+-----------+-----------+-----------+-----------+-----------+-----------+------+------+------+------+
97 * | | | | | | | | | | | | |
98 * |------+------------+-----------+-----------+-----------+-----------+-----------+-----------+------+------+------+------+
99 * | | | | | | LED | | | | | |
100 * `-----------------------------------------------------------------------------------------------------------------------'
101 */
102
103 [_FUNCTION] = LAYOUT_planck_mit(RESET, LCA_T(KC_F1), LCA_T(KC_F2), LCA_T(KC_F3), LCA_T(KC_F4), LCA_T(KC_F5), LCA_T(KC_F6), LCA_T(KC_F7), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, QWERTY, DVORAK, COLEMAK, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, LED, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO)};
104
105// constants to toggle LED behavior
106
107// Setup config struct for LED
108typedef union {
109 uint32_t raw;
110 struct {
111 bool red_mode : 1;
112 bool green_mode : 1;
113 };
114} led_config_t;
115led_config_t led_config;
116
117void keyboard_post_init_user(void) { led_config.raw = eeconfig_read_user(); }
118
119void eeconfig_init_user(void) { // EEPROM is getting reset!
120 led_config.raw = 0;
121 led_config.red_mode = LED_ON;
122 led_config.green_mode = LED_ON;
123 eeconfig_update_user(led_config.raw);
124 eeconfig_update_user(led_config.raw);
125}
126
127// When LOWER and RAISE are held together, go to the FUNCTION layer
128uint32_t layer_state_set_user(uint32_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _FUNCTION); }
129
130// Runs constantly in the background, in a loop.
131void matrix_scan_user(void) {
132 uint8_t layer = biton32(layer_state);
133
134 switch (layer) {
135 case _LOWER:
136 writePinHigh(LED_RED);
137 break;
138 case _RAISE:
139 writePinHigh(LED_GREEN);
140 break;
141 default:
142 writePinLow(LED_GREEN);
143 writePinLow(LED_RED);
144 }
145}
146
147bool process_record_user(uint16_t keycode, keyrecord_t *record) {
148 switch (keycode) {
149 case QWERTY:
150 if (record->event.pressed) {
151 set_single_persistent_default_layer(_QWERTY);
152 }
153 return false;
154 break;
155 case COLEMAK:
156 if (record->event.pressed) {
157 set_single_persistent_default_layer(_COLEMAK);
158 }
159 return false;
160 break;
161 case DVORAK:
162 if (record->event.pressed) {
163 set_single_persistent_default_layer(_DVORAK);
164 }
165 return false;
166 break;
167 case LED:
168 if (record->event.pressed) {
169 if (led_config.red_mode == LED_ON && led_config.green_mode == LED_ON) {
170 led_config.red_mode = LED_OFF;
171 led_config.green_mode = LED_OFF;
172 } else if (led_config.red_mode == LED_OFF && led_config.green_mode == LED_OFF) {
173 led_config.red_mode = LED_ON;
174 led_config.green_mode = LED_ON;
175 }
176 }
177 eeconfig_update_user(led_config.raw);
178 return false;
179 break;
180 }
181 return true;
182}
diff --git a/keyboards/dm9records/plaid/keymaps/thehalfdeafchef/readme.md b/keyboards/dm9records/plaid/keymaps/thehalfdeafchef/readme.md
new file mode 100644
index 000000000..bd09965b5
--- /dev/null
+++ b/keyboards/dm9records/plaid/keymaps/thehalfdeafchef/readme.md
@@ -0,0 +1,5 @@
1![Plaid Layout Image](https://i.imgur.com/WnVnwEG.png)
2
3# The Half Deaf Chef Plaid Layout
4
5Opinionated keymaps optimized for programmers. The Left and Right Shift tap as parenthesis and the bracket keys are to either side of the layer keys (LOWER, RAISE). A 'right-side' up number pad in a layer with a complementary 'symbol' pad on the opposite side. An additional layer is provided to switch to virtual console on Linux based systems running xorg. These changes are propagated among all the layouts.
diff --git a/keyboards/dm9records/plaid/plaid.c b/keyboards/dm9records/plaid/plaid.c
new file mode 100644
index 000000000..28f56d7f9
--- /dev/null
+++ b/keyboards/dm9records/plaid/plaid.c
@@ -0,0 +1,43 @@
1/* Copyright 2019 Takuya Urakawa (dm9records.com)
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 "plaid.h"
17
18void matrix_init_kb(void) {
19 // put your keyboard start-up code here
20 // runs once when the firmware starts up
21
22 matrix_init_user();
23}
24
25void matrix_scan_kb(void) {
26 // put your looping keyboard code here
27 // runs every cycle (a lot)
28
29 matrix_scan_user();
30}
31
32bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
33 // put your per-action keyboard code here
34 // runs for every action, just before processing by the firmware
35
36 return process_record_user(keycode, record);
37}
38
39void led_set_kb(uint8_t usb_led) {
40 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
41
42 led_set_user(usb_led);
43}
diff --git a/keyboards/dm9records/plaid/plaid.h b/keyboards/dm9records/plaid/plaid.h
new file mode 100644
index 000000000..d791cf7c0
--- /dev/null
+++ b/keyboards/dm9records/plaid/plaid.h
@@ -0,0 +1,68 @@
1/* Copyright 2019 Takuya Urakawa (dm9records.com)
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#define LAYOUT_plaid_mit( \
22 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
23 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
24 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
25 k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \
26) \
27{ \
28 { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \
29 { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \
30 { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \
31 { k30, k31, k32, k33, k34, k35, k35, k37, k38, k39, k3a, k3b } \
32}
33
34#define LAYOUT_plaid_grid( \
35 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
36 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
37 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
38 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \
39) \
40{ \
41 { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \
42 { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \
43 { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \
44 { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \
45}
46
47// Used to create a keymap using only KC_ prefixed keys
48#define KC_KEYMAP( \
49 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
50 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
51 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
52 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \
53 ) \
54 LAYOUT_plaid_grid( \
55 KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \
56 KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \
57 KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \
58 KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \
59 )
60
61#define KEYMAP LAYOUT_plaid_grid
62#define LAYOUT_ortho_4x12 LAYOUT_plaid_grid
63#define LAYOUT_planck_mit LAYOUT_plaid_mit
64#define LAYOUT_kc_ortho_4x12 KC_KEYMAP
65#define KC_LAYOUT_ortho_4x12 KC_KEYMAP
66
67#define LED_RED C5
68#define LED_GREEN C4
diff --git a/keyboards/dm9records/plaid/readme.md b/keyboards/dm9records/plaid/readme.md
new file mode 100644
index 000000000..79621deec
--- /dev/null
+++ b/keyboards/dm9records/plaid/readme.md
@@ -0,0 +1,23 @@
1# plaid // Through Hole
2
3![plaid](https://i.imgur.com/tTi9yR9h.jpg)
4
512x4 ortholinear keyboard with only through hole components.
6
7Keyboard Maintainer: [hsgw](https://github.com/hsgw)
8Hardware Supported: ATMEGA328p with vusb [PCB](https://github.com/hsgw/plaid)
9Hardware Availability: Group buy in r/mk
10
11Make example for this keyboard (after setting up your build environment):
12 make dm9records/plaid:default
13
14Flashing example for this keyboard:
15
16 make dm9records/plaid:default:flash
17
18## Bootloader
19use usbasploader in my repository.
20https://github.com/hsgw/USBaspLoader/tree/plaid
21
22
23See 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/dm9records/plaid/rules.mk b/keyboards/dm9records/plaid/rules.mk
new file mode 100644
index 000000000..7c4112c9a
--- /dev/null
+++ b/keyboards/dm9records/plaid/rules.mk
@@ -0,0 +1,36 @@
1# MCU name
2MCU = atmega328p
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 = USBasp
13
14# Build Options
15# change yes to no to disable
16#
17BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
18MOUSEKEY_ENABLE = yes # Mouse keys
19EXTRAKEY_ENABLE = yes # Audio control and System control
20CONSOLE_ENABLE = no # Console for debug
21COMMAND_ENABLE = no # Commands for debug and configuration
22# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
23SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
24# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
25NKRO_ENABLE = no # USB Nkey Rollover
26BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
27RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
28MIDI_ENABLE = no # MIDI support
29UNICODE_ENABLE = no # Unicode
30BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
31AUDIO_ENABLE = no # Audio output on port C6
32FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
33HD44780_ENABLE = no # Enable support for HD44780 based LCDs
34
35LAYOUTS = ortho_4x12 planck_mit
36LAYOUTS_HAS_RGB = no
diff --git a/keyboards/dm9records/tartan/config.h b/keyboards/dm9records/tartan/config.h
new file mode 100644
index 000000000..ee4393e53
--- /dev/null
+++ b/keyboards/dm9records/tartan/config.h
@@ -0,0 +1,246 @@
1/*
2Copyright 2019 Takuya Urakawa (dm9records.com)
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/* VID & PID from vusb project, see tmk_core/protocol/vusb/USB-IDs-for-free.txt"*/
24#define VENDOR_ID 0x16c0
25#define PRODUCT_ID 0x27db
26#define DEVICE_VER 0x0001
27#define MANUFACTURER dm9records
28#define PRODUCT Tartan
29#define DESCRIPTION 60% keyboard with through hole components
30
31/* key matrix size */
32#define MATRIX_ROWS 5
33#define MATRIX_COLS 13
34
35/*
36 * Keyboard Matrix Assignments
37 *
38 * Change this to how you wired your keyboard
39 * COLS: AVR pins used for columns, left to right
40 * ROWS: AVR pins used for rows, top to bottom
41 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
42 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
43 *
44 */
45#define MATRIX_ROW_PINS { B4, B5, B3, B0, C0 }
46#define MATRIX_COL_PINS { D7, D6, D5, D4, B1, B2, C1, C2, C3, C5, D1, D0, C4 }
47#define UNUSED_PINS
48
49/* COL2ROW, ROW2COL*/
50#define DIODE_DIRECTION COL2ROW
51
52/*
53 * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
54 */
55// #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
56
57// #define BACKLIGHT_PIN B7
58// #define BACKLIGHT_BREATHING
59// #define BACKLIGHT_LEVELS 3
60
61// #define RGB_DI_PIN E2
62// #ifdef RGB_DI_PIN
63// #define RGBLED_NUM 16
64// #define RGBLIGHT_HUE_STEP 8
65// #define RGBLIGHT_SAT_STEP 8
66// #define RGBLIGHT_VAL_STEP 8
67// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
68// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
69// /*== all animations enable ==*/
70// #define RGBLIGHT_ANIMATIONS
71// /*== or choose animations ==*/
72// #define RGBLIGHT_EFFECT_BREATHING
73// #define RGBLIGHT_EFFECT_RAINBOW_MOOD
74// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
75// #define RGBLIGHT_EFFECT_SNAKE
76// #define RGBLIGHT_EFFECT_KNIGHT
77// #define RGBLIGHT_EFFECT_CHRISTMAS
78// #define RGBLIGHT_EFFECT_STATIC_GRADIENT
79// #define RGBLIGHT_EFFECT_RGB_TEST
80// #define RGBLIGHT_EFFECT_ALTERNATING
81// #endif
82
83/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
84#define DEBOUNCE 5
85
86/* define if matrix has ghost (lacks anti-ghosting diodes) */
87//#define MATRIX_HAS_GHOST
88
89/* number of backlight levels */
90
91/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
92#define LOCKING_SUPPORT_ENABLE
93/* Locking resynchronize hack */
94#define LOCKING_RESYNC_ENABLE
95
96/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
97 * This is userful for the Windows task manager shortcut (ctrl+shift+esc).
98 */
99// #define GRAVE_ESC_CTRL_OVERRIDE
100
101/*
102 * Force NKRO
103 *
104 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
105 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
106 * makefile for this to work.)
107 *
108 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
109 * until the next keyboard reset.
110 *
111 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
112 * fully operational during normal computer usage.
113 *
114 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
115 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
116 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
117 * power-up.
118 *
119 */
120//#define FORCE_NKRO
121
122/*
123 * Magic Key Options
124 *
125 * Magic keys are hotkey commands that allow control over firmware functions of
126 * the keyboard. They are best used in combination with the HID Listen program,
127 * found here: https://www.pjrc.com/teensy/hid_listen.html
128 *
129 * The options below allow the magic key functionality to be changed. This is
130 * useful if your keyboard/keypad is missing keys and you want magic key support.
131 *
132 */
133
134/* key combination for magic key command */
135/* defined by default; to change, uncomment and set to the combination you want */
136// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
137
138/* control how magic key switches layers */
139//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
140//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
141//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
142
143/* override magic key keymap */
144//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
145//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
146//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
147//#define MAGIC_KEY_HELP H
148//#define MAGIC_KEY_HELP_ALT SLASH
149//#define MAGIC_KEY_DEBUG D
150//#define MAGIC_KEY_DEBUG_MATRIX X
151//#define MAGIC_KEY_DEBUG_KBD K
152//#define MAGIC_KEY_DEBUG_MOUSE M
153//#define MAGIC_KEY_VERSION V
154//#define MAGIC_KEY_STATUS S
155//#define MAGIC_KEY_CONSOLE C
156//#define MAGIC_KEY_LAYER0 0
157//#define MAGIC_KEY_LAYER0_ALT GRAVE
158//#define MAGIC_KEY_LAYER1 1
159//#define MAGIC_KEY_LAYER2 2
160//#define MAGIC_KEY_LAYER3 3
161//#define MAGIC_KEY_LAYER4 4
162//#define MAGIC_KEY_LAYER5 5
163//#define MAGIC_KEY_LAYER6 6
164//#define MAGIC_KEY_LAYER7 7
165//#define MAGIC_KEY_LAYER8 8
166//#define MAGIC_KEY_LAYER9 9
167//#define MAGIC_KEY_BOOTLOADER B
168//#define MAGIC_KEY_BOOTLOADER_ALT ESC
169//#define MAGIC_KEY_LOCK CAPS
170//#define MAGIC_KEY_EEPROM E
171//#define MAGIC_KEY_EEPROM_CLEAR BSPACE
172//#define MAGIC_KEY_NKRO N
173//#define MAGIC_KEY_SLEEP_LED Z
174
175/*
176 * Feature disable options
177 * These options are also useful to firmware size reduction.
178 */
179
180/* disable debug print */
181//#define NO_DEBUG
182
183/* disable print */
184//#define NO_PRINT
185
186/* disable action features */
187//#define NO_ACTION_LAYER
188//#define NO_ACTION_TAPPING
189//#define NO_ACTION_ONESHOT
190//#define NO_ACTION_MACRO
191//#define NO_ACTION_FUNCTION
192
193/*
194 * MIDI options
195 */
196
197/* Prevent use of disabled MIDI features in the keymap */
198//#define MIDI_ENABLE_STRICT 1
199
200/* enable basic MIDI features:
201 - MIDI notes can be sent when in Music mode is on
202*/
203//#define MIDI_BASIC
204
205/* enable advanced MIDI features:
206 - MIDI notes can be added to the keymap
207 - Octave shift and transpose
208 - Virtual sustain, portamento, and modulation wheel
209 - etc.
210*/
211//#define MIDI_ADVANCED
212
213/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
214//#define MIDI_TONE_KEYCODE_OCTAVES 1
215
216/*
217 * HD44780 LCD Display Configuration
218 */
219/*
220#define LCD_LINES 2 //< number of visible lines of the display
221#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display
222
223#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode
224
225#if LCD_IO_MODE
226#define LCD_PORT PORTB //< port for the LCD lines
227#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0
228#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1
229#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2
230#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3
231#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0
232#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1
233#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2
234#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3
235#define LCD_RS_PORT LCD_PORT //< port for RS line
236#define LCD_RS_PIN 3 //< pin for RS line
237#define LCD_RW_PORT LCD_PORT //< port for RW line
238#define LCD_RW_PIN 2 //< pin for RW line
239#define LCD_E_PORT LCD_PORT //< port for Enable line
240#define LCD_E_PIN 1 //< pin for Enable line
241#endif
242*/
243
244/* Bootmagic Lite key configuration */
245// #define BOOTMAGIC_LITE_ROW 0
246// #define BOOTMAGIC_LITE_COLUMN 0
diff --git a/keyboards/dm9records/tartan/info.json b/keyboards/dm9records/tartan/info.json
new file mode 100644
index 000000000..ff0ddfdf9
--- /dev/null
+++ b/keyboards/dm9records/tartan/info.json
@@ -0,0 +1,34 @@
1{
2 "keyboard_name": "Tartan # Through Hole",
3 "keyboard_folder": "dm9records/tartan",
4 "url": "https://github.com/hsgw/tartan",
5 "maintainer": "hsgw(Takuya Urakawa)",
6 "width": 13,
7 "height": 5,
8 "layouts": {
9 "LAYOUT_60_ansi": {
10 "key_count": 61,
11 "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
12 },
13 "LAYOUT_60_ansi_split_bs": {
14 "key_count": 62,
15 "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":1}, {"label":"", "x":14, "y":0, "w":1}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
16 },
17 "LAYOUT_60_ansi_split_bs_rshift": {
18 "key_count": 63,
19 "layout": [{"label":"ESC", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"BS", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
20 },
21 "LAYOUT_60_iso": {
22 "key_count": 62,
23 "layout": [{"label":"¬", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"£", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
24 },
25 "LAYOUT_60_iso_split_bs": {
26 "key_count": 63,
27 "layout": [{"label":"¬", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"£", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
28 },
29 "LAYOUT_60_iso_split_bs_rshift": {
30 "key_count": 64,
31 "layout": [{"label":"¬", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
32 }
33 }
34}
diff --git a/keyboards/dm9records/tartan/keymaps/default/keymap.c b/keyboards/dm9records/tartan/keymaps/default/keymap.c
new file mode 100644
index 000000000..6224b4e61
--- /dev/null
+++ b/keyboards/dm9records/tartan/keymaps/default/keymap.c
@@ -0,0 +1,34 @@
1/* Copyright 2019 Takuya Urakawa (dm9records.com)
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 QMK_KEYBOARD_H
18
19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
20 [0] = LAYOUT_60_ansi(
21 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
22 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
23 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
24 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
25 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL
26 ),
27 [1] = LAYOUT_60_ansi(
28 KC_GRV, 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,
29 _______, _______, KC_UP, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_INS, _______,
30 _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, _______,
31 _______, _______, _______, _______, _______, _______, _______, _______, KC_END, KC_PGDN, KC_DOWN, _______,
32 _______, _______, _______, _______, _______, _______, _______, _______
33 )
34};
diff --git a/keyboards/dm9records/tartan/keymaps/default/readme.md b/keyboards/dm9records/tartan/keymaps/default/readme.md
new file mode 100644
index 000000000..c829d5310
--- /dev/null
+++ b/keyboards/dm9records/tartan/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default keymap for Tartan
diff --git a/keyboards/dm9records/tartan/readme.md b/keyboards/dm9records/tartan/readme.md
new file mode 100644
index 000000000..b8439ed22
--- /dev/null
+++ b/keyboards/dm9records/tartan/readme.md
@@ -0,0 +1,25 @@
1# Tartan # Through Hole
2
3![tartan](https://i.imgur.com/1qSrVcs.jpg)
4
5A 60% keyboard with only through hole components.
6
7* Keyboard Maintainer: [hsgw](https://github.com/hsgw)
8* Hardware Supported: ATMEGA328p with vusb [PCB](https://github.com/hsgw/tartan)
9* Hardware Availability: https://5z6p.com/products/tartan/
10
11Make example for this keyboard (after setting up your build environment):
12
13 make dm9records/tartan:default
14
15Flash firmware:
16
17 // In bootloader mode
18 make dm9records/tartan:default:flash
19
20## Bootloader
21use usbasploader in my repository.
22https://github.com/hsgw/USBaspLoader/tree/plaid
23
24
25See 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/dm9records/tartan/rules.mk b/keyboards/dm9records/tartan/rules.mk
new file mode 100644
index 000000000..811300191
--- /dev/null
+++ b/keyboards/dm9records/tartan/rules.mk
@@ -0,0 +1,36 @@
1# MCU name
2MCU = atmega328p
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 = USBasp
13
14# Build Options
15# change yes to no to disable
16#
17BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
18MOUSEKEY_ENABLE = yes # Mouse keys
19EXTRAKEY_ENABLE = yes # Audio control and System control
20CONSOLE_ENABLE = no # Console for debug
21COMMAND_ENABLE = no # Commands for debug and configuration
22# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
23SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
24# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
25NKRO_ENABLE = no # USB Nkey Rollover
26BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
27RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
28MIDI_ENABLE = no # MIDI support
29UNICODE_ENABLE = no # Unicode
30BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
31AUDIO_ENABLE = no # Audio output on port C6
32FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
33HD44780_ENABLE = no # Enable support for HD44780 based LCDs
34
35LAYOUTS = 60_ansi 60_ansi_split_bs_rshift 60_iso 60_iso_split_bs_rshift
36LAYOUTS_HAS_RGB = no
diff --git a/keyboards/dm9records/tartan/tartan.c b/keyboards/dm9records/tartan/tartan.c
new file mode 100644
index 000000000..b702633cc
--- /dev/null
+++ b/keyboards/dm9records/tartan/tartan.c
@@ -0,0 +1,16 @@
1/* Copyright 2019 Takuya Urakawa (dm9records.com)
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 "tartan.h"
diff --git a/keyboards/dm9records/tartan/tartan.h b/keyboards/dm9records/tartan/tartan.h
new file mode 100644
index 000000000..e99008889
--- /dev/null
+++ b/keyboards/dm9records/tartan/tartan.h
@@ -0,0 +1,111 @@
1/* Copyright 2019 Takuya Urakawa (dm9records.com)
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#define LAYOUT_60_ansi( \
22 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k49, \
23 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k4b, \
24 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
25 k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \
26 k40, k41, k42, k43, k44, k45, k46, k47 \
27) \
28{ \
29 { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c }, \
30 { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c }, \
31 { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c }, \
32 { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c }, \
33 { k40, k41, k42, k43, k44, k45, k46, k47, KC_NO, k49, KC_NO, k4b, KC_NO } \
34}
35
36#define LAYOUT_60_ansi_split_bs( \
37 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k49, k4a, \
38 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k4b, \
39 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
40 k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \
41 k40, k41, k42, k43, k44, k45, k46, k47 \
42) \
43{ \
44 { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c }, \
45 { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c }, \
46 { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c }, \
47 { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c }, \
48 { k40, k41, k42, k43, k44, k45, k46, k47, KC_NO, k49, k4a, k4b, KC_NO } \
49}
50
51#define LAYOUT_60_ansi_split_bs_rshift( \
52 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k49, k4a, \
53 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k4b, \
54 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
55 k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k4c, \
56 k40, k41, k42, k43, k44, k45, k46, k47 \
57) \
58{ \
59 { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c }, \
60 { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c }, \
61 { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c }, \
62 { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c }, \
63 { k40, k41, k42, k43, k44, k45, k46, k47, KC_NO, k49, k4a, k4b, k4c } \
64}
65
66#define LAYOUT_60_iso( \
67 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k49, \
68 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
69 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k4b, \
70 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \
71 k40, k41, k42, k43, k44, k45, k46, k47 \
72) \
73{ \
74 { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c }, \
75 { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c }, \
76 { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c }, \
77 { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c }, \
78 { k40, k41, k42, k43, k44, k45, k46, k47, KC_NO, k49, KC_NO, k4b, KC_NO } \
79}
80
81#define LAYOUT_60_iso_split_bs( \
82 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k49, k4a, \
83 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
84 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k4b, \
85 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \
86 k40, k41, k42, k43, k44, k45, k46, k47 \
87) \
88{ \
89 { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c }, \
90 { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c }, \
91 { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c }, \
92 { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c }, \
93 { k40, k41, k42, k43, k44, k45, k46, k47, KC_NO, k49, k4a, k4b, KC_NO } \
94}
95
96#define LAYOUT_60_iso_split_bs_rshift( \
97 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k49, k4a, \
98 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
99 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k4b, \
100 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k4c, \
101 k40, k41, k42, k43, k44, k45, k46, k47 \
102) \
103{ \
104 { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c }, \
105 { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c }, \
106 { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c }, \
107 { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c }, \
108 { k40, k41, k42, k43, k44, k45, k46, k47, KC_NO, k49, k4a, k4b, k4c } \
109}
110
111#define LAYOUT_all LAYOUT_60_iso_split_bs_rshift