aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKgOfHedgehogs <kgofhedgehogs@gmail.com>2020-06-18 04:17:30 +0200
committerGitHub <noreply@github.com>2020-06-17 19:17:30 -0700
commit157319fbd03e6f7a6618111fd03ab3e53317893e (patch)
tree93ca9aab1d065325d22b939f4814eeda4544fc25
parent39ff121d7389fd6575e65ecb54b11bb87777ca38 (diff)
downloadqmk_firmware-157319fbd03e6f7a6618111fd03ab3e53317893e.tar.gz
qmk_firmware-157319fbd03e6f7a6618111fd03ab3e53317893e.zip
[Keyboard] Jian keyboard (#8914)
Co-authored-by: Joel Challis <git@zvecr.com> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: Nick Brassel <nick@tzarc.org>
-rw-r--r--keyboards/jian/config.h21
-rw-r--r--keyboards/jian/handwired/config.h41
-rw-r--r--keyboards/jian/handwired/handwired.c8
-rw-r--r--keyboards/jian/handwired/handwired.h30
-rw-r--r--keyboards/jian/handwired/rules.mk19
-rw-r--r--keyboards/jian/info.json67
-rw-r--r--keyboards/jian/jian.c1
-rw-r--r--keyboards/jian/jian.h19
-rw-r--r--keyboards/jian/keymaps/advanced/config.h27
-rw-r--r--keyboards/jian/keymaps/advanced/keymap.c584
-rw-r--r--keyboards/jian/keymaps/advanced/rules.mk5
-rw-r--r--keyboards/jian/keymaps/default/config.h22
-rw-r--r--keyboards/jian/keymaps/default/keymap.c120
-rw-r--r--keyboards/jian/keymaps/default/rules.mk2
-rw-r--r--keyboards/jian/nsrev2/config.h129
-rw-r--r--keyboards/jian/nsrev2/nsrev2.c74
-rw-r--r--keyboards/jian/nsrev2/nsrev2.h39
-rw-r--r--keyboards/jian/nsrev2/rules.mk20
-rw-r--r--keyboards/jian/readme.md16
-rw-r--r--keyboards/jian/rev1/config.h138
-rw-r--r--keyboards/jian/rev1/rev1.c74
-rw-r--r--keyboards/jian/rev1/rev1.h56
-rw-r--r--keyboards/jian/rev1/rules.mk20
-rw-r--r--keyboards/jian/rev2/config.h136
-rw-r--r--keyboards/jian/rev2/rev2.c74
-rw-r--r--keyboards/jian/rev2/rev2.h39
-rw-r--r--keyboards/jian/rev2/rules.mk20
-rw-r--r--keyboards/jian/rules.mk1
28 files changed, 1802 insertions, 0 deletions
diff --git a/keyboards/jian/config.h b/keyboards/jian/config.h
new file mode 100644
index 000000000..cfb6bf4ff
--- /dev/null
+++ b/keyboards/jian/config.h
@@ -0,0 +1,21 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3Copyright 2015 Jack Humbert
4
5This program is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 2 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#pragma once
20
21#include "config_common.h"
diff --git a/keyboards/jian/handwired/config.h b/keyboards/jian/handwired/config.h
new file mode 100644
index 000000000..5b69621bc
--- /dev/null
+++ b/keyboards/jian/handwired/config.h
@@ -0,0 +1,41 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3Copyright 2015 Jack Humbert
4
5This program is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 2 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18#pragma once
19
20#include "config_common.h"
21
22/* USB Device descriptor parameter */
23#define VENDOR_ID 0xC0DE
24#define PRODUCT_ID 0x1337
25#define DEVICE_VER 0x0010
26#define MANUFACTURER KgOfHedgehogs
27#define PRODUCT Huma
28#define DESCRIPTION An ergo handwired keyboard
29
30/* key matrix size */
31// Rows are doubled-up
32#define MATRIX_ROWS 4
33#define MATRIX_COLS 14
34#define DIODE_DIRECTION COL2ROW
35
36// wiring of each half
37#define MATRIX_ROW_PINS { D3, D2, B5, B6 }
38#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B4, E6, D7, C6, D4, D0, D1 }
39
40/* Set 0 if debouncing isn't needed */
41#define DEBOUNCE 5
diff --git a/keyboards/jian/handwired/handwired.c b/keyboards/jian/handwired/handwired.c
new file mode 100644
index 000000000..bcb7ec710
--- /dev/null
+++ b/keyboards/jian/handwired/handwired.c
@@ -0,0 +1,8 @@
1#include "handwired.h"
2
3const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
4 {{13, 0}, {12, 0}, {11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}},
5 {{13, 1}, {12, 1}, {11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}},
6 {{13, 2}, {12, 2}, {11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}},
7 {{13, 3}, {12, 3}, {11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}},
8};
diff --git a/keyboards/jian/handwired/handwired.h b/keyboards/jian/handwired/handwired.h
new file mode 100644
index 000000000..9b388b94a
--- /dev/null
+++ b/keyboards/jian/handwired/handwired.h
@@ -0,0 +1,30 @@
1#pragma once
2
3#include "jian.h"
4
5#define XXX KC_NO
6#define LAYOUT( \
7 L00, L01, L02, L03, L04, L05, L06, R06, R05, R04, R03, R02, R01, R00, \
8 L11, L12, L13, L14, L15, L16, R16, R15, R14, R13, R12, R11, \
9 L21, L22, L23, L24, L25, L26, R26, R25, R24, R23, R22, R21, \
10 L34, L35, L36, R36, R35, R34 \
11) \
12{ \
13 {L00, L01, L02, L03, L04, L05, L06, R06, R05, R04, R03, R02, R01, R00}, \
14 {XXX, L11, L12, L13, L14, L15, L16, R16, R15, R14, R13, R12, R11, XXX}, \
15 {XXX, L21, L22, L23, L24, L25, L26, R26, R25, R24, R23, R22, R21, XXX}, \
16 {XXX, XXX, XXX, XXX, L34, L35, L36, R36, R35, R34, XXX, XXX, XXX, XXX} \
17}
18
19#define LAYOUT_symmetric( \
20 K00, K01, K02, K03, K04, K05, K06, \
21 K11, K12, K13, K14, K15, K16, \
22 K21, K22, K23, K24, K25, K26, \
23 K34, K35, K36 \
24) \
25{ \
26 {K00, K01, K02, K03, K04, K05, K06, K06, K05, K04, K03, K02, K01, K00}, \
27 {XXX, K11, K12, K13, K14, K15, K16, K16, K15, K14, K13, K12, K11, XXX}, \
28 {XXX, K21, K22, K23, K24, K25, K26, K26, K25, K24, K23, K22, K21, XXX}, \
29 {XXX, XXX, XXX, XXX, K34, K35, K36, K36, K35, K34, XXX, XXX, XXX, XXX} \
30}
diff --git a/keyboards/jian/handwired/rules.mk b/keyboards/jian/handwired/rules.mk
new file mode 100644
index 000000000..61f40dfcb
--- /dev/null
+++ b/keyboards/jian/handwired/rules.mk
@@ -0,0 +1,19 @@
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 yes to no to disable
16#
17SPLIT_KEYBOARD = no
18BACKLIGHT_ENABLE = no
19RGBLIGHT_ENABLE = no
diff --git a/keyboards/jian/info.json b/keyboards/jian/info.json
new file mode 100644
index 000000000..4503fb3b4
--- /dev/null
+++ b/keyboards/jian/info.json
@@ -0,0 +1,67 @@
1{
2 "keyboard_name": "jian",
3 "url": "t.me/s/kgofhedgehogs",
4 "maintainer": "KGOH",
5 "width": 17,
6 "height": 4,
7 "layouts": {
8 "LAYOUT": {
9 "layout": [
10 { "label": "Super", "x": 0, "y": 1.5 },
11 { "label": "~", "x": 1, "y": 0.75 },
12 { "label": "Q", "x": 2, "y": 0.625 },
13 { "label": "W", "x": 3, "y": 0.25 },
14 { "label": "E", "x": 4, "y": 0 },
15 { "label": "R", "x": 5, "y": 0.25 },
16 { "label": "T", "x": 6, "y": 0.375 },
17
18 { "label": "Y", "x": 10, "y": 0.375 },
19 { "label": "U", "x": 11, "y": 0.25 },
20 { "label": "I", "x": 12, "y": 0 },
21 { "label": "O", "x": 13, "y": 0.25 },
22 { "label": "P", "x": 14, "y": 0.625 },
23 { "label": "{[", "x": 15, "y": 0.75 },
24 { "label": "}]", "x": 16, "y": 1.5 },
25
26
27 { "label": "Ctrl", "x": 1, "y": 1.75 },
28 { "label": "A", "x": 2, "y": 1.625 },
29 { "label": "S", "x": 3, "y": 1.25 },
30 { "label": "D", "x": 4, "y": 1 },
31 { "label": "F", "x": 5, "y": 1.25 },
32 { "label": "G", "x": 6, "y": 1.375 },
33
34 { "label": "H", "x": 10, "y": 1.375 },
35 { "label": "J", "x": 11, "y": 1.25 },
36 { "label": "K", "x": 12, "y": 1 },
37 { "label": "L", "x": 13, "y": 1.25 },
38 { "label": ":;", "x": 14, "y": 1.625 },
39 { "label": "\"'", "x": 15, "y": 1.75 },
40
41
42 { "label": "Alt", "x": 1, "y": 2.75 },
43 { "label": "Z", "x": 2, "y": 2.625 },
44 { "label": "X", "x": 3, "y": 2.25 },
45 { "label": "C", "x": 4, "y": 2 },
46 { "label": "V", "x": 5, "y": 2.25 },
47 { "label": "B", "x": 6, "y": 2.375 },
48
49 { "label": "N", "x": 10, "y": 2.375 },
50 { "label": "M", "x": 11, "y": 2.25 },
51 { "label": "<,", "x": 12, "y": 2 },
52 { "label": ">.", "x": 13, "y": 2.25 },
53 { "label": "?/", "x": 14, "y": 2.625 },
54 { "label": "|\\", "x": 15, "y": 2.75 },
55
56
57 { "label": "Tab", "x": 5, "y": 3.25 },
58 { "label": "Spc", "x": 6, "y": 3.375 },
59 { "label": "Enter", "x": 7, "y": 3.5 },
60
61 { "label": "Esc", "x": 9, "y": 3.5 },
62 { "label": "Bscp", "x": 10, "y": 3.375 },
63 { "label": "Del", "x": 11, "y": 3.25 }
64 ]
65 }
66 }
67}
diff --git a/keyboards/jian/jian.c b/keyboards/jian/jian.c
new file mode 100644
index 000000000..e85b8554f
--- /dev/null
+++ b/keyboards/jian/jian.c
@@ -0,0 +1 @@
#include "jian.h"
diff --git a/keyboards/jian/jian.h b/keyboards/jian/jian.h
new file mode 100644
index 000000000..d09d056e9
--- /dev/null
+++ b/keyboards/jian/jian.h
@@ -0,0 +1,19 @@
1#pragma once
2
3#include "quantum.h"
4
5#ifdef KEYBOARD_jian_handwired
6 #include "handwired.h"
7#endif
8
9#ifdef KEYBOARD_jian_rev1
10 #include "rev1.h"
11#endif
12
13#ifdef KEYBOARD_jian_rev2
14#include "rev2.h"
15#endif
16
17#ifdef KEYBOARD_jian_nsrev2
18 #include "nsrev2.h"
19#endif
diff --git a/keyboards/jian/keymaps/advanced/config.h b/keyboards/jian/keymaps/advanced/config.h
new file mode 100644
index 000000000..85b41c86d
--- /dev/null
+++ b/keyboards/jian/keymaps/advanced/config.h
@@ -0,0 +1,27 @@
1/*
2This is the c configuration file for the keymap
3
4Copyright 2012 Jun Wako <wakojun@gmail.com>
5Copyright 2015 Jack Humbert
6
7This program is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 2 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program. If not, see <http://www.gnu.org/licenses/>.
19*/
20#pragma once
21
22//#define AUTO_SHIFT_TIMEOUT 150
23//#define NO_AUTO_SHIFT_NUMERIC
24//#define AUTO_SHIFT_MODIFIERS
25#define IGNORE_MOD_TAP_INTERRUPT
26#define ALT_LAYOUTS_ENABLE
27//#define TRAINING_HALFES_LOCK
diff --git a/keyboards/jian/keymaps/advanced/keymap.c b/keyboards/jian/keymaps/advanced/keymap.c
new file mode 100644
index 000000000..417678f7e
--- /dev/null
+++ b/keyboards/jian/keymaps/advanced/keymap.c
@@ -0,0 +1,584 @@
1#include QMK_KEYBOARD_H
2
3typedef union {
4 uint32_t raw;
5 struct {
6 bool thumb_alt :1;
7 bool iso :1;
8 };
9} user_config_t;
10
11user_config_t user_config;
12
13#ifdef STENO_ENABLE
14#include "keymap_steno.h"
15#endif // STENO_ENABLE
16
17
18#define QWERTY_base KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, \
19 KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
20 KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH
21#define DVORAK_base KC_GRV, KC_QUOT, KC_COMM, KC_DOT,KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_LBRC, KC_RBRC, \
22 KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \
23 KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z
24#define COLEMAK_base KC_GRV, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, \
25 KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
26 KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH
27#define WORKMAN_base KC_GRV, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_LBRC, KC_RBRC, \
28 KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT, \
29 KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH
30#ifdef ALT_LAYOUTS_ENABLE
31#include "keymap_dvorak.h"
32#include "keymap_colemak.h"
33#include "keymap_workman.h"
34#define DVK2QWE_base DV_GRV, DV_Q, DV_W, DV_E, DV_R, DV_T, DV_Y, DV_U, DV_I, DV_O, DV_P, DV_LBRC, DV_RBRC, \
35 DV_A, DV_S, DV_D, DV_F, DV_G, DV_H, DV_J, DV_K, DV_L, DV_SCLN, DV_QUOT, \
36 DV_Z, DV_X, DV_C, DV_V, DV_B, DV_N, DV_M, DV_COMM, DV_DOT, DV_SLSH
37#define CMK2QWE_base KC_GRV, CM_Q, CM_W, CM_E, CM_R, CM_T, CM_Y, CM_U, CM_I, CM_O, CM_P, KC_LBRC, KC_RBRC, \
38 CM_A, CM_S, CM_D, CM_F, CM_G, CM_H, CM_J, CM_K, CM_L, CM_SCLN, KC_QUOT, \
39 CM_Z, CM_X, CM_C, CM_V, CM_B, CM_N, CM_M, CM_COMM, CM_DOT, CM_SLSH
40#define WMN2QWE_base KC_GRV, WK_Q, WK_W, WK_E, WK_R, WK_T, WK_Y, WK_U, WK_I, WK_O, WK_P, KC_LBRC, KC_RBRC, \
41 WK_A, WK_S, WK_D, WK_F, WK_G, WK_H, WK_J, WK_K, WK_L, WK_SCLN, KC_QUOT, \
42 WK_Z, WK_X, WK_C, WK_V, WK_B, WK_N, WK_M, KC_COMM, KC_DOT, KC_SLSH
43#define CMK2DVK_base KC_GRV, KC_QUOT, KC_COMM, KC_DOT,CM_P, CM_Y, CM_F, CM_G, CM_C, CM_R, CM_L, KC_LBRC, KC_RBRC, \
44 CM_A, CM_O, CM_E, CM_U, CM_I, CM_D, CM_H, CM_T, CM_N, CM_S, CM_SLSH, \
45 CM_SCLN, CM_Q, CM_J, CM_K, CM_X, CM_B, CM_M, CM_W, CM_V, CM_Z
46#define WMN2DVK_base KC_GRV, KC_QUOT, KC_COMM, KC_DOT,WK_P, WK_Y, WK_F, WK_G, WK_C, WK_R, WK_L, KC_LBRC, KC_RBRC, \
47 WK_A, WK_O, WK_E, WK_U, WK_I, WK_D, WK_H, WK_T, WK_N, WK_S, KC_SLSH, \
48 WK_SCLN, WK_Q, WK_J, WK_K, WK_X, WK_B, WK_M, WK_W, WK_V, WK_Z
49#define DVK2CMK_base DV_GRV, DV_Q, DV_W, DV_F, DV_P, DV_G, DV_J, DV_L, DV_U, DV_Y, DV_SCLN, DV_LBRC, DV_RBRC, \
50 DV_A, DV_R, DV_S, DV_T, DV_D, DV_H, DV_N, DV_E, DV_I, DV_O, DV_QUOT, \
51 DV_Z, DV_X, DV_C, DV_V, DV_B, DV_K, DV_M, DV_COMM, DV_DOT, DV_SLSH
52#define WMN2CMK_base KC_GRV, WK_Q, WK_W, WK_F, WK_P, WK_G, WK_J, WK_L, WK_U, WK_Y, WK_SCLN, KC_LBRC, KC_RBRC, \
53 WK_A, WK_R, WK_S, WK_T, WK_D, WK_H, WK_N, WK_E, WK_I, WK_O, KC_QUOT, \
54 WK_Z, WK_X, WK_C, WK_V, WK_B, WK_K, WK_M, KC_COMM, KC_DOT, KC_SLSH
55#define DVK2WMN_base DV_GRV, DV_Q, DV_D, DV_R, DV_W, DV_B, DV_J, DV_F, DV_U, DV_P, DV_SCLN, DV_LBRC, DV_RBRC, \
56 DV_A, DV_S, DV_H, DV_T, DV_G, DV_Y, DV_N, DV_E, DV_O, DV_I, DV_QUOT, \
57 DV_Z, DV_X, DV_M, DV_C, DV_V, DV_K, DV_L, DV_COMM, DV_DOT, DV_SLSH
58#define CMK2WMN_base KC_GRV, CM_Q, CM_D, CM_R, CM_W, CM_B, CM_J, CM_F, CM_U, CM_P, CM_SCLN, KC_LBRC, KC_RBRC, \
59 CM_A, CM_S, CM_H, CM_T, CM_G, CM_Y, CM_N, CM_E, CM_O, CM_I, KC_QUOT, \
60 CM_Z, CM_X, CM_M, CM_C, CM_V, CM_K, CM_L, CM_COMM, CM_DOT, CM_SLSH
61#endif // ALT_LAYOUTS_ENABLE
62
63enum jian_layers {
64 _QWERTY,
65#ifdef ALT_LAYOUTS_ENABLE
66 _DVORAK,
67 _COLEMAK,
68 _WORKMAN,
69 _DVK2QWE,
70 _DVK2CMK,
71 _DVK2WMN,
72 _CMK2QWE,
73 _CMK2DVK,
74 _CMK2WMN,
75 _WMN2QWE,
76 _WMN2DVK,
77 _WMN2CMK,
78#endif // ALT_LAYOUTS_ENABLE
79 _ISO,
80 _LOWER,
81 _RAISE,
82 _ADJUST,
83 _BCKLT_ADJ,
84 _THUMB_ALT,
85#ifdef TRAINING_HALFES_LOCK
86 _LEFT,
87 _RIGHT,
88#endif //TRAINING_HALFES_LOCK
89#ifdef DIPS_ENABLE
90 _DIPS,
91#endif // DIPS_ENABLE
92#ifdef STENO_ENABLE
93 _PLOVER
94#endif // STENO_ENABLE
95};
96
97enum jian_keycodes {
98 QWERTY = SAFE_RANGE,
99 PLOVER,
100 EXT_PLV,
101 EXT_RGB,
102 ISO,
103 THUMB_ALT,
104//ifdef ALT_LAYOUTS_ENABLE
105 CH_WMN,
106 CH_CMK,
107 CH_QWE,
108 CH_DVK,
109//endif // ALT_LAYOUTS_ENABLE
110#ifdef DIPS_ENABLE
111 LAYOUT0,
112 LAYOUT1,
113 LAYOUT2,
114 LAYOUT3,
115 DIP_ISO,
116 FLIP_TH,
117 DIP6,
118 DIP7,
119 DIP8,
120 DIP9,
121 DIP10,
122 DIP11,
123#endif // DIPS_ENABLE
124};
125
126#ifdef TRAINING_HALFES_LOCK
127static uint8_t lock_timeout = 1;
128static uint8_t lock_cooldown = 0;
129#endif //TRAINING_HALFES_LOCK
130#ifdef DIPS_ENABLE
131#ifdef ALT_LAYOUTS_ENABLE
132static uint8_t layout_conversion_dip_state = 0;
133#endif // ALT_LAYOUTS_ENABLE
134#endif // DIPS_ENABLE
135
136#define LOWER MO(_LOWER)
137#define RAISE MO(_RAISE)
138
139#define BL_ADJ TG(_BCKLT_ADJ)
140#define TG_LWR TG(_LOWER)
141#define TG_RSE TG(_RAISE)
142
143#define RBR_RGU MT(MOD_RGUI, KC_RBRC)
144#define F12_RGU MT(MOD_RGUI, KC_F12)
145#define EQL_LCT MT(MOD_LCTL, KC_EQL)
146#define APP_LCT MT(MOD_LCTL, KC_APP)
147#define EQL_RCT MT(MOD_RCTL, KC_EQL)
148#define QUO_RCT MT(MOD_RCTL, KC_QUOT)
149#define APP_RCT MT(MOD_RCTL, KC_APP)
150#define MIN_RCT MT(MOD_RCTL, KC_MINS)
151#define PLS_LAL MT(MOD_LALT, KC_PPLS)
152#define BSL_RAL MT(MOD_RALT, KC_BSLS)
153
154#define NBS_LCT MT(MOD_LCTL, KC_NUBS)
155#define BSH_LAL MT(MOD_LALT, KC_BSLS)
156#define APP_RAL MT(MOD_RALT, KC_APP)
157
158#define BSP_LSH MT(MOD_LSFT, KC_BSPC)
159#define BSP_RSH MT(MOD_RSFT, KC_BSPC)
160#define SPC_LSH MT(MOD_LSFT, KC_SPC)
161#define SPC_RSH MT(MOD_RSFT, KC_SPC)
162#define DEL_RSE LT(_RAISE, KC_DEL)
163#define TAB_RSE LT(_RAISE, KC_TAB)
164#define ENT_LWR LT(_LOWER, KC_ENT)
165#define ESC_LWR LT(_LOWER, KC_ESC)
166
167#define RGU_RBR RGUI_T(KC_RBRC)
168#define RCT_QUO RCTL_T(KC_QUOT)
169
170#define LAYOUT_base( \
171 GRV, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, \
172 A, S, D, F, G, H, J, K, L, SCLN, QUOT, \
173 Z, X, C, V, B, N, M, COMM, DOT, SLSH \
174 ) \
175 LAYOUT( \
176 KC_LGUI, GRV, Q, W, E, R, T, Y, U, I, O, P, LBRC, RGU_RBR, \
177 KC_LCTL, A, S, D, F, G, H, J, K, L, SCLN, RCT_QUO, \
178 KC_LALT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, BSL_RAL, \
179 TAB_RSE, SPC_LSH, ENT_LWR, ESC_LWR, BSP_RSH, DEL_RSE \
180 )
181#define LAYOUT_base_wrapper(...) LAYOUT_base(__VA_ARGS__)
182
183#ifdef SWAP_HANDS_ENABLE
184#define SW_TG SH_TG
185#else
186#define SW_TG _______
187#endif
188
189const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
190
191[_QWERTY] = LAYOUT_base_wrapper(QWERTY_base),
192
193#ifdef DIPS_ENABLE
194[_DIPS] = LAYOUT_DIPS(\
195 LAYOUT0, LAYOUT1, LAYOUT2, LAYOUT3, DIP_ISO, FLIP_TH, \
196 LAYOUT0, LAYOUT1, LAYOUT2, LAYOUT3, DIP_ISO, FLIP_TH \
197),
198#endif // DIPS_ENABLE
199
200[_LOWER] = LAYOUT(
201 _______, KC_UNDS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, F12_RGU,
202 EQL_LCT, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, MIN_RCT,
203 PLS_LAL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
204 _______, _______, _______, _______, _______, _______
205),
206
207[_RAISE] = LAYOUT(
208 _______, KC_NLCK, KC_PSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, KC_VOLU, KC_HOME, KC_PSCR, KC_PGUP, KC_SLCK, KC_CAPS, _______,
209 EQL_LCT, KC_PAST, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_MUTE, KC_LEFT, KC_UP, KC_RGHT, KC_INS, APP_RCT,
210 _______, KC_P0, KC_P1, KC_P2, KC_P3, KC_PCMM, KC_VOLD, KC_END, KC_DOWN, KC_PGDN, KC_PAUS, _______,
211 _______, _______, _______, _______, _______, _______
212),
213
214[_ADJUST] = LAYOUT_symmetric(
215 RESET, DEBUG, KC_ASUP, CH_WMN, CH_CMK, CH_QWE, CH_DVK,
216 KC_ASRP, KC_ASTG, XXXXXXX, XXXXXXX, QWERTY, PLOVER,
217 BL_ADJ, KC_ASDN, XXXXXXX, XXXXXXX, ISO, THUMB_ALT,
218 _______, SW_TG, _______
219),
220#if defined(RGBLIGHT) | defined(BACKLIGHT_ENABLE)
221[_BCKLT_ADJ] = LAYOUT_symmetric(
222 XXXXXXX, XXXXXXX, XXXXXXX, BL_INC, RGB_VAI, RGB_HUD, RGB_HUI,
223 XXXXXXX, XXXXXXX, BL_DEC, RGB_VAD, RGB_SAD, RGB_SAI,
224 BL_ADJ, BL_BRTG, BL_TOGG, RGB_TOG, RGB_RMOD,RGB_MOD,
225 _______, _______, _______
226),
227#endif // defined(RGBLIGHT) | defined(BACKLIGHT_ENABLE)
228#ifdef TRAINING_HALFES_LOCK
229[_LEFT] = LAYOUT_base(
230 _______, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
231 _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
232 _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
233),
234
235[_RIGHT] = LAYOUT_base(
236 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, _______,
237 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______,
238 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______
239),
240#endif // TRAINING_HALFES_LOCK
241
242#ifdef STENO_ENABLE
243[_PLOVER] = LAYOUT(
244 EXT_PLV, STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, STN_N6, STN_N7, STN_N8, STN_N9, STN_NA, STN_NB, STN_NC, EXT_PLV,
245 STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR,
246 XXXXXXX, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR,
247 XXXXXXX, STN_A, STN_O, STN_E, STN_U, XXXXXXX
248),
249#endif // STENO_ENABLE
250
251[_THUMB_ALT] = LAYOUT(
252 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
253 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
254 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
255 DEL_RSE, BSP_LSH, ESC_LWR, ENT_LWR, SPC_RSH, TAB_RSE
256),
257
258[_ISO] = LAYOUT(
259 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
260 LCTL_T(KC_NUBS), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
261 LALT_T(KC_NUHS), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RALT,
262 _______, _______, _______, _______, _______, _______
263),
264
265#ifdef ALT_LAYOUTS_ENABLE
266[_DVORAK] = LAYOUT_base_wrapper(DVORAK_base),
267[_COLEMAK] = LAYOUT_base_wrapper(COLEMAK_base),
268[_WORKMAN] = LAYOUT_base_wrapper(WORKMAN_base),
269[_DVK2QWE] = LAYOUT_base_wrapper(DVK2QWE_base),
270[_CMK2QWE] = LAYOUT_base_wrapper(CMK2QWE_base),
271[_WMN2QWE] = LAYOUT_base_wrapper(WMN2QWE_base),
272[_CMK2DVK] = LAYOUT_base_wrapper(CMK2DVK_base),
273[_WMN2DVK] = LAYOUT_base_wrapper(WMN2DVK_base),
274[_DVK2CMK] = LAYOUT_base_wrapper(DVK2CMK_base),
275[_WMN2CMK] = LAYOUT_base_wrapper(WMN2CMK_base),
276[_DVK2WMN] = LAYOUT_base_wrapper(DVK2WMN_base),
277[_CMK2WMN] = LAYOUT_base_wrapper(CMK2WMN_base)
278#endif // ALT_LAYOUTS_ENABLE
279};
280
281uint32_t layer_state_set_user(uint32_t state) {
282 return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
283}
284
285#ifdef DIPS_ENABLE
286#ifdef ALT_LAYOUTS_ENABLE
287void layout_convert(uint8_t statuses) {
288 switch (0b1111 & statuses) {
289 case 0b0000:
290 set_single_persistent_default_layer(_QWERTY);
291 break;
292 case 0b0001:
293 set_single_persistent_default_layer(_DVORAK);
294 break;
295 case 0b0010:
296 set_single_persistent_default_layer(_COLEMAK);
297 break;
298 case 0b0011:
299 set_single_persistent_default_layer(_WORKMAN);
300 break;
301 case 0b0100:
302 set_single_persistent_default_layer(_DVK2QWE);
303 break;
304 case 0b0101:
305 set_single_persistent_default_layer(_QWERTY);
306 break;
307 case 0b0110:
308 set_single_persistent_default_layer(_DVK2CMK);
309 break;
310 case 0b0111:
311 set_single_persistent_default_layer(_DVK2WMN);
312 break;
313 case 0b1000:
314 set_single_persistent_default_layer(_CMK2QWE);
315 break;
316 case 0b1001:
317 set_single_persistent_default_layer(_CMK2DVK);
318 break;
319 case 0b1010:
320 set_single_persistent_default_layer(_QWERTY);
321 break;
322 case 0b1011:
323 set_single_persistent_default_layer(_CMK2WMN);
324 break;
325 case 0b1100:
326 set_single_persistent_default_layer(_WMN2QWE);
327 break;
328 case 0b1101:
329 set_single_persistent_default_layer(_WMN2DVK);
330 break;
331 case 0b1110:
332 set_single_persistent_default_layer(_WMN2CMK);
333 break;
334 case 0b1111:
335 set_single_persistent_default_layer(_QWERTY);
336 break;
337 }
338}
339#endif // ALT_LAYOUTS_ENABLE
340#endif // DIPS_ENABLE
341
342void matrix_init_user(void) {
343#ifdef DIPS_ENABLE
344 layer_on(_DIPS);
345#endif // DIPS_ENABLE
346}
347
348void keyboard_post_init_user(void) {
349 user_config.raw = eeconfig_read_user();
350 if (user_config.thumb_alt) {
351 layer_on(_THUMB_ALT);
352 } else {
353 layer_off(_THUMB_ALT);
354 }
355 if (user_config.iso) {
356 layer_on(_ISO);
357 } else {
358 layer_off(_ISO);
359 }
360}
361
362#ifdef ALT_LAYOUTS_ENABLE
363static char change_layout_input = 0;
364static bool change_layout_keystroke = 0;
365void change_layout_conversion(uint16_t keycode) {
366 switch (keycode) {
367 case CH_WMN:
368 change_layout_input |= 0b1000 << (change_layout_keystroke << 2);
369 break;
370 case CH_CMK:
371 change_layout_input |= 0b0100 << (change_layout_keystroke << 2);
372 break;
373 case CH_DVK:
374 change_layout_input |= 0b0010 << (change_layout_keystroke << 2);
375 break;
376 case CH_QWE:
377 change_layout_input |= 0b0001 << (change_layout_keystroke << 2);
378 break;
379 }
380 if (change_layout_keystroke == 1) {
381 switch (change_layout_input) {
382 case 0b00010001:
383 set_single_persistent_default_layer(_QWERTY);
384 break;
385 case 0b00100001:
386 set_single_persistent_default_layer(_DVORAK);
387 break;
388 case 0b01000001:
389 set_single_persistent_default_layer(_COLEMAK);
390 break;
391 case 0b10000001:
392 set_single_persistent_default_layer(_WORKMAN);
393 break;
394 case 0b00010010:
395 set_single_persistent_default_layer(_DVK2QWE);
396 break;
397 case 0b00100010:
398 set_single_persistent_default_layer(_QWERTY);
399 break;
400 case 0b01000010:
401 set_single_persistent_default_layer(_DVK2CMK);
402 break;
403 case 0b10000010:
404 set_single_persistent_default_layer(_DVK2WMN);
405 break;
406 case 0b00010100:
407 set_single_persistent_default_layer(_CMK2QWE);
408 break;
409 case 0b00100100:
410 set_single_persistent_default_layer(_CMK2DVK);
411 break;
412 case 0b01000100:
413 set_single_persistent_default_layer(_QWERTY);
414 break;
415 case 0b10000100:
416 set_single_persistent_default_layer(_CMK2WMN);
417 break;
418 case 0b00011000:
419 set_single_persistent_default_layer(_WMN2QWE);
420 break;
421 case 0b00101000:
422 set_single_persistent_default_layer(_WMN2DVK);
423 break;
424 case 0b01001000:
425 set_single_persistent_default_layer(_WMN2CMK);
426 break;
427 case 0b10001000:
428 set_single_persistent_default_layer(_QWERTY);
429 break;
430 }
431 change_layout_input = 0;
432 }
433 change_layout_keystroke ^= 1;
434}
435#endif // ALT_LAYOUTS_ENABLE
436
437bool process_record_user(uint16_t keycode, keyrecord_t *record) {
438#ifdef TRAINING_HALFES_LOCK
439 if (!record->event.pressed) {
440 lock_cooldown = --lock_cooldown < 0 ? 0 : lock_cooldown;
441 }
442 if (lock_cooldown == 0) {
443 layer_off(_LEFT);
444 layer_off(_RIGHT);
445 }
446#endif // TRAINING_HALFES_LOCK
447 switch (keycode) {
448#ifdef TRAINING_HALFES_LOCK
449 case SPC_RSH:
450 case BSP_RSH:
451 case DEL_RSE:
452 case ESC_LWR:
453 case BSL_RAL:
454 case RGU_RBR:
455 case RCT_QUO:
456 if (record->event.pressed) {
457 layer_on(_LEFT);
458 lock_cooldown = lock_timeout;
459 }
460 else {
461 lock_cooldown = 0;
462 layer_off(_LEFT);
463 }
464 break;
465 case BSP_LSH:
466 case SPC_LSH:
467 case TAB_RSE:
468 case ENT_LWR:
469 case KC_LCTL:
470 case KC_LGUI:
471 case KC_LALT:
472 if (record->event.pressed) {
473 layer_on(_RIGHT);
474 lock_cooldown = lock_timeout;
475 }
476 else {
477 lock_cooldown = 0;
478 layer_off(_RIGHT);
479 }
480 break;
481#endif // TRAINING_HALFES_LOCK
482#ifdef STENO_ENABLE
483 case PLOVER:
484 if (!record->event.pressed) {
485 layer_off(_RAISE);
486 layer_off(_LOWER);
487 layer_off(_ADJUST);
488 layer_on(_PLOVER);
489 if (!eeconfig_is_enabled()) {
490 eeconfig_init();
491 }
492 keymap_config.raw = eeconfig_read_keymap();
493 keymap_config.nkro = 1;
494 eeconfig_update_keymap(keymap_config.raw);
495 }
496 return false;
497 case EXT_PLV:
498 if (record->event.pressed) {
499 layer_off(_PLOVER);
500 }
501 return false;
502#endif // STENO_ENABLE
503 case QWERTY:
504 if (record->event.pressed) {
505 set_single_persistent_default_layer(_QWERTY);
506 }
507 return false;
508#ifdef ALT_LAYOUTS_ENABLE
509 case CH_WMN:
510 case CH_CMK:
511 case CH_QWE:
512 case CH_DVK:
513 if (record->event.pressed) {
514 change_layout_conversion(keycode);
515 }
516 return false;
517#endif // ALT_LAYOUTS_ENABLE
518#ifdef DIPS_ENABLE
519#ifdef ALT_LAYOUTS_ENABLE
520 case LAYOUT0:
521 if (record->event.pressed) {
522 layout_conversion_dip_state |= 1 << 0;
523 } else {
524 layout_conversion_dip_state &= ~(1 << 0);
525 }
526 layout_convert(layout_conversion_dip_state);
527 return false;
528 case LAYOUT1:
529 if (record->event.pressed) {
530 layout_conversion_dip_state |= 1 << 1;
531 } else {
532 layout_conversion_dip_state &= ~(1 << 1);
533 }
534 layout_convert(layout_conversion_dip_state);
535 return false;
536 case LAYOUT2:
537 if (record->event.pressed) {
538 layout_conversion_dip_state |= 1 << 2;
539 } else {
540 layout_conversion_dip_state &= ~(1 << 2);
541 }
542 layout_convert(layout_conversion_dip_state);
543 return false;
544 case LAYOUT3:
545 if (record->event.pressed) {
546 layout_conversion_dip_state |= 1 << 3;
547 } else {
548 layout_conversion_dip_state &= ~(1 << 3);
549 }
550 layout_convert(layout_conversion_dip_state);
551 return false;
552#endif // ALT_LAYOUTS_ENABLE
553 case DIP_ISO:
554 if (record->event.pressed) {
555 layer_on(_ISO);
556 } else {
557 layer_off(_ISO);
558 }
559 return false;
560 case FLIP_TH:
561 if (record->event.pressed) {
562 layer_on(_THUMB_ALT);
563 } else {
564 layer_off(_THUMB_ALT);
565 }
566 return false;
567#endif // DIPS_ENABLE
568 case THUMB_ALT:
569 if (record->event.pressed) {
570 layer_invert(_THUMB_ALT);
571 user_config.thumb_alt ^= 1;
572 eeconfig_update_user(user_config.raw);
573 }
574 return false;
575 case ISO:
576 if (record->event.pressed) {
577 layer_invert(_ISO);
578 user_config.iso ^= 1;
579 eeconfig_update_user(user_config.raw);
580 }
581 return false;
582 }
583 return true;
584}
diff --git a/keyboards/jian/keymaps/advanced/rules.mk b/keyboards/jian/keymaps/advanced/rules.mk
new file mode 100644
index 000000000..2a61a2639
--- /dev/null
+++ b/keyboards/jian/keymaps/advanced/rules.mk
@@ -0,0 +1,5 @@
1SWAP_HANDS_ENABLE = yes
2STENO_ENABLE = no
3MOUSEKEY_ENABLE = no
4EXTRAKEY_ENABLE = yes # Audio control and System control
5
diff --git a/keyboards/jian/keymaps/default/config.h b/keyboards/jian/keymaps/default/config.h
new file mode 100644
index 000000000..4d9cb17ca
--- /dev/null
+++ b/keyboards/jian/keymaps/default/config.h
@@ -0,0 +1,22 @@
1/*
2This is the c configuration file for the keymap
3
4Copyright 2012 Jun Wako <wakojun@gmail.com>
5Copyright 2015 Jack Humbert
6
7This program is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 2 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program. If not, see <http://www.gnu.org/licenses/>.
19*/
20#pragma once
21
22#define IGNORE_MOD_TAP_INTERRUPT
diff --git a/keyboards/jian/keymaps/default/keymap.c b/keyboards/jian/keymaps/default/keymap.c
new file mode 100644
index 000000000..7f4391f7d
--- /dev/null
+++ b/keyboards/jian/keymaps/default/keymap.c
@@ -0,0 +1,120 @@
1#include QMK_KEYBOARD_H
2
3enum jian_layers {
4 _QWERTY,
5 _DVORAK,
6 _COLEMAK,
7 _WORKMAN,
8 _LOWER,
9 _RAISE,
10 _ADJUST,
11 _BCKLT_ADJ
12};
13
14enum jian_keycodes {
15 QWERTY = SAFE_RANGE,
16 DVORAK,
17 COLEMAK,
18 WORKMAN
19};
20
21#define RAISE_T(kc) LT(_RAISE, kc)
22#define LOWER_T(kc) LT(_LOWER, kc)
23
24#ifdef SWAP_HANDS_ENABLE
25#define SW_TG SH_TG
26#else
27#define SW_TG _______
28#endif
29
30const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
31
32[_QWERTY] = LAYOUT(
33 KC_LGUI, KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, RGUI_T(KC_RBRC),
34 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, RCTL_T(KC_QUOT),
35 KC_LALT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RALT_T(KC_BSLS),
36 RAISE_T(KC_TAB), LSFT_T(KC_SPC), LOWER_T(KC_ENT), LOWER_T(KC_ESC), RSFT_T(KC_BSPC), RAISE_T(KC_DEL)
37),
38
39[_DVORAK] = LAYOUT(
40 KC_LGUI, KC_GRV, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_LBRC, RGUI_T(KC_RBRC),
41 KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, RCTL_T(KC_SLSH),
42 KC_LALT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, RALT_T(KC_BSLS),
43 RAISE_T(KC_TAB), LSFT_T(KC_SPC), LOWER_T(KC_ENT), LOWER_T(KC_ESC), RSFT_T(KC_BSPC), RAISE_T(KC_DEL)
44),
45
46[_COLEMAK] = LAYOUT(
47 KC_LGUI, KC_GRV, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, RGUI_T(KC_RBRC),
48 KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, RCTL_T(KC_QUOT),
49 KC_LALT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, RALT_T(KC_BSLS),
50 RAISE_T(KC_TAB), LSFT_T(KC_SPC), LOWER_T(KC_ENT), LOWER_T(KC_ESC), RSFT_T(KC_BSPC), RAISE_T(KC_DEL)
51),
52
53[_WORKMAN] = LAYOUT(
54 KC_LGUI, KC_GRV, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_LBRC, RGUI_T(KC_RBRC),
55 KC_LCTL, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, RCTL_T(KC_QUOT),
56 KC_LALT, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, RALT_T(KC_BSLS),
57 RAISE_T(KC_TAB), LSFT_T(KC_SPC), LOWER_T(KC_ENT), LOWER_T(KC_ESC), RSFT_T(KC_BSPC), RAISE_T(KC_DEL)
58),
59
60[_LOWER] = LAYOUT(
61 _______, KC_UNDS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, RGUI_T(KC_F12),
62 LCTL_T(KC_EQL), KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, RCTL_T(KC_MINS),
63 LALT_T(KC_PPLS), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
64 _______, _______, _______, _______, _______, _______
65),
66
67[_RAISE] = LAYOUT(
68 _______, KC_NLCK, KC_PSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, KC_VOLU, KC_HOME, KC_PSCR, KC_PGUP, KC_SLCK, KC_CAPS, _______,
69 LCTL_T(KC_EQL), KC_PAST, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_MUTE, KC_LEFT, KC_UP, KC_RGHT, KC_INS, RCTL_T(KC_APP),
70 _______, KC_P0, KC_P1, KC_P2, KC_P3, KC_PCMM, KC_VOLD, KC_END, KC_DOWN, KC_PGDN, KC_PAUS, _______,
71 _______, _______, _______, _______, _______, _______
72),
73
74[_ADJUST] = LAYOUT_symmetric(
75 RESET, DEBUG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
76 XXXXXXX, WORKMAN, COLEMAK, DVORAK, QWERTY, XXXXXXX,
77 TG(_BCKLT_ADJ), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
78 _______, SW_TG, _______
79),
80
81#if defined(RGBLIGHT) || defined(BACKLIGHT_ENABLE)
82[_BCKLT_ADJ] = LAYOUT_symmetric(
83 XXXXXXX, XXXXXXX, XXXXXXX, BL_INC, RGB_VAI, RGB_HUD, RGB_HUI,
84 XXXXXXX, XXXXXXX, BL_DEC, RGB_VAD, RGB_SAD, RGB_SAI,
85 TG(_BCKLT_ADJ), BL_BRTG, BL_TOGG, RGB_TOG, RGB_RMOD,RGB_MOD,
86 _______, _______, _______
87)
88#endif // defined(RGBLIGHT) || defined(BACKLIGHT_ENABLE)
89
90};
91
92layer_state_t layer_state_set_user(layer_state_t state) {
93 return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
94}
95
96bool process_record_user(uint16_t keycode, keyrecord_t *record) {
97 switch (keycode) {
98 case QWERTY:
99 if (record->event.pressed) {
100 set_single_persistent_default_layer(_QWERTY);
101 }
102 return false;
103 case DVORAK:
104 if (record->event.pressed) {
105 set_single_persistent_default_layer(_DVORAK);
106 }
107 return false;
108 case COLEMAK:
109 if (record->event.pressed) {
110 set_single_persistent_default_layer(_COLEMAK);
111 }
112 return false;
113 case WORKMAN:
114 if (record->event.pressed) {
115 set_single_persistent_default_layer(_WORKMAN);
116 }
117 return false;
118 }
119 return true;
120}
diff --git a/keyboards/jian/keymaps/default/rules.mk b/keyboards/jian/keymaps/default/rules.mk
new file mode 100644
index 000000000..092b119d3
--- /dev/null
+++ b/keyboards/jian/keymaps/default/rules.mk
@@ -0,0 +1,2 @@
1SWAP_HANDS_ENABLE = yes
2EXTRAKEY_ENABLE = yes # Audio control and System control
diff --git a/keyboards/jian/nsrev2/config.h b/keyboards/jian/nsrev2/config.h
new file mode 100644
index 000000000..9277aa19a
--- /dev/null
+++ b/keyboards/jian/nsrev2/config.h
@@ -0,0 +1,129 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3Copyright 2015 Jack Humbert
4
5This program is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 2 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18#pragma once
19
20#include "config_common.h"
21
22/* USB Device descriptor parameter */
23#define VENDOR_ID 0xC0DE
24#define PRODUCT_ID 0x1337
25#define DEVICE_VER 0x0210
26#define MANUFACTURER KgOfHedgehogs
27#define PRODUCT Huma
28#define DESCRIPTION An ergo keyboard
29
30/* key matrix size */
31// Rows are doubled-up
32#define MATRIX_ROWS 8
33#define MATRIX_COLS 6
34#define DIODE_DIRECTION COL2ROW
35
36
37// wiring of each half
38#define MATRIX_ROW_PINS { F4, F5, B1, B3, D1, D0, D7, E6 }
39#define MATRIX_COL_PINS { D3, D2, B4, F6, F7, B2 }
40
41/* Set 0 if debouncing isn't needed */
42#define DEBOUNCE 5
43
44#define PHYSICAL_LEDS_ENABLE
45
46#ifdef BACKLIGHT_ENABLE
47#define BACKLIGHT_PIN C6
48#define BACKLIGHT_LEVELS 5
49#define BACKLIGHT_BREATHING //not working with splits right now
50#define BREATHING_PERIOD 6
51#endif
52
53/* ws2812 RGB LED */
54#define RGB_DI_PIN D4
55#define RGBLIGHT_TIMER
56#define RGBLED_NUM 7 // Number of LEDs
57#define RGBLIGHT_ANIMATIONS //not working with splits right now
58
59#define RGBLIGHT_SLEEP
60#define RGBLIGHT_SPLIT
61
62#ifndef IOS_DEVICE_ENABLE
63#if RGBLED_NUM <= 6
64#define RGBLIGHT_LIMIT_VAL 255
65#else
66#define RGBLIGHT_LIMIT_VAL 130
67#endif
68#define RGBLIGHT_VAL_STEP 8
69#else
70#if RGBLED_NUM <= 6
71#define RGBLIGHT_LIMIT_VAL 90
72#else
73#define RGBLIGHT_LIMIT_VAL 45
74#endif
75#define RGBLIGHT_VAL_STEP 4
76#endif
77#define RGBLIGHT_HUE_STEP 10
78#define RGBLIGHT_SAT_STEP 17
79
80#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE)
81#define USB_MAX_POWER_CONSUMPTION 400
82#else
83// iOS device need lessthan 100
84#define USB_MAX_POWER_CONSUMPTION 100
85#endif
86
87#define NUM_LOCK_LED_PIN B6
88#define CAPS_LOCK_LED_PIN B5
89// #define SCROLL_LOCK_LED_PIN B6
90
91// #define NUM_NMOSFET //uncomment this if you using n-mosfet
92// #define CAPS_NMOSFET //uncomment this if you using n-mosfet
93// #define SCROLL_NMOSFET //uncomment this if you using n-mosfet
94
95// #define NUM_INVERT // uncomment this if you want to reverse logic of numlock
96// This will make it light up only when lock is off
97// (Doesn't work on mac. There is no num lock, so it will be always off and lit)
98
99#ifdef NUM_NMOSFET
100#define RESET_NUM_LOCK_LED() writePinLow(NUM_LOCK_LED_PIN)
101#ifdef NUM_INVERT
102#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, !led_state.num_lock)
103#else
104#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, led_state.num_lock)
105#endif // NUM_INVERT
106#else
107#define RESET_NUM_LOCK_LED() writePinHigh(NUM_LOCK_LED_PIN)
108#ifdef NUM_INVERT
109#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, led_state.num_lock)
110#else
111#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, !led_state.num_lock)
112#endif // NUM_INVERT
113#endif // NUM_NMOSFET
114
115#ifdef CAPS_NMOSFET
116#define RESET_CAPS_LOCK_LED() writePinLow(CAPS_LOCK_LED_PIN)
117#define UPDATE_CAPS_LOCK_LED() writePin(CAPS_LOCK_LED_PIN, led_state.caps_lock)
118#else
119#define RESET_CAPS_LOCK_LED() writePinHigh(CAPS_LOCK_LED_PIN)
120#define UPDATE_CAPS_LOCK_LED() writePin(CAPS_LOCK_LED_PIN, !led_state.caps_lock)
121#endif // CAPS_NMOSFET
122
123#ifdef SCROLL_NMOSFET
124#define RESET_SCROLL_LOCK_LED() writePinLow(SCROLL_LOCK_LED_PIN)
125#define UPDATE_SCROLL_LOCK_LED() writePin(SCROLL_LOCK_LED_PIN, led_state.scroll_lock)
126#else
127#define RESET_SCROLL_LOCK_LED() writePinHigh(SCROLL_LOCK_LED_PIN)
128#define UPDATE_SCROLL_LOCK_LED() writePin(SCROLL_LOCK_LED_PIN, !led_state.scroll_lock)
129#endif // SCROLL_NMOSFET
diff --git a/keyboards/jian/nsrev2/nsrev2.c b/keyboards/jian/nsrev2/nsrev2.c
new file mode 100644
index 000000000..a7508ad9b
--- /dev/null
+++ b/keyboards/jian/nsrev2/nsrev2.c
@@ -0,0 +1,74 @@
1#include "nsrev2.h"
2
3// TODO:
4#ifdef SWAP_HANDS_ENABLE
5const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
6 {{0, 4}, {1, 4}, {2, 4}, {3, 4}, {4, 4}, {5, 4}},
7 {{0, 5}, {1, 5}, {2, 5}, {3, 5}, {4, 5}, {5, 5}},
8 {{0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}},
9 {{0, 7}, {1, 7}, {2, 7}, {3, 7}, {4, 7}, {5, 7}},
10 {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}},
11 {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}},
12 {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}},
13 {{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}},
14};
15#endif
16
17static bool backlight_was_toggled = false;
18
19void suspend_power_down_kb(void) {
20 if (is_backlight_enabled()) {
21 backlight_disable();
22 backlight_was_toggled = true;
23 }
24}
25
26void suspend_wakeup_init_kb(void) {
27 if (backlight_was_toggled) {
28 backlight_enable();
29 backlight_was_toggled = false;
30 }
31}
32
33#ifdef PHYSICAL_LEDS_ENABLE
34void led_init_kb(void)
35{
36#ifdef NUM_LOCK_LED_PIN
37 setPinOutput(NUM_LOCK_LED_PIN);
38 RESET_NUM_LOCK_LED();
39#endif // NUM_LOCK_LED_PIN
40#ifdef CAPS_LOCK_LED_PIN
41 setPinOutput(CAPS_LOCK_LED_PIN);
42 RESET_CAPS_LOCK_LED();
43#endif // CAPS_LOCK_LED_PIN
44#ifdef SCROLL_LOCK_LED_PIN
45 setPinOutput(SCROLL_LOCK_LED_PIN);
46 RESET_SCROLL_LOCK_LED();
47#endif // SCROLL_LOCK_LED_PIN
48}
49#endif // PHYSICAL_LEDS_ENABLE
50
51void matrix_init_kb(void) {
52#ifdef PHYSICAL_LEDS_ENABLE
53 led_init_kb();
54#endif // PHYSICAL_LEDS_ENABLE
55 matrix_init_user();
56};
57
58#ifdef PHYSICAL_LEDS_ENABLE
59bool led_update_kb(led_t led_state) {
60 bool res = led_update_user(led_state);
61 if(res) {
62#ifdef NUM_LOCK_LED_PIN
63 UPDATE_NUM_LOCK_LED();
64#endif // NUM_LOCK_LED_PIN
65#ifdef CAPS_LOCK_LED_PIN
66 UPDATE_CAPS_LOCK_LED();
67#endif // CAPS_LOCK_LED_PIN
68#ifdef SCROLL_LOCK_LED_PIN
69 UPDATE_SCROLL_LOCK_LED();
70#endif // SCROLL_LOCK_LED_PIN
71 }
72 return res;
73}
74#endif // PHYSICAL_LEDS_ENABLE
diff --git a/keyboards/jian/nsrev2/nsrev2.h b/keyboards/jian/nsrev2/nsrev2.h
new file mode 100644
index 000000000..9dfb7240b
--- /dev/null
+++ b/keyboards/jian/nsrev2/nsrev2.h
@@ -0,0 +1,39 @@
1#pragma once
2
3#include "jian.h"
4
5#define XXX KC_NO
6
7#define LAYOUT( \
8 L20, L00, L01, L12, L02, L03, L04, R04, R03, R02, R12, R01, R00, R20, \
9 L10, L11, L22, L13, L14, L05, R05, R14, R13, R22, R11, R10, \
10 L21, L32, L33, L23, L24, L15, R15, R24, R23, R33, R32, R21, \
11 L34, L25, L35, R35, R25, R34 \
12) \
13{ \
14 {L00, L01, L02, L03, L04, L05 }, \
15 {L10, L11, L12, L13, L14, L15 }, \
16 {L20, L21, L22, L23, L24, L25 }, \
17 {XXX, XXX, L32, L33, L34, L35 }, \
18 {R00, R01, R02, R03, R04, R05 }, \
19 {R10, R11, R12, R13, R14, R15 }, \
20 {R20, R21, R22, R23, R24, R25 }, \
21 {XXX, XXX, R32, R33, R34, R35 } \
22}
23
24#define LAYOUT_symmetric( \
25 K20, K00, K01, K12, K02, K03, K04, \
26 K10, K11, K22, K13, K14, K05, \
27 K21, K32, K33, K23, K24, K15, \
28 K34, K25, K35 \
29) \
30{ \
31 {K00, K01, K02, K03, K04, K05 }, \
32 {K10, K11, K12, K13, K14, K15 }, \
33 {K20, K21, K22, K23, K24, K25 }, \
34 {XXX, XXX, K32, K33, K34, K35 }, \
35 {K00, K01, K02, K03, K04, K05 }, \
36 {K10, K11, K12, K13, K14, K15 }, \
37 {K20, K21, K22, K23, K24, K25 }, \
38 {XXX, XXX, K32, K33, K34, K35 } \
39}
diff --git a/keyboards/jian/nsrev2/rules.mk b/keyboards/jian/nsrev2/rules.mk
new file mode 100644
index 000000000..3942e629a
--- /dev/null
+++ b/keyboards/jian/nsrev2/rules.mk
@@ -0,0 +1,20 @@
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 = qmk-dfu
13
14# Build Options
15# change yes to no to disable
16#
17CONSOLE_ENABLE = no
18SPLIT_KEYBOARD = no
19BACKLIGHT_ENABLE = yes
20RGBLIGHT_ENABLE = no
diff --git a/keyboards/jian/readme.md b/keyboards/jian/readme.md
new file mode 100644
index 000000000..7afff2ab7
--- /dev/null
+++ b/keyboards/jian/readme.md
@@ -0,0 +1,16 @@
1# Jian
2
3<img src="https://i.imgur.com/XUzcaWG.png" data-canonical-src="Jian" width="600"/>
4
5A 40% ergonomic keyboard kit. Jian supports cherry mx, alps, kailh choc switches PCB and plate mounted. You can assembly keyboard without mounting plate. Jian also supports rgb led strip like ws2812b and 1 color in-switch backlight. Each half can work standalone.
6
7* Keyboard Maintainer: [KGOH](https://github.com/KGOH)
8* Hardware Supported: Jian PCB rev1, rev2, Pro Micro
9* Layout: [keyboard-layout-editor.com](http://www.keyboard-layout-editor.com/#/gists/4b6c2af67148f58ddd6c6b2976c4370f)
10* Hardware Availability: [Telegram channel](https://t.me/KgOfHedgehogs)
11
12Make example for this keyboard (after setting up your build environment):
13
14 make jian/rev2:default
15
16See 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/jian/rev1/config.h b/keyboards/jian/rev1/config.h
new file mode 100644
index 000000000..799a71fc0
--- /dev/null
+++ b/keyboards/jian/rev1/config.h
@@ -0,0 +1,138 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3Copyright 2015 Jack Humbert
4
5This program is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 2 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18#pragma once
19
20#include "config_common.h"
21
22/* USB Device descriptor parameter */
23#define VENDOR_ID 0xC0DE
24#define PRODUCT_ID 0x1337
25#define DEVICE_VER 0x0100
26#define MANUFACTURER KgOfHedgehogs
27#define PRODUCT Jian
28#define DESCRIPTION An ergo split keyboard
29
30/* key matrix size */
31// Rows are doubled-up
32#define MATRIX_ROWS 8
33#define MATRIX_COLS 7
34#define DIODE_DIRECTION COL2ROW
35
36// wiring of each half
37#define MATRIX_ROW_PINS { D3, D2, E6, B4 }
38#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 }
39
40/* Use I2C or Serial, not both */
41// #define USE_SERIAL
42#define USE_I2C
43
44/* Select hand configuration */
45// #define MASTER_LEFT
46// #define MASTER_RIGHT
47#define EE_HANDS
48
49// different Jian configs
50#define DIPS_ENABLE
51#define PHYSICAL_LEDS_ENABLE
52#define NUM_LOCK_LED_PIN C6
53#define CAPS_LOCK_LED_PIN D7
54#define SCROLL_LOCK_LED_PIN B5
55
56// #define NUM_NMOSFET //uncomment this if you using n-mosfet
57// #define CAPS_NMOSFET //uncomment this if you using n-mosfet
58// #define SCROLL_NMOSFET //uncomment this if you using n-mosfet
59
60// #define NUM_INVERT // uncomment this if you want to reverse logic of numlock
61// This will make it light up only when lock is off
62// (Doesn't work on mac. There is no num lock, so it will be always off and lit)
63
64#ifdef NUM_NMOSFET
65#define RESET_NUM_LOCK_LED() writePinLow(NUM_LOCK_LED_PIN)
66#ifdef NUM_INVERT
67#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, !led_state.num_lock)
68#else
69#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, led_state.num_lock)
70#endif // NUM_INVERT
71#else
72#define RESET_NUM_LOCK_LED() writePinHigh(NUM_LOCK_LED_PIN)
73#ifdef NUM_INVERT
74#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, led_state.num_lock)
75#else
76#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, !led_state.num_lock)
77#endif // NUM_INVERT
78#endif // NUM_NMOSFET
79
80#ifdef CAPS_NMOSFET
81#define RESET_CAPS_LOCK_LED() writePinLow(CAPS_LOCK_LED_PIN)
82#define UPDATE_CAPS_LOCK_LED() writePin(CAPS_LOCK_LED_PIN, led_state.caps_lock)
83#else
84#define RESET_CAPS_LOCK_LED() writePinHigh(CAPS_LOCK_LED_PIN)
85#define UPDATE_CAPS_LOCK_LED() writePin(CAPS_LOCK_LED_PIN, !led_state.caps_lock)
86#endif // CAPS_NMOSFET
87
88#ifdef SCROLL_NMOSFET
89#define RESET_SCROLL_LOCK_LED() writePinLow(SCROLL_LOCK_LED_PIN)
90#define UPDATE_SCROLL_LOCK_LED() writePin(SCROLL_LOCK_LED_PIN, led_state.scroll_lock)
91#else
92#define RESET_SCROLL_LOCK_LED() writePinHigh(SCROLL_LOCK_LED_PIN)
93#define UPDATE_SCROLL_LOCK_LED() writePin(SCROLL_LOCK_LED_PIN, !led_state.scroll_lock)
94#endif // SCROLL_NMOSFET
95
96/* Set 0 if debouncing isn't needed */
97#define DEBOUNCE 5
98
99#ifdef BACKLIGHT_ENABLE
100#define BACKLIGHT_PIN B6
101#define BACKLIGHT_LEVELS 5
102//#define BACKLIGHT_BREATHING //not working with splits right now
103#define BREATHING_PERIOD 6
104#endif
105
106/* ws2812 RGB LED */
107#define RGB_DI_PIN D4
108#define RGBLIGHT_TIMER
109#define RGBLED_NUM 7 // Number of LEDs
110#define RGBLIGHT_ANIMATIONS //not working with splits right now
111
112#define RGBLIGHT_SLEEP
113#define RGBLIGHT_SPLIT
114
115#ifndef IOS_DEVICE_ENABLE
116#if RGBLED_NUM <= 6
117#define RGBLIGHT_LIMIT_VAL 255
118#else
119#define RGBLIGHT_LIMIT_VAL 130
120#endif
121#define RGBLIGHT_VAL_STEP 8
122#else
123#if RGBLED_NUM <= 6
124#define RGBLIGHT_LIMIT_VAL 90
125#else
126#define RGBLIGHT_LIMIT_VAL 45
127#endif
128#define RGBLIGHT_VAL_STEP 4
129#endif
130#define RGBLIGHT_HUE_STEP 10
131#define RGBLIGHT_SAT_STEP 17
132
133#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE)
134#define USB_MAX_POWER_CONSUMPTION 400
135#else
136// iOS device need lessthan 100
137#define USB_MAX_POWER_CONSUMPTION 100
138#endif
diff --git a/keyboards/jian/rev1/rev1.c b/keyboards/jian/rev1/rev1.c
new file mode 100644
index 000000000..f1cfe9918
--- /dev/null
+++ b/keyboards/jian/rev1/rev1.c
@@ -0,0 +1,74 @@
1#include "rev1.h"
2
3#ifdef SWAP_HANDS_ENABLE
4__attribute__ ((weak))
5const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
6 {{0, 4}, {1, 4}, {2, 4}, {3, 4}, {4, 4}, {5, 4}, {6, 4}},
7 {{0, 5}, {1, 5}, {2, 5}, {3, 5}, {4, 5}, {5, 5}, {6, 5}},
8 {{0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}, {6, 6}},
9 {{0, 7}, {1, 7}, {2, 7}, {3, 7}, {4, 7}, {5, 7}, {6, 7}},
10 {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {6, 0}},
11 {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}, {6, 1}},
12 {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}, {6, 2}},
13 {{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}, {6, 3}},
14};
15#endif
16
17static bool backlight_was_toggled = false;
18
19void suspend_power_down_kb(void) {
20 if (is_backlight_enabled()) {
21 backlight_disable();
22 backlight_was_toggled = true;
23 }
24}
25
26void suspend_wakeup_init_kb(void) {
27 if (backlight_was_toggled) {
28 backlight_enable();
29 backlight_was_toggled = false;
30 }
31}
32
33#ifdef PHYSICAL_LEDS_ENABLE
34void led_init_kb(void)
35{
36#ifdef NUM_LOCK_LED_PIN
37 setPinOutput(NUM_LOCK_LED_PIN);
38 RESET_NUM_LOCK_LED();
39#endif // NUM_LOCK_LED_PIN
40#ifdef CAPS_LOCK_LED_PIN
41 setPinOutput(CAPS_LOCK_LED_PIN);
42 RESET_CAPS_LOCK_LED();
43#endif // CAPS_LOCK_LED_PIN
44#ifdef SCROLL_LOCK_LED_PIN
45 setPinOutput(SCROLL_LOCK_LED_PIN);
46 RESET_SCROLL_LOCK_LED();
47#endif // SCROLL_LOCK_LED_PIN
48}
49#endif // PHYSICAL_LEDS_ENABLE
50
51void matrix_init_kb(void) {
52#ifdef PHYSICAL_LEDS_ENABLE
53 led_init_kb();
54#endif // PHYSICAL_LEDS_ENABLE
55 matrix_init_user();
56};
57
58#ifdef PHYSICAL_LEDS_ENABLE
59bool led_update_kb(led_t led_state) {
60 bool res = led_update_user(led_state);
61 if(res) {
62#ifdef NUM_LOCK_LED_PIN
63 UPDATE_NUM_LOCK_LED();
64#endif // NUM_LOCK_LED_PIN
65#ifdef CAPS_LOCK_LED_PIN
66 UPDATE_CAPS_LOCK_LED();
67#endif // CAPS_LOCK_LED_PIN
68#ifdef SCROLL_LOCK_LED_PIN
69 UPDATE_SCROLL_LOCK_LED();
70#endif // SCROLL_LOCK_LED_PIN
71 }
72 return res;
73}
74#endif // PHYSICAL_LEDS_ENABLE
diff --git a/keyboards/jian/rev1/rev1.h b/keyboards/jian/rev1/rev1.h
new file mode 100644
index 000000000..ee55de628
--- /dev/null
+++ b/keyboards/jian/rev1/rev1.h
@@ -0,0 +1,56 @@
1#pragma once
2
3#include "jian.h"
4
5#define XXX KC_NO
6
7#define LAYOUT( \
8 L00, L01, L02, L03, L04, L05, L06, R06, R05, R04, R03, R02, R01, R00, \
9 L11, L12, L13, L14, L15, L16, R16, R15, R14, R13, R12, R11, \
10 L21, L22, L23, L24, L25, L26, R26, R25, R24, R23, R22, R21, \
11 L34, L35, L36, R36, R35, R34 \
12) \
13{ \
14 {L00, L01, L02, L03, L04, L05, L06}, \
15 {XXX, L11, L12, L13, L14, L15, L16}, \
16 {XXX, L21, L22, L23, L24, L25, L26}, \
17 {XXX, XXX, XXX, XXX, L34, L35, L36}, \
18 {R00, R01, R02, R03, R04, R05, R06}, \
19 {XXX, R11, R12, R13, R14, R15, R16}, \
20 {XXX, R21, R22, R23, R24, R25, R26}, \
21 {XXX, XXX, XXX, XXX, R34, R35, R36} \
22}
23
24#define LAYOUT_symmetric( \
25 K00, K01, K02, K03, K04, K05, K06, \
26 K11, K12, K13, K14, K15, K16, \
27 K21, K22, K23, K24, K25, K26, \
28 K34, K35, K36 \
29) \
30{ \
31 {K00, K01, K02, K03, K04, K05, K06}, \
32 {XXX, K11, K12, K13, K14, K15, K16}, \
33 {XXX, K21, K22, K23, K24, K25, K26}, \
34 {XXX, XXX, XXX, XXX, K34, K35, K36}, \
35 {K00, K01, K02, K03, K04, K05, K06}, \
36 {XXX, K11, K12, K13, K14, K15, K16}, \
37 {XXX, K21, K22, K23, K24, K25, K26}, \
38 {XXX, XXX, XXX, XXX, K34, K35, K36} \
39}
40
41#ifdef DIPS_ENABLE
42#define LAYOUT_dips( \
43 DL0, DL1, DL2, DL3, DL4, DL5, \
44 DR5, DR4, DR3, DR2, DR1, DR0 \
45) \
46{ \
47 {XXX, XXX, XXX, XXX, XXX, XXX, XXX}, \
48 {DL0, XXX, XXX, XXX, XXX, XXX, XXX}, \
49 {DL1, XXX, XXX, XXX, XXX, XXX, XXX}, \
50 {DL2, DL3, DL4, DL5, XXX, XXX, XXX}, \
51 {XXX, XXX, XXX, XXX, XXX, XXX, XXX}, \
52 {DR0, XXX, XXX, XXX, XXX, XXX, XXX}, \
53 {DR1, XXX, XXX, XXX, XXX, XXX, XXX}, \
54 {DR2, DR3, DR4, DR5, XXX, XXX, XXX}, \
55}
56#endif // DIPS_ENABLE
diff --git a/keyboards/jian/rev1/rules.mk b/keyboards/jian/rev1/rules.mk
new file mode 100644
index 000000000..915b64754
--- /dev/null
+++ b/keyboards/jian/rev1/rules.mk
@@ -0,0 +1,20 @@
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 yes to no to disable
16#
17CONSOLE_ENABLE = no
18SPLIT_KEYBOARD = yes
19BACKLIGHT_ENABLE = yes
20RGBLIGHT_ENABLE = yes
diff --git a/keyboards/jian/rev2/config.h b/keyboards/jian/rev2/config.h
new file mode 100644
index 000000000..760389cc6
--- /dev/null
+++ b/keyboards/jian/rev2/config.h
@@ -0,0 +1,136 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3Copyright 2015 Jack Humbert
4
5This program is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 2 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18#pragma once
19
20#include "config_common.h"
21
22/* USB Device descriptor parameter */
23#define VENDOR_ID 0xC0DE
24#define PRODUCT_ID 0x1337
25#define DEVICE_VER 0x0200
26#define MANUFACTURER KgOfHedgehogs
27#define PRODUCT Jian
28#define DESCRIPTION An ergo keyboard
29
30/* key matrix size */
31// Rows are doubled-up
32#define MATRIX_ROWS 8
33#define MATRIX_COLS 6
34#define DIODE_DIRECTION COL2ROW
35
36// wiring of each half
37#define MATRIX_ROW_PINS { F4, F5, B1, B3 }
38#define MATRIX_COL_PINS { D3, D2, B4, F6, F7, B2 }
39
40//#define USE_I2C
41#define USE_SERIAL
42#define SOFT_SERIAL_PIN D1
43
44//#define EE_HANDS
45#define SPLIT_HAND_PIN E6
46
47/* Set 0 if debouncing isn't needed */
48#define DEBOUNCE 5
49
50#define PHYSICAL_LEDS_ENABLE
51#define IOS_DEVICE_ENABLE
52
53#ifdef BACKLIGHT_ENABLE
54#define BACKLIGHT_PIN C6
55#define BACKLIGHT_LEVELS 5
56#define BACKLIGHT_BREATHING //not working with splits right now
57#define BREATHING_PERIOD 6
58#endif
59
60/* ws2812 RGB LED */
61#define RGB_DI_PIN D4
62#define RGBLIGHT_TIMER
63#define RGBLED_NUM 7 // Number of LEDs
64#define RGBLIGHT_ANIMATIONS //not working with splits right now
65
66#define RGBLIGHT_SLEEP
67#define RGBLIGHT_SPLIT
68
69#ifndef IOS_DEVICE_ENABLE
70#if RGBLED_NUM <= 6
71#define RGBLIGHT_LIMIT_VAL 255
72#else
73#define RGBLIGHT_LIMIT_VAL 130
74#endif
75#define RGBLIGHT_VAL_STEP 8
76#else
77#if RGBLED_NUM <= 6
78#define RGBLIGHT_LIMIT_VAL 90
79#else
80#define RGBLIGHT_LIMIT_VAL 45
81#endif
82#define RGBLIGHT_VAL_STEP 4
83#endif
84#define RGBLIGHT_HUE_STEP 10
85#define RGBLIGHT_SAT_STEP 17
86
87#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE)
88#define USB_MAX_POWER_CONSUMPTION 400
89#else
90// iOS device need lessthan 100
91#define USB_MAX_POWER_CONSUMPTION 100
92#endif
93
94#define NUM_LOCK_LED_PIN D7
95#define CAPS_LOCK_LED_PIN B5
96#define SCROLL_LOCK_LED_PIN B6
97
98// #define NUM_NMOSFET //uncomment this if you using n-mosfet
99// #define CAPS_NMOSFET //uncomment this if you using n-mosfet
100// #define SCROLL_NMOSFET //uncomment this if you using n-mosfet
101
102// #define NUM_INVERT // uncomment this if you want to reverse logic of numlock
103// This will make it light up only when lock is off
104// (Doesn't work on mac. There is no num lock, so it will be always off and lit)
105
106#ifdef NUM_NMOSFET
107#define RESET_NUM_LOCK_LED() writePinLow(NUM_LOCK_LED_PIN)
108#ifdef NUM_INVERT
109#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, !led_state.num_lock)
110#else
111#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, led_state.num_lock)
112#endif // NUM_INVERT
113#else
114#define RESET_NUM_LOCK_LED() writePinHigh(NUM_LOCK_LED_PIN)
115#ifdef NUM_INVERT
116#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, led_state.num_lock)
117#else
118#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, !led_state.num_lock)
119#endif // NUM_INVERT
120#endif // NUM_NMOSFET
121
122#ifdef CAPS_NMOSFET
123#define RESET_CAPS_LOCK_LED() writePinLow(CAPS_LOCK_LED_PIN)
124#define UPDATE_CAPS_LOCK_LED() writePin(CAPS_LOCK_LED_PIN, led_state.caps_lock)
125#else
126#define RESET_CAPS_LOCK_LED() writePinHigh(CAPS_LOCK_LED_PIN)
127#define UPDATE_CAPS_LOCK_LED() writePin(CAPS_LOCK_LED_PIN, !led_state.caps_lock)
128#endif // CAPS_NMOSFET
129
130#ifdef SCROLL_NMOSFET
131#define RESET_SCROLL_LOCK_LED() writePinLow(SCROLL_LOCK_LED_PIN)
132#define UPDATE_SCROLL_LOCK_LED() writePin(SCROLL_LOCK_LED_PIN, led_state.scroll_lock)
133#else
134#define RESET_SCROLL_LOCK_LED() writePinHigh(SCROLL_LOCK_LED_PIN)
135#define UPDATE_SCROLL_LOCK_LED() writePin(SCROLL_LOCK_LED_PIN, !led_state.scroll_lock)
136#endif // SCROLL_NMOSFET
diff --git a/keyboards/jian/rev2/rev2.c b/keyboards/jian/rev2/rev2.c
new file mode 100644
index 000000000..6f4808de7
--- /dev/null
+++ b/keyboards/jian/rev2/rev2.c
@@ -0,0 +1,74 @@
1#include "rev2.h"
2
3#ifdef SWAP_HANDS_ENABLE
4__attribute__ ((weak))
5const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
6 {{0, 4}, {1, 4}, {2, 4}, {3, 4}, {4, 4}, {5, 4}},
7 {{0, 5}, {1, 5}, {2, 5}, {3, 5}, {4, 5}, {5, 5}},
8 {{0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}},
9 {{0, 7}, {1, 7}, {2, 7}, {3, 7}, {4, 7}, {5, 7}},
10 {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}},
11 {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}},
12 {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}},
13 {{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}},
14};
15#endif
16
17static bool backlight_was_toggled = false;
18
19void suspend_power_down_kb(void) {
20 if (is_backlight_enabled()) {
21 backlight_disable();
22 backlight_was_toggled = true;
23 }
24}
25
26void suspend_wakeup_init_kb(void) {
27 if (backlight_was_toggled) {
28 backlight_enable();
29 backlight_was_toggled = false;
30 }
31}
32
33#ifdef PHYSICAL_LEDS_ENABLE
34void led_init_kb(void)
35{
36#ifdef NUM_LOCK_LED_PIN
37 setPinOutput(NUM_LOCK_LED_PIN);
38 RESET_NUM_LOCK_LED();
39#endif // NUM_LOCK_LED_PIN
40#ifdef CAPS_LOCK_LED_PIN
41 setPinOutput(CAPS_LOCK_LED_PIN);
42 RESET_CAPS_LOCK_LED();
43#endif // CAPS_LOCK_LED_PIN
44#ifdef SCROLL_LOCK_LED_PIN
45 setPinOutput(SCROLL_LOCK_LED_PIN);
46 RESET_SCROLL_LOCK_LED();
47#endif // SCROLL_LOCK_LED_PIN
48}
49#endif // PHYSICAL_LEDS_ENABLE
50
51void matrix_init_kb(void) {
52#ifdef PHYSICAL_LEDS_ENABLE
53 led_init_kb();
54#endif // PHYSICAL_LEDS_ENABLE
55 matrix_init_user();
56};
57
58#ifdef PHYSICAL_LEDS_ENABLE
59bool led_update_kb(led_t led_state) {
60 bool res = led_update_user(led_state);
61 if(res) {
62#ifdef NUM_LOCK_LED_PIN
63 UPDATE_NUM_LOCK_LED();
64#endif // NUM_LOCK_LED_PIN
65#ifdef CAPS_LOCK_LED_PIN
66 UPDATE_CAPS_LOCK_LED();
67#endif // CAPS_LOCK_LED_PIN
68#ifdef SCROLL_LOCK_LED_PIN
69 UPDATE_SCROLL_LOCK_LED();
70#endif // SCROLL_LOCK_LED_PIN
71 }
72 return res;
73}
74#endif // PHYSICAL_LEDS_ENABLE
diff --git a/keyboards/jian/rev2/rev2.h b/keyboards/jian/rev2/rev2.h
new file mode 100644
index 000000000..9dfb7240b
--- /dev/null
+++ b/keyboards/jian/rev2/rev2.h
@@ -0,0 +1,39 @@
1#pragma once
2
3#include "jian.h"
4
5#define XXX KC_NO
6
7#define LAYOUT( \
8 L20, L00, L01, L12, L02, L03, L04, R04, R03, R02, R12, R01, R00, R20, \
9 L10, L11, L22, L13, L14, L05, R05, R14, R13, R22, R11, R10, \
10 L21, L32, L33, L23, L24, L15, R15, R24, R23, R33, R32, R21, \
11 L34, L25, L35, R35, R25, R34 \
12) \
13{ \
14 {L00, L01, L02, L03, L04, L05 }, \
15 {L10, L11, L12, L13, L14, L15 }, \
16 {L20, L21, L22, L23, L24, L25 }, \
17 {XXX, XXX, L32, L33, L34, L35 }, \
18 {R00, R01, R02, R03, R04, R05 }, \
19 {R10, R11, R12, R13, R14, R15 }, \
20 {R20, R21, R22, R23, R24, R25 }, \
21 {XXX, XXX, R32, R33, R34, R35 } \
22}
23
24#define LAYOUT_symmetric( \
25 K20, K00, K01, K12, K02, K03, K04, \
26 K10, K11, K22, K13, K14, K05, \
27 K21, K32, K33, K23, K24, K15, \
28 K34, K25, K35 \
29) \
30{ \
31 {K00, K01, K02, K03, K04, K05 }, \
32 {K10, K11, K12, K13, K14, K15 }, \
33 {K20, K21, K22, K23, K24, K25 }, \
34 {XXX, XXX, K32, K33, K34, K35 }, \
35 {K00, K01, K02, K03, K04, K05 }, \
36 {K10, K11, K12, K13, K14, K15 }, \
37 {K20, K21, K22, K23, K24, K25 }, \
38 {XXX, XXX, K32, K33, K34, K35 } \
39}
diff --git a/keyboards/jian/rev2/rules.mk b/keyboards/jian/rev2/rules.mk
new file mode 100644
index 000000000..bbfde67f9
--- /dev/null
+++ b/keyboards/jian/rev2/rules.mk
@@ -0,0 +1,20 @@
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 = qmk-dfu
13
14# Build Options
15# change yes to no to disable
16#
17CONSOLE_ENABLE = no
18SPLIT_KEYBOARD = yes
19BACKLIGHT_ENABLE = yes
20RGBLIGHT_ENABLE = yes
diff --git a/keyboards/jian/rules.mk b/keyboards/jian/rules.mk
new file mode 100644
index 000000000..c19fa00b5
--- /dev/null
+++ b/keyboards/jian/rules.mk
@@ -0,0 +1 @@
DEFAULT_FOLDER = jian/rev2