aboutsummaryrefslogtreecommitdiff
path: root/keyboards/mechlovin/serratus
diff options
context:
space:
mode:
authormechlovin <57231893+mechlovin@users.noreply.github.com>2021-07-14 13:55:52 -0700
committerGitHub <noreply@github.com>2021-07-14 13:55:52 -0700
commit18c6e1d46d36b27a6db64c85b306515e42e94b12 (patch)
tree92cc18461e56130f67e11eb29bbd2555a68c04d6 /keyboards/mechlovin/serratus
parent867d60bd64b854cd68cd9ae93de27d9eff4ca0b6 (diff)
downloadqmk_firmware-18c6e1d46d36b27a6db64c85b306515e42e94b12.tar.gz
qmk_firmware-18c6e1d46d36b27a6db64c85b306515e42e94b12.zip
[Keyboard] Add Serratus PCB (#13281)
Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'keyboards/mechlovin/serratus')
-rw-r--r--keyboards/mechlovin/serratus/config.h89
-rw-r--r--keyboards/mechlovin/serratus/info.json105
-rw-r--r--keyboards/mechlovin/serratus/keymaps/default/keymap.c27
-rw-r--r--keyboards/mechlovin/serratus/keymaps/default/readme.md1
-rw-r--r--keyboards/mechlovin/serratus/keymaps/via/keymap.c52
-rw-r--r--keyboards/mechlovin/serratus/keymaps/via/readme.md1
-rw-r--r--keyboards/mechlovin/serratus/keymaps/via/rules.mk2
-rw-r--r--keyboards/mechlovin/serratus/matrix.c388
-rw-r--r--keyboards/mechlovin/serratus/readme.md21
-rw-r--r--keyboards/mechlovin/serratus/rules.mk25
-rw-r--r--keyboards/mechlovin/serratus/serratus.c17
-rw-r--r--keyboards/mechlovin/serratus/serratus.h35
12 files changed, 763 insertions, 0 deletions
diff --git a/keyboards/mechlovin/serratus/config.h b/keyboards/mechlovin/serratus/config.h
new file mode 100644
index 000000000..055557b3a
--- /dev/null
+++ b/keyboards/mechlovin/serratus/config.h
@@ -0,0 +1,89 @@
1/*
2Copyright 2021 mechlovin
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#pragma once
19
20#include "config_common.h"
21
22/* USB Device descriptor parameter */
23#define VENDOR_ID 0x4D4C // ML
24#define PRODUCT_ID 0x0870
25#define DEVICE_VER 0x0001
26#define PRODUCT Serratus Rev.1
27/* key matrix size */
28#define MATRIX_ROWS 6
29#define MATRIX_COLS 17
30
31
32/*
33 * Keyboard Matrix Assignments
34 *
35 * Change this to how you wired your keyboard
36 * COLS: AVR pins used for columns, left to right
37 * ROWS: AVR pins used for rows, top to bottom
38 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
39 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
40 *
41 */
42#define MATRIX_ROW_PINS { D5, D2, D4, D3, D0, D1 }
43#define UNUSED_PINS
44
45/* COL2ROW, ROW2COL*/
46#define DIODE_DIRECTION ROW2COL
47
48#define USB_POLLING_INTERVAL_MS 1
49
50
51#define LED_NUM_LOCK_PIN D7
52#define LED_CAPS_LOCK_PIN D6
53#define LED_SCROLL_LOCK_PIN B4
54#define LED_PIN_ON_STATE 1
55
56#define BACKLIGHT_PIN B6
57#define BACKLIGHT_LEVELS 3
58#define BACKLIGHT_BREATHING
59
60#ifdef RGBLIGHT_ENABLE
61#define RGB_DI_PIN E2
62#define RGBLED_NUM 24
63#define RGBLIGHT_HUE_STEP 8
64#define RGBLIGHT_SAT_STEP 8
65#define RGBLIGHT_VAL_STEP 8
66#define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
67#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
68/*== all animations enable ==*/
69#define RGBLIGHT_ANIMATIONS
70/*== or choose animations ==*/
71//# define RGBLIGHT_EFFECT_BREATHING
72//# define RGBLIGHT_EFFECT_RAINBOW_MOOD
73//# define RGBLIGHT_EFFECT_RAINBOW_SWIRL
74//# define RGBLIGHT_EFFECT_SNAKE
75//# define RGBLIGHT_EFFECT_KNIGHT
76//# define RGBLIGHT_EFFECT_CHRISTMAS
77//# define RGBLIGHT_EFFECT_STATIC_GRADIENT
78//# define RGBLIGHT_EFFECT_RGB_TEST
79//# define RGBLIGHT_EFFECT_ALTERNATING
80/*== customize breathing effect ==*/
81/*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
82//# define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
83/*==== use exp() and sin() ====*/
84//# define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
85//# define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
86#endif
87
88/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
89#define DEBOUNCE 5
diff --git a/keyboards/mechlovin/serratus/info.json b/keyboards/mechlovin/serratus/info.json
new file mode 100644
index 000000000..4c82c8374
--- /dev/null
+++ b/keyboards/mechlovin/serratus/info.json
@@ -0,0 +1,105 @@
1{
2 "keyboard_name": "Serratus",
3 "url": "",
4 "maintainer": "Mechlovin' Studio",
5 "width": 18.25,
6 "height": 6.25,
7 "layouts": {
8 "LAYOUT_all": {
9 "layout": [
10 {"label":"K00 (B0,B6)", "x":0, "y":0},
11 {"label":"K01 (B0,F4)", "x":2, "y":0},
12 {"label":"K02 (B0,C0)", "x":3, "y":0},
13 {"label":"K03 (B0,C1)", "x":4, "y":0},
14 {"label":"K04 (B0,C2)", "x":5, "y":0},
15 {"label":"K05 (B0,C3)", "x":6.5, "y":0},
16 {"label":"K06 (B0,C4)", "x":7.5, "y":0},
17 {"label":"K07 (B0,C5)", "x":8.5, "y":0},
18 {"label":"K08 (B0,C6)", "x":9.5, "y":0},
19 {"label":"K09 (B0,C7)", "x":11, "y":0},
20 {"label":"K0A (B0,D0)", "x":12, "y":0},
21 {"label":"K0B (B0,D1)", "x":13, "y":0},
22 {"label":"K0C (B0,D2)", "x":14, "y":0},
23 {"label":"K0E (B0,D4)", "x":15.25, "y":0},
24 {"label":"K0F (B0,D5)", "x":16.25, "y":0},
25 {"label":"K0G (B0,D6)", "x":17.25, "y":0},
26 {"label":"K10 (B1,B6)", "x":0, "y":1.25},
27 {"label":"K11 (B1,F4)", "x":1, "y":1.25},
28 {"label":"K12 (B1,C0)", "x":2, "y":1.25},
29 {"label":"K13 (B1,C1)", "x":3, "y":1.25},
30 {"label":"K14 (B1,C2)", "x":4, "y":1.25},
31 {"label":"K15 (B1,C3)", "x":5, "y":1.25},
32 {"label":"K16 (B1,C4)", "x":6, "y":1.25},
33 {"label":"K17 (B1,C5)", "x":7, "y":1.25},
34 {"label":"K18 (B1,C6)", "x":8, "y":1.25},
35 {"label":"K19 (B1,C7)", "x":9, "y":1.25},
36 {"label":"K1A (B1,D0)", "x":10, "y":1.25},
37 {"label":"K1B (B1,D1)", "x":11, "y":1.25},
38 {"label":"K1C (B1,D2)", "x":12, "y":1.25},
39 {"label":"K1D (B1,D3)", "x":13, "y":1.25},
40 {"label":"K0D (B0,D3)", "x":14, "y":1.25},
41 {"label":"K1E (B1,D4)", "x":15.25, "y":1.25},
42 {"label":"K1F (B1,D5)", "x":16.25, "y":1.25},
43 {"label":"K1G (B1,D6)", "x":17.25, "y":1.25},
44 {"label":"K20 (B2,B6)", "x":0, "y":2.25, "w":1.5},
45 {"label":"K21 (B2,F4)", "x":1.5, "y":2.25},
46 {"label":"K22 (B2,C0)", "x":2.5, "y":2.25},
47 {"label":"K23 (B2,C1)", "x":3.5, "y":2.25},
48 {"label":"K24 (B2,C2)", "x":4.5, "y":2.25},
49 {"label":"K25 (B2,C3)", "x":5.5, "y":2.25},
50 {"label":"K26 (B2,C4)", "x":6.5, "y":2.25},
51 {"label":"K27 (B2,C5)", "x":7.5, "y":2.25},
52 {"label":"K28 (B2,C6)", "x":8.5, "y":2.25},
53 {"label":"K29 (B2,C7)", "x":9.5, "y":2.25},
54 {"label":"K2A (B2,D0)", "x":10.5, "y":2.25},
55 {"label":"K2B (B2,D1)", "x":11.5, "y":2.25},
56 {"label":"K2C (B2,D2)", "x":12.5, "y":2.25},
57 {"label":"K2D (B2,D3)", "x":13.5, "y":2.25, "w":1.5},
58 {"label":"K2E (B2,D4)", "x":15.25, "y":2.25},
59 {"label":"K2F (B2,D5)", "x":16.25, "y":2.25},
60 {"label":"K2G (B2,D6)", "x":17.25, "y":2.25},
61 {"label":"K30 (B3,B6)", "x":0, "y":3.25, "w":1.75},
62 {"label":"K31 (B3,F4)", "x":1.75, "y":3.25},
63 {"label":"K32 (B3,C0)", "x":2.75, "y":3.25},
64 {"label":"K33 (B3,C1)", "x":3.75, "y":3.25},
65 {"label":"K34 (B3,C2)", "x":4.75, "y":3.25},
66 {"label":"K35 (B3,C3)", "x":5.75, "y":3.25},
67 {"label":"K36 (B3,C4)", "x":6.75, "y":3.25},
68 {"label":"K37 (B3,C5)", "x":7.75, "y":3.25},
69 {"label":"K38 (B3,C6)", "x":8.75, "y":3.25},
70 {"label":"K39 (B3,C7)", "x":9.75, "y":3.25},
71 {"label":"K3A (B3,D0)", "x":10.75, "y":3.25},
72 {"label":"K3B (B3,D1)", "x":11.75, "y":3.25},
73 {"label":"K3C (B3,D2)", "x":12.75, "y":3.25},
74 {"label":"K3D (B3,D3)", "x":13.75, "y":3.25, "w":1.25},
75 {"label":"K40 (B4,B6)", "x":0, "y":4.25, "w":1.25},
76 {"label":"K41 (B4,F4)", "x":1.25, "y":4.25},
77 {"label":"K42 (B4,C0)", "x":2.25, "y":4.25},
78 {"label":"K43 (B4,C1)", "x":3.25, "y":4.25},
79 {"label":"K44 (B4,C2)", "x":4.25, "y":4.25},
80 {"label":"K45 (B4,C3)", "x":5.25, "y":4.25},
81 {"label":"K46 (B4,C4)", "x":6.25, "y":4.25},
82 {"label":"K47 (B4,C5)", "x":7.25, "y":4.25},
83 {"label":"K48 (B4,C6)", "x":8.25, "y":4.25},
84 {"label":"K49 (B4,C7)", "x":9.25, "y":4.25},
85 {"label":"K4A (B4,D0)", "x":10.25, "y":4.25},
86 {"label":"K4B (B4,D1)", "x":11.25, "y":4.25},
87 {"label":"K4C (B4,D2)", "x":12.25, "y":4.25, "w":1.75},
88 {"label":"K4D (B4,D3)", "x":14, "y":4.25},
89 {"label":"K4F (B4,D5)", "x":16.25, "y":4.25},
90 {"label":"K50 (B5,B6)", "x":0, "y":5.25, "w":1.25},
91 {"label":"K51 (B5,F4)", "x":1.25, "y":5.25, "w":1.25},
92 {"label":"K52 (B5,C0)", "x":2.5, "y":5.25, "w":1.25},
93 {"label":"K56 (B5,C4)", "x":3.75, "y":5.25, "w":6.25},
94 {"label":"K5A (B5,D0)", "x":10, "y":5.25, "w":1.25},
95 {"label":"K5B (B5,D1)", "x":11.25, "y":5.25, "w":1.25},
96 {"label":"K5C (B5,D2)", "x":12.5, "y":5.25, "w":1.25},
97 {"label":"K5D (B5,D3)", "x":13.75, "y":5.25, "w":1.25},
98 {"label":"K5E (B5,D4)", "x":15.25, "y":5.25},
99 {"label":"K5F (B5,D5)", "x":16.25, "y":5.25},
100 {"label":"K5G (B5,D6)", "x":17.25, "y":5.25}
101 ]
102 }
103 }
104 ,"meta": "https://noroadsleft.github.io/kbf_qmk_converter/"
105}
diff --git a/keyboards/mechlovin/serratus/keymaps/default/keymap.c b/keyboards/mechlovin/serratus/keymaps/default/keymap.c
new file mode 100644
index 000000000..a98abef90
--- /dev/null
+++ b/keyboards/mechlovin/serratus/keymaps/default/keymap.c
@@ -0,0 +1,27 @@
1/* Copyright 2020 Team Mechlovin'
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
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 [0] = LAYOUT_all(
20 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,
21 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_DEL, KC_INS, KC_HOME, KC_PGUP,
22 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN,
23 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_HASH, KC_ENT,
24 KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_LSFT, KC_UP,
25 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, KC_LGUI,MO(1), KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT
26 ),
27};
diff --git a/keyboards/mechlovin/serratus/keymaps/default/readme.md b/keyboards/mechlovin/serratus/keymaps/default/readme.md
new file mode 100644
index 000000000..206166171
--- /dev/null
+++ b/keyboards/mechlovin/serratus/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default keymap for serratus
diff --git a/keyboards/mechlovin/serratus/keymaps/via/keymap.c b/keyboards/mechlovin/serratus/keymaps/via/keymap.c
new file mode 100644
index 000000000..22250ad0e
--- /dev/null
+++ b/keyboards/mechlovin/serratus/keymaps/via/keymap.c
@@ -0,0 +1,52 @@
1/* Copyright 2020 Team Mechlovin'
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
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 [0] = LAYOUT_all(
20 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,
21 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_DEL, KC_INS, KC_HOME, KC_PGUP,
22 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN,
23 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_HASH, KC_ENT,
24 KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_LSFT, KC_UP,
25 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, KC_LGUI, MO(1), KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT
26 ),
27 [1] = LAYOUT_all(
28 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,
29 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, KC_TRNS,
30 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,
31 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,
32 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,
33 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
34 ),
35 [2] = LAYOUT_all(
36 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,
37 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, KC_TRNS,
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, 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,
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,
41 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
42 ),
43 [3] = LAYOUT_all(
44 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,
45 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, KC_TRNS,
46 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,
47 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,
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,
49 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
50 ),
51
52};
diff --git a/keyboards/mechlovin/serratus/keymaps/via/readme.md b/keyboards/mechlovin/serratus/keymaps/via/readme.md
new file mode 100644
index 000000000..3481201f9
--- /dev/null
+++ b/keyboards/mechlovin/serratus/keymaps/via/readme.md
@@ -0,0 +1 @@
# The via keymap for serratus
diff --git a/keyboards/mechlovin/serratus/keymaps/via/rules.mk b/keyboards/mechlovin/serratus/keymaps/via/rules.mk
new file mode 100644
index 000000000..36b7ba9cb
--- /dev/null
+++ b/keyboards/mechlovin/serratus/keymaps/via/rules.mk
@@ -0,0 +1,2 @@
1VIA_ENABLE = yes
2LTO_ENABLE = yes
diff --git a/keyboards/mechlovin/serratus/matrix.c b/keyboards/mechlovin/serratus/matrix.c
new file mode 100644
index 000000000..b1b0d2065
--- /dev/null
+++ b/keyboards/mechlovin/serratus/matrix.c
@@ -0,0 +1,388 @@
1/*
2Copyright 2012-2018 Jun Wako, Jack Humbert, Yiancar
3Copyright 2019 Evy Dekkers
4
5This program is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 2 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#include <stdint.h>
20#include <stdbool.h>
21#include "wait.h"
22#include "util.h"
23#include "matrix.h"
24#include "debounce.h"
25#include "quantum.h"
26
27#ifdef DIRECT_PINS
28static pin_t direct_pins[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS;
29#elif (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW)
30static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
31//static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
32#endif
33
34// matrix code
35
36#ifdef DIRECT_PINS
37
38static void init_pins(void) {
39 for (int row = 0; row < MATRIX_ROWS; row++) {
40 for (int col = 0; col < MATRIX_COLS; col++) {
41 pin_t pin = direct_pins[row][col];
42 if (pin != NO_PIN) {
43 setPinInputHigh(pin);
44 }
45 }
46 }
47}
48
49static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
50 matrix_row_t last_row_value = current_matrix[current_row];
51 current_matrix[current_row] = 0;
52
53 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
54 pin_t pin = direct_pins[current_row][col_index];
55 if (pin != NO_PIN) {
56 current_matrix[current_row] |= readPin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index);
57 }
58 }
59
60 return (last_row_value != current_matrix[current_row]);
61}
62
63#elif (DIODE_DIRECTION == ROW2COL)
64
65/* Cols 0 - 16
66 * These columns use two 74HC138 3 to 8 bit demultiplexer. B0, F1 is the enable pin, must be set high (1) to use it.
67 *
68 * col / pin: PB5 PB7 PF0 PB0 PF1 PE6
69 * 0: 0 ── 0 ── 0 1 ── 0 0
70 * ────────────────────────────────────────────
71 * 1: 0 ── 0 ── 1 1 ── 0 0
72 * ────────────────────────────────────────────
73 * 2: 0 ── 1 ── 0 1 ── 0 0
74 * ────────────────────────────────────────────
75 * 3: 0 ── 1 ── 1 1 ── 0 0
76 * ────────────────────────────────────────────
77 * 4: 1 ── 0 ── 0 1 ── 0 0
78 * ────────────────────────────────────────────
79 * 5: 1 ── 0 ── 1 1 ── 0 0
80 * ────────────────────────────────────────────
81 * 6: 1 ── 1 ── 0 1 ── 0 0
82 * ────────────────────────────────────────────
83 * 7: 1 ── 1 ── 1 1 ── 0 0
84 * ────────────────────────────────────────────
85 * 8: 0 ── 0 ── 0 0 ── 1 0
86 * ────────────────────────────────────────────
87 * 9: 0 ── 0 ── 1 0 ── 1 0
88 * ────────────────────────────────────────────
89 *10: 0 ── 1 ── 0 0 ── 1 0
90 * ────────────────────────────────────────────
91 *11: 0 ── 1 ── 1 0 ── 1 0
92 * ────────────────────────────────────────────
93 *12: 1 ── 0 ── 0 0 ── 1 0
94 * ────────────────────────────────────────────
95 *13: 1 ── 0 ── 1 0 ── 1 0
96 * ────────────────────────────────────────────
97 *14: 1 ── 1 ── 1 0 ── 1 0
98 * ────────────────────────────────────────────
99 *15: 1 ── 1 ── 0 0 ── 1 0
100 * ────────────────────────────────────────────
101 *16: 0 ── 0 ── 0 0 ── 0 1
102 *
103 */
104static void select_col(uint8_t col) {
105 switch (col) {
106 case 0:
107 writePinLow(B5);
108 writePinLow(B7);
109 writePinLow(F0);
110 writePinHigh(B0);
111 break;
112 case 1:
113 writePinLow(B5);
114 writePinLow(B7);
115 writePinHigh(F0);
116 writePinHigh(B0);
117 break;
118 case 2:
119 writePinLow(B5);
120 writePinHigh(B7);
121 writePinLow(F0);
122 writePinHigh(B0);
123 break;
124 case 3:
125 writePinLow(B5);
126 writePinHigh(B7);
127 writePinHigh(F0);
128 writePinHigh(B0);
129 break;
130 case 4:
131 writePinHigh(B5);
132 writePinLow(B7);
133 writePinLow(F0);
134 writePinHigh(B0);
135 break;
136 case 5:
137 writePinHigh(B5);
138 writePinLow(B7);
139 writePinHigh(F0);
140 writePinHigh(B0);
141 break;
142 case 6:
143 writePinHigh(B5);
144 writePinHigh(B7);
145 writePinLow(F0);
146 writePinHigh(B0);
147 break;
148 case 7:
149 writePinHigh(B5);
150 writePinHigh(B7);
151 writePinHigh(F0);
152 writePinHigh(B0);
153 break;
154 case 8:
155 writePinLow(B5);
156 writePinLow(B7);
157 writePinLow(F0);
158 writePinHigh(F1);
159 break;
160 case 9:
161 writePinLow(B5);
162 writePinLow(B7);
163 writePinHigh(F0);
164 writePinHigh(F1);
165 break;
166 case 10:
167 writePinLow(B5);
168 writePinHigh(B7);
169 writePinLow(F0);
170 writePinHigh(F1);
171 break;
172 case 11:
173 writePinLow(B5);
174 writePinHigh(B7);
175 writePinHigh(F0);
176 writePinHigh(F1);
177 break;
178 case 12:
179 writePinHigh(B5);
180 writePinLow(B7);
181 writePinLow(F0);
182 writePinHigh(F1);
183 break;
184 case 13:
185 writePinHigh(B5);
186 writePinLow(B7);
187 writePinHigh(F0);
188 writePinHigh(F1);
189 break;
190 case 14:
191 writePinHigh(B5);
192 writePinHigh(B7);
193 writePinHigh(F0);
194 writePinHigh(F1);
195 break;
196 case 15:
197 writePinHigh(B5);
198 writePinHigh(B7);
199 writePinLow(F0);
200 writePinHigh(F1);
201 break;
202 case 16:
203 writePinLow(E6);
204 break;
205 }
206}
207
208static void unselect_col(uint8_t col) {
209 switch (col) {
210 case 0:
211 writePinHigh(B5);
212 writePinHigh(B7);
213 writePinHigh(F0);
214 writePinLow(B0);
215 break;
216 case 1:
217 writePinHigh(B5);
218 writePinHigh(B7);
219 writePinLow(F0);
220 writePinLow(B0);
221 break;
222 case 2:
223 writePinHigh(B5);
224 writePinLow(B7);
225 writePinHigh(F0);
226 writePinLow(B0);
227 break;
228 case 3:
229 writePinHigh(B5);
230 writePinLow(B7);
231 writePinLow(F0);
232 writePinLow(B0);
233 break;
234 case 4:
235 writePinLow(B5);
236 writePinHigh(B7);
237 writePinHigh(F0);
238 writePinLow(B0);
239 break;
240 case 5:
241 writePinLow(B5);
242 writePinHigh(B7);
243 writePinLow(F0);
244 writePinLow(B0);
245 break;
246 case 6:
247 writePinLow(B5);
248 writePinLow(B7);
249 writePinHigh(F0);
250 writePinLow(B0);
251 break;
252 case 7:
253 writePinLow(B5);
254 writePinLow(B7);
255 writePinLow(F0);
256 writePinLow(B0);
257 break;
258 case 8:
259 writePinHigh(B5);
260 writePinHigh(B7);
261 writePinHigh(F0);
262 writePinLow(F1);
263 break;
264 case 9:
265 writePinHigh(B5);
266 writePinHigh(B7);
267 writePinLow(F0);
268 writePinLow(F1);
269 break;
270 case 10:
271 writePinHigh(B5);
272 writePinLow(B7);
273 writePinHigh(F0);
274 writePinLow(F1);
275 break;
276 case 11:
277 writePinHigh(B5);
278 writePinLow(B7);
279 writePinLow(F0);
280 writePinLow(F1);
281 break;
282 case 12:
283 writePinLow(B5);
284 writePinHigh(B7);
285 writePinHigh(F0);
286 writePinLow(F1);
287 break;
288 case 13:
289 writePinLow(B5);
290 writePinHigh(B7);
291 writePinLow(F0);
292 writePinLow(F1);
293 break;
294 case 14:
295 writePinLow(B5);
296 writePinLow(B7);
297 writePinLow(F0);
298 writePinLow(F1);
299 break;
300 case 15:
301 writePinLow(B5);
302 writePinLow(B7);
303 writePinHigh(F0);
304 writePinLow(F1);
305 break;
306 case 16:
307 writePinHigh(E6);
308 break;
309 }
310}
311
312static void unselect_cols(void) {
313 //Native
314 writePinHigh(E6);
315
316 //Demultiplexer
317 writePinLow(B0);
318 writePinLow(F1);
319 writePinHigh(B5);
320 writePinHigh(B7);
321 writePinHigh(F0);
322}
323
324static void init_pins(void) {
325 unselect_cols();
326 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
327 setPinInputHigh(row_pins[x]);
328 }
329 setPinOutput(B5);
330 setPinOutput(B7);
331 setPinOutput(F0);
332 setPinOutput(B0);
333 setPinOutput(F1);
334 setPinOutput(E6);
335}
336
337static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) {
338 bool matrix_changed = false;
339
340 // Select col and wait for col selecton to stabilize
341 select_col(current_col);
342 wait_us(30);
343
344 // For each row...
345 for (uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++) {
346 // Store last value of row prior to reading
347 matrix_row_t last_row_value = current_matrix[row_index];
348
349 // Check row pin state
350 if (readPin(row_pins[row_index]) == 0) {
351 // Pin LO, set col bit
352 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col);
353 } else {
354 // Pin HI, clear col bit
355 current_matrix[row_index] &= ~(MATRIX_ROW_SHIFTER << current_col);
356 }
357
358 // Determine if the matrix changed state
359 if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) {
360 matrix_changed = true;
361 }
362 }
363
364 // Unselect col
365 unselect_col(current_col);
366
367 return matrix_changed;
368}
369
370#endif
371
372void matrix_init_custom(void) {
373 // initialize key pins
374 init_pins();
375}
376
377bool matrix_scan_custom(matrix_row_t current_matrix[]) {
378 bool changed = false;
379
380#if defined(DIRECT_PINS) || (DIODE_DIRECTION == ROW2COL)
381 // Set col, read rows
382 for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
383 changed |= read_rows_on_col(current_matrix, current_col);
384 }
385#endif
386
387 return changed;
388}
diff --git a/keyboards/mechlovin/serratus/readme.md b/keyboards/mechlovin/serratus/readme.md
new file mode 100644
index 000000000..5181f4169
--- /dev/null
+++ b/keyboards/mechlovin/serratus/readme.md
@@ -0,0 +1,21 @@
1# serratus
2
3![serratus](https://i.imgur.com/VN38ogYh.jpeg)
4
5A TKL PCB TypeC for Serratus keyboard.
6
7* Keyboard Maintainer: [mechlovin](https://github.com/mechlovin)
8* Hardware Supported: Serratus, Atmega32u4
9* Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=112768.0)
10
11Make example for this keyboard (after setting up your build environment):
12
13 make mechlovin/serratus:default
14
15Flashing example for this keyboard:
16
17 make mechlovin/serratus:default:flash
18
19See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
20
21**Reset Key:** To put the Serratus PCB into bootloader, push reset swith on the bottom of the PCB.
diff --git a/keyboards/mechlovin/serratus/rules.mk b/keyboards/mechlovin/serratus/rules.mk
new file mode 100644
index 000000000..fed40192e
--- /dev/null
+++ b/keyboards/mechlovin/serratus/rules.mk
@@ -0,0 +1,25 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5BOOTLOADER = atmel-dfu
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
11MOUSEKEY_ENABLE = yes # Mouse keys
12EXTRAKEY_ENABLE = yes # Audio control and System control
13CONSOLE_ENABLE = no # Console for debug
14COMMAND_ENABLE = no # Commands for debug and configuration
15# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
16SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
18NKRO_ENABLE = yes # USB Nkey Rollover
19BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
20RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
21BLUETOOTH_ENABLE = no # Enable Bluetooth
22AUDIO_ENABLE = no # Audio output
23CUSTOM_MATRIX = lite
24
25SRC += matrix.c
diff --git a/keyboards/mechlovin/serratus/serratus.c b/keyboards/mechlovin/serratus/serratus.c
new file mode 100644
index 000000000..b396e57bf
--- /dev/null
+++ b/keyboards/mechlovin/serratus/serratus.c
@@ -0,0 +1,17 @@
1/* Copyright 2021 mechlovin
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 "serratus.h"
diff --git a/keyboards/mechlovin/serratus/serratus.h b/keyboards/mechlovin/serratus/serratus.h
new file mode 100644
index 000000000..fd04f7a22
--- /dev/null
+++ b/keyboards/mechlovin/serratus/serratus.h
@@ -0,0 +1,35 @@
1/* Copyright 2021 mechlovin
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19#include "quantum.h"
20
21#define LAYOUT_all( \
22 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, K0F, K0G, \
23 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K0D, K1E, K1F, K1G, \
24 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \
25 K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
26 K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4F, \
27 K50, K51, K52, K56, K5A, K5B, K5C, K5D, K5E, K5F, K5G \
28) { \
29 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G }, \
30 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G }, \
31 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G }, \
32 { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, KC_NO, KC_NO, KC_NO }, \
33 { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, KC_NO, K4F, KC_NO }, \
34 { K50, K51, K52, KC_NO, KC_NO, KC_NO, K56, KC_NO, KC_NO, KC_NO, K5A, K5B, K5C, K5D, K5E, K5F, K5G }, \
35}