diff options
-rw-r--r-- | keyboards/makrosu/config.h | 70 | ||||
-rw-r--r-- | keyboards/makrosu/info.json | 21 | ||||
-rw-r--r-- | keyboards/makrosu/keymaps/default/keymap.c | 133 | ||||
-rw-r--r-- | keyboards/makrosu/keymaps/via/keymap.c | 133 | ||||
-rw-r--r-- | keyboards/makrosu/keymaps/via/rules.mk | 1 | ||||
-rw-r--r-- | keyboards/makrosu/makrosu.c | 16 | ||||
-rw-r--r-- | keyboards/makrosu/makrosu.h | 20 | ||||
-rw-r--r-- | keyboards/makrosu/readme.md | 14 | ||||
-rw-r--r-- | keyboards/makrosu/rules.mk | 23 |
9 files changed, 431 insertions, 0 deletions
diff --git a/keyboards/makrosu/config.h b/keyboards/makrosu/config.h new file mode 100644 index 000000000..8a5214fe6 --- /dev/null +++ b/keyboards/makrosu/config.h | |||
@@ -0,0 +1,70 @@ | |||
1 | /* Copyright 2021 Valdydesu_ | ||
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 "config_common.h" | ||
20 | |||
21 | /* USB Device descriptor parameter */ | ||
22 | #define VENDOR_ID 0xAB69 | ||
23 | #define PRODUCT_ID 0x8585 | ||
24 | #define DEVICE_VER 0x0001 | ||
25 | #define MANUFACTURER valdydesu_ | ||
26 | #define PRODUCT makrosu | ||
27 | |||
28 | /* key matrix size */ | ||
29 | #define MATRIX_ROWS 1 | ||
30 | #define MATRIX_COLS 6 | ||
31 | |||
32 | /* key matrix pins */ | ||
33 | #define MATRIX_ROW_PINS { B6 } | ||
34 | #define MATRIX_COL_PINS { B2, B3, B1, F7, F6, F5} | ||
35 | #define UNUSED_PINS | ||
36 | |||
37 | #define ENCODERS_PAD_A { D1 } | ||
38 | #define ENCODERS_PAD_B { E6 } | ||
39 | #define ENCODER_DIRECTION_FLIP | ||
40 | #define TAP_CODE_DELAY 10 | ||
41 | /* COL2ROW or ROW2COL */ | ||
42 | #define DIODE_DIRECTION COL2ROW | ||
43 | |||
44 | #define BOOTMAGIC_LITE_ROW 0 | ||
45 | #define BOOTMAGIC_LITE_COLUMN 5 | ||
46 | /* number of backlight levels */ | ||
47 | |||
48 | #ifdef BACKLIGHT_PIN | ||
49 | #define BACKLIGHT_LEVELS 0 | ||
50 | #endif | ||
51 | |||
52 | |||
53 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
54 | #define LOCKING_SUPPORT_ENABLE | ||
55 | |||
56 | /* Locking resynchronize hack */ | ||
57 | #define LOCKING_RESYNC_ENABLE | ||
58 | |||
59 | |||
60 | |||
61 | // EEPROM usage | ||
62 | |||
63 | |||
64 | #ifdef RGB_DI_PIN | ||
65 | #define RGBLIGHT_ANIMATIONS | ||
66 | #define RGBLED_NUM 0 | ||
67 | #define RGBLIGHT_HUE_STEP 8 | ||
68 | #define RGBLIGHT_SAT_STEP 8 | ||
69 | #define RGBLIGHT_VAL_STEP 8 | ||
70 | #endif | ||
diff --git a/keyboards/makrosu/info.json b/keyboards/makrosu/info.json new file mode 100644 index 000000000..caf039ac6 --- /dev/null +++ b/keyboards/makrosu/info.json | |||
@@ -0,0 +1,21 @@ | |||
1 | { | ||
2 | "keyboard_name": "MakrOSU", | ||
3 | "url": "", | ||
4 | "maintainer": "Valdydesu_", | ||
5 | "width": 3, | ||
6 | "height": 2, | ||
7 | "layouts": { | ||
8 | "LAYOUT": { | ||
9 | "layout": [ | ||
10 | |||
11 | {"label" : "Esc", "x":0, "y":0}, | ||
12 | {"label" : "F1", "x":1, "y":0}, | ||
13 | {"label" : "F2", "x":2, "y":0}, | ||
14 | |||
15 | {"label" : "Lower", "x":0, "y":1}, | ||
16 | {"label" : "Z", "x":1.5, "y":1}, | ||
17 | {"label" : "X", "x":2.5, "y":1} | ||
18 | ] | ||
19 | } | ||
20 | } | ||
21 | } | ||
diff --git a/keyboards/makrosu/keymaps/default/keymap.c b/keyboards/makrosu/keymaps/default/keymap.c new file mode 100644 index 000000000..b7f60a414 --- /dev/null +++ b/keyboards/makrosu/keymaps/default/keymap.c | |||
@@ -0,0 +1,133 @@ | |||
1 | /* Copyright 2021 Valdydesu_ | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #include QMK_KEYBOARD_H | ||
18 | |||
19 | enum planck_layers { | ||
20 | _1, | ||
21 | _2, | ||
22 | _3, | ||
23 | _4 | ||
24 | |||
25 | }; | ||
26 | |||
27 | |||
28 | enum planck_keycodes { | ||
29 | L1 = SAFE_RANGE, | ||
30 | L2, | ||
31 | L3 | ||
32 | |||
33 | }; | ||
34 | |||
35 | #define LOWER MO(_4) | ||
36 | #define IND_1 D4 | ||
37 | #define IND_2 C6 | ||
38 | #define IND_3 D7 | ||
39 | |||
40 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
41 | |||
42 | [_1] = LAYOUT( | ||
43 | KC_ESC, KC_F1, KC_F2, | ||
44 | LOWER, KC_Z, KC_X), | ||
45 | |||
46 | [_2] = LAYOUT( | ||
47 | LALT(KC_TAB), LGUI(KC_TAB), LCTL(KC_S), | ||
48 | LOWER, LCTL(KC_C), LCTL(KC_V)), | ||
49 | |||
50 | [_3] = LAYOUT( | ||
51 | KC_TRNS, KC_TRNS, KC_TRNS, | ||
52 | KC_TRNS, KC_TRNS, KC_TRNS), | ||
53 | |||
54 | [_4] = LAYOUT( | ||
55 | L1, L2, L3, | ||
56 | _______, _______, _______), | ||
57 | |||
58 | }; | ||
59 | |||
60 | |||
61 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
62 | state = update_tri_layer_state(state, _4, X_PAUSE, X_PAUSE); | ||
63 | writePin(IND_1, layer_state_cmp(state, 1)); | ||
64 | writePin(IND_2, layer_state_cmp(state, 2)); | ||
65 | writePin(IND_3, layer_state_cmp(state, 3)); | ||
66 | return state; | ||
67 | } | ||
68 | |||
69 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
70 | switch (keycode) { | ||
71 | case L1: | ||
72 | if (record->event.pressed) { | ||
73 | set_single_persistent_default_layer(_1); | ||
74 | |||
75 | |||
76 | } | ||
77 | return false; | ||
78 | break; | ||
79 | case L2: | ||
80 | if (record->event.pressed) { | ||
81 | set_single_persistent_default_layer(_2); | ||
82 | |||
83 | } | ||
84 | return false; | ||
85 | break; | ||
86 | case L3: | ||
87 | if (record->event.pressed) { | ||
88 | set_single_persistent_default_layer(_3); | ||
89 | |||
90 | } | ||
91 | return false; | ||
92 | break; | ||
93 | |||
94 | } | ||
95 | return true; | ||
96 | } | ||
97 | |||
98 | void matrix_init_user(void) { | ||
99 | //init the Pro Micro on-board LEDs | ||
100 | setPinOutput(IND_1); | ||
101 | setPinOutput(IND_2); | ||
102 | setPinOutput(IND_3); | ||
103 | //set to off | ||
104 | writePinHigh(IND_1); | ||
105 | writePinHigh(IND_2); | ||
106 | writePinHigh(IND_3); | ||
107 | } | ||
108 | |||
109 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
110 | if (layer_state_is(_1)) { | ||
111 | if (clockwise) { | ||
112 | tap_code(KC_UP); | ||
113 | } else { | ||
114 | tap_code(KC_DOWN); | ||
115 | } | ||
116 | } | ||
117 | |||
118 | else if (layer_state_is(_2)) { | ||
119 | if (clockwise) { | ||
120 | tap_code(KC_RGHT); | ||
121 | } else { | ||
122 | tap_code(KC_LEFT); | ||
123 | } | ||
124 | } | ||
125 | |||
126 | else if (layer_state_is(_3)) { | ||
127 | if (clockwise) { | ||
128 | tap_code(KC_VOLU); | ||
129 | } else { | ||
130 | tap_code(KC_VOLD); | ||
131 | } | ||
132 | } | ||
133 | } | ||
diff --git a/keyboards/makrosu/keymaps/via/keymap.c b/keyboards/makrosu/keymaps/via/keymap.c new file mode 100644 index 000000000..b7f60a414 --- /dev/null +++ b/keyboards/makrosu/keymaps/via/keymap.c | |||
@@ -0,0 +1,133 @@ | |||
1 | /* Copyright 2021 Valdydesu_ | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #include QMK_KEYBOARD_H | ||
18 | |||
19 | enum planck_layers { | ||
20 | _1, | ||
21 | _2, | ||
22 | _3, | ||
23 | _4 | ||
24 | |||
25 | }; | ||
26 | |||
27 | |||
28 | enum planck_keycodes { | ||
29 | L1 = SAFE_RANGE, | ||
30 | L2, | ||
31 | L3 | ||
32 | |||
33 | }; | ||
34 | |||
35 | #define LOWER MO(_4) | ||
36 | #define IND_1 D4 | ||
37 | #define IND_2 C6 | ||
38 | #define IND_3 D7 | ||
39 | |||
40 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
41 | |||
42 | [_1] = LAYOUT( | ||
43 | KC_ESC, KC_F1, KC_F2, | ||
44 | LOWER, KC_Z, KC_X), | ||
45 | |||
46 | [_2] = LAYOUT( | ||
47 | LALT(KC_TAB), LGUI(KC_TAB), LCTL(KC_S), | ||
48 | LOWER, LCTL(KC_C), LCTL(KC_V)), | ||
49 | |||
50 | [_3] = LAYOUT( | ||
51 | KC_TRNS, KC_TRNS, KC_TRNS, | ||
52 | KC_TRNS, KC_TRNS, KC_TRNS), | ||
53 | |||
54 | [_4] = LAYOUT( | ||
55 | L1, L2, L3, | ||
56 | _______, _______, _______), | ||
57 | |||
58 | }; | ||
59 | |||
60 | |||
61 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
62 | state = update_tri_layer_state(state, _4, X_PAUSE, X_PAUSE); | ||
63 | writePin(IND_1, layer_state_cmp(state, 1)); | ||
64 | writePin(IND_2, layer_state_cmp(state, 2)); | ||
65 | writePin(IND_3, layer_state_cmp(state, 3)); | ||
66 | return state; | ||
67 | } | ||
68 | |||
69 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
70 | switch (keycode) { | ||
71 | case L1: | ||
72 | if (record->event.pressed) { | ||
73 | set_single_persistent_default_layer(_1); | ||
74 | |||
75 | |||
76 | } | ||
77 | return false; | ||
78 | break; | ||
79 | case L2: | ||
80 | if (record->event.pressed) { | ||
81 | set_single_persistent_default_layer(_2); | ||
82 | |||
83 | } | ||
84 | return false; | ||
85 | break; | ||
86 | case L3: | ||
87 | if (record->event.pressed) { | ||
88 | set_single_persistent_default_layer(_3); | ||
89 | |||
90 | } | ||
91 | return false; | ||
92 | break; | ||
93 | |||
94 | } | ||
95 | return true; | ||
96 | } | ||
97 | |||
98 | void matrix_init_user(void) { | ||
99 | //init the Pro Micro on-board LEDs | ||
100 | setPinOutput(IND_1); | ||
101 | setPinOutput(IND_2); | ||
102 | setPinOutput(IND_3); | ||
103 | //set to off | ||
104 | writePinHigh(IND_1); | ||
105 | writePinHigh(IND_2); | ||
106 | writePinHigh(IND_3); | ||
107 | } | ||
108 | |||
109 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
110 | if (layer_state_is(_1)) { | ||
111 | if (clockwise) { | ||
112 | tap_code(KC_UP); | ||
113 | } else { | ||
114 | tap_code(KC_DOWN); | ||
115 | } | ||
116 | } | ||
117 | |||
118 | else if (layer_state_is(_2)) { | ||
119 | if (clockwise) { | ||
120 | tap_code(KC_RGHT); | ||
121 | } else { | ||
122 | tap_code(KC_LEFT); | ||
123 | } | ||
124 | } | ||
125 | |||
126 | else if (layer_state_is(_3)) { | ||
127 | if (clockwise) { | ||
128 | tap_code(KC_VOLU); | ||
129 | } else { | ||
130 | tap_code(KC_VOLD); | ||
131 | } | ||
132 | } | ||
133 | } | ||
diff --git a/keyboards/makrosu/keymaps/via/rules.mk b/keyboards/makrosu/keymaps/via/rules.mk new file mode 100644 index 000000000..036bd6d1c --- /dev/null +++ b/keyboards/makrosu/keymaps/via/rules.mk | |||
@@ -0,0 +1 @@ | |||
VIA_ENABLE = yes \ No newline at end of file | |||
diff --git a/keyboards/makrosu/makrosu.c b/keyboards/makrosu/makrosu.c new file mode 100644 index 000000000..8a9a22278 --- /dev/null +++ b/keyboards/makrosu/makrosu.c | |||
@@ -0,0 +1,16 @@ | |||
1 | /* Copyright 2021 Valdydesu_ | ||
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 "makrosu.h" | ||
diff --git a/keyboards/makrosu/makrosu.h b/keyboards/makrosu/makrosu.h new file mode 100644 index 000000000..ee61ce118 --- /dev/null +++ b/keyboards/makrosu/makrosu.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "quantum.h" | ||
4 | |||
5 | /* This is a shortcut to help you visually see your layout. | ||
6 | * | ||
7 | * The first section contains all of the arguments representing the physical | ||
8 | * layout of the board and position of the keys. | ||
9 | * | ||
10 | * The second converts the arguments into a two-dimensional array which | ||
11 | * represents the switch matrix. | ||
12 | */ | ||
13 | #define LAYOUT( \ | ||
14 | K02, K03, K04, \ | ||
15 | K00, K01, K05 \ | ||
16 | ) \ | ||
17 | { \ | ||
18 | { K00, K01, K02, K03, K04, K05 }, \ | ||
19 | } | ||
20 | |||
diff --git a/keyboards/makrosu/readme.md b/keyboards/makrosu/readme.md new file mode 100644 index 000000000..fab6c0911 --- /dev/null +++ b/keyboards/makrosu/readme.md | |||
@@ -0,0 +1,14 @@ | |||
1 | # [Makrosu Keypad](https://www.instagram.com/p/CJ8eoQ7BoGZ/) | ||
2 | |||
3 | A Macropad that has 1 rotary encoder, 2 switches and 3 push buttons. Default function is for playing OSU! | ||
4 | |||
5 | * Keyboard Maintainer: [Valdy](https://github.com/valdiieee) | ||
6 | * Hardware Supported: Pro Micro, EC11 rotary encoder, MX Style Switches, Push Buttons, 1n4148 diodes | ||
7 | * Hardware Availability: Private GB | ||
8 | |||
9 | Make example for this keyboard (after setting up your build environment): | ||
10 | |||
11 | make makrosu:default | ||
12 | |||
13 | 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). | ||
14 | |||
diff --git a/keyboards/makrosu/rules.mk b/keyboards/makrosu/rules.mk new file mode 100644 index 000000000..d12ce5037 --- /dev/null +++ b/keyboards/makrosu/rules.mk | |||
@@ -0,0 +1,23 @@ | |||
1 | # MCU name | ||
2 | MCU = atmega32u4 | ||
3 | |||
4 | # Bootloader selection | ||
5 | BOOTLOADER = caterina | ||
6 | |||
7 | # Build Options | ||
8 | # change yes to no to disable | ||
9 | # | ||
10 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration | ||
11 | MOUSEKEY_ENABLE = no # 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 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
16 | SLEEP_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 | ||
18 | NKRO_ENABLE = yes # USB Nkey Rollover | ||
19 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
20 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow | ||
21 | BLUETOOTH_ENABLE = no # Enable Bluetooth | ||
22 | AUDIO_ENABLE = no # Audio output | ||
23 | ENCODER_ENABLE = yes | ||