diff options
author | William Ehman <will@ehman.com> | 2021-07-02 21:53:13 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-02 20:53:13 -0700 |
commit | ad30218701782192b9125c32b85cdbcc203c0c85 (patch) | |
tree | 6fe212ac7440baeec179b046347e1f9b3254650b | |
parent | 04bc74d8f52370a01f1f67a5de8ae751e307e8c9 (diff) | |
download | qmk_firmware-ad30218701782192b9125c32b85cdbcc203c0c85.tar.gz qmk_firmware-ad30218701782192b9125c32b85cdbcc203c0c85.zip |
[Keyboard] manyboard macro (#11896)
Co-authored-by: Joel Challis <git@zvecr.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>
-rw-r--r-- | keyboards/manyboard/macro/config.h | 53 | ||||
-rw-r--r-- | keyboards/manyboard/macro/info.json | 29 | ||||
-rw-r--r-- | keyboards/manyboard/macro/keymaps/default/keymap.c | 73 | ||||
-rw-r--r-- | keyboards/manyboard/macro/keymaps/via/keymap.c | 72 | ||||
-rw-r--r-- | keyboards/manyboard/macro/keymaps/via/rules.mk | 1 | ||||
-rw-r--r-- | keyboards/manyboard/macro/macro.c | 17 | ||||
-rw-r--r-- | keyboards/manyboard/macro/macro.h | 31 | ||||
-rw-r--r-- | keyboards/manyboard/macro/readme.md | 15 | ||||
-rw-r--r-- | keyboards/manyboard/macro/rules.mk | 23 |
9 files changed, 314 insertions, 0 deletions
diff --git a/keyboards/manyboard/macro/config.h b/keyboards/manyboard/macro/config.h new file mode 100644 index 000000000..d7a950f2e --- /dev/null +++ b/keyboards/manyboard/macro/config.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | Copyright 2020 William Ehman | ||
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 | #include "config_common.h" | ||
20 | |||
21 | /* USB Device descriptor parameter */ | ||
22 | #define VENDOR_ID 0x4D42 // MB | ||
23 | #define PRODUCT_ID 0x0015 // 15 keys | ||
24 | #define DEVICE_VER 0x0103 | ||
25 | #define MANUFACTURER Manyboard | ||
26 | #define PRODUCT MB_Macro | ||
27 | |||
28 | /* key matrix size */ | ||
29 | #define MATRIX_ROWS 4 | ||
30 | #define MATRIX_COLS 4 | ||
31 | |||
32 | /* key matrix pins */ | ||
33 | #define MATRIX_ROW_PINS { D0, D1, D2, D3 } | ||
34 | #define MATRIX_COL_PINS { D4, D5, D6, D7 } | ||
35 | #define UNUSED_PINS | ||
36 | |||
37 | /*Encoder Pins*/ | ||
38 | #define ENCODERS_PAD_A { C6 } | ||
39 | #define ENCODERS_PAD_B { C7 } | ||
40 | |||
41 | /* COL2ROW, ROW2COL */ | ||
42 | #define DIODE_DIRECTION ROW2COL | ||
43 | |||
44 | /* RGB Pins */ | ||
45 | #define RGB_DI_PIN B6 | ||
46 | #define RGBLED_NUM 2 | ||
47 | #define RGBLIGHT_LIMIT_VAL 10 | ||
48 | |||
49 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
50 | #define DEBOUNCE 5 | ||
51 | /* disable these deprecated features by default */ | ||
52 | #define NO_ACTION_MACRO | ||
53 | #define NO_ACTION_FUNCTION | ||
diff --git a/keyboards/manyboard/macro/info.json b/keyboards/manyboard/macro/info.json new file mode 100644 index 000000000..8155672a7 --- /dev/null +++ b/keyboards/manyboard/macro/info.json | |||
@@ -0,0 +1,29 @@ | |||
1 | { | ||
2 | "keyboard_name": "manyboard_macro", | ||
3 | "url": "https://github.com/WillEhman/qmk_firmware/tree/dev_create_mb_macro", | ||
4 | "maintainer": "William Ehman", | ||
5 | "width": 4, | ||
6 | "height": 4, | ||
7 | "layouts": { | ||
8 | "LAYOUT_ortho_4x4": { | ||
9 | "layout": [ | ||
10 | {"x": 0, "y": 0}, | ||
11 | {"x": 1, "y": 0}, | ||
12 | {"x": 2, "y": 0}, | ||
13 | {"x": 3, "y": 0}, | ||
14 | {"x": 0, "y": 1}, | ||
15 | {"x": 1, "y": 1}, | ||
16 | {"x": 2, "y": 1}, | ||
17 | {"x": 3, "y": 1}, | ||
18 | {"x": 0, "y": 2}, | ||
19 | {"x": 1, "y": 2}, | ||
20 | {"x": 2, "y": 2}, | ||
21 | {"x": 3, "y": 2}, | ||
22 | {"x": 0, "y": 3}, | ||
23 | {"x": 1, "y": 3}, | ||
24 | {"x": 2, "y": 3}, | ||
25 | {"x": 3, "y": 3} | ||
26 | ] | ||
27 | } | ||
28 | } | ||
29 | } | ||
diff --git a/keyboards/manyboard/macro/keymaps/default/keymap.c b/keyboards/manyboard/macro/keymaps/default/keymap.c new file mode 100644 index 000000000..4feda5080 --- /dev/null +++ b/keyboards/manyboard/macro/keymaps/default/keymap.c | |||
@@ -0,0 +1,73 @@ | |||
1 | /* Copyright 2020 William Ehman | ||
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 | |||
19 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
20 | [0] = LAYOUT_ortho_4x4( | ||
21 | KC_F1, KC_F2, KC_F3, KC_F4, | ||
22 | KC_F5, KC_F6, KC_F7, KC_F8, | ||
23 | KC_F9, KC_F10, KC_F11, KC_F12, | ||
24 | KC_F13, KC_F14, KC_F15, TO(1) | ||
25 | ), | ||
26 | [1] = LAYOUT_ortho_4x4( | ||
27 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
28 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
29 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
30 | KC_TRNS, KC_TRNS, KC_TRNS, TO(2) | ||
31 | ), | ||
32 | [2] = LAYOUT_ortho_4x4( | ||
33 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
34 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
35 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
36 | KC_TRNS, KC_TRNS, KC_TRNS, TO(0) | ||
37 | ), | ||
38 | }; | ||
39 | |||
40 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
41 | switch (get_highest_layer(state)) { | ||
42 | case 0: | ||
43 | sethsv(HSV_WHITE, (LED_TYPE *)&led[0]); | ||
44 | rgblight_set(); | ||
45 | break; | ||
46 | case 1: | ||
47 | sethsv(HSV_GREEN, (LED_TYPE *)&led[0]); | ||
48 | rgblight_set(); | ||
49 | break; | ||
50 | case 2: | ||
51 | sethsv(HSV_BLUE, (LED_TYPE *)&led[0]); | ||
52 | rgblight_set(); | ||
53 | break; | ||
54 | } | ||
55 | return state; | ||
56 | } | ||
57 | |||
58 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
59 | /* With an if statement we can check which encoder was turned. */ | ||
60 | if (index == 0) { /* First encoder */ | ||
61 | /* And with another if statement we can check the direction. */ | ||
62 | if (clockwise) { | ||
63 | /* This is where the actual magic happens: this bit of code taps on the | ||
64 | Page Down key. You can do anything QMK allows you to do here. | ||
65 | You'll want to replace these lines with the things you want your | ||
66 | encoders to do. */ | ||
67 | tap_code(KC_AUDIO_VOL_UP); | ||
68 | } else { | ||
69 | /* And likewise for the other direction, this time Vol Down is pressed. */ | ||
70 | tap_code(KC_AUDIO_VOL_DOWN); | ||
71 | } | ||
72 | } | ||
73 | } | ||
diff --git a/keyboards/manyboard/macro/keymaps/via/keymap.c b/keyboards/manyboard/macro/keymaps/via/keymap.c new file mode 100644 index 000000000..ce32d6d24 --- /dev/null +++ b/keyboards/manyboard/macro/keymaps/via/keymap.c | |||
@@ -0,0 +1,72 @@ | |||
1 | /* Copyright 2020 William Ehman | ||
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 | |||
19 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
20 | [0] = LAYOUT_ortho_4x4( | ||
21 | KC_F1, KC_F2, KC_F3, KC_F4, | ||
22 | KC_F5, KC_F6, KC_F7, KC_F8, | ||
23 | KC_F9, KC_F10, KC_F11, KC_F12, | ||
24 | KC_F13, KC_F14, KC_F15, TO(1) | ||
25 | ), | ||
26 | [1] = LAYOUT_ortho_4x4( | ||
27 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
28 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
29 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
30 | KC_TRNS, KC_TRNS, KC_TRNS, TO(2) | ||
31 | ), | ||
32 | [2] = LAYOUT_ortho_4x4( | ||
33 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
34 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
35 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
36 | KC_TRNS, KC_TRNS, KC_TRNS, TO(0) | ||
37 | ), | ||
38 | }; | ||
39 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
40 | switch (get_highest_layer(state)) { | ||
41 | case 0: | ||
42 | sethsv(HSV_WHITE, (LED_TYPE *)&led[0]); | ||
43 | rgblight_set(); | ||
44 | break; | ||
45 | case 1: | ||
46 | sethsv(HSV_GREEN, (LED_TYPE *)&led[0]); | ||
47 | rgblight_set(); | ||
48 | break; | ||
49 | case 2: | ||
50 | sethsv(HSV_BLUE, (LED_TYPE *)&led[0]); | ||
51 | rgblight_set(); | ||
52 | break; | ||
53 | } | ||
54 | return state; | ||
55 | } | ||
56 | |||
57 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
58 | /* With an if statement we can check which encoder was turned. */ | ||
59 | if (index == 0) { /* First encoder */ | ||
60 | /* And with another if statement we can check the direction. */ | ||
61 | if (clockwise) { | ||
62 | /* This is where the actual magic happens: this bit of code taps on the | ||
63 | Page Down key. You can do anything QMK allows you to do here. | ||
64 | You'll want to replace these lines with the things you want your | ||
65 | encoders to do. */ | ||
66 | tap_code(KC_AUDIO_VOL_UP); | ||
67 | } else { | ||
68 | /* And likewise for the other direction, this time Vol Down is pressed. */ | ||
69 | tap_code(KC_AUDIO_VOL_DOWN); | ||
70 | } | ||
71 | } | ||
72 | } | ||
diff --git a/keyboards/manyboard/macro/keymaps/via/rules.mk b/keyboards/manyboard/macro/keymaps/via/rules.mk new file mode 100644 index 000000000..036bd6d1c --- /dev/null +++ b/keyboards/manyboard/macro/keymaps/via/rules.mk | |||
@@ -0,0 +1 @@ | |||
VIA_ENABLE = yes \ No newline at end of file | |||
diff --git a/keyboards/manyboard/macro/macro.c b/keyboards/manyboard/macro/macro.c new file mode 100644 index 000000000..eb8a188f3 --- /dev/null +++ b/keyboards/manyboard/macro/macro.c | |||
@@ -0,0 +1,17 @@ | |||
1 | /* Copyright 2020 WillEhman | ||
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 "macro.h" | ||
diff --git a/keyboards/manyboard/macro/macro.h b/keyboards/manyboard/macro/macro.h new file mode 100644 index 000000000..0dccdbebf --- /dev/null +++ b/keyboards/manyboard/macro/macro.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* Copyright 2020 WillEhman | ||
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_ortho_4x4( \ | ||
22 | K00, K01, K02, K03, \ | ||
23 | K10, K11, K12, K13, \ | ||
24 | K20, K21, K22, K23, \ | ||
25 | K30, K31, K32, K33 \ | ||
26 | ) { \ | ||
27 | { K00, K01, K02, K03 }, \ | ||
28 | { K10, K11, K12, K13 }, \ | ||
29 | { K20, K21, K22, K23 }, \ | ||
30 | { K30, K31, K32, K33 } \ | ||
31 | } | ||
diff --git a/keyboards/manyboard/macro/readme.md b/keyboards/manyboard/macro/readme.md new file mode 100644 index 000000000..ca400b30e --- /dev/null +++ b/keyboards/manyboard/macro/readme.md | |||
@@ -0,0 +1,15 @@ | |||
1 | # manyboard_macro | ||
2 | |||
3 | * Keyboard Maintainer: [WillEhman](https://github.com/WillEhman) | ||
4 | * Hardware Supported: The Manyboard Family of keyboards | ||
5 | * Hardware Availability: TBA | ||
6 | |||
7 | Make example for this keyboard (after setting up your build environment): | ||
8 | |||
9 | make manyboard/macro:default | ||
10 | |||
11 | Flashing example for this keyboard: | ||
12 | |||
13 | make manyboard/macro:default:flash | ||
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/manyboard/macro/rules.mk b/keyboards/manyboard/macro/rules.mk new file mode 100644 index 000000000..fd709670b --- /dev/null +++ b/keyboards/manyboard/macro/rules.mk | |||
@@ -0,0 +1,23 @@ | |||
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 = lite # Virtual DIP switch configuration | ||
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 | # 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 = no # USB Nkey Rollover | ||
19 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
20 | RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow | ||
21 | BLUETOOTH_ENABLE = no # Enable Bluetooth | ||
22 | AUDIO_ENABLE = no # Audio output | ||
23 | ENCODER_ENABLE = yes # Encoder Input | ||