diff options
Diffstat (limited to 'keyboards/ai03')
144 files changed, 7026 insertions, 0 deletions
diff --git a/keyboards/ai03/andromeda/andromeda.c b/keyboards/ai03/andromeda/andromeda.c new file mode 100644 index 000000000..5dd580eff --- /dev/null +++ b/keyboards/ai03/andromeda/andromeda.c | |||
@@ -0,0 +1,17 @@ | |||
1 | /* | ||
2 | Copyright 2021 Andrew Kannan | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation, either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | #include "andromeda.h" | ||
diff --git a/keyboards/ai03/andromeda/andromeda.h b/keyboards/ai03/andromeda/andromeda.h new file mode 100644 index 000000000..1fcae4d77 --- /dev/null +++ b/keyboards/ai03/andromeda/andromeda.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | Copyright 2021 Andrew Kannan | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation, either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | #pragma once | ||
18 | |||
19 | #include "quantum.h" | ||
20 | |||
21 | #define LAYOUT_tkl_ansi_wkl( \ | ||
22 | K000, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, \ | ||
23 | K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ | ||
24 | K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, \ | ||
25 | K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ | ||
26 | K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K413, K415, \ | ||
27 | K500, K502, K507, K511, K513, K514, K515, K516 \ | ||
28 | ) { \ | ||
29 | { K000, KC_NO, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016 }, \ | ||
30 | { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116 }, \ | ||
31 | { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213 , K214, K215, K216 }, \ | ||
32 | { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO, KC_NO, KC_NO }, \ | ||
33 | { K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, KC_NO, K413, KC_NO, K415, KC_NO }, \ | ||
34 | { K500, KC_NO, K502, KC_NO, KC_NO, KC_NO, KC_NO, K507, KC_NO, KC_NO, KC_NO, K511, KC_NO, K513, K514, K515, K516 } \ | ||
35 | } | ||
diff --git a/keyboards/ai03/andromeda/config.h b/keyboards/ai03/andromeda/config.h new file mode 100644 index 000000000..f88eb0212 --- /dev/null +++ b/keyboards/ai03/andromeda/config.h | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | Copyright 2021 Andrew Kannan | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation, either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | #pragma once | ||
19 | |||
20 | /* USB Device descriptor parameter */ | ||
21 | #define VENDOR_ID 0xA103 | ||
22 | #define PRODUCT_ID 0x000A | ||
23 | #define DEVICE_VER 0x0001 | ||
24 | #define MANUFACTURER ai03 Design Studio | ||
25 | #define PRODUCT Andromeda | ||
26 | |||
27 | #define MATRIX_ROWS 6 | ||
28 | #define MATRIX_COLS 17 | ||
29 | |||
30 | #define MATRIX_COL_PINS { A10, A9, A8, B15, B14, B13, B12, B11, B10, B2, B1, B0, A7, A6, B5, B8, B9 } | ||
31 | #define MATRIX_ROW_PINS { B4, B3, A15, A3, A4, A5 } | ||
32 | #define DIODE_DIRECTION COL2ROW | ||
33 | |||
34 | /* define if matrix has ghost */ | ||
35 | //#define MATRIX_HAS_GHOST | ||
36 | |||
37 | /* Set 0 if debouncing isn't needed */ | ||
38 | #define DEBOUNCE 5 | ||
39 | |||
40 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
41 | #define LOCKING_SUPPORT_ENABLE | ||
42 | /* Locking resynchronize hack */ | ||
43 | #define LOCKING_RESYNC_ENABLE | ||
44 | |||
45 | #define LED_CAPS_LOCK_PIN A2 | ||
46 | #define LED_SCROLL_LOCK_PIN A1 | ||
47 | #define LED_PIN_ON_STATE 0 | ||
diff --git a/keyboards/ai03/andromeda/info.json b/keyboards/ai03/andromeda/info.json new file mode 100644 index 000000000..0f4c0adb1 --- /dev/null +++ b/keyboards/ai03/andromeda/info.json | |||
@@ -0,0 +1,10 @@ | |||
1 | { | ||
2 | "keyboard_name": "Andromeda", | ||
3 | "url": "", | ||
4 | "maintainer": "ai03", | ||
5 | "layouts": { | ||
6 | "LAYOUT_tkl_ansi_wkl": { | ||
7 | "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.25}, {"label":"!", "x":1, "y":1.25}, {"label":"@", "x":2, "y":1.25}, {"label":"#", "x":3, "y":1.25}, {"label":"$", "x":4, "y":1.25}, {"label":"%", "x":5, "y":1.25}, {"label":"^", "x":6, "y":1.25}, {"label":"&", "x":7, "y":1.25}, {"label":"*", "x":8, "y":1.25}, {"label":"(", "x":9, "y":1.25}, {"label":")", "x":10, "y":1.25}, {"label":"_", "x":11, "y":1.25}, {"label":"+", "x":12, "y":1.25}, {"label":"Backspace", "x":13, "y":1.25, "w":2}, {"label":"Insert", "x":15.25, "y":1.25}, {"label":"Home", "x":16.25, "y":1.25}, {"label":"PgUp", "x":17.25, "y":1.25}, {"label":"Tab", "x":0, "y":2.25, "w":1.5}, {"label":"Q", "x":1.5, "y":2.25}, {"label":"W", "x":2.5, "y":2.25}, {"label":"E", "x":3.5, "y":2.25}, {"label":"R", "x":4.5, "y":2.25}, {"label":"T", "x":5.5, "y":2.25}, {"label":"Y", "x":6.5, "y":2.25}, {"label":"U", "x":7.5, "y":2.25}, {"label":"I", "x":8.5, "y":2.25}, {"label":"O", "x":9.5, "y":2.25}, {"label":"P", "x":10.5, "y":2.25}, {"label":"{", "x":11.5, "y":2.25}, {"label":"}", "x":12.5, "y":2.25}, {"label":"|", "x":13.5, "y":2.25, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.25}, {"label":"End", "x":16.25, "y":2.25}, {"label":"PgDn", "x":17.25, "y":2.25}, {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, {"label":"A", "x":1.75, "y":3.25}, {"label":"S", "x":2.75, "y":3.25}, {"label":"D", "x":3.75, "y":3.25}, {"label":"F", "x":4.75, "y":3.25}, {"label":"G", "x":5.75, "y":3.25}, {"label":"H", "x":6.75, "y":3.25}, {"label":"J", "x":7.75, "y":3.25}, {"label":"K", "x":8.75, "y":3.25}, {"label":"L", "x":9.75, "y":3.25}, {"label":":", "x":10.75, "y":3.25}, {"label":"\"", "x":11.75, "y":3.25}, {"label":"Enter", "x":12.75, "y":3.25, "w":2.25}, {"label":"Shift", "x":0, "y":4.25, "w":2.25}, {"label":"Z", "x":2.25, "y":4.25}, {"label":"X", "x":3.25, "y":4.25}, {"label":"C", "x":4.25, "y":4.25}, {"label":"V", "x":5.25, "y":4.25}, {"label":"B", "x":6.25, "y":4.25}, {"label":"N", "x":7.25, "y":4.25}, {"label":"M", "x":8.25, "y":4.25}, {"label":"<", "x":9.25, "y":4.25}, {"label":">", "x":10.25, "y":4.25}, {"label":"?", "x":11.25, "y":4.25}, {"label":"Shift", "x":12.25, "y":4.25, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.25}, {"label":"Ctrl", "x":0, "y":5.25, "w":1.5}, {"label":"Alt", "x":2.5, "y":5.25, "w":1.5}, {"x":4, "y":5.25, "w":7}, {"label":"Alt", "x":11, "y":5.25, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":5.25, "w":1.5}, {"label":"\u2190", "x":15.25, "y":5.25}, {"label":"\u2193", "x":16.25, "y":5.25}, {"label":"\u2192", "x":17.25, "y":5.25}] | ||
8 | } | ||
9 | } | ||
10 | } | ||
diff --git a/keyboards/ai03/andromeda/keymaps/default/keymap.c b/keyboards/ai03/andromeda/keymaps/default/keymap.c new file mode 100644 index 000000000..41db12fc5 --- /dev/null +++ b/keyboards/ai03/andromeda/keymaps/default/keymap.c | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | Copyright 2012,2013 Jun Wako <[email protected]> | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation, either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | #include QMK_KEYBOARD_H | ||
18 | enum layer_names { | ||
19 | _BASE, | ||
20 | }; | ||
21 | |||
22 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
23 | |||
24 | [_BASE] = LAYOUT_tkl_ansi_wkl( | ||
25 | KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, | ||
26 | KC_GRV, 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, KC_INS, KC_HOME, KC_PGUP, | ||
27 | 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, KC_DEL, KC_END, KC_PGDN, | ||
28 | 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, | ||
29 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
30 | KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT | ||
31 | ) | ||
32 | |||
33 | }; | ||
diff --git a/keyboards/ai03/andromeda/keymaps/via/keymap.c b/keyboards/ai03/andromeda/keymaps/via/keymap.c new file mode 100644 index 000000000..967bfdf2b --- /dev/null +++ b/keyboards/ai03/andromeda/keymaps/via/keymap.c | |||
@@ -0,0 +1,65 @@ | |||
1 | /* | ||
2 | Copyright 2012,2013 Jun Wako <[email protected]> | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation, either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | #include QMK_KEYBOARD_H | ||
18 | enum layer_names { | ||
19 | _BASE, | ||
20 | _FN1, | ||
21 | _FN2, | ||
22 | _FN3 | ||
23 | }; | ||
24 | |||
25 | |||
26 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
27 | |||
28 | [_BASE] = LAYOUT_tkl_ansi_wkl( | ||
29 | KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, | ||
30 | KC_GRV, 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, KC_INS, KC_HOME, KC_PGUP, | ||
31 | 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, KC_DEL, KC_END, KC_PGDN, | ||
32 | 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, | ||
33 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
34 | KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT | ||
35 | ), | ||
36 | |||
37 | [_FN1] = LAYOUT_tkl_ansi_wkl( | ||
38 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
39 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
40 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
41 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
42 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
43 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS | ||
44 | ), | ||
45 | |||
46 | |||
47 | [_FN2] = LAYOUT_tkl_ansi_wkl( | ||
48 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
49 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
50 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
51 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
52 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
53 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS | ||
54 | ), | ||
55 | |||
56 | |||
57 | [_FN3] = LAYOUT_tkl_ansi_wkl( | ||
58 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
59 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
60 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
61 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
62 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
63 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS | ||
64 | ) | ||
65 | }; | ||
diff --git a/keyboards/ai03/andromeda/keymaps/via/rules.mk b/keyboards/ai03/andromeda/keymaps/via/rules.mk new file mode 100644 index 000000000..1e5b99807 --- /dev/null +++ b/keyboards/ai03/andromeda/keymaps/via/rules.mk | |||
@@ -0,0 +1 @@ | |||
VIA_ENABLE = yes | |||
diff --git a/keyboards/ai03/andromeda/readme.md b/keyboards/ai03/andromeda/readme.md new file mode 100644 index 000000000..2ac3b5c1c --- /dev/null +++ b/keyboards/ai03/andromeda/readme.md | |||
@@ -0,0 +1,12 @@ | |||
1 | # ai03 Andromeda | ||
2 | |||
3 | * Keyboard Maintainer: [ai03](https://github.com/ai03-2725) | ||
4 | * Hardware Supported: Andromeda PCB | ||
5 | |||
6 | Make example for this keyboard (after setting up your build environment): | ||
7 | |||
8 | make ai03/andromeda:default | ||
9 | |||
10 | See 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). | ||
11 | |||
12 | Press and hold the reset button for at least 5 seconds before releasing to enter the bootloader mode. | ||
diff --git a/keyboards/ai03/andromeda/rules.mk b/keyboards/ai03/andromeda/rules.mk new file mode 100644 index 000000000..fd4498078 --- /dev/null +++ b/keyboards/ai03/andromeda/rules.mk | |||
@@ -0,0 +1,21 @@ | |||
1 | # MCU name | ||
2 | MCU = STM32F072 | ||
3 | |||
4 | # Bootloader selection | ||
5 | BOOTLOADER = stm32-dfu | ||
6 | |||
7 | # Build Options | ||
8 | # change yes to no to disable | ||
9 | # | ||
10 | BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite | ||
11 | MOUSEKEY_ENABLE = yes # Mouse keys | ||
12 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
13 | CONSOLE_ENABLE = yes # Console for debug | ||
14 | COMMAND_ENABLE = yes # Commands for debug and configuration | ||
15 | NKRO_ENABLE = yes # Enable N-Key Rollover | ||
16 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
17 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow | ||
18 | AUDIO_ENABLE = no # Audio output | ||
19 | |||
20 | # Enter lower-power sleep mode when on the ChibiOS idle thread | ||
21 | OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE | ||
diff --git a/keyboards/ai03/equinox/config.h b/keyboards/ai03/equinox/config.h new file mode 100644 index 000000000..5130f510b --- /dev/null +++ b/keyboards/ai03/equinox/config.h | |||
@@ -0,0 +1,140 @@ | |||
1 | /* | ||
2 | Copyright 2019 Ryota Goto | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation, either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | #pragma once | ||
19 | |||
20 | #include "config_common.h" | ||
21 | |||
22 | /* USB Device descriptor parameter */ | ||
23 | #define VENDOR_ID 0xA103 | ||
24 | #define PRODUCT_ID 0x0004 | ||
25 | #define DEVICE_VER 0x0001 | ||
26 | #define MANUFACTURER ai03 Design Studio | ||
27 | #define PRODUCT Equinox | ||
28 | |||
29 | /* key matrix size */ | ||
30 | #define MATRIX_ROWS 4 | ||
31 | #define MATRIX_COLS 12 | ||
32 | |||
33 | /* | ||
34 | * Keyboard Matrix Assignments | ||
35 | * | ||
36 | * Change this to how you wired your keyboard | ||
37 | * COLS: AVR pins used for columns, left to right | ||
38 | * ROWS: AVR pins used for rows, top to bottom | ||
39 | * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) | ||
40 | * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) | ||
41 | * | ||
42 | */ | ||
43 | #define MATRIX_ROW_PINS { D3, C5, D4, D5 } | ||
44 | #define MATRIX_COL_PINS { D1, D2, C6, C7, B6, B5, B4, B3, B2, B1, B0, D6 } | ||
45 | #define UNUSED_PINS | ||
46 | |||
47 | /* COL2ROW, ROW2COL*/ | ||
48 | #define DIODE_DIRECTION COL2ROW | ||
49 | |||
50 | /* | ||
51 | * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. | ||
52 | */ | ||
53 | //#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 | ||
54 | |||
55 | #define BACKLIGHT_PIN B7 | ||
56 | #define BACKLIGHT_BREATHING | ||
57 | #define BACKLIGHT_LEVELS 5 | ||
58 | |||
59 | //#define RGB_DI_PIN C4 | ||
60 | //#ifdef RGB_DI_PIN | ||
61 | // #define RGBLED_NUM 12 | ||
62 | // #define RGBLIGHT_HUE_STEP 8 | ||
63 | // #define RGBLIGHT_SAT_STEP 8 | ||
64 | // #define RGBLIGHT_VAL_STEP 8 | ||
65 | // #define RGBLIGHT_LIMIT_VAL 230 /* The maximum brightness level */ | ||
66 | // #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ | ||
67 | /*== all animations enable ==*/ | ||
68 | // #define RGBLIGHT_ANIMATIONS | ||
69 | // /*== or choose animations ==*/ | ||
70 | // #define RGBLIGHT_EFFECT_BREATHING | ||
71 | // #define RGBLIGHT_EFFECT_RAINBOW_MOOD | ||
72 | // #define RGBLIGHT_EFFECT_RAINBOW_SWIRL | ||
73 | // #define RGBLIGHT_EFFECT_SNAKE | ||
74 | // #define RGBLIGHT_EFFECT_KNIGHT | ||
75 | // #define RGBLIGHT_EFFECT_CHRISTMAS | ||
76 | // #define RGBLIGHT_EFFECT_STATIC_GRADIENT | ||
77 | // #define RGBLIGHT_EFFECT_RGB_TEST | ||
78 | // #define RGBLIGHT_EFFECT_ALTERNATING | ||
79 | //#endif | ||
80 | |||
81 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
82 | #define DEBOUNCE 5 | ||
83 | |||
84 | /* define if matrix has ghost (lacks anti-ghosting diodes) */ | ||
85 | //#define MATRIX_HAS_GHOST | ||
86 | |||
87 | /* number of backlight levels */ | ||
88 | |||
89 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
90 | #define LOCKING_SUPPORT_ENABLE | ||
91 | /* Locking resynchronize hack */ | ||
92 | #define LOCKING_RESYNC_ENABLE | ||
93 | |||
94 | /* If defined, GRAVE_ESC will always act as ESC when CTRL is held. | ||
95 | * This is userful for the Windows task manager shortcut (ctrl+shift+esc). | ||
96 | */ | ||
97 | // #define GRAVE_ESC_CTRL_OVERRIDE | ||
98 | |||
99 | /* | ||
100 | * Force NKRO | ||
101 | * | ||
102 | * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved | ||
103 | * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the | ||
104 | * makefile for this to work.) | ||
105 | * | ||
106 | * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) | ||
107 | * until the next keyboard reset. | ||
108 | * | ||
109 | * NKRO may prevent your keystrokes from being detected in the BIOS, but it is | ||
110 | * fully operational during normal computer usage. | ||
111 | * | ||
112 | * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) | ||
113 | * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by | ||
114 | * bootmagic, NKRO mode will always be enabled until it is toggled again during a | ||
115 | * power-up. | ||
116 | * | ||
117 | */ | ||
118 | //#define FORCE_NKRO | ||
119 | |||
120 | /* | ||
121 | * Feature disable options | ||
122 | * These options are also useful to firmware size reduction. | ||
123 | */ | ||
124 | |||
125 | /* disable debug print */ | ||
126 | //#define NO_DEBUG | ||
127 | |||
128 | /* disable print */ | ||
129 | //#define NO_PRINT | ||
130 | |||
131 | /* disable action features */ | ||
132 | //#define NO_ACTION_LAYER | ||
133 | //#define NO_ACTION_TAPPING | ||
134 | //#define NO_ACTION_ONESHOT | ||
135 | //#define NO_ACTION_MACRO | ||
136 | //#define NO_ACTION_FUNCTION | ||
137 | |||
138 | /* Bootmagic Lite key configuration */ | ||
139 | // #define BOOTMAGIC_LITE_ROW 0 | ||
140 | // #define BOOTMAGIC_LITE_COLUMN 0 | ||
diff --git a/keyboards/ai03/equinox/equinox.c b/keyboards/ai03/equinox/equinox.c new file mode 100644 index 000000000..a8ea38ecd --- /dev/null +++ b/keyboards/ai03/equinox/equinox.c | |||
@@ -0,0 +1,17 @@ | |||
1 | /* Copyright 2019 Ryota Goto | ||
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 "equinox.h" | ||
17 | |||
diff --git a/keyboards/ai03/equinox/equinox.h b/keyboards/ai03/equinox/equinox.h new file mode 100644 index 000000000..e5ac15812 --- /dev/null +++ b/keyboards/ai03/equinox/equinox.h | |||
@@ -0,0 +1,39 @@ | |||
1 | /* Copyright 2019 Ryota Goto | ||
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 | #pragma once | ||
17 | |||
18 | #include "quantum.h" | ||
19 | |||
20 | /* This a shortcut to help you visually see your layout. | ||
21 | * | ||
22 | * The first section contains all of the arguments representing the physical | ||
23 | * layout of the board and position of the keys. | ||
24 | * | ||
25 | * The second converts the arguments into a two-dimensional array which | ||
26 | * represents the switch matrix. | ||
27 | */ | ||
28 | #define LAYOUT_all( \ | ||
29 | K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ | ||
30 | K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \ | ||
31 | K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \ | ||
32 | K300, K301, K302, K304, K306, K308, K309, K310, K311 \ | ||
33 | ) \ | ||
34 | { \ | ||
35 | { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \ | ||
36 | { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \ | ||
37 | { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \ | ||
38 | { K300, K301, K302, KC_NO, K304, KC_NO, K306, KC_NO, K308, K309, K310, K311 } \ | ||
39 | } | ||
diff --git a/keyboards/ai03/equinox/info.json b/keyboards/ai03/equinox/info.json new file mode 100644 index 000000000..18aa1fe8d --- /dev/null +++ b/keyboards/ai03/equinox/info.json | |||
@@ -0,0 +1,56 @@ | |||
1 | { | ||
2 | "keyboard_name": "Equinox", | ||
3 | "url": "", | ||
4 | "maintainer": "ai03", | ||
5 | "layouts": { | ||
6 | "LAYOUT_all": { | ||
7 | "layout": [ | ||
8 | {"label":"Tab", "x":0, "y":0, "w":1.5}, | ||
9 | {"label":"Q", "x":1.5, "y":0}, | ||
10 | {"label":"W", "x":2.5, "y":0}, | ||
11 | {"label":"E", "x":3.5, "y":0}, | ||
12 | {"label":"R", "x":4.5, "y":0}, | ||
13 | {"label":"T", "x":5.5, "y":0}, | ||
14 | {"label":"Y", "x":6.5, "y":0}, | ||
15 | {"label":"U", "x":7.5, "y":0}, | ||
16 | {"label":"I", "x":8.5, "y":0}, | ||
17 | {"label":"O", "x":9.5, "y":0}, | ||
18 | {"label":"P", "x":10.5, "y":0}, | ||
19 | {"label":"|", "x":11.5, "y":0, "w":1.5}, | ||
20 | {"label":"Caps Lock", "x":0, "y":1, "w":1.75}, | ||
21 | {"label":"A", "x":1.75, "y":1}, | ||
22 | {"label":"S", "x":2.75, "y":1}, | ||
23 | {"label":"D", "x":3.75, "y":1}, | ||
24 | {"label":"F", "x":4.75, "y":1}, | ||
25 | {"label":"G", "x":5.75, "y":1}, | ||
26 | {"label":"H", "x":6.75, "y":1}, | ||
27 | {"label":"J", "x":7.75, "y":1}, | ||
28 | {"label":"K", "x":8.75, "y":1}, | ||
29 | {"label":"L", "x":9.75, "y":1}, | ||
30 | {"label":":", "x":10.75, "y":1}, | ||
31 | {"label":"Enter", "x":11.75, "y":1, "w":1.25}, | ||
32 | {"label":"Shift", "x":0, "y":2, "w":1.25}, | ||
33 | {"label":"Fn", "x":1.25, "y":2}, | ||
34 | {"label":"Z", "x":2.25, "y":2}, | ||
35 | {"label":"X", "x":3.25, "y":2}, | ||
36 | {"label":"C", "x":4.25, "y":2}, | ||
37 | {"label":"V", "x":5.25, "y":2}, | ||
38 | {"label":"B", "x":6.25, "y":2}, | ||
39 | {"label":"N", "x":7.25, "y":2}, | ||
40 | {"label":"M", "x":8.25, "y":2}, | ||
41 | {"label":"<", "x":9.25, "y":2}, | ||
42 | {"label":">", "x":10.25, "y":2}, | ||
43 | {"label":"Shift", "x":11.25, "y":2, "w":1.75}, | ||
44 | {"label":"Ctrl", "x":0, "y":3, "w":1.25}, | ||
45 | {"label":"Super", "x":1.25, "y":3}, | ||
46 | {"label":"Alt", "x":2.25, "y":3, "w":1.25}, | ||
47 | {"x":3.5, "y":3, "w":2.25}, | ||
48 | {"x":5.75, "y":3}, | ||
49 | {"x":6.75, "y":3, "w":2.75}, | ||
50 | {"label":"Alt", "x":9.5, "y":3, "w":1.25}, | ||
51 | {"label":"Super", "x":10.75, "y":3}, | ||
52 | {"label":"Ctrl", "x":11.75, "y":3, "w":1.25} | ||
53 | ] | ||
54 | } | ||
55 | } | ||
56 | } | ||
diff --git a/keyboards/ai03/equinox/keymaps/crd/keymap.c b/keyboards/ai03/equinox/keymaps/crd/keymap.c new file mode 100644 index 000000000..108a00d9d --- /dev/null +++ b/keyboards/ai03/equinox/keymaps/crd/keymap.c | |||
@@ -0,0 +1,47 @@ | |||
1 | /* Copyright 2019 Ryota Goto | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | #include QMK_KEYBOARD_H | ||
17 | /* | ||
18 | K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ | ||
19 | K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \ | ||
20 | K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \ | ||
21 | K300, K301, K302, K304, K306, K308, K309, K310, K311 \ | ||
22 | */ | ||
23 | |||
24 | #define KC_CTES RCTL_T(KC_ESC) | ||
25 | #define KC_BSM1 LT(1, KC_BSPC) | ||
26 | #define KC_SPM1 LT(1, KC_SPC) | ||
27 | |||
28 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
29 | [0] = LAYOUT_all( /* Base */ | ||
30 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_GRV, | ||
31 | KC_CTES, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, XXXXXXX, KC_ENT, | ||
32 | KC_LSFT, KC_SLSH, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, | ||
33 | KC_LCTL, XXXXXXX, KC_RGUI, KC_BSM1, MO(2), KC_SPM1, KC_RALT, XXXXXXX, KC_RCTL | ||
34 | ), | ||
35 | [1] = LAYOUT_all( /* Extra Keys */ | ||
36 | _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, | ||
37 | _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, _______, | ||
38 | _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, _______, | ||
39 | _______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______ | ||
40 | ), | ||
41 | [2] = LAYOUT_all( /* Num and FN */ | ||
42 | RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, KC_MINS, KC_EQL, _______, | ||
43 | _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, _______, KC_SCLN, KC_QUOT, XXXXXXX, _______, | ||
44 | _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, | ||
45 | _______, XXXXXXX, _______, _______, _______, _______, _______, XXXXXXX, _______ | ||
46 | ) | ||
47 | }; | ||
diff --git a/keyboards/ai03/equinox/keymaps/crd/readme.md b/keyboards/ai03/equinox/keymaps/crd/readme.md new file mode 100644 index 000000000..c1f50e5eb --- /dev/null +++ b/keyboards/ai03/equinox/keymaps/crd/readme.md | |||
@@ -0,0 +1,3 @@ | |||
1 | # crd's keymap for equinox | ||
2 | |||
3 | [KLE](http://www.keyboard-layout-editor.com/#/gists/0be9c4a916dba80ebb5533cd00c5304c) | ||
diff --git a/keyboards/ai03/equinox/keymaps/default/keymap.c b/keyboards/ai03/equinox/keymaps/default/keymap.c new file mode 100644 index 000000000..a7c358a37 --- /dev/null +++ b/keyboards/ai03/equinox/keymaps/default/keymap.c | |||
@@ -0,0 +1,37 @@ | |||
1 | /* Copyright 2019 Ryota Goto | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | #include QMK_KEYBOARD_H | ||
17 | |||
18 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
19 | [0] = LAYOUT_all( /* Base */ | ||
20 | MO(2), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, | ||
21 | MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, | ||
22 | KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, | ||
23 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_GRV, KC_RGUI, KC_DEL | ||
24 | ), | ||
25 | [1] = LAYOUT_all( /* Extra Keys */ | ||
26 | _______, _______, KC_PGUP, _______, _______, KC_LBRC, KC_RBRC, _______, KC_UP, _______, _______, _______, | ||
27 | _______, KC_HOME, KC_PGDN, KC_END, _______, KC_BSLS, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, | ||
28 | _______, _______, _______, _______, _______, KC_PSCR, KC_ESC, KC_QUOT, _______, KC_DOT, _______, _______, | ||
29 | _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
30 | ), | ||
31 | [2] = LAYOUT_all( /* Num and FN */ | ||
32 | _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, | ||
33 | _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, _______, _______, _______, | ||
34 | _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, | ||
35 | _______, _______, _______, _______, _______, _______, _______, _______, RESET | ||
36 | ) | ||
37 | }; | ||
diff --git a/keyboards/ai03/equinox/keymaps/default/readme.md b/keyboards/ai03/equinox/keymaps/default/readme.md new file mode 100644 index 000000000..9a8bd56a3 --- /dev/null +++ b/keyboards/ai03/equinox/keymaps/default/readme.md | |||
@@ -0,0 +1,3 @@ | |||
1 | # The default keymap for equinox | ||
2 | |||
3 | Basic, nothing special \ No newline at end of file | ||
diff --git a/keyboards/ai03/equinox/keymaps/via/keymap.c b/keyboards/ai03/equinox/keymaps/via/keymap.c new file mode 100644 index 000000000..e0da041f7 --- /dev/null +++ b/keyboards/ai03/equinox/keymaps/via/keymap.c | |||
@@ -0,0 +1,43 @@ | |||
1 | /* Copyright 2019 Ryota Goto | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | #include QMK_KEYBOARD_H | ||
17 | |||
18 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
19 | [0] = LAYOUT_all( /* Base */ | ||
20 | MO(2), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, | ||
21 | MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, | ||
22 | KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, | ||
23 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_GRV, KC_RGUI, KC_DEL | ||
24 | ), | ||
25 | [1] = LAYOUT_all( /* Extra Keys */ | ||
26 | _______, _______, KC_PGUP, _______, _______, KC_LBRC, KC_RBRC, _______, KC_UP, _______, _______, _______, | ||
27 | _______, KC_HOME, KC_PGDN, KC_END, _______, KC_BSLS, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, | ||
28 | _______, _______, _______, _______, _______, KC_PSCR, KC_ESC, KC_QUOT, _______, KC_DOT, _______, _______, | ||
29 | _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
30 | ), | ||
31 | [2] = LAYOUT_all( /* Num and FN */ | ||
32 | _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, | ||
33 | _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, _______, _______, _______, | ||
34 | _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, | ||
35 | _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
36 | ), | ||
37 | [3] = LAYOUT_all( /* Other */ | ||
38 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
39 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
40 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
41 | _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
42 | ) | ||
43 | }; | ||
diff --git a/keyboards/ai03/equinox/keymaps/via/readme.md b/keyboards/ai03/equinox/keymaps/via/readme.md new file mode 100644 index 000000000..c2892a3ad --- /dev/null +++ b/keyboards/ai03/equinox/keymaps/via/readme.md | |||
@@ -0,0 +1,3 @@ | |||
1 | # The via keymap for equinox | ||
2 | |||
3 | The basic keymap with full support for VIA Configurator | ||
diff --git a/keyboards/ai03/equinox/keymaps/via/rules.mk b/keyboards/ai03/equinox/keymaps/via/rules.mk new file mode 100644 index 000000000..036bd6d1c --- /dev/null +++ b/keyboards/ai03/equinox/keymaps/via/rules.mk | |||
@@ -0,0 +1 @@ | |||
VIA_ENABLE = yes \ No newline at end of file | |||
diff --git a/keyboards/ai03/equinox/readme.md b/keyboards/ai03/equinox/readme.md new file mode 100644 index 000000000..beeef864b --- /dev/null +++ b/keyboards/ai03/equinox/readme.md | |||
@@ -0,0 +1,15 @@ | |||
1 | # Equinox | ||
2 | |||
3 |  | ||
4 | |||
5 | Compact Tabbed Gasket-PCB Gravity Mount WKL High-End Keyboard | ||
6 | |||
7 | * Keyboard Maintainer: [ai03](https://github.com/ai03-2725), [Ion Keyboards](https://ionkeyboards.com/) | ||
8 | * Hardware Supported: The Equinox keyboard kit | ||
9 | * Hardware Availability: [CannonKeys](https://cannonkeys.com/products/gb-equinox-keyboard); other proxy vendors | ||
10 | |||
11 | Make example for this keyboard (after setting up your build environment): | ||
12 | |||
13 | make ai03/equinox:via | ||
14 | |||
15 | See 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/ai03/equinox/rev0/.noci b/keyboards/ai03/equinox/rev0/.noci new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/keyboards/ai03/equinox/rev0/.noci | |||
diff --git a/keyboards/ai03/equinox/rev0/config.h b/keyboards/ai03/equinox/rev0/config.h new file mode 100644 index 000000000..be599c122 --- /dev/null +++ b/keyboards/ai03/equinox/rev0/config.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | Copyright 2019 Ryota Goto | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation, either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | #pragma once | ||
19 | |||
20 | // Fix for prototype missing COL0, COL1, using backlight and RGB underglow I/O pins | ||
21 | #undef MATRIX_COL_PINS | ||
22 | #define MATRIX_COL_PINS { C4, B7, C6, C7, B6, B5, B4, B3, B2, B1, B0, D6 } | ||
23 | |||
24 | // This directs backlight code to use a disconnected pin, so the firwmare still has | ||
25 | // backlight code and VIA support even though it doesn't do anything. | ||
26 | #undef BACKLIGHT_PIN | ||
27 | #define BACKLIGHT_PIN D1 \ No newline at end of file | ||
diff --git a/keyboards/ai03/equinox/rev0/rules.mk b/keyboards/ai03/equinox/rev0/rules.mk new file mode 100644 index 000000000..9d7635000 --- /dev/null +++ b/keyboards/ai03/equinox/rev0/rules.mk | |||
@@ -0,0 +1,18 @@ | |||
1 | # MCU name | ||
2 | MCU = atmega32u2 | ||
3 | |||
4 | # Bootloader selection | ||
5 | BOOTLOADER = atmel-dfu | ||
6 | |||
7 | # Build Options | ||
8 | # change yes to no to disable | ||
9 | # | ||
10 | BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite | ||
11 | MOUSEKEY_ENABLE = yes # Mouse keys | ||
12 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
13 | CONSOLE_ENABLE = no # Console for debug | ||
14 | COMMAND_ENABLE = yes # Commands for debug and configuration | ||
15 | NKRO_ENABLE = yes # Enable N-Key Rollover | ||
16 | BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality | ||
17 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow | ||
18 | AUDIO_ENABLE = no # Audio output | ||
diff --git a/keyboards/ai03/equinox/rev1/config.h b/keyboards/ai03/equinox/rev1/config.h new file mode 100644 index 000000000..dfaa2d368 --- /dev/null +++ b/keyboards/ai03/equinox/rev1/config.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | Copyright 2019 Ryota Goto | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation, either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | #pragma once | ||
diff --git a/keyboards/ai03/equinox/rev1/rules.mk b/keyboards/ai03/equinox/rev1/rules.mk new file mode 100644 index 000000000..9d7635000 --- /dev/null +++ b/keyboards/ai03/equinox/rev1/rules.mk | |||
@@ -0,0 +1,18 @@ | |||
1 | # MCU name | ||
2 | MCU = atmega32u2 | ||
3 | |||
4 | # Bootloader selection | ||
5 | BOOTLOADER = atmel-dfu | ||
6 | |||
7 | # Build Options | ||
8 | # change yes to no to disable | ||
9 | # | ||
10 | BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite | ||
11 | MOUSEKEY_ENABLE = yes # Mouse keys | ||
12 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
13 | CONSOLE_ENABLE = no # Console for debug | ||
14 | COMMAND_ENABLE = yes # Commands for debug and configuration | ||
15 | NKRO_ENABLE = yes # Enable N-Key Rollover | ||
16 | BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality | ||
17 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow | ||
18 | AUDIO_ENABLE = no # Audio output | ||
diff --git a/keyboards/ai03/jp60/config.h b/keyboards/ai03/jp60/config.h new file mode 100644 index 000000000..a06d75c8e --- /dev/null +++ b/keyboards/ai03/jp60/config.h | |||
@@ -0,0 +1,109 @@ | |||
1 | /* | ||
2 | Copyright 2021 ai03 | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation, either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | #pragma once | ||
19 | |||
20 | #include "config_common.h" | ||
21 | |||
22 | /* USB Device descriptor parameter */ | ||
23 | #define VENDOR_ID 0xA103 | ||
24 | #define PRODUCT_ID 0x0024 | ||
25 | #define DEVICE_VER 0x0001 | ||
26 | #define MANUFACTURER ai03 Design Studio | ||
27 | #define PRODUCT JP60 | ||
28 | |||
29 | /* key matrix size */ | ||
30 | #define MATRIX_ROWS 5 | ||
31 | #define MATRIX_COLS 14 | ||
32 | |||
33 | /* | ||
34 | * Keyboard Matrix Assignments | ||
35 | * | ||
36 | * Change this to how you wired your keyboard | ||
37 | * COLS: AVR pins used for columns, left to right | ||
38 | * ROWS: AVR pins used for rows, top to bottom | ||
39 | * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) | ||
40 | * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) | ||
41 | * | ||
42 | */ | ||
43 | #define MATRIX_ROW_PINS { B6, B5, B4, D7, E6 } | ||
44 | #define MATRIX_COL_PINS { D2, D1, D3, D5, D4, D6, C6, F0, F1, F4, F5, F6, F7, C7 } | ||
45 | #define UNUSED_PINS | ||
46 | |||
47 | /* COL2ROW, ROW2COL */ | ||
48 | #define DIODE_DIRECTION COL2ROW | ||
49 | |||
50 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
51 | #define DEBOUNCE 5 | ||
52 | |||
53 | /* define if matrix has ghost (lacks anti-ghosting diodes) */ | ||
54 | //#define MATRIX_HAS_GHOST | ||
55 | |||
56 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
57 | #define LOCKING_SUPPORT_ENABLE | ||
58 | /* Locking resynchronize hack */ | ||
59 | #define LOCKING_RESYNC_ENABLE | ||
60 | |||
61 | /* If defined, GRAVE_ESC will always act as ESC when CTRL is held. | ||
62 | * This is useful for the Windows task manager shortcut (ctrl+shift+esc). | ||
63 | */ | ||
64 | //#define GRAVE_ESC_CTRL_OVERRIDE | ||
65 | |||
66 | /* | ||
67 | * Force NKRO | ||
68 | * | ||
69 | * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved | ||
70 | * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the | ||
71 | * makefile for this to work.) | ||
72 | * | ||
73 | * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) | ||
74 | * until the next keyboard reset. | ||
75 | * | ||
76 | * NKRO may prevent your keystrokes from being detected in the BIOS, but it is | ||
77 | * fully operational during normal computer usage. | ||
78 | * | ||
79 | * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) | ||
80 | * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by | ||
81 | * bootmagic, NKRO mode will always be enabled until it is toggled again during a | ||
82 | * power-up. | ||
83 | * | ||
84 | */ | ||
85 | //#define FORCE_NKRO | ||
86 | |||
87 | /* | ||
88 | * Feature disable options | ||
89 | * These options are also useful to firmware size reduction. | ||
90 | */ | ||
91 | |||
92 | /* disable debug print */ | ||
93 | //#define NO_DEBUG | ||
94 | |||
95 | /* disable print */ | ||
96 | //#define NO_PRINT | ||
97 | |||
98 | /* disable action features */ | ||
99 | //#define NO_ACTION_LAYER | ||
100 | //#define NO_ACTION_TAPPING | ||
101 | //#define NO_ACTION_ONESHOT | ||
102 | |||
103 | /* disable these deprecated features by default */ | ||
104 | #define NO_ACTION_MACRO | ||
105 | #define NO_ACTION_FUNCTION | ||
106 | |||
107 | /* Bootmagic Lite key configuration */ | ||
108 | //#define BOOTMAGIC_LITE_ROW 0 | ||
109 | //#define BOOTMAGIC_LITE_COLUMN 0 | ||
diff --git a/keyboards/ai03/jp60/info.json b/keyboards/ai03/jp60/info.json new file mode 100644 index 000000000..d5453de73 --- /dev/null +++ b/keyboards/ai03/jp60/info.json | |||
@@ -0,0 +1,342 @@ | |||
1 | { | ||
2 | "keyboard_name": "JP60", | ||
3 | "url": "https://github.com/ai03-2725/JP60", | ||
4 | "maintainer": "ai03", | ||
5 | "layouts": { | ||
6 | "LAYOUT": { | ||
7 | "layout": [ | ||
8 | { | ||
9 | "label": "Esc", | ||
10 | "x": 0, | ||
11 | "y": 0 | ||
12 | }, | ||
13 | { | ||
14 | "label": "!", | ||
15 | "x": 1, | ||
16 | "y": 0 | ||
17 | }, | ||
18 | { | ||
19 | "label": "\"", | ||
20 | "x": 2, | ||
21 | "y": 0 | ||
22 | }, | ||
23 | { | ||
24 | "label": "#", | ||
25 | "x": 3, | ||
26 | "y": 0 | ||
27 | }, | ||
28 | { | ||
29 | "label": "$", | ||
30 | "x": 4, | ||
31 | "y": 0 | ||
32 | }, | ||
33 | { | ||
34 | "label": "%", | ||
35 | "x": 5, | ||
36 | "y": 0 | ||
37 | }, | ||
38 | { | ||
39 | "label": "&", | ||
40 | "x": 6, | ||
41 | "y": 0 | ||
42 | }, | ||
43 | { | ||
44 | "label": "'", | ||
45 | "x": 7, | ||
46 | "y": 0 | ||
47 | }, | ||
48 | { | ||
49 | "label": "(", | ||
50 | "x": 8, | ||
51 | "y": 0 | ||
52 | }, | ||
53 | { | ||
54 | "label": ")", | ||
55 | "x": 9, | ||
56 | "y": 0 | ||
57 | }, | ||
58 | { | ||
59 | "label": "", | ||
60 | "x": 10, | ||
61 | "y": 0 | ||
62 | }, | ||
63 | { | ||
64 | "label": "=", | ||
65 | "x": 11, | ||
66 | "y": 0 | ||
67 | }, | ||
68 | { | ||
69 | "label": "~", | ||
70 | "x": 12, | ||
71 | "y": 0 | ||
72 | }, | ||
73 | { | ||
74 | "label": "|", | ||
75 | "x": 13, | ||
76 | "y": 0 | ||
77 | }, | ||
78 | { | ||
79 | "label": "Back Space", | ||
80 | "x": 14, | ||
81 | "y": 0 | ||
82 | }, | ||
83 | { | ||
84 | "label": "Tab", | ||
85 | "x": 0, | ||
86 | "y": 1, | ||
87 | "w": 1.5 | ||
88 | }, | ||
89 | { | ||
90 | "label": "Q", | ||
91 | "x": 1.5, | ||
92 | "y": 1 | ||
93 | }, | ||
94 | { | ||
95 | "label": "W", | ||
96 | "x": 2.5, | ||
97 | "y": 1 | ||
98 | }, | ||
99 | { | ||
100 | "label": "E", | ||
101 | "x": 3.5, | ||
102 | "y": 1 | ||
103 | }, | ||
104 | { | ||
105 | "label": "R", | ||
106 | "x": 4.5, | ||
107 | "y": 1 | ||
108 | }, | ||
109 | { | ||
110 | "label": "T", | ||
111 | "x": 5.5, | ||
112 | "y": 1 | ||
113 | }, | ||
114 | { | ||
115 | "label": "Y", | ||
116 | "x": 6.5, | ||
117 | "y": 1 | ||
118 | }, | ||
119 | { | ||
120 | "label": "U", | ||
121 | "x": 7.5, | ||
122 | "y": 1 | ||
123 | }, | ||
124 | { | ||
125 | "label": "I", | ||
126 | "x": 8.5, | ||
127 | "y": 1 | ||
128 | }, | ||
129 | { | ||
130 | "label": "O", | ||
131 | "x": 9.5, | ||
132 | "y": 1 | ||
133 | }, | ||
134 | { | ||
135 | "label": "P", | ||
136 | "x": 10.5, | ||
137 | "y": 1 | ||
138 | }, | ||
139 | { | ||
140 | "label": "`", | ||
141 | "x": 11.5, | ||
142 | "y": 1 | ||
143 | }, | ||
144 | { | ||
145 | "label": "{", | ||
146 | "x": 12.5, | ||
147 | "y": 1 | ||
148 | }, | ||
149 | { | ||
150 | "label": "Enter", | ||
151 | "x": 13.75, | ||
152 | "y": 1, | ||
153 | "w": 1.25, | ||
154 | "h": 2 | ||
155 | }, | ||
156 | { | ||
157 | "label": "Fn", | ||
158 | "x": 0, | ||
159 | "y": 2, | ||
160 | "w": 1.75 | ||
161 | }, | ||
162 | { | ||
163 | "label": "A", | ||
164 | "x": 1.75, | ||
165 | "y": 2 | ||
166 | }, | ||
167 | { | ||
168 | "label": "S", | ||
169 | "x": 2.75, | ||
170 | "y": 2 | ||
171 | }, | ||
172 | { | ||
173 | "label": "D", | ||
174 | "x": 3.75, | ||
175 | "y": 2 | ||
176 | }, | ||
177 | { | ||
178 | "label": "F", | ||
179 | "x": 4.75, | ||
180 | "y": 2 | ||
181 | }, | ||
182 | { | ||
183 | "label": "G", | ||
184 | "x": 5.75, | ||
185 | "y": 2 | ||
186 | }, | ||
187 | { | ||
188 | "label": "H", | ||
189 | "x": 6.75, | ||
190 | "y": 2 | ||
191 | }, | ||
192 | { | ||
193 | "label": "J", | ||
194 | "x": 7.75, | ||
195 | "y": 2 | ||
196 | }, | ||
197 | { | ||
198 | "label": "K", | ||
199 | "x": 8.75, | ||
200 | "y": 2 | ||
201 | }, | ||
202 | { | ||
203 | "label": "L", | ||
204 | "x": 9.75, | ||
205 | "y": 2 | ||
206 | }, | ||
207 | { | ||
208 | "label": "+", | ||
209 | "x": 10.75, | ||
210 | "y": 2 | ||
211 | }, | ||
212 | { | ||
213 | "label": "*", | ||
214 | "x": 11.75, | ||
215 | "y": 2 | ||
216 | }, | ||
217 | { | ||
218 | "label": "}", | ||
219 | "x": 12.75, | ||
220 | "y": 2 | ||
221 | }, | ||
222 | { | ||
223 | "label": "Shift", | ||
224 | "x": 0, | ||
225 | "y": 3, | ||
226 | "w": 2.25 | ||
227 | }, | ||
228 | { | ||
229 | "label": "Z", | ||
230 | "x": 2.25, | ||
231 | "y": 3 | ||
232 | }, | ||
233 | { | ||
234 | "label": "X", | ||
235 | "x": 3.25, | ||
236 | "y": 3 | ||
237 | }, | ||
238 | { | ||
239 | "label": "C", | ||
240 | "x": 4.25, | ||
241 | "y": 3 | ||
242 | }, | ||
243 | { | ||
244 | "label": "V", | ||
245 | "x": 5.25, | ||
246 | "y": 3 | ||
247 | }, | ||
248 | { | ||
249 | "label": "B", | ||
250 | "x": 6.25, | ||
251 | "y": 3 | ||
252 | }, | ||
253 | { | ||
254 | "label": "N", | ||
255 | "x": 7.25, | ||
256 | "y": 3 | ||
257 | }, | ||
258 | { | ||
259 | "label": "M", | ||
260 | "x": 8.25, | ||
261 | "y": 3 | ||
262 | }, | ||
263 | { | ||
264 | "label": "<", | ||
265 | "x": 9.25, | ||
266 | "y": 3 | ||
267 | }, | ||
268 | { | ||
269 | "label": ">", | ||
270 | "x": 10.25, | ||
271 | "y": 3 | ||
272 | }, | ||
273 | { | ||
274 | "label": "?", | ||
275 | "x": 11.25, | ||
276 | "y": 3 | ||
277 | }, | ||
278 | { | ||
279 | "label": "_", | ||
280 | "x": 12.25, | ||
281 | "y": 3 | ||
282 | }, | ||
283 | { | ||
284 | "label": "Shift", | ||
285 | "x": 13.25, | ||
286 | "y": 3, | ||
287 | "w": 1.75 | ||
288 | }, | ||
289 | { | ||
290 | "label": "Ctrl", | ||
291 | "x": 0, | ||
292 | "y": 4, | ||
293 | "w": 1.25 | ||
294 | }, | ||
295 | { | ||
296 | "label": "Win", | ||
297 | "x": 1.25, | ||
298 | "y": 4 | ||
299 | }, | ||
300 | { | ||
301 | "label": "Alt", | ||
302 | "x": 2.25, | ||
303 | "y": 4 | ||
304 | }, | ||
305 | { | ||
306 | "label": "\u7121\u5909\u63db", | ||
307 | "x": 3.25, | ||
308 | "y": 4, | ||
309 | "w": 1.25 | ||
310 | }, | ||
311 | { | ||
312 | "label": "", | ||
313 | "x": 4.5, | ||
314 | "y": 4, | ||
315 | "w": 6 | ||
316 | }, | ||
317 | { | ||
318 | "label": "\u5909\u63db", | ||
319 | "x": 10.5, | ||
320 | "y": 4, | ||
321 | "w": 1.25 | ||
322 | }, | ||
323 | { | ||
324 | "label": "\u304b\u306a", | ||
325 | "x": 11.75, | ||
326 | "y": 4 | ||
327 | }, | ||
328 | { | ||
329 | "label": "\u534a\u89d2 \u5168\u89d2 \u6f22\u5b57", | ||
330 | "x": 12.75, | ||
331 | "y": 4 | ||
332 | }, | ||
333 | { | ||
334 | "label": "Caps Lock", | ||
335 | "x": 13.75, | ||
336 | "y": 4, | ||
337 | "w": 1.25 | ||
338 | } | ||
339 | ] | ||
340 | } | ||
341 | } | ||
342 | } \ No newline at end of file | ||
diff --git a/keyboards/ai03/jp60/jp60.c b/keyboards/ai03/jp60/jp60.c new file mode 100644 index 000000000..c18a99c6a --- /dev/null +++ b/keyboards/ai03/jp60/jp60.c | |||
@@ -0,0 +1,17 @@ | |||
1 | /* Copyright 2021 ai03 | ||
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 "jp60.h" | ||
diff --git a/keyboards/ai03/jp60/jp60.h b/keyboards/ai03/jp60/jp60.h new file mode 100644 index 000000000..9635e2f3c --- /dev/null +++ b/keyboards/ai03/jp60/jp60.h | |||
@@ -0,0 +1,42 @@ | |||
1 | /* Copyright 2021 ai03 | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #pragma once | ||
18 | |||
19 | #include "quantum.h" | ||
20 | |||
21 | /* This is a shortcut to help you visually see your layout. | ||
22 | * | ||
23 | * The first section contains all of the arguments representing the physical | ||
24 | * layout of the board and position of the keys. | ||
25 | * | ||
26 | * The second converts the arguments into a two-dimensional array which | ||
27 | * represents the switch matrix. | ||
28 | */ | ||
29 | #define LAYOUT( \ | ||
30 | K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K212, \ | ||
31 | K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, \ | ||
32 | K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K113, K213, \ | ||
33 | K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ | ||
34 | K400, K401, K402, K403, K407, K410, K411, K412, K413 \ | ||
35 | ) \ | ||
36 | { \ | ||
37 | { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \ | ||
38 | { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113 }, \ | ||
39 | { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213 }, \ | ||
40 | { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313 }, \ | ||
41 | { K400, K401, K402, K403, KC_NO, KC_NO, KC_NO, K407, KC_NO, KC_NO, K410, K411, K412, K413 } \ | ||
42 | } | ||
diff --git a/keyboards/ai03/jp60/keymaps/default/config.h b/keyboards/ai03/jp60/keymaps/default/config.h new file mode 100644 index 000000000..ee63d9fee --- /dev/null +++ b/keyboards/ai03/jp60/keymaps/default/config.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* Copyright 2021 ai03 | ||
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 | /* Increase polling rates and scan quantity for improved performance */ | ||
20 | #define USB_POLLING_INTERVAL_MS 1 | ||
21 | #define QMK_KEYS_PER_SCAN 12 | ||
diff --git a/keyboards/ai03/jp60/keymaps/default/keymap.c b/keyboards/ai03/jp60/keymaps/default/keymap.c new file mode 100644 index 000000000..f26c2a908 --- /dev/null +++ b/keyboards/ai03/jp60/keymaps/default/keymap.c | |||
@@ -0,0 +1,40 @@ | |||
1 | /* Copyright 2021 ai03 | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | #include QMK_KEYBOARD_H | ||
17 | #include "keymap_jp.h" | ||
18 | |||
19 | // Defines names for use in layer keycodes and the keymap | ||
20 | enum layer_names { | ||
21 | _BASE, | ||
22 | _FN | ||
23 | }; | ||
24 | |||
25 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
26 | [_BASE] = LAYOUT( /* Base */ | ||
27 | KC_ESC, JP_1, JP_2, JP_3, JP_4, JP_5, JP_6, JP_7, JP_8, JP_9, JP_0, JP_MINS, JP_CIRC, JP_YEN, KC_DEL, | ||
28 | KC_TAB, JP_Q, JP_W, JP_E, JP_R, JP_T, JP_Y, JP_U, JP_I, JP_O, JP_P, JP_AT, JP_LBRC, | ||
29 | MO(1), JP_A, JP_S, JP_D, JP_F, JP_G, JP_H, JP_J, JP_K, JP_L, JP_SCLN, JP_COLN, JP_RBRC, KC_ENT, | ||
30 | KC_LSFT, JP_Z, JP_X, JP_C, JP_V, JP_B, JP_N, JP_M, JP_COMM, JP_DOT, JP_SLSH, JP_BSLS, KC_RSFT, | ||
31 | KC_LCTL, KC_LGUI, KC_LALT, JP_MHEN, KC_SPC, JP_HENK, JP_KANA, JP_ZKHK, JP_EISU | ||
32 | ), | ||
33 | [_FN] = LAYOUT( /* FN */ | ||
34 | RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, | ||
35 | _______, _______, KC_PGUP, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, _______, | ||
36 | _______, KC_HOME, KC_PGDN, KC_END, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, | ||
37 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
38 | _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
39 | ) | ||
40 | }; | ||
diff --git a/keyboards/ai03/jp60/keymaps/default/readme.md b/keyboards/ai03/jp60/keymaps/default/readme.md new file mode 100644 index 000000000..a240bd905 --- /dev/null +++ b/keyboards/ai03/jp60/keymaps/default/readme.md | |||
@@ -0,0 +1,3 @@ | |||
1 | # The default keymap for JP60 | ||
2 | |||
3 | Configured for JIS input. \ No newline at end of file | ||
diff --git a/keyboards/ai03/jp60/keymaps/default/rules.mk b/keyboards/ai03/jp60/keymaps/default/rules.mk new file mode 100644 index 000000000..edac26d08 --- /dev/null +++ b/keyboards/ai03/jp60/keymaps/default/rules.mk | |||
@@ -0,0 +1 @@ | |||
DEBOUNCE_TYPE = asym_eager_defer_pk # Specify per-key debounce for improved responsiveness \ No newline at end of file | |||
diff --git a/keyboards/ai03/jp60/keymaps/via/config.h b/keyboards/ai03/jp60/keymaps/via/config.h new file mode 100644 index 000000000..ee63d9fee --- /dev/null +++ b/keyboards/ai03/jp60/keymaps/via/config.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* Copyright 2021 ai03 | ||
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 | /* Increase polling rates and scan quantity for improved performance */ | ||
20 | #define USB_POLLING_INTERVAL_MS 1 | ||
21 | #define QMK_KEYS_PER_SCAN 12 | ||
diff --git a/keyboards/ai03/jp60/keymaps/via/keymap.c b/keyboards/ai03/jp60/keymaps/via/keymap.c new file mode 100644 index 000000000..5c8f9ecf6 --- /dev/null +++ b/keyboards/ai03/jp60/keymaps/via/keymap.c | |||
@@ -0,0 +1,57 @@ | |||
1 | /* Copyright 2021 ai03 | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | #include QMK_KEYBOARD_H | ||
17 | #include "keymap_jp.h" | ||
18 | |||
19 | // Defines names for use in layer keycodes and the keymap | ||
20 | enum layer_names { | ||
21 | _BASE, | ||
22 | _FN1, | ||
23 | _FN2, | ||
24 | _FN3 | ||
25 | }; | ||
26 | |||
27 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
28 | [_BASE] = LAYOUT( /* Base */ | ||
29 | 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_JYEN, KC_DEL, | ||
30 | 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, | ||
31 | MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, | ||
32 | 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, | ||
33 | KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN, KC_SPC, KC_HENK, KC_KANA, KC_GRV, KC_CAPS | ||
34 | ), | ||
35 | [_FN1] = LAYOUT( /* FN1 */ | ||
36 | RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, | ||
37 | _______, _______, KC_PGUP, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, _______, | ||
38 | _______, KC_HOME, KC_PGDN, KC_END, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, | ||
39 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
40 | _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
41 | ), | ||
42 | [_FN2] = LAYOUT( /* FN2 */ | ||
43 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
44 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
45 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
46 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
47 | _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
48 | ), | ||
49 | [_FN3] = LAYOUT( /* FN3 */ | ||
50 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
51 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
52 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
53 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
54 | _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
55 | ), | ||
56 | |||
57 | }; | ||
diff --git a/keyboards/ai03/jp60/keymaps/via/readme.md b/keyboards/ai03/jp60/keymaps/via/readme.md new file mode 100644 index 000000000..f6e9c3d8c --- /dev/null +++ b/keyboards/ai03/jp60/keymaps/via/readme.md | |||
@@ -0,0 +1,3 @@ | |||
1 | # The via keymap for JP60 | ||
2 | |||
3 | For use with VIA configurator and compatible keymap editors. \ No newline at end of file | ||
diff --git a/keyboards/ai03/jp60/keymaps/via/rules.mk b/keyboards/ai03/jp60/keymaps/via/rules.mk new file mode 100644 index 000000000..4956961be --- /dev/null +++ b/keyboards/ai03/jp60/keymaps/via/rules.mk | |||
@@ -0,0 +1,2 @@ | |||
1 | VIA_ENABLE = yes # Enable compatibility with VIA-protocol configurators | ||
2 | DEBOUNCE_TYPE = asym_eager_defer_pk # Specify per-key debounce for improved responsiveness \ No newline at end of file | ||
diff --git a/keyboards/ai03/jp60/readme.md b/keyboards/ai03/jp60/readme.md new file mode 100644 index 000000000..25a3b1641 --- /dev/null +++ b/keyboards/ai03/jp60/readme.md | |||
@@ -0,0 +1,27 @@ | |||
1 | # JP60 | ||
2 | |||
3 |  | ||
4 | |||
5 | GH60-compatible JIS-like hotswap keyboard PCB | ||
6 | |||
7 | * Keyboard Maintainer: [ai03](https://github.com/ai03-2725) | ||
8 | * Hardware Supported: [JP60 PCB](https://github.com/ai03-2725/JP60) | ||
9 | * Hardware Availability: To be made available in JP market soon; will be listed in the repo above | ||
10 | |||
11 | Make example for this keyboard (after setting up your build environment): | ||
12 | |||
13 | make ai03/jp60:default | ||
14 | |||
15 | Flashing example for this keyboard: | ||
16 | |||
17 | make ai03/jp60:default:flash | ||
18 | |||
19 | See 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). | ||
20 | |||
21 | ## Bootloader | ||
22 | |||
23 | Enter the bootloader in 3 ways: | ||
24 | |||
25 | * **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard | ||
26 | * **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead | ||
27 | * **Keycode in layout**: Press the key mapped to `RESET` if it is available | ||
diff --git a/keyboards/ai03/jp60/rules.mk b/keyboards/ai03/jp60/rules.mk new file mode 100644 index 000000000..c37bcf9b2 --- /dev/null +++ b/keyboards/ai03/jp60/rules.mk | |||
@@ -0,0 +1,19 @@ | |||
1 | # MCU name | ||
2 | MCU = atmega32u4 | ||
3 | |||
4 | # Bootloader selection | ||
5 | BOOTLOADER = atmel-dfu | ||
6 | |||
7 | # Build Options | ||
8 | # change yes to no to disable | ||
9 | # | ||
10 | BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite | ||
11 | MOUSEKEY_ENABLE = yes # Mouse keys | ||
12 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
13 | CONSOLE_ENABLE = no # Console for debug | ||
14 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
15 | NKRO_ENABLE = yes # Enable N-Key Rollover | ||
16 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
17 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow | ||
18 | AUDIO_ENABLE = no # Audio output | ||
19 | LTO_ENABLE = yes # Optimize firmware at link time \ No newline at end of file | ||
diff --git a/keyboards/ai03/lunar/config.h b/keyboards/ai03/lunar/config.h new file mode 100644 index 000000000..9ee8cbf6f --- /dev/null +++ b/keyboards/ai03/lunar/config.h | |||
@@ -0,0 +1,140 @@ | |||
1 | /* | ||
2 | Copyright 2019 Ryota Goto | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation, either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | #pragma once | ||
19 | |||
20 | #include "config_common.h" | ||
21 | |||
22 | /* USB Device descriptor parameter */ | ||
23 | #define VENDOR_ID 0xA103 | ||
24 | #define PRODUCT_ID 0x0001 | ||
25 | #define DEVICE_VER 0x0001 | ||
26 | #define MANUFACTURER Switchplate Peripherals | ||
27 | #define PRODUCT Lunar | ||
28 | |||
29 | /* key matrix size */ | ||
30 | #define MATRIX_ROWS 5 | ||
31 | #define MATRIX_COLS 15 | ||
32 | |||
33 | /* | ||
34 | * Keyboard Matrix Assignments | ||
35 | * | ||
36 | * Change this to how you wired your keyboard | ||
37 | * COLS: AVR pins used for columns, left to right | ||
38 | * ROWS: AVR pins used for rows, top to bottom | ||
39 | * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) | ||
40 | * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) | ||
41 | * | ||
42 | */ | ||
43 | #define MATRIX_ROW_PINS { B3, D0, D1, D2, D3 } | ||
44 | #define MATRIX_COL_PINS { D5, D4, D6, D7, B4, B5, B6, C6, C7, F7, F6, F5, F4, F1, F0 } | ||
45 | #define UNUSED_PINS | ||
46 | |||
47 | /* COL2ROW, ROW2COL*/ | ||
48 | #define DIODE_DIRECTION COL2ROW | ||
49 | |||
50 | /* | ||
51 | * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. | ||
52 | */ | ||
53 | #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 | ||
54 | |||
55 | // #define BACKLIGHT_PIN B7 | ||
56 | // #define BACKLIGHT_BREATHING | ||
57 | // #define BACKLIGHT_LEVELS 3 | ||
58 | |||
59 | // #define RGB_DI_PIN E2 | ||
60 | // #ifdef RGB_DI_PIN | ||
61 | // #define RGBLED_NUM 16 | ||
62 | // #define RGBLIGHT_HUE_STEP 8 | ||
63 | // #define RGBLIGHT_SAT_STEP 8 | ||
64 | // #define RGBLIGHT_VAL_STEP 8 | ||
65 | // #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ | ||
66 | // #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ | ||
67 | // /*== all animations enable ==*/ | ||
68 | // #define RGBLIGHT_ANIMATIONS | ||
69 | // /*== or choose animations ==*/ | ||
70 | // #define RGBLIGHT_EFFECT_BREATHING | ||
71 | // #define RGBLIGHT_EFFECT_RAINBOW_MOOD | ||
72 | // #define RGBLIGHT_EFFECT_RAINBOW_SWIRL | ||
73 | // #define RGBLIGHT_EFFECT_SNAKE | ||
74 | // #define RGBLIGHT_EFFECT_KNIGHT | ||
75 | // #define RGBLIGHT_EFFECT_CHRISTMAS | ||
76 | // #define RGBLIGHT_EFFECT_STATIC_GRADIENT | ||
77 | // #define RGBLIGHT_EFFECT_RGB_TEST | ||
78 | // #define RGBLIGHT_EFFECT_ALTERNATING | ||
79 | // #endif | ||
80 | |||
81 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
82 | #define DEBOUNCE 5 | ||
83 | |||
84 | /* define if matrix has ghost (lacks anti-ghosting diodes) */ | ||
85 | //#define MATRIX_HAS_GHOST | ||
86 | |||
87 | /* number of backlight levels */ | ||
88 | |||
89 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
90 | #define LOCKING_SUPPORT_ENABLE | ||
91 | /* Locking resynchronize hack */ | ||
92 | #define LOCKING_RESYNC_ENABLE | ||
93 | |||
94 | /* If defined, GRAVE_ESC will always act as ESC when CTRL is held. | ||
95 | * This is userful for the Windows task manager shortcut (ctrl+shift+esc). | ||
96 | */ | ||
97 | // #define GRAVE_ESC_CTRL_OVERRIDE | ||
98 | |||
99 | /* | ||
100 | * Force NKRO | ||
101 | * | ||
102 | * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved | ||
103 | * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the | ||
104 | * makefile for this to work.) | ||
105 | * | ||
106 | * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) | ||
107 | * until the next keyboard reset. | ||
108 | * | ||
109 | * NKRO may prevent your keystrokes from being detected in the BIOS, but it is | ||
110 | * fully operational during normal computer usage. | ||
111 | * | ||
112 | * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) | ||
113 | * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by | ||
114 | * bootmagic, NKRO mode will always be enabled until it is toggled again during a | ||
115 | * power-up. | ||
116 | * | ||
117 | */ | ||
118 | //#define FORCE_NKRO | ||
119 | |||
120 | /* | ||
121 | * Feature disable options | ||
122 | * These options are also useful to firmware size reduction. | ||
123 | */ | ||
124 | |||
125 | /* disable debug print */ | ||
126 | //#define NO_DEBUG | ||
127 | |||
128 | /* disable print */ | ||
129 | //#define NO_PRINT | ||
130 | |||
131 | /* disable action features */ | ||
132 | //#define NO_ACTION_LAYER | ||
133 | //#define NO_ACTION_TAPPING | ||
134 | //#define NO_ACTION_ONESHOT | ||
135 | //#define NO_ACTION_MACRO | ||
136 | //#define NO_ACTION_FUNCTION | ||
137 | |||
138 | /* Bootmagic Lite key configuration */ | ||
139 | // #define BOOTMAGIC_LITE_ROW 0 | ||
140 | // #define BOOTMAGIC_LITE_COLUMN 0 | ||
diff --git a/keyboards/ai03/lunar/info.json b/keyboards/ai03/lunar/info.json new file mode 100644 index 000000000..ca2b35e3d --- /dev/null +++ b/keyboards/ai03/lunar/info.json | |||
@@ -0,0 +1,81 @@ | |||
1 | { | ||
2 | "keyboard_name": "Lunar", | ||
3 | "url": "https://geekhack.org/index.php?topic=96112.0", | ||
4 | "maintainer": "ai03", | ||
5 | "layouts": { | ||
6 | "LAYOUT": { | ||
7 | "layout": [ | ||
8 | {"label":"Esc", "x":0, "y":0}, | ||
9 | {"label":"!", "x":1, "y":0}, | ||
10 | {"label":"@", "x":2, "y":0}, | ||
11 | {"label":"#", "x":3, "y":0}, | ||
12 | {"label":"$", "x":4, "y":0}, | ||
13 | {"label":"%", "x":5, "y":0}, | ||
14 | {"label":"^", "x":6, "y":0}, | ||
15 | {"label":"&", "x":7, "y":0}, | ||
16 | {"label":"*", "x":8, "y":0}, | ||
17 | {"label":"(", "x":9, "y":0}, | ||
18 | {"label":")", "x":10, "y":0}, | ||
19 | {"label":"_", "x":11, "y":0}, | ||
20 | {"label":"+", "x":12, "y":0}, | ||
21 | {"label":"BackspaceL", "x":13, "y":0}, | ||
22 | {"label":"BackspaceR", "x":14, "y":0}, | ||
23 | {"label":"Insert", "x":15, "y":0}, | ||
24 | {"label":"Tab", "x":0, "y":1, "w":1.5}, | ||
25 | {"label":"Q", "x":1.5, "y":1}, | ||
26 | {"label":"W", "x":2.5, "y":1}, | ||
27 | {"label":"E", "x":3.5, "y":1}, | ||
28 | {"label":"R", "x":4.5, "y":1}, | ||
29 | {"label":"T", "x":5.5, "y":1}, | ||
30 | {"label":"Y", "x":6.5, "y":1}, | ||
31 | {"label":"U", "x":7.5, "y":1}, | ||
32 | {"label":"I", "x":8.5, "y":1}, | ||
33 | {"label":"O", "x":9.5, "y":1}, | ||
34 | {"label":"P", "x":10.5, "y":1}, | ||
35 | {"label":"{", "x":11.5, "y":1}, | ||
36 | {"label":"}", "x":12.5, "y":1}, | ||
37 | {"label":"|", "x":13.5, "y":1, "w":1.5}, | ||
38 | {"label":"Delete", "x":15, "y":1}, | ||
39 | {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, | ||
40 | {"label":"A", "x":1.75, "y":2}, | ||
41 | {"label":"S", "x":2.75, "y":2}, | ||
42 | {"label":"D", "x":3.75, "y":2}, | ||
43 | {"label":"F", "x":4.75, "y":2}, | ||
44 | {"label":"G", "x":5.75, "y":2}, | ||
45 | {"label":"H", "x":6.75, "y":2}, | ||
46 | {"label":"J", "x":7.75, "y":2}, | ||
47 | {"label":"K", "x":8.75, "y":2}, | ||
48 | {"label":"L", "x":9.75, "y":2}, | ||
49 | {"label":":", "x":10.75, "y":2}, | ||
50 | {"label":"\"", "x":11.75, "y":2}, | ||
51 | {"label":"Enter", "x":12.75, "y":2, "w":2.25}, | ||
52 | {"label":"Home", "x":15, "y":2}, | ||
53 | {"label":"Shift", "x":0, "y":3, "w":2.25}, | ||
54 | {"label":"Z", "x":2.25, "y":3}, | ||
55 | {"label":"X", "x":3.25, "y":3}, | ||
56 | {"label":"C", "x":4.25, "y":3}, | ||
57 | {"label":"V", "x":5.25, "y":3}, | ||
58 | {"label":"B", "x":6.25, "y":3}, | ||
59 | {"label":"N", "x":7.25, "y":3}, | ||
60 | {"label":"M", "x":8.25, "y":3}, | ||
61 | {"label":"<", "x":9.25, "y":3}, | ||
62 | {"label":">", "x":10.25, "y":3}, | ||
63 | {"label":"?", "x":11.25, "y":3}, | ||
64 | {"label":"Shift", "x":12.25, "y":3, "w":1.75}, | ||
65 | {"label":"\u2191", "x":14, "y":3}, | ||
66 | {"label":"End", "x":15, "y":3}, | ||
67 | {"label":"Ctrl", "x":0, "y":4, "w":1.5}, | ||
68 | {"label":"Win", "x":1.5, "y":4, "w":1.25}, | ||
69 | {"label":"Alt", "x":2.75, "y":4, "w":1.5}, | ||
70 | {"x":4.25, "y":4, "w":2.25}, | ||
71 | {"x":6.5, "y":4, "w":1.5}, | ||
72 | {"x":8, "y":4, "w":2.75}, | ||
73 | {"label":"Alt", "x":10.75, "y":4, "w":1.25}, | ||
74 | {"label":"Win", "x":12, "y":4}, | ||
75 | {"label":"\u2190", "x":13, "y":4}, | ||
76 | {"label":"\u2193", "x":14, "y":4}, | ||
77 | {"label":"\u2192", "x":15, "y":4} | ||
78 | ] | ||
79 | } | ||
80 | } | ||
81 | } | ||
diff --git a/keyboards/ai03/lunar/keymaps/default/keymap.c b/keyboards/ai03/lunar/keymaps/default/keymap.c new file mode 100644 index 000000000..e05775c2d --- /dev/null +++ b/keyboards/ai03/lunar/keymaps/default/keymap.c | |||
@@ -0,0 +1,78 @@ | |||
1 | /* Copyright 2019 Ryota Goto | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | #include QMK_KEYBOARD_H | ||
17 | |||
18 | // Defines the keycodes used by our macros in process_record_user | ||
19 | enum custom_keycodes { | ||
20 | MANUAL = SAFE_RANGE, | ||
21 | SWPLURL | ||
22 | }; | ||
23 | |||
24 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
25 | |||
26 | /* | ||
27 | |||
28 | Layout | ||
29 | |||
30 | K000 K001 K002 K003 K004 K005 K006 K007 K008 K009 K010 K011 K012 K013 K212 K014 | ||
31 | K100 K101 K102 K103 K104 K105 K106 K107 K108 K109 K110 K111 K112 K113 K114 | ||
32 | K200 K201 K202 K203 K204 K205 K206 K207 K208 K209 K210 K211 K213 K214 | ||
33 | K300 K301 K302 K303 K304 K305 K306 K307 K308 K309 K310 K311 K313 K314 | ||
34 | K400 K401 K402 K403 K405 K407 K409 K410 K411 K413 K414 | ||
35 | |||
36 | K212 = Split backspace (bound to Del by default) | ||
37 | K403, K407 = Split space (bound to space by default) | ||
38 | K405 = Main space | ||
39 | |||
40 | */ | ||
41 | |||
42 | [0] = LAYOUT( /* Base */ | ||
43 | 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, KC_BSPC, KC_HOME, | ||
44 | 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, KC_END, | ||
45 | MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, | ||
46 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, KC_PGDN, | ||
47 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, MO(1), KC_GRV, KC_LEFT, KC_DOWN, KC_RGHT | ||
48 | ), | ||
49 | [1] = LAYOUT( /* FN */ | ||
50 | RESET, 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, KC_DEL, MANUAL, | ||
51 | KC_CAPS, _______, KC_UP, _______, _______, _______, KC_NLCK, KC_P7, KC_P8, KC_P9, KC_MPRV, KC_MPLY, KC_MNXT, _______, SWPLURL, | ||
52 | _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_VOLD, KC_VOLU, KC_P4, KC_P5, KC_P6, _______, _______, _______, _______, | ||
53 | _______, KC_RCTL, KC_RGUI, KC_RALT, _______, _______, KC_P0, KC_P1, KC_P2, KC_P3, _______, _______, KC_PGUP, _______, | ||
54 | _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END | ||
55 | ) | ||
56 | }; | ||
57 | |||
58 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
59 | switch (keycode) { | ||
60 | case MANUAL: | ||
61 | if (record->event.pressed) { | ||
62 | // when keycode QMKBEST is pressed | ||
63 | SEND_STRING("https://kb.ai03.me/redir/lunar/index.html"); | ||
64 | } else { | ||
65 | // when keycode QMKBEST is released | ||
66 | } | ||
67 | break; | ||
68 | case SWPLURL: | ||
69 | if (record->event.pressed) { | ||
70 | // when keycode QMKURL is pressed | ||
71 | SEND_STRING("https://switchplate.co/collections/lunar-group-buy"); | ||
72 | } else { | ||
73 | // when keycode QMKURL is released | ||
74 | } | ||
75 | break; | ||
76 | } | ||
77 | return true; | ||
78 | } | ||
diff --git a/keyboards/ai03/lunar/keymaps/default/readme.md b/keyboards/ai03/lunar/keymaps/default/readme.md new file mode 100644 index 000000000..8ff536ffc --- /dev/null +++ b/keyboards/ai03/lunar/keymaps/default/readme.md | |||
@@ -0,0 +1,2 @@ | |||
1 | # The default keymap for Lunar | ||
2 | For use without VIA configurator. \ No newline at end of file | ||
diff --git a/keyboards/ai03/lunar/keymaps/muzfuz/keymap.c b/keyboards/ai03/lunar/keymaps/muzfuz/keymap.c new file mode 100644 index 000000000..4bbea42af --- /dev/null +++ b/keyboards/ai03/lunar/keymaps/muzfuz/keymap.c | |||
@@ -0,0 +1,52 @@ | |||
1 | #include QMK_KEYBOARD_H | ||
2 | |||
3 | // Helpful defines | ||
4 | #define ESC_CTL CTL_T(KC_ESCAPE) // Tap for Esc, hold for Ctrl | ||
5 | #define FL_KCF LT(1,KC_F) | ||
6 | #define FL_KCJ LT(1,KC_J) | ||
7 | #define CMD_ENT LGUI(LSFT(KC_ENT)) | ||
8 | |||
9 | enum custom_keycodes { | ||
10 | HASHRKT = SAFE_RANGE, | ||
11 | CLNEQLS, | ||
12 | }; | ||
13 | |||
14 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
15 | [0] = LAYOUT( /* Base */ | ||
16 | KC_GRV, 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, KC_BSLS, LGUI(KC_C), | ||
17 | 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_BSPC, LGUI(KC_V), | ||
18 | ESC_CTL, KC_A, KC_S, KC_D, FL_KCF, KC_G, KC_H, FL_KCJ, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, | ||
19 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, KC_PGDN, | ||
20 | CMD_ENT, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, MO(2), KC_GRV, KC_LEFT, KC_DOWN, KC_RGHT | ||
21 | ), | ||
22 | [1] = LAYOUT( /* FL */ | ||
23 | KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, KC_VOLU, | ||
24 | _______, HASHRKT, _______, KC_LCBR, KC_RCBR, _______, _______, KC_UNDS, KC_PLUS, KC_PIPE, _______, _______, _______, _______, KC_VOLD, | ||
25 | _______, CLNEQLS, _______, KC_LBRC, KC_RBRC, _______, _______, KC_MINS, KC_EQL, KC_BSLS, KC_TILD, KC_GRV, _______, KC_HOME, | ||
26 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END, | ||
27 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
28 | ), | ||
29 | [2] = LAYOUT( /* FN */ | ||
30 | RESET, 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, KC_DEL, _______, | ||
31 | KC_CAPS, _______, KC_UP, _______, _______, _______, KC_NLCK, KC_P7, KC_P8, KC_P9, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, | ||
32 | _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_VOLD, KC_VOLU, KC_P4, KC_P5, KC_P6, _______, _______, _______, _______, | ||
33 | _______, KC_RCTL, KC_RGUI, KC_RALT, _______, _______, KC_P0, KC_P1, KC_P2, KC_P3, _______, _______, KC_PGUP, _______, | ||
34 | _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END | ||
35 | ) | ||
36 | }; | ||
37 | |||
38 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
39 | switch(keycode) { | ||
40 | case HASHRKT: | ||
41 | if (record->event.pressed) { | ||
42 | SEND_STRING("=>"); | ||
43 | } | ||
44 | break; | ||
45 | case CLNEQLS: | ||
46 | if (record->event.pressed) { | ||
47 | SEND_STRING(":="); | ||
48 | } | ||
49 | break; | ||
50 | } | ||
51 | return true; | ||
52 | } | ||
diff --git a/keyboards/ai03/lunar/keymaps/muzfuz/readme.md b/keyboards/ai03/lunar/keymaps/muzfuz/readme.md new file mode 100644 index 000000000..f0fef0923 --- /dev/null +++ b/keyboards/ai03/lunar/keymaps/muzfuz/readme.md | |||
@@ -0,0 +1,5 @@ | |||
1 | # muzfuz's keymap for Lunar | ||
2 | |||
3 | ```shell | ||
4 | make ai03/lunar:muzfuz:dfu | ||
5 | ``` | ||
diff --git a/keyboards/ai03/lunar/keymaps/via/keymap.c b/keyboards/ai03/lunar/keymaps/via/keymap.c new file mode 100644 index 000000000..b98e6cf0a --- /dev/null +++ b/keyboards/ai03/lunar/keymaps/via/keymap.c | |||
@@ -0,0 +1,64 @@ | |||
1 | /* Copyright 2019 Ryota Goto | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | #include QMK_KEYBOARD_H | ||
17 | |||
18 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
19 | |||
20 | /* | ||
21 | |||
22 | Layout | ||
23 | |||
24 | K000 K001 K002 K003 K004 K005 K006 K007 K008 K009 K010 K011 K012 K013 K212 K014 | ||
25 | K100 K101 K102 K103 K104 K105 K106 K107 K108 K109 K110 K111 K112 K113 K114 | ||
26 | K200 K201 K202 K203 K204 K205 K206 K207 K208 K209 K210 K211 K213 K214 | ||
27 | K300 K301 K302 K303 K304 K305 K306 K307 K308 K309 K310 K311 K313 K314 | ||
28 | K400 K401 K402 K403 K405 K407 K409 K410 K411 K413 K414 | ||
29 | |||
30 | K212 = Split backspace (bound to Del by default) | ||
31 | K403, K407 = Split space (bound to space by default) | ||
32 | K405 = Main space | ||
33 | |||
34 | */ | ||
35 | |||
36 | [0] = LAYOUT( /* Base */ | ||
37 | 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, KC_BSPC, KC_HOME, | ||
38 | 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, KC_END, | ||
39 | MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, | ||
40 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, KC_PGDN, | ||
41 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, MO(1), KC_GRV, KC_LEFT, KC_DOWN, KC_RGHT | ||
42 | ), | ||
43 | [1] = LAYOUT( /* FN */ | ||
44 | RESET, 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, KC_DEL, _______, | ||
45 | KC_CAPS, _______, KC_UP, _______, _______, _______, KC_NLCK, KC_P7, KC_P8, KC_P9, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, | ||
46 | _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_VOLD, KC_VOLU, KC_P4, KC_P5, KC_P6, _______, _______, _______, _______, | ||
47 | _______, KC_RCTL, KC_RGUI, KC_RALT, _______, _______, KC_P0, KC_P1, KC_P2, KC_P3, _______, _______, KC_PGUP, _______, | ||
48 | _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END | ||
49 | ), | ||
50 | [2] = LAYOUT( /* Blank. For VIA compatibility */ | ||
51 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
52 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
53 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
54 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
55 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
56 | ), | ||
57 | [3] = LAYOUT( /* Blank. For VIA compatibility */ | ||
58 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
59 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
60 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
61 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
62 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
63 | ) | ||
64 | }; | ||
diff --git a/keyboards/ai03/lunar/keymaps/via/readme.md b/keyboards/ai03/lunar/keymaps/via/readme.md new file mode 100644 index 000000000..ff0b73bfc --- /dev/null +++ b/keyboards/ai03/lunar/keymaps/via/readme.md | |||
@@ -0,0 +1,2 @@ | |||
1 | # The VIA keymap for Lunar | ||
2 | This keymap is for compatibility with the VIA configurator. \ No newline at end of file | ||
diff --git a/keyboards/ai03/lunar/keymaps/via/rules.mk b/keyboards/ai03/lunar/keymaps/via/rules.mk new file mode 100644 index 000000000..1e5b99807 --- /dev/null +++ b/keyboards/ai03/lunar/keymaps/via/rules.mk | |||
@@ -0,0 +1 @@ | |||
VIA_ENABLE = yes | |||
diff --git a/keyboards/ai03/lunar/lunar.c b/keyboards/ai03/lunar/lunar.c new file mode 100644 index 000000000..9c7bf23a6 --- /dev/null +++ b/keyboards/ai03/lunar/lunar.c | |||
@@ -0,0 +1,16 @@ | |||
1 | /* Copyright 2019 Ryota Goto | ||
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 "lunar.h" | ||
diff --git a/keyboards/ai03/lunar/lunar.h b/keyboards/ai03/lunar/lunar.h new file mode 100644 index 000000000..2e66ecb5c --- /dev/null +++ b/keyboards/ai03/lunar/lunar.h | |||
@@ -0,0 +1,41 @@ | |||
1 | /* Copyright 2019 Ryota Goto | ||
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 | #pragma once | ||
17 | |||
18 | #include "quantum.h" | ||
19 | |||
20 | /* This a shortcut to help you visually see your layout. | ||
21 | * | ||
22 | * The first section contains all of the arguments representing the physical | ||
23 | * layout of the board and position of the keys. | ||
24 | * | ||
25 | * The second converts the arguments into a two-dimensional array which | ||
26 | * represents the switch matrix. | ||
27 | */ | ||
28 | #define LAYOUT( \ | ||
29 | K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K212, K014, \ | ||
30 | K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ | ||
31 | K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K213, K214, \ | ||
32 | K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ | ||
33 | K400, K401, K402, K403, K405, K407, K409, K410, K411, K413, K414 \ | ||
34 | ) \ | ||
35 | { \ | ||
36 | { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ | ||
37 | { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ | ||
38 | { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ | ||
39 | { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ | ||
40 | { K400, K401, K402, K403, KC_NO, K405, KC_NO, K407, KC_NO, K409, K410, K411, KC_NO, K413, K414 } \ | ||
41 | } | ||
diff --git a/keyboards/ai03/lunar/readme.md b/keyboards/ai03/lunar/readme.md new file mode 100644 index 000000000..585d6454b --- /dev/null +++ b/keyboards/ai03/lunar/readme.md | |||
@@ -0,0 +1,15 @@ | |||
1 | # Lunar | ||
2 | |||
3 |  | ||
4 | |||
5 | A 65% keyboard made specifically for Alps SKCM/L switches and AEK/M0116 keycaps. | ||
6 | |||
7 | Keyboard Maintainer: [ai03](https://github.com/ai03-2725) | ||
8 | Hardware Supported: Official Lunar PCB | ||
9 | Hardware Availability: [Switchplate Peripherals](https://switchplate.co/) | ||
10 | |||
11 | Make example for this keyboard (after setting up your build environment): | ||
12 | |||
13 | make ai03/lunar:default | ||
14 | |||
15 | See 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/ai03/lunar/rules.mk b/keyboards/ai03/lunar/rules.mk new file mode 100644 index 000000000..3305f83bb --- /dev/null +++ b/keyboards/ai03/lunar/rules.mk | |||
@@ -0,0 +1,18 @@ | |||
1 | # MCU name | ||
2 | MCU = atmega32u4 | ||
3 | |||
4 | # Bootloader selection | ||
5 | BOOTLOADER = atmel-dfu | ||
6 | |||
7 | # Build Options | ||
8 | # change yes to no to disable | ||
9 | # | ||
10 | BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite | ||
11 | MOUSEKEY_ENABLE = yes # Mouse keys | ||
12 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
13 | CONSOLE_ENABLE = yes # Console for debug | ||
14 | COMMAND_ENABLE = yes # Commands for debug and configuration | ||
15 | NKRO_ENABLE = yes # Enable N-Key Rollover | ||
16 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
17 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow | ||
18 | AUDIO_ENABLE = no # Audio output | ||
diff --git a/keyboards/ai03/orbit/config.h b/keyboards/ai03/orbit/config.h new file mode 100644 index 000000000..9ad384c8f --- /dev/null +++ b/keyboards/ai03/orbit/config.h | |||
@@ -0,0 +1,149 @@ | |||
1 | /* | ||
2 | Copyright 2018 Ryota Goto | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation, either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | #pragma once | ||
19 | |||
20 | #include "config_common.h" | ||
21 | |||
22 | /* USB Device descriptor parameter */ | ||
23 | #define VENDOR_ID 0xA103 | ||
24 | #define PRODUCT_ID 0x0003 | ||
25 | #define DEVICE_VER 0x0003 | ||
26 | #define MANUFACTURER ai03 Keyboard Designs | ||
27 | #define PRODUCT Orbit | ||
28 | |||
29 | /* key matrix size */ | ||
30 | #define MATRIX_ROWS 10 // Double rows for split keyboards. Orbit has 5, so define 10 | ||
31 | #define MATRIX_COLS 7 | ||
32 | |||
33 | /* | ||
34 | * Keyboard Matrix Assignments | ||
35 | * | ||
36 | * Change this to how you wired your keyboard | ||
37 | * COLS: AVR pins used for columns, left to right | ||
38 | * ROWS: AVR pins used for rows, top to bottom | ||
39 | * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) | ||
40 | * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) | ||
41 | * | ||
42 | */ | ||
43 | #define MATRIX_ROW_PINS { F7, F6, F5, F4, D3 } | ||
44 | #define MATRIX_COL_PINS { C7, B4, D7, D6, D4, F1, F0 } | ||
45 | #define MATRIX_ROW_PINS_RIGHT { B6, B5, B4, D7, E6 } | ||
46 | #define MATRIX_COL_PINS_RIGHT { D4, D6, F1, F0, F4, F5, C6 } | ||
47 | |||
48 | #define SPLIT_HAND_PIN D5 | ||
49 | |||
50 | //#define USE_I2C | ||
51 | |||
52 | #define SELECT_SOFT_SERIAL_SPEED 1 | ||
53 | |||
54 | #define UNUSED_PINS | ||
55 | |||
56 | /* COL2ROW, ROW2COL */ | ||
57 | #define DIODE_DIRECTION COL2ROW | ||
58 | |||
59 | /* | ||
60 | * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. | ||
61 | */ | ||
62 | #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 | ||
63 | |||
64 | #define BACKLIGHT_PIN B7 | ||
65 | // #define BACKLIGHT_BREATHING | ||
66 | #define BACKLIGHT_LEVELS 3 | ||
67 | |||
68 | // #define RGB_DI_PIN E2 | ||
69 | // #ifdef RGB_DI_PIN | ||
70 | // #define RGBLED_NUM 16 | ||
71 | // #define RGBLIGHT_HUE_STEP 8 | ||
72 | // #define RGBLIGHT_SAT_STEP 8 | ||
73 | // #define RGBLIGHT_VAL_STEP 8 | ||
74 | // #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ | ||
75 | // #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ | ||
76 | // /*== all animations enable ==*/ | ||
77 | // #define RGBLIGHT_ANIMATIONS | ||
78 | // /*== or choose animations ==*/ | ||
79 | // #define RGBLIGHT_EFFECT_BREATHING | ||
80 | // #define RGBLIGHT_EFFECT_RAINBOW_MOOD | ||
81 | // #define RGBLIGHT_EFFECT_RAINBOW_SWIRL | ||
82 | // #define RGBLIGHT_EFFECT_SNAKE | ||
83 | // #define RGBLIGHT_EFFECT_KNIGHT | ||
84 | // #define RGBLIGHT_EFFECT_CHRISTMAS | ||
85 | // #define RGBLIGHT_EFFECT_STATIC_GRADIENT | ||
86 | // #define RGBLIGHT_EFFECT_RGB_TEST | ||
87 | // #define RGBLIGHT_EFFECT_ALTERNATING | ||
88 | // #endif | ||
89 | |||
90 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
91 | #define DEBOUNCE 5 | ||
92 | |||
93 | /* define if matrix has ghost (lacks anti-ghosting diodes) */ | ||
94 | //#define MATRIX_HAS_GHOST | ||
95 | |||
96 | /* number of backlight levels */ | ||
97 | |||
98 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
99 | #define LOCKING_SUPPORT_ENABLE | ||
100 | /* Locking resynchronize hack */ | ||
101 | #define LOCKING_RESYNC_ENABLE | ||
102 | |||
103 | /* If defined, GRAVE_ESC will always act as ESC when CTRL is held. | ||
104 | * This is userful for the Windows task manager shortcut (ctrl+shift+esc). | ||
105 | */ | ||
106 | // #define GRAVE_ESC_CTRL_OVERRIDE | ||
107 | |||
108 | /* | ||
109 | * Force NKRO | ||
110 | * | ||
111 | * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved | ||
112 | * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the | ||
113 | * makefile for this to work.) | ||
114 | * | ||
115 | * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) | ||
116 | * until the next keyboard reset. | ||
117 | * | ||
118 | * NKRO may prevent your keystrokes from being detected in the BIOS, but it is | ||
119 | * fully operational during normal computer usage. | ||
120 | * | ||
121 | * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) | ||
122 | * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by | ||
123 | * bootmagic, NKRO mode will always be enabled until it is toggled again during a | ||
124 | * power-up. | ||
125 | * | ||
126 | */ | ||
127 | //#define FORCE_NKRO | ||
128 | |||
129 | /* | ||
130 | * Feature disable options | ||
131 | * These options are also useful to firmware size reduction. | ||
132 | */ | ||
133 | |||
134 | /* disable debug print */ | ||
135 | //#define NO_DEBUG | ||
136 | |||
137 | /* disable print */ | ||
138 | //#define NO_PRINT | ||
139 | |||
140 | /* disable action features */ | ||
141 | //#define NO_ACTION_LAYER | ||
142 | //#define NO_ACTION_TAPPING | ||
143 | //#define NO_ACTION_ONESHOT | ||
144 | //#define NO_ACTION_MACRO | ||
145 | //#define NO_ACTION_FUNCTION | ||
146 | |||
147 | /* Bootmagic Lite key configuration */ | ||
148 | // #define BOOTMAGIC_LITE_ROW 0 | ||
149 | // #define BOOTMAGIC_LITE_COLUMN 0 | ||
diff --git a/keyboards/ai03/orbit/info.json b/keyboards/ai03/orbit/info.json new file mode 100644 index 000000000..a9f080482 --- /dev/null +++ b/keyboards/ai03/orbit/info.json | |||
@@ -0,0 +1,86 @@ | |||
1 | { | ||
2 | "keyboard_name": "orbit", | ||
3 | "url": "https://github.com/ai03-2725/Orbit", | ||
4 | "maintainer": "ai03", | ||
5 | "layouts": { | ||
6 | "LAYOUT": { | ||
7 | "layout": [ | ||
8 | {"x":0, "y":0.63}, | ||
9 | {"x":1, "y":0.38}, | ||
10 | {"x":2, "y":0.38}, | ||
11 | {"x":3, "y":0.13}, | ||
12 | {"x":4, "y":0}, | ||
13 | {"x":5, "y":0.13}, | ||
14 | {"x":6, "y":0.25}, | ||
15 | {"x":9, "y":0.25}, | ||
16 | {"x":10, "y":0.13}, | ||
17 | {"x":11, "y":0}, | ||
18 | {"x":12, "y":0.13}, | ||
19 | {"x":13, "y":0.38}, | ||
20 | {"x":14, "y":0.38}, | ||
21 | {"x":15, "y":0.63}, | ||
22 | |||
23 | {"x":0, "y":1.63}, | ||
24 | {"x":1, "y":1.38}, | ||
25 | {"x":2, "y":1.38}, | ||
26 | {"x":3, "y":1.13}, | ||
27 | {"x":4, "y":1}, | ||
28 | {"x":5, "y":1.13}, | ||
29 | {"x":6, "y":1.25}, | ||
30 | {"x":9, "y":1.25}, | ||
31 | {"x":10, "y":1.13}, | ||
32 | {"x":11, "y":1}, | ||
33 | {"x":12, "y":1.13}, | ||
34 | {"x":13, "y":1.38}, | ||
35 | {"x":14, "y":1.38}, | ||
36 | {"x":15, "y":1.63}, | ||
37 | |||
38 | {"x":0, "y":2.63}, | ||
39 | {"x":1, "y":2.38}, | ||
40 | {"x":2, "y":2.38}, | ||
41 | {"x":3, "y":2.13}, | ||
42 | {"x":4, "y":2}, | ||
43 | {"x":5, "y":2.13}, | ||
44 | {"x":6, "y":2.25}, | ||
45 | {"x":9, "y":2.25}, | ||
46 | {"x":10, "y":2.13}, | ||
47 | {"x":11, "y":2}, | ||
48 | {"x":12, "y":2.13}, | ||
49 | {"x":13, "y":2.38}, | ||
50 | {"x":14, "y":2.38}, | ||
51 | {"x":15, "y":2.63}, | ||
52 | |||
53 | {"x":0, "y":3.63}, | ||
54 | {"x":1, "y":3.38}, | ||
55 | {"x":2, "y":3.38}, | ||
56 | {"x":3, "y":3.13}, | ||
57 | {"x":4, "y":3}, | ||
58 | {"x":5, "y":3.13}, | ||
59 | {"x":6, "y":3.25}, | ||
60 | {"x":9, "y":3.25}, | ||
61 | {"x":10, "y":3.13}, | ||
62 | {"x":11, "y":3}, | ||
63 | {"x":12, "y":3.13}, | ||
64 | {"x":13, "y":3.38}, | ||
65 | {"x":14, "y":3.38}, | ||
66 | {"x":15, "y":3.63}, | ||
67 | |||
68 | {"x":1, "y":4.38}, | ||
69 | {"x":2, "y":4.38}, | ||
70 | {"x":3, "y":4.13}, | ||
71 | {"x":4, "y":4}, | ||
72 | |||
73 | {"x":5.5, "y":4.25}, | ||
74 | {"x":6.5, "y":4.5, "h":1.5}, | ||
75 | |||
76 | {"x":8.5, "y":4.5, "h":1.5}, | ||
77 | {"x":9.5, "y":4.25}, | ||
78 | |||
79 | {"x":11, "y":4}, | ||
80 | {"x":12, "y":4.13}, | ||
81 | {"x":13, "y":4.38}, | ||
82 | {"x":14, "y":4.38} | ||
83 | ] | ||
84 | } | ||
85 | } | ||
86 | } | ||
diff --git a/keyboards/ai03/orbit/keymaps/default/keymap.c b/keyboards/ai03/orbit/keymaps/default/keymap.c new file mode 100644 index 000000000..fa383d7c0 --- /dev/null +++ b/keyboards/ai03/orbit/keymaps/default/keymap.c | |||
@@ -0,0 +1,74 @@ | |||
1 | /* Copyright 2018 Ryota Goto | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | #include QMK_KEYBOARD_H | ||
17 | |||
18 | // Defines the keycodes used by our macros in process_record_user | ||
19 | enum custom_keycodes { | ||
20 | MANUAL = SAFE_RANGE, | ||
21 | DBLZERO | ||
22 | }; | ||
23 | |||
24 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
25 | [0] = LAYOUT( /* Base */ | ||
26 | TO(1), KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_BSPC, | ||
27 | TO(1), KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRC, KC_BSLS, | ||
28 | KC_NO, 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, | ||
29 | KC_NO, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_PSCR, KC_DEL, | ||
30 | KC_LCTL, KC_LCTL, KC_LGUI, KC_LALT, MO(1), KC_SPC, KC_SPC, MO(2), KC_GRV, KC_MENU, KC_MINS, KC_EQL | ||
31 | ), | ||
32 | [1] = LAYOUT( /* Fn, Arrowkeys, Media control, Backlight */ | ||
33 | TO(2), _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_VOLU, _______, | ||
34 | TO(2), _______, _______, KC_PGUP, _______, _______, KC_F11, KC_F12, _______, KC_UP, _______, _______, KC_VOLD, BL_STEP, | ||
35 | TO(0), _______, KC_HOME, KC_PGDN, KC_END, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_MPLY, _______, | ||
36 | TO(0), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, | ||
37 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
38 | ), | ||
39 | [2] = LAYOUT( /* Mousekeys and Numpad */ | ||
40 | KC_NO, _______, _______, _______, _______, _______, _______, KC_NLCK, KC_P7, KC_P8, KC_P9, KC_PSLS, _______, _______, | ||
41 | KC_NO, _______, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, _______, _______, KC_P4, KC_P5, KC_P6, KC_PAST, _______, _______, | ||
42 | TO(1), _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, _______, _______, KC_P1, KC_P2, KC_P3, KC_PMNS, _______, _______, | ||
43 | TO(1), _______, KC_ACL0, KC_ACL1, KC_ACL2, KC_BTN3, _______, DBLZERO, KC_P0, KC_PDOT, KC_PENT, KC_PPLS, _______, MANUAL, | ||
44 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
45 | ) | ||
46 | }; | ||
47 | |||
48 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
49 | switch (keycode) { | ||
50 | case MANUAL: | ||
51 | if (record->event.pressed) | ||
52 | { | ||
53 | // Keypress | ||
54 | SEND_STRING("https://kb.ai03.me/redir/orbit"); | ||
55 | } | ||
56 | else | ||
57 | { | ||
58 | // Key release | ||
59 | } | ||
60 | break; | ||
61 | case DBLZERO: | ||
62 | if (record->event.pressed) | ||
63 | { | ||
64 | // Keypress | ||
65 | SEND_STRING("00"); | ||
66 | } | ||
67 | else | ||
68 | { | ||
69 | // Key release | ||
70 | } | ||
71 | break; | ||
72 | } | ||
73 | return true; | ||
74 | } | ||
diff --git a/keyboards/ai03/orbit/keymaps/default/readme.md b/keyboards/ai03/orbit/keymaps/default/readme.md new file mode 100644 index 000000000..63c528abf --- /dev/null +++ b/keyboards/ai03/orbit/keymaps/default/readme.md | |||
@@ -0,0 +1,3 @@ | |||
1 | # The default keymap for Orbit | ||
2 | |||
3 | [KLE of layout](http://www.keyboard-layout-editor.com/#/gists/53ebf59524de12515cb7e2e6de94f0d6) \ No newline at end of file | ||
diff --git a/keyboards/ai03/orbit/matrix.c b/keyboards/ai03/orbit/matrix.c new file mode 100644 index 000000000..b8e329668 --- /dev/null +++ b/keyboards/ai03/orbit/matrix.c | |||
@@ -0,0 +1,328 @@ | |||
1 | /* | ||
2 | Copyright 2012 Jun Wako <[email protected]> | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation, either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along 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 "wait.h" | ||
24 | #include "util.h" | ||
25 | #include "matrix.h" | ||
26 | #include "split_util.h" | ||
27 | #include "config.h" | ||
28 | #include "split_flags.h" | ||
29 | #include "quantum.h" | ||
30 | #include "debounce.h" | ||
31 | #include "transport.h" | ||
32 | |||
33 | #if (MATRIX_COLS <= 8) | ||
34 | # define print_matrix_header() print("\nr/c 01234567\n") | ||
35 | # define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) | ||
36 | # define matrix_bitpop(i) bitpop(matrix[i]) | ||
37 | # define ROW_SHIFTER ((uint8_t)1) | ||
38 | #elif (MATRIX_COLS <= 16) | ||
39 | # define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") | ||
40 | # define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) | ||
41 | # define matrix_bitpop(i) bitpop16(matrix[i]) | ||
42 | # define ROW_SHIFTER ((uint16_t)1) | ||
43 | #elif (MATRIX_COLS <= 32) | ||
44 | # define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") | ||
45 | # define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) | ||
46 | # define matrix_bitpop(i) bitpop32(matrix[i]) | ||
47 | # define ROW_SHIFTER ((uint32_t)1) | ||
48 | #endif | ||
49 | |||
50 | #define ERROR_DISCONNECT_COUNT 5 | ||
51 | |||
52 | //#define ROWS_PER_HAND (MATRIX_ROWS / 2) | ||
53 | |||
54 | #ifdef DIRECT_PINS | ||
55 | static pin_t direct_pins[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS; | ||
56 | #else | ||
57 | static pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; | ||
58 | static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; | ||
59 | #endif | ||
60 | |||
61 | /* matrix state(1:on, 0:off) */ | ||
62 | static matrix_row_t matrix[MATRIX_ROWS]; | ||
63 | static matrix_row_t raw_matrix[ROWS_PER_HAND]; | ||
64 | |||
65 | // row offsets for each hand | ||
66 | uint8_t thisHand, thatHand; | ||
67 | |||
68 | // user-defined overridable functions | ||
69 | |||
70 | __attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); } | ||
71 | |||
72 | __attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); } | ||
73 | |||
74 | __attribute__((weak)) void matrix_init_user(void) {} | ||
75 | |||
76 | __attribute__((weak)) void matrix_scan_user(void) {} | ||
77 | |||
78 | __attribute__((weak)) void matrix_slave_scan_user(void) {} | ||
79 | |||
80 | // helper functions | ||
81 | |||
82 | inline uint8_t matrix_rows(void) { return MATRIX_ROWS; } | ||
83 | |||
84 | inline uint8_t matrix_cols(void) { return MATRIX_COLS; } | ||
85 | |||
86 | bool matrix_is_modified(void) { | ||
87 | if (debounce_active()) return false; | ||
88 | return true; | ||
89 | } | ||
90 | |||
91 | inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & ((matrix_row_t)1 << col)); } | ||
92 | |||
93 | inline matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; } | ||
94 | |||
95 | void matrix_print(void) { | ||
96 | print_matrix_header(); | ||
97 | |||
98 | for (uint8_t row = 0; row < MATRIX_ROWS; row++) { | ||
99 | print_hex8(row); | ||
100 | print(": "); | ||
101 | print_matrix_row(row); | ||
102 | print("\n"); | ||
103 | } | ||
104 | } | ||
105 | |||
106 | uint8_t matrix_key_count(void) { | ||
107 | uint8_t count = 0; | ||
108 | for (uint8_t i = 0; i < MATRIX_ROWS; i++) { | ||
109 | count += matrix_bitpop(i); | ||
110 | } | ||
111 | return count; | ||
112 | } | ||
113 | |||
114 | // matrix code | ||
115 | |||
116 | #ifdef DIRECT_PINS | ||
117 | |||
118 | static void init_pins(void) { | ||
119 | for (int row = 0; row < MATRIX_ROWS; row++) { | ||
120 | for (int col = 0; col < MATRIX_COLS; col++) { | ||
121 | pin_t pin = direct_pins[row][col]; | ||
122 | if (pin != NO_PIN) { | ||
123 | setPinInputHigh(pin); | ||
124 | } | ||
125 | } | ||
126 | } | ||
127 | } | ||
128 | |||
129 | static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { | ||
130 | matrix_row_t last_row_value = current_matrix[current_row]; | ||
131 | current_matrix[current_row] = 0; | ||
132 | |||
133 | for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { | ||
134 | pin_t pin = direct_pins[current_row][col_index]; | ||
135 | if (pin != NO_PIN) { | ||
136 | current_matrix[current_row] |= readPin(pin) ? 0 : (ROW_SHIFTER << col_index); | ||
137 | } | ||
138 | } | ||
139 | |||
140 | return (last_row_value != current_matrix[current_row]); | ||
141 | } | ||
142 | |||
143 | #elif (DIODE_DIRECTION == COL2ROW) | ||
144 | |||
145 | static void select_row(uint8_t row) { | ||
146 | setPinOutput(row_pins[row]); | ||
147 | writePinLow(row_pins[row]); | ||
148 | } | ||
149 | |||
150 | static void unselect_row(uint8_t row) { setPinInputHigh(row_pins[row]); } | ||
151 | |||
152 | static void unselect_rows(void) { | ||
153 | for (uint8_t x = 0; x < ROWS_PER_HAND; x++) { | ||
154 | setPinInputHigh(row_pins[x]); | ||
155 | } | ||
156 | } | ||
157 | |||
158 | static void init_pins(void) { | ||
159 | unselect_rows(); | ||
160 | for (uint8_t x = 0; x < MATRIX_COLS; x++) { | ||
161 | setPinInputHigh(col_pins[x]); | ||
162 | } | ||
163 | } | ||
164 | |||
165 | static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { | ||
166 | // Store last value of row prior to reading | ||
167 | matrix_row_t last_row_value = current_matrix[current_row]; | ||
168 | |||
169 | // Clear data in matrix row | ||
170 | current_matrix[current_row] = 0; | ||
171 | |||
172 | // Select row and wait for row selecton to stabilize | ||
173 | select_row(current_row); | ||
174 | wait_us(30); | ||
175 | |||
176 | // For each col... | ||
177 | for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { | ||
178 | // Populate the matrix row with the state of the col pin | ||
179 | current_matrix[current_row] |= readPin(col_pins[col_index]) ? 0 : (ROW_SHIFTER << col_index); | ||
180 | } | ||
181 | |||
182 | // Unselect row | ||
183 | unselect_row(current_row); | ||
184 | |||
185 | return (last_row_value != current_matrix[current_row]); | ||
186 | } | ||
187 | |||
188 | #elif (DIODE_DIRECTION == ROW2COL) | ||
189 | |||
190 | static void select_col(uint8_t col) { | ||
191 | setPinOutput(col_pins[col]); | ||
192 | writePinLow(col_pins[col]); | ||
193 | } | ||
194 | |||
195 | static void unselect_col(uint8_t col) { setPinInputHigh(col_pins[col]); } | ||
196 | |||
197 | static void unselect_cols(void) { | ||
198 | for (uint8_t x = 0; x < MATRIX_COLS; x++) { | ||
199 | setPinInputHigh(col_pins[x]); | ||
200 | } | ||
201 | } | ||
202 | |||
203 | static void init_pins(void) { | ||
204 | unselect_cols(); | ||
205 | for (uint8_t x = 0; x < ROWS_PER_HAND; x++) { | ||
206 | setPinInputHigh(row_pins[x]); | ||
207 | } | ||
208 | } | ||
209 | |||
210 | static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { | ||
211 | bool matrix_changed = false; | ||
212 | |||
213 | // Select col and wait for col selecton to stabilize | ||
214 | select_col(current_col); | ||
215 | wait_us(30); | ||
216 | |||
217 | // For each row... | ||
218 | for (uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) { | ||
219 | // Store last value of row prior to reading | ||
220 | matrix_row_t last_row_value = current_matrix[row_index]; | ||
221 | |||
222 | // Check row pin state | ||
223 | if (readPin(row_pins[row_index])) { | ||
224 | // Pin HI, clear col bit | ||
225 | current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); | ||
226 | } else { | ||
227 | // Pin LO, set col bit | ||
228 | current_matrix[row_index] |= (ROW_SHIFTER << current_col); | ||
229 | } | ||
230 | |||
231 | // Determine if the matrix changed state | ||
232 | if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) { | ||
233 | matrix_changed = true; | ||
234 | } | ||
235 | } | ||
236 | |||
237 | // Unselect col | ||
238 | unselect_col(current_col); | ||
239 | |||
240 | return matrix_changed; | ||
241 | } | ||
242 | |||
243 | #endif | ||
244 | |||
245 | void matrix_init(void) { | ||
246 | debug_enable = true; | ||
247 | debug_matrix = true; | ||
248 | debug_mouse = true; | ||
249 | |||
250 | // Set pinout for right half if pinout for that half is defined | ||
251 | if (!isLeftHand) { | ||
252 | #ifdef MATRIX_ROW_PINS_RIGHT | ||
253 | const uint8_t row_pins_right[MATRIX_ROWS] = MATRIX_ROW_PINS_RIGHT; | ||
254 | for (uint8_t i = 0; i < MATRIX_ROWS; i++) { | ||
255 | row_pins[i] = row_pins_right[i]; | ||
256 | } | ||
257 | #endif | ||
258 | #ifdef MATRIX_COL_PINS_RIGHT | ||
259 | const uint8_t col_pins_right[MATRIX_COLS] = MATRIX_COL_PINS_RIGHT; | ||
260 | for (uint8_t i = 0; i < MATRIX_COLS; i++) { | ||
261 | col_pins[i] = col_pins_right[i]; | ||
262 | } | ||
263 | #endif | ||
264 | } | ||
265 | |||
266 | thisHand = isLeftHand ? 0 : (ROWS_PER_HAND); | ||
267 | thatHand = ROWS_PER_HAND - thisHand; | ||
268 | |||
269 | // initialize key pins | ||
270 | init_pins(); | ||
271 | |||
272 | // initialize matrix state: all keys off | ||
273 | for (uint8_t i = 0; i < MATRIX_ROWS; i++) { | ||
274 | matrix[i] = 0; | ||
275 | } | ||
276 | |||
277 | debounce_init(ROWS_PER_HAND); | ||
278 | |||
279 | matrix_init_quantum(); | ||
280 | } | ||
281 | |||
282 | uint8_t _matrix_scan(void) { | ||
283 | bool changed = false; | ||
284 | |||
285 | #if defined(DIRECT_PINS) || (DIODE_DIRECTION == COL2ROW) | ||
286 | // Set row, read cols | ||
287 | for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { | ||
288 | changed |= read_cols_on_row(raw_matrix, current_row); | ||
289 | } | ||
290 | #elif (DIODE_DIRECTION == ROW2COL) | ||
291 | // Set col, read rows | ||
292 | for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { | ||
293 | changed |= read_rows_on_col(raw_matrix, current_col); | ||
294 | } | ||
295 | #endif | ||
296 | |||
297 | debounce(raw_matrix, matrix + thisHand, ROWS_PER_HAND, changed); | ||
298 | |||
299 | return 1; | ||
300 | } | ||
301 | |||
302 | uint8_t matrix_scan(void) { | ||
303 | uint8_t ret = _matrix_scan(); | ||
304 | |||
305 | if (is_keyboard_master()) { | ||
306 | static uint8_t error_count; | ||
307 | |||
308 | if (!transport_master(matrix + thatHand)) { | ||
309 | error_count++; | ||
310 | |||
311 | if (error_count > ERROR_DISCONNECT_COUNT) { | ||
312 | // reset other half if disconnected | ||
313 | for (int i = 0; i < ROWS_PER_HAND; ++i) { | ||
314 | matrix[thatHand + i] = 0; | ||
315 | } | ||
316 | } | ||
317 | } else { | ||
318 | error_count = 0; | ||
319 | } | ||
320 | |||
321 | matrix_scan_quantum(); | ||
322 | } else { | ||
323 | transport_slave(matrix + thisHand); | ||
324 | matrix_slave_scan_user(); | ||
325 | } | ||
326 | |||
327 | return ret; | ||
328 | } | ||
diff --git a/keyboards/ai03/orbit/orbit.c b/keyboards/ai03/orbit/orbit.c new file mode 100644 index 000000000..97553e318 --- /dev/null +++ b/keyboards/ai03/orbit/orbit.c | |||
@@ -0,0 +1,210 @@ | |||
1 | /* Copyright 2018 Ryota Goto | ||
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 "orbit.h" | ||
17 | #include "split_util.h" | ||
18 | #include "transport.h" | ||
19 | |||
20 | |||
21 | // Call led_toggle to set LEDs easily | ||
22 | // LED IDs: | ||
23 | // | ||
24 | // (LEFT) 0 1 2 | 3 4 5 (RIGHT) | ||
25 | |||
26 | void led_toggle(int id, bool on) { | ||
27 | |||
28 | if (isLeftHand) { | ||
29 | switch(id) { | ||
30 | case 0: | ||
31 | // Left hand C6 | ||
32 | if (on) | ||
33 | //PORTC |= (1<<6); | ||
34 | writePinHigh(C6); | ||
35 | else | ||
36 | //PORTC &= ~(1<<6); | ||
37 | writePinLow(C6); | ||
38 | break; | ||
39 | case 1: | ||
40 | // Left hand B6 | ||
41 | if (on) | ||
42 | //PORTB |= (1<<6); | ||
43 | writePinHigh(B6); | ||
44 | else | ||
45 | //PORTB &= ~(1<<6); | ||
46 | writePinLow(B6); | ||
47 | break; | ||
48 | case 2: | ||
49 | // Left hand B5 | ||
50 | if (on) | ||
51 | //PORTB |= (1<<5); | ||
52 | writePinHigh(B5); | ||
53 | else | ||
54 | //PORTB &= ~(1<<5); | ||
55 | writePinLow(B5); | ||
56 | break; | ||
57 | default: | ||
58 | break; | ||
59 | } | ||
60 | } else { | ||
61 | switch(id) { | ||
62 | case 3: | ||
63 | // Right hand F6 | ||
64 | if (on) | ||
65 | //PORTF |= (1<<6); | ||
66 | writePinHigh(F6); | ||
67 | else | ||
68 | //PORTF &= ~(1<<6); | ||
69 | writePinLow(F6); | ||
70 | break; | ||
71 | case 4: | ||
72 | // Right hand F7 | ||
73 | if (on) | ||
74 | //PORTF |= (1<<7); | ||
75 | writePinHigh(F7); | ||
76 | else | ||
77 | //PORTF &= ~(1<<7); | ||
78 | writePinLow(F7); | ||
79 | break; | ||
80 | case 5: | ||
81 | // Right hand C7 | ||
82 | if (on) | ||
83 | //PORTC |= (1<<7); | ||
84 | writePinHigh(C7); | ||
85 | else | ||
86 | //PORTC &= ~(1<<7); | ||
87 | writePinLow(C7); | ||
88 | break; | ||
89 | default: | ||
90 | break; | ||
91 | } | ||
92 | } | ||
93 | } | ||
94 | |||
95 | // Set all LEDs at once using an array of 6 booleans | ||
96 | // LED IDs: | ||
97 | // | ||
98 | // (LEFT) 0 1 2 | 3 4 5 (RIGHT) | ||
99 | // | ||
100 | // Ex. set_all_leds({ false, false, false, true, true, true }) would turn off left hand, turn on right hand | ||
101 | |||
102 | void set_all_leds(bool leds[6]) { | ||
103 | for (int i = 0; i < 6; i++) { | ||
104 | led_toggle(i, leds[i]); | ||
105 | } | ||
106 | } | ||
107 | |||
108 | void set_layer_indicators(uint8_t layer) { | ||
109 | |||
110 | switch (layer) | ||
111 | { | ||
112 | case 0: | ||
113 | led_toggle(0, true); | ||
114 | led_toggle(1, false); | ||
115 | led_toggle(2, false); | ||
116 | break; | ||
117 | case 1: | ||
118 | led_toggle(0, true); | ||
119 | led_toggle(1, true); | ||
120 | led_toggle(2, false); | ||
121 | break; | ||
122 | case 2: | ||
123 | led_toggle(0, true); | ||
124 | led_toggle(1, true); | ||
125 | led_toggle(2, true); | ||
126 | break; | ||
127 | case 3: | ||
128 | led_toggle(0, false); | ||
129 | led_toggle(1, true); | ||
130 | led_toggle(2, true); | ||
131 | break; | ||
132 | case 4: | ||
133 | led_toggle(0, false); | ||
134 | led_toggle(1, false); | ||
135 | led_toggle(2, true); | ||
136 | break; | ||
137 | default: | ||
138 | led_toggle(0, true); | ||
139 | led_toggle(1, false); | ||
140 | led_toggle(2, true); | ||
141 | break; | ||
142 | } | ||
143 | |||
144 | } | ||
145 | |||
146 | void matrix_init_kb(void) { | ||
147 | // put your keyboard start-up code here | ||
148 | // runs once when the firmware starts up | ||
149 | |||
150 | // Initialize indicator LEDs to output | ||
151 | if (isLeftHand) | ||
152 | { | ||
153 | setPinOutput(C6); | ||
154 | setPinOutput(B6); | ||
155 | setPinOutput(B5); | ||
156 | //DDRC |= (1<<6); | ||
157 | //DDRB |= (1<<6); | ||
158 | //DDRB |= (1<<5); | ||
159 | } | ||
160 | else | ||
161 | { | ||
162 | setPinOutput(F6); | ||
163 | setPinOutput(F7); | ||
164 | setPinOutput(C7); | ||
165 | //DDRF |= (1<<6); | ||
166 | //DDRF |= (1<<7); | ||
167 | //DDRC |= (1<<7); | ||
168 | } | ||
169 | |||
170 | set_layer_indicators(0); | ||
171 | |||
172 | matrix_init_user(); | ||
173 | } | ||
174 | |||
175 | void led_set_kb(uint8_t usb_led) { | ||
176 | // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here | ||
177 | |||
178 | if (is_keyboard_master()) { | ||
179 | |||
180 | serial_m2s_buffer.nlock_led = IS_LED_ON(usb_led, USB_LED_NUM_LOCK); | ||
181 | serial_m2s_buffer.clock_led = IS_LED_ON(usb_led, USB_LED_CAPS_LOCK); | ||
182 | serial_m2s_buffer.slock_led = IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK); | ||
183 | |||
184 | led_toggle(3, IS_LED_ON(usb_led, USB_LED_NUM_LOCK)); | ||
185 | led_toggle(4, IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)); | ||
186 | led_toggle(5, IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)); | ||
187 | |||
188 | } | ||
189 | |||
190 | led_set_user(usb_led); | ||
191 | } | ||
192 | |||
193 | uint32_t layer_state_set_kb(uint32_t state) { | ||
194 | |||
195 | if (is_keyboard_master()) | ||
196 | { | ||
197 | serial_m2s_buffer.current_layer = biton32(state); | ||
198 | |||
199 | // If left half, do the LED toggle thing | ||
200 | if (isLeftHand) | ||
201 | { | ||
202 | set_layer_indicators(biton32(state)); | ||
203 | } | ||
204 | |||
205 | } | ||
206 | // NOTE: Do not set slave LEDs here. | ||
207 | // This is not called on slave | ||
208 | |||
209 | return layer_state_set_user(state); | ||
210 | } | ||
diff --git a/keyboards/ai03/orbit/orbit.h b/keyboards/ai03/orbit/orbit.h new file mode 100644 index 000000000..39f1ebb0e --- /dev/null +++ b/keyboards/ai03/orbit/orbit.h | |||
@@ -0,0 +1,61 @@ | |||
1 | /* Copyright 2018 Ryota Goto | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #pragma once | ||
18 | |||
19 | #include "quantum.h" | ||
20 | |||
21 | /* This a shortcut to help you visually see your layout. | ||
22 | * | ||
23 | * The first section contains all of the arguments representing the physical | ||
24 | * layout of the board and position of the keys. | ||
25 | * | ||
26 | * The second converts the arguments into a two-dimensional array which | ||
27 | * represents the switch matrix. | ||
28 | */ | ||
29 | |||
30 | #ifdef USE_I2C | ||
31 | #include <stddef.h> | ||
32 | #ifdef __AVR__ | ||
33 | #include <avr/io.h> | ||
34 | #include <avr/interrupt.h> | ||
35 | #endif | ||
36 | #endif | ||
37 | |||
38 | #define XXX KC_NO | ||
39 | |||
40 | #define LAYOUT( \ | ||
41 | L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ | ||
42 | L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ | ||
43 | L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ | ||
44 | L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ | ||
45 | L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45 \ | ||
46 | ) { \ | ||
47 | { L00, L01, L02, L03, L04, L05, L06 }, \ | ||
48 | { L10, L11, L12, L13, L14, L15, L16 }, \ | ||
49 | { L20, L21, L22, L23, L24, L25, L26 }, \ | ||
50 | { L30, L31, L32, L33, L34, L35, L36 }, \ | ||
51 | { XXX, L41, L42, L43, L44, L45, L46 }, \ | ||
52 | { R00, R01, R02, R03, R04, R05, R06 }, \ | ||
53 | { R10, R11, R12, R13, R14, R15, R16 }, \ | ||
54 | { R20, R21, R22, R23, R24, R25, R26 }, \ | ||
55 | { R30, R31, R32, R33, R34, R35, R36 }, \ | ||
56 | { R40, R41, R42, R43, R44, R45, XXX } \ | ||
57 | } | ||
58 | |||
59 | extern void led_toggle(int id, bool on); | ||
60 | void set_all_leds(bool leds[6]); | ||
61 | extern void set_layer_indicators(uint8_t layer); | ||
diff --git a/keyboards/ai03/orbit/readme.md b/keyboards/ai03/orbit/readme.md new file mode 100644 index 000000000..58ba2079d --- /dev/null +++ b/keyboards/ai03/orbit/readme.md | |||
@@ -0,0 +1,15 @@ | |||
1 | # Orbit | ||
2 | |||
3 |  | ||
4 | |||
5 | A split ergonomic keyboard project. | ||
6 | |||
7 | Keyboard Maintainer: [ai03](https://github.com/ai03-2725) | ||
8 | Hardware Supported: The [Orbit PCB](https://github.com/ai03-2725/Orbit) | ||
9 | Hardware Availability: [This repository](https://github.com/ai03-2725/Orbit) has PCB files. Case group buy orders are currently closed. | ||
10 | |||
11 | Make example for this keyboard (after setting up your build environment): | ||
12 | |||
13 | make ai03/orbit:default | ||
14 | |||
15 | See 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/ai03/orbit/rules.mk b/keyboards/ai03/orbit/rules.mk new file mode 100644 index 000000000..f98e2382f --- /dev/null +++ b/keyboards/ai03/orbit/rules.mk | |||
@@ -0,0 +1,27 @@ | |||
1 | # MCU name | ||
2 | MCU = atmega32u4 | ||
3 | |||
4 | # Bootloader selection | ||
5 | BOOTLOADER = atmel-dfu | ||
6 | |||
7 | # Build Options | ||
8 | # change yes to no to disable | ||
9 | # | ||
10 | BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite | ||
11 | MOUSEKEY_ENABLE = yes # Mouse keys | ||
12 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
13 | CONSOLE_ENABLE = no # Console for debug | ||
14 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
15 | NKRO_ENABLE = yes # Enable N-Key Rollover | ||
16 | BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality | ||
17 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow | ||
18 | AUDIO_ENABLE = no # Audio output | ||
19 | USE_I2C = no # I2C for split communication | ||
20 | CUSTOM_MATRIX = yes # For providing custom matrix.c (in this case, override regular matrix.c with split matrix.c) | ||
21 | # SPLIT_KEYBOARD = yes # Split keyboard flag disabled as manual edits had to be done to the split common files | ||
22 | |||
23 | SRC += split_util.c \ | ||
24 | split_flags.c \ | ||
25 | serial.c \ | ||
26 | transport.c \ | ||
27 | matrix.c | ||
diff --git a/keyboards/ai03/orbit/serial.c b/keyboards/ai03/orbit/serial.c new file mode 100644 index 000000000..636dfa090 --- /dev/null +++ b/keyboards/ai03/orbit/serial.c | |||
@@ -0,0 +1,545 @@ | |||
1 | /* | ||
2 | * WARNING: be careful changing this code, it is very timing dependent | ||
3 | * | ||
4 | * 2018-10-28 checked | ||
5 | * avr-gcc 4.9.2 | ||
6 | * avr-gcc 5.4.0 | ||
7 | * avr-gcc 7.3.0 | ||
8 | */ | ||
9 | |||
10 | #ifndef F_CPU | ||
11 | #define F_CPU 16000000 | ||
12 | #endif | ||
13 | |||
14 | #include <avr/io.h> | ||
15 | #include <avr/interrupt.h> | ||
16 | #include <util/delay.h> | ||
17 | #include <stddef.h> | ||
18 | #include <stdbool.h> | ||
19 | #include "serial.h" | ||
20 | |||
21 | #ifdef SOFT_SERIAL_PIN | ||
22 | |||
23 | #ifdef __AVR_ATmega32U4__ | ||
24 | // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. | ||
25 | #ifdef USE_AVR_I2C | ||
26 | #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 | ||
27 | #error Using ATmega32U4 I2C, so can not use PD0, PD1 | ||
28 | #endif | ||
29 | #endif | ||
30 | |||
31 | #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 | ||
32 | #define SERIAL_PIN_DDR DDRD | ||
33 | #define SERIAL_PIN_PORT PORTD | ||
34 | #define SERIAL_PIN_INPUT PIND | ||
35 | #if SOFT_SERIAL_PIN == D0 | ||
36 | #define SERIAL_PIN_MASK _BV(PD0) | ||
37 | #define EIMSK_BIT _BV(INT0) | ||
38 | #define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01))) | ||
39 | #define SERIAL_PIN_INTERRUPT INT0_vect | ||
40 | #elif SOFT_SERIAL_PIN == D1 | ||
41 | #define SERIAL_PIN_MASK _BV(PD1) | ||
42 | #define EIMSK_BIT _BV(INT1) | ||
43 | #define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11))) | ||
44 | #define SERIAL_PIN_INTERRUPT INT1_vect | ||
45 | #elif SOFT_SERIAL_PIN == D2 | ||
46 | #define SERIAL_PIN_MASK _BV(PD2) | ||
47 | #define EIMSK_BIT _BV(INT2) | ||
48 | #define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21))) | ||
49 | #define SERIAL_PIN_INTERRUPT INT2_vect | ||
50 | #elif SOFT_SERIAL_PIN == D3 | ||
51 | #define SERIAL_PIN_MASK _BV(PD3) | ||
52 | #define EIMSK_BIT _BV(INT3) | ||
53 | #define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31))) | ||
54 | #define SERIAL_PIN_INTERRUPT INT3_vect | ||
55 | #endif | ||
56 | #elif SOFT_SERIAL_PIN == E6 | ||
57 | #define SERIAL_PIN_DDR DDRE | ||
58 | #define SERIAL_PIN_PORT PORTE | ||
59 | #define SERIAL_PIN_INPUT PINE | ||
60 | #define SERIAL_PIN_MASK _BV(PE6) | ||
61 | #define EIMSK_BIT _BV(INT6) | ||
62 | #define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61))) | ||
63 | #define SERIAL_PIN_INTERRUPT INT6_vect | ||
64 | #else | ||
65 | #error invalid SOFT_SERIAL_PIN value | ||
66 | #endif | ||
67 | |||
68 | #else | ||
69 | #error serial.c now support ATmega32U4 only | ||
70 | #endif | ||
71 | |||
72 | #define ALWAYS_INLINE __attribute__((always_inline)) | ||
73 | #define NO_INLINE __attribute__((noinline)) | ||
74 | #define _delay_sub_us(x) __builtin_avr_delay_cycles(x) | ||
75 | |||
76 | // parity check | ||
77 | #define ODD_PARITY 1 | ||
78 | #define EVEN_PARITY 0 | ||
79 | #define PARITY EVEN_PARITY | ||
80 | |||
81 | #ifdef SERIAL_DELAY | ||
82 | // custom setup in config.h | ||
83 | // #define TID_SEND_ADJUST 2 | ||
84 | // #define SERIAL_DELAY 6 // micro sec | ||
85 | // #define READ_WRITE_START_ADJUST 30 // cycles | ||
86 | // #define READ_WRITE_WIDTH_ADJUST 8 // cycles | ||
87 | #else | ||
88 | // ============ Standard setups ============ | ||
89 | |||
90 | #ifndef SELECT_SOFT_SERIAL_SPEED | ||
91 | #define SELECT_SOFT_SERIAL_SPEED 1 | ||
92 | // 0: about 189kbps (Experimental only) | ||
93 | // 1: about 137kbps (default) | ||
94 | // 2: about 75kbps | ||
95 | // 3: about 39kbps | ||
96 | // 4: about 26kbps | ||
97 | // 5: about 20kbps | ||
98 | #endif | ||
99 | |||
100 | #if __GNUC__ < 6 | ||
101 | #define TID_SEND_ADJUST 14 | ||
102 | #else | ||
103 | #define TID_SEND_ADJUST 2 | ||
104 | #endif | ||
105 | |||
106 | #if SELECT_SOFT_SERIAL_SPEED == 0 | ||
107 | // Very High speed | ||
108 | #define SERIAL_DELAY 4 // micro sec | ||
109 | #if __GNUC__ < 6 | ||
110 | #define READ_WRITE_START_ADJUST 33 // cycles | ||
111 | #define READ_WRITE_WIDTH_ADJUST 3 // cycles | ||
112 | #else | ||
113 | #define READ_WRITE_START_ADJUST 34 // cycles | ||
114 | #define READ_WRITE_WIDTH_ADJUST 7 // cycles | ||
115 | #endif | ||
116 | #elif SELECT_SOFT_SERIAL_SPEED == 1 | ||
117 | // High speed | ||
118 | #define SERIAL_DELAY 6 // micro sec | ||
119 | #if __GNUC__ < 6 | ||
120 | #define READ_WRITE_START_ADJUST 30 // cycles | ||
121 | #define READ_WRITE_WIDTH_ADJUST 3 // cycles | ||
122 | #else | ||
123 | #define READ_WRITE_START_ADJUST 33 // cycles | ||
124 | #define READ_WRITE_WIDTH_ADJUST 7 // cycles | ||
125 | #endif | ||
126 | #elif SELECT_SOFT_SERIAL_SPEED == 2 | ||
127 | // Middle speed | ||
128 | #define SERIAL_DELAY 12 // micro sec | ||
129 | #define READ_WRITE_START_ADJUST 30 // cycles | ||
130 | #if __GNUC__ < 6 | ||
131 | #define READ_WRITE_WIDTH_ADJUST 3 // cycles | ||
132 | #else | ||
133 | #define READ_WRITE_WIDTH_ADJUST 7 // cycles | ||
134 | #endif | ||
135 | #elif SELECT_SOFT_SERIAL_SPEED == 3 | ||
136 | // Low speed | ||
137 | #define SERIAL_DELAY 24 // micro sec | ||
138 | #define READ_WRITE_START_ADJUST 30 // cycles | ||
139 | #if __GNUC__ < 6 | ||
140 | #define READ_WRITE_WIDTH_ADJUST 3 // cycles | ||
141 | #else | ||
142 | #define READ_WRITE_WIDTH_ADJUST 7 // cycles | ||
143 | #endif | ||
144 | #elif SELECT_SOFT_SERIAL_SPEED == 4 | ||
145 | // Very Low speed | ||
146 | #define SERIAL_DELAY 36 // micro sec | ||
147 | #define READ_WRITE_START_ADJUST 30 // cycles | ||
148 | #if __GNUC__ < 6 | ||
149 | #define READ_WRITE_WIDTH_ADJUST 3 // cycles | ||
150 | #else | ||
151 | #define READ_WRITE_WIDTH_ADJUST 7 // cycles | ||
152 | #endif | ||
153 | #elif SELECT_SOFT_SERIAL_SPEED == 5 | ||
154 | // Ultra Low speed | ||
155 | #define SERIAL_DELAY 48 // micro sec | ||
156 | #define READ_WRITE_START_ADJUST 30 // cycles | ||
157 | #if __GNUC__ < 6 | ||
158 | #define READ_WRITE_WIDTH_ADJUST 3 // cycles | ||
159 | #else | ||
160 | #define READ_WRITE_WIDTH_ADJUST 7 // cycles | ||
161 | #endif | ||
162 | #else | ||
163 | #error invalid SELECT_SOFT_SERIAL_SPEED value | ||
164 | #endif /* SELECT_SOFT_SERIAL_SPEED */ | ||
165 | #endif /* SERIAL_DELAY */ | ||
166 | |||
167 | #define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) | ||
168 | #define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) | ||
169 | |||
170 | #define SLAVE_INT_WIDTH_US 1 | ||
171 | #ifndef SERIAL_USE_MULTI_TRANSACTION | ||
172 | #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY | ||
173 | #else | ||
174 | #define SLAVE_INT_ACK_WIDTH_UNIT 2 | ||
175 | #define SLAVE_INT_ACK_WIDTH 4 | ||
176 | #endif | ||
177 | |||
178 | static SSTD_t *Transaction_table = NULL; | ||
179 | static uint8_t Transaction_table_size = 0; | ||
180 | |||
181 | inline static void serial_delay(void) ALWAYS_INLINE; | ||
182 | inline static | ||
183 | void serial_delay(void) { | ||
184 | _delay_us(SERIAL_DELAY); | ||
185 | } | ||
186 | |||
187 | inline static void serial_delay_half1(void) ALWAYS_INLINE; | ||
188 | inline static | ||
189 | void serial_delay_half1(void) { | ||
190 | _delay_us(SERIAL_DELAY_HALF1); | ||
191 | } | ||
192 | |||
193 | inline static void serial_delay_half2(void) ALWAYS_INLINE; | ||
194 | inline static | ||
195 | void serial_delay_half2(void) { | ||
196 | _delay_us(SERIAL_DELAY_HALF2); | ||
197 | } | ||
198 | |||
199 | inline static void serial_output(void) ALWAYS_INLINE; | ||
200 | inline static | ||
201 | void serial_output(void) { | ||
202 | SERIAL_PIN_DDR |= SERIAL_PIN_MASK; | ||
203 | } | ||
204 | |||
205 | // make the serial pin an input with pull-up resistor | ||
206 | inline static void serial_input_with_pullup(void) ALWAYS_INLINE; | ||
207 | inline static | ||
208 | void serial_input_with_pullup(void) { | ||
209 | SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; | ||
210 | SERIAL_PIN_PORT |= SERIAL_PIN_MASK; | ||
211 | } | ||
212 | |||
213 | inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; | ||
214 | inline static | ||
215 | uint8_t serial_read_pin(void) { | ||
216 | return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); | ||
217 | } | ||
218 | |||
219 | inline static void serial_low(void) ALWAYS_INLINE; | ||
220 | inline static | ||
221 | void serial_low(void) { | ||
222 | SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; | ||
223 | } | ||
224 | |||
225 | inline static void serial_high(void) ALWAYS_INLINE; | ||
226 | inline static | ||
227 | void serial_high(void) { | ||
228 | SERIAL_PIN_PORT |= SERIAL_PIN_MASK; | ||
229 | } | ||
230 | |||
231 | void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) | ||
232 | { | ||
233 | Transaction_table = sstd_table; | ||
234 | Transaction_table_size = (uint8_t)sstd_table_size; | ||
235 | serial_output(); | ||
236 | serial_high(); | ||
237 | } | ||
238 | |||
239 | void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) | ||
240 | { | ||
241 | Transaction_table = sstd_table; | ||
242 | Transaction_table_size = (uint8_t)sstd_table_size; | ||
243 | serial_input_with_pullup(); | ||
244 | |||
245 | // Enable INT0-INT3,INT6 | ||
246 | EIMSK |= EIMSK_BIT; | ||
247 | #if SERIAL_PIN_MASK == _BV(PE6) | ||
248 | // Trigger on falling edge of INT6 | ||
249 | EICRB &= EICRx_BIT; | ||
250 | #else | ||
251 | // Trigger on falling edge of INT0-INT3 | ||
252 | EICRA &= EICRx_BIT; | ||
253 | #endif | ||
254 | } | ||
255 | |||
256 | // Used by the sender to synchronize timing with the reciver. | ||
257 | static void sync_recv(void) NO_INLINE; | ||
258 | static | ||
259 | void sync_recv(void) { | ||
260 | for (uint8_t i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { | ||
261 | } | ||
262 | // This shouldn't hang if the target disconnects because the | ||
263 | // serial line will float to high if the target does disconnect. | ||
264 | while (!serial_read_pin()); | ||
265 | } | ||
266 | |||
267 | // Used by the reciver to send a synchronization signal to the sender. | ||
268 | static void sync_send(void) NO_INLINE; | ||
269 | static | ||
270 | void sync_send(void) { | ||
271 | serial_low(); | ||
272 | serial_delay(); | ||
273 | serial_high(); | ||
274 | } | ||
275 | |||
276 | // Reads a byte from the serial line | ||
277 | static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) NO_INLINE; | ||
278 | static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { | ||
279 | uint8_t byte, i, p, pb; | ||
280 | |||
281 | _delay_sub_us(READ_WRITE_START_ADJUST); | ||
282 | for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) { | ||
283 | serial_delay_half1(); // read the middle of pulses | ||
284 | if( serial_read_pin() ) { | ||
285 | byte = (byte << 1) | 1; p ^= 1; | ||
286 | } else { | ||
287 | byte = (byte << 1) | 0; p ^= 0; | ||
288 | } | ||
289 | _delay_sub_us(READ_WRITE_WIDTH_ADJUST); | ||
290 | serial_delay_half2(); | ||
291 | } | ||
292 | /* recive parity bit */ | ||
293 | serial_delay_half1(); // read the middle of pulses | ||
294 | pb = serial_read_pin(); | ||
295 | _delay_sub_us(READ_WRITE_WIDTH_ADJUST); | ||
296 | serial_delay_half2(); | ||
297 | |||
298 | *pterrcount += (p != pb)? 1 : 0; | ||
299 | |||
300 | return byte; | ||
301 | } | ||
302 | |||
303 | // Sends a byte with MSB ordering | ||
304 | void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; | ||
305 | void serial_write_chunk(uint8_t data, uint8_t bit) { | ||
306 | uint8_t b, p; | ||
307 | for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) { | ||
308 | if(data & b) { | ||
309 | serial_high(); p ^= 1; | ||
310 | } else { | ||
311 | serial_low(); p ^= 0; | ||
312 | } | ||
313 | serial_delay(); | ||
314 | } | ||
315 | /* send parity bit */ | ||
316 | if(p & 1) { serial_high(); } | ||
317 | else { serial_low(); } | ||
318 | serial_delay(); | ||
319 | |||
320 | serial_low(); // sync_send() / senc_recv() need raise edge | ||
321 | } | ||
322 | |||
323 | static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE; | ||
324 | static | ||
325 | void serial_send_packet(uint8_t *buffer, uint8_t size) { | ||
326 | for (uint8_t i = 0; i < size; ++i) { | ||
327 | uint8_t data; | ||
328 | data = buffer[i]; | ||
329 | sync_send(); | ||
330 | serial_write_chunk(data,8); | ||
331 | } | ||
332 | } | ||
333 | |||
334 | static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) NO_INLINE; | ||
335 | static | ||
336 | uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) { | ||
337 | uint8_t pecount = 0; | ||
338 | for (uint8_t i = 0; i < size; ++i) { | ||
339 | uint8_t data; | ||
340 | sync_recv(); | ||
341 | data = serial_read_chunk(&pecount, 8); | ||
342 | buffer[i] = data; | ||
343 | } | ||
344 | return pecount == 0; | ||
345 | } | ||
346 | |||
347 | inline static | ||
348 | void change_sender2reciver(void) { | ||
349 | sync_send(); //0 | ||
350 | serial_delay_half1(); //1 | ||
351 | serial_low(); //2 | ||
352 | serial_input_with_pullup(); //2 | ||
353 | serial_delay_half1(); //3 | ||
354 | } | ||
355 | |||
356 | inline static | ||
357 | void change_reciver2sender(void) { | ||
358 | sync_recv(); //0 | ||
359 | serial_delay(); //1 | ||
360 | serial_low(); //3 | ||
361 | serial_output(); //3 | ||
362 | serial_delay_half1(); //4 | ||
363 | } | ||
364 | |||
365 | static inline uint8_t nibble_bits_count(uint8_t bits) | ||
366 | { | ||
367 | bits = (bits & 0x5) + (bits >> 1 & 0x5); | ||
368 | bits = (bits & 0x3) + (bits >> 2 & 0x3); | ||
369 | return bits; | ||
370 | } | ||
371 | |||
372 | // interrupt handle to be used by the target device | ||
373 | ISR(SERIAL_PIN_INTERRUPT) { | ||
374 | |||
375 | #ifndef SERIAL_USE_MULTI_TRANSACTION | ||
376 | serial_low(); | ||
377 | serial_output(); | ||
378 | SSTD_t *trans = Transaction_table; | ||
379 | #else | ||
380 | // recive transaction table index | ||
381 | uint8_t tid, bits; | ||
382 | uint8_t pecount = 0; | ||
383 | sync_recv(); | ||
384 | bits = serial_read_chunk(&pecount,7); | ||
385 | tid = bits>>3; | ||
386 | bits = (bits&7) != nibble_bits_count(tid); | ||
387 | if( bits || pecount> 0 || tid > Transaction_table_size ) { | ||
388 | return; | ||
389 | } | ||
390 | serial_delay_half1(); | ||
391 | |||
392 | serial_high(); // response step1 low->high | ||
393 | serial_output(); | ||
394 | _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); | ||
395 | SSTD_t *trans = &Transaction_table[tid]; | ||
396 | serial_low(); // response step2 ack high->low | ||
397 | #endif | ||
398 | |||
399 | // target send phase | ||
400 | if( trans->target2initiator_buffer_size > 0 ) | ||
401 | serial_send_packet((uint8_t *)trans->target2initiator_buffer, | ||
402 | trans->target2initiator_buffer_size); | ||
403 | // target switch to input | ||
404 | change_sender2reciver(); | ||
405 | |||
406 | // target recive phase | ||
407 | if( trans->initiator2target_buffer_size > 0 ) { | ||
408 | if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, | ||
409 | trans->initiator2target_buffer_size) ) { | ||
410 | *trans->status = TRANSACTION_ACCEPTED; | ||
411 | } else { | ||
412 | *trans->status = TRANSACTION_DATA_ERROR; | ||
413 | } | ||
414 | } else { | ||
415 | *trans->status = TRANSACTION_ACCEPTED; | ||
416 | } | ||
417 | |||
418 | sync_recv(); //weit initiator output to high | ||
419 | } | ||
420 | |||
421 | ///////// | ||
422 | // start transaction by initiator | ||
423 | // | ||
424 | // int soft_serial_transaction(int sstd_index) | ||
425 | // | ||
426 | // Returns: | ||
427 | // TRANSACTION_END | ||
428 | // TRANSACTION_NO_RESPONSE | ||
429 | // TRANSACTION_DATA_ERROR | ||
430 | // this code is very time dependent, so we need to disable interrupts | ||
431 | #ifndef SERIAL_USE_MULTI_TRANSACTION | ||
432 | int soft_serial_transaction(void) { | ||
433 | SSTD_t *trans = Transaction_table; | ||
434 | #else | ||
435 | int soft_serial_transaction(int sstd_index) { | ||
436 | if( sstd_index > Transaction_table_size ) | ||
437 | return TRANSACTION_TYPE_ERROR; | ||
438 | SSTD_t *trans = &Transaction_table[sstd_index]; | ||
439 | #endif | ||
440 | cli(); | ||
441 | |||
442 | // signal to the target that we want to start a transaction | ||
443 | serial_output(); | ||
444 | serial_low(); | ||
445 | _delay_us(SLAVE_INT_WIDTH_US); | ||
446 | |||
447 | #ifndef SERIAL_USE_MULTI_TRANSACTION | ||
448 | // wait for the target response | ||
449 | serial_input_with_pullup(); | ||
450 | _delay_us(SLAVE_INT_RESPONSE_TIME); | ||
451 | |||
452 | // check if the target is present | ||
453 | if (serial_read_pin()) { | ||
454 | // target failed to pull the line low, assume not present | ||
455 | serial_output(); | ||
456 | serial_high(); | ||
457 | *trans->status = TRANSACTION_NO_RESPONSE; | ||
458 | sei(); | ||
459 | return TRANSACTION_NO_RESPONSE; | ||
460 | } | ||
461 | |||
462 | #else | ||
463 | // send transaction table index | ||
464 | int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index)); | ||
465 | sync_send(); | ||
466 | _delay_sub_us(TID_SEND_ADJUST); | ||
467 | serial_write_chunk(tid, 7); | ||
468 | serial_delay_half1(); | ||
469 | |||
470 | // wait for the target response (step1 low->high) | ||
471 | serial_input_with_pullup(); | ||
472 | while( !serial_read_pin() ) { | ||
473 | _delay_sub_us(2); | ||
474 | } | ||
475 | |||
476 | // check if the target is present (step2 high->low) | ||
477 | for( int i = 0; serial_read_pin(); i++ ) { | ||
478 | if (i > SLAVE_INT_ACK_WIDTH + 1) { | ||
479 | // slave failed to pull the line low, assume not present | ||
480 | serial_output(); | ||
481 | serial_high(); | ||
482 | *trans->status = TRANSACTION_NO_RESPONSE; | ||
483 | sei(); | ||
484 | return TRANSACTION_NO_RESPONSE; | ||
485 | } | ||
486 | _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); | ||
487 | } | ||
488 | #endif | ||
489 | |||
490 | // initiator recive phase | ||
491 | // if the target is present syncronize with it | ||
492 | if( trans->target2initiator_buffer_size > 0 ) { | ||
493 | if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, | ||
494 | trans->target2initiator_buffer_size) ) { | ||
495 | serial_output(); | ||
496 | serial_high(); | ||
497 | *trans->status = TRANSACTION_DATA_ERROR; | ||
498 | sei(); | ||
499 | return TRANSACTION_DATA_ERROR; | ||
500 | } | ||
501 | } | ||
502 | |||
503 | // initiator switch to output | ||
504 | change_reciver2sender(); | ||
505 | |||
506 | // initiator send phase | ||
507 | if( trans->initiator2target_buffer_size > 0 ) { | ||
508 | serial_send_packet((uint8_t *)trans->initiator2target_buffer, | ||
509 | trans->initiator2target_buffer_size); | ||
510 | } | ||
511 | |||
512 | // always, release the line when not in use | ||
513 | sync_send(); | ||
514 | |||
515 | *trans->status = TRANSACTION_END; | ||
516 | sei(); | ||
517 | return TRANSACTION_END; | ||
518 | } | ||
519 | |||
520 | #ifdef SERIAL_USE_MULTI_TRANSACTION | ||
521 | int soft_serial_get_and_clean_status(int sstd_index) { | ||
522 | SSTD_t *trans = &Transaction_table[sstd_index]; | ||
523 | cli(); | ||
524 | int retval = *trans->status; | ||
525 | *trans->status = 0;; | ||
526 | sei(); | ||
527 | return retval; | ||
528 | } | ||
529 | #endif | ||
530 | |||
531 | #endif | ||
532 | |||
533 | // Helix serial.c history | ||
534 | // 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) | ||
535 | // 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) | ||
536 | // (adjusted with avr-gcc 4.9.2) | ||
537 | // 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) | ||
538 | // (adjusted with avr-gcc 4.9.2) | ||
539 | // 2018-8-11 add support multi-type transaction (#3608, feb5e4aae) | ||
540 | // (adjusted with avr-gcc 4.9.2) | ||
541 | // 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff) | ||
542 | // (adjusted with avr-gcc 7.3.0) | ||
543 | // 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66) | ||
544 | // (adjusted with avr-gcc 5.4.0, 7.3.0) | ||
545 | // 2018-12-17 copy to TOP/quantum/split_common/ and remove backward compatibility code (#4669) | ||
diff --git a/keyboards/ai03/orbit/serial.h b/keyboards/ai03/orbit/serial.h new file mode 100644 index 000000000..1c1e64006 --- /dev/null +++ b/keyboards/ai03/orbit/serial.h | |||
@@ -0,0 +1,62 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include <stdbool.h> | ||