diff options
| author | Albert Y <76888457+filterpaper@users.noreply.github.com> | 2021-11-16 09:05:15 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-15 17:05:15 -0800 |
| commit | 22eba600418696542a6b84125f4dff2f37638c1e (patch) | |
| tree | 7bbc86cb9d13596abfc905b78c8a397c2b41753f /keyboards/macro3 | |
| parent | d3ae937b50df8d98deb3dc3b9f8aa1635eac1c8b (diff) | |
| download | qmk_firmware-22eba600418696542a6b84125f4dff2f37638c1e.tar.gz qmk_firmware-22eba600418696542a6b84125f4dff2f37638c1e.zip | |
[Keyboard] Add macro3 PCB support (#15131)
Co-authored-by: Joel Challis <git@zvecr.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: filterpaper <filterpaper@localhost>
Diffstat (limited to 'keyboards/macro3')
| -rw-r--r-- | keyboards/macro3/config.h | 55 | ||||
| -rw-r--r-- | keyboards/macro3/info.json | 20 | ||||
| -rw-r--r-- | keyboards/macro3/keymaps/default/keymap.c | 30 | ||||
| -rw-r--r-- | keyboards/macro3/macro3.c | 39 | ||||
| -rw-r--r-- | keyboards/macro3/macro3.h | 28 | ||||
| -rw-r--r-- | keyboards/macro3/readme.md | 26 | ||||
| -rw-r--r-- | keyboards/macro3/rules.mk | 22 |
7 files changed, 220 insertions, 0 deletions
diff --git a/keyboards/macro3/config.h b/keyboards/macro3/config.h new file mode 100644 index 000000000..59f7a151c --- /dev/null +++ b/keyboards/macro3/config.h | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | /* Copyright 2020 David Philip Barr <@davidphilipbarr> | ||
| 2 | * Copyright 2021 @filterpaper | ||
| 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 0xC88B | ||
| 23 | #define PRODUCT_ID 0x3388 | ||
| 24 | #define DEVICE_VER 0x0003 | ||
| 25 | #define MANUFACTURER DPB | ||
| 26 | #define PRODUCT Macro3 | ||
| 27 | |||
| 28 | /* key matrix size */ | ||
| 29 | #define MATRIX_ROWS 2 | ||
| 30 | #define MATRIX_COLS 4 | ||
| 31 | |||
| 32 | /* key matrix pins */ | ||
| 33 | #define DIRECT_PINS { \ | ||
| 34 | { D7, C6, D4, D1 }, \ | ||
| 35 | { B1, B4, B5, B3 } \ | ||
| 36 | } | ||
| 37 | |||
| 38 | #define ENCODERS_PAD_A { D2, F7 } | ||
| 39 | #define ENCODERS_PAD_B { D3, F6 } | ||
| 40 | |||
| 41 | #define UNUSED_PINS | ||
| 42 | |||
| 43 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
| 44 | #define DEBOUNCE 5 | ||
| 45 | |||
| 46 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
| 47 | #define LOCKING_SUPPORT_ENABLE | ||
| 48 | |||
| 49 | /* Locking resynchronize hack */ | ||
| 50 | #define LOCKING_RESYNC_ENABLE | ||
| 51 | |||
| 52 | /* Top right key */ | ||
| 53 | #define BOOTMAGIC_LITE_ROW 0 | ||
| 54 | #define BOOTMAGIC_LITE_COLUMN 3 | ||
| 55 | |||
diff --git a/keyboards/macro3/info.json b/keyboards/macro3/info.json new file mode 100644 index 000000000..b25779cb7 --- /dev/null +++ b/keyboards/macro3/info.json | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | { | ||
| 2 | "keyboard_name": "Macro3", | ||
| 3 | "url": "https://github.com/davidphilipbarr/Macropads/tree/main/macro3", | ||
| 4 | "maintainer": "@davidphilipbarr", | ||
| 5 | "layouts": { | ||
| 6 | "LAYOUT": { | ||
| 7 | "layout": [ | ||
| 8 | {"x": 0, "y": 0}, | ||
| 9 | {"x": 1, "y": 0}, | ||
| 10 | {"x": 2, "y": 0}, | ||
| 11 | {"x": 3, "y": 0}, | ||
| 12 | |||
| 13 | {"x": 0, "y": 1}, | ||
| 14 | {"x": 1, "y": 1}, | ||
| 15 | {"x": 2, "y": 1}, | ||
| 16 | {"x": 3, "y": 1}, | ||
| 17 | ] | ||
| 18 | } | ||
| 19 | } | ||
| 20 | } | ||
diff --git a/keyboards/macro3/keymaps/default/keymap.c b/keyboards/macro3/keymaps/default/keymap.c new file mode 100644 index 000000000..ca4db51f3 --- /dev/null +++ b/keyboards/macro3/keymaps/default/keymap.c | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | /* Copyright 2020 David Philip Barr <@davidphilipbarr> | ||
| 2 | * Copyright 2021 @filterpaper | ||
| 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 | #include QMK_KEYBOARD_H | ||
| 19 | |||
| 20 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 21 | [0] = LAYOUT( | ||
| 22 | KC_HOME, KC_MUTE, KC_MPLY, KC_MSEL, | ||
| 23 | KC_UNDO, KC_CUT, KC_COPY, LT(1,KC_PSTE) | ||
| 24 | ), | ||
| 25 | [1] = LAYOUT( | ||
| 26 | _______, _______, _______, _______, | ||
| 27 | RESET, _______, _______, _______ | ||
| 28 | ) | ||
| 29 | }; | ||
| 30 | |||
diff --git a/keyboards/macro3/macro3.c b/keyboards/macro3/macro3.c new file mode 100644 index 000000000..cc12c0268 --- /dev/null +++ b/keyboards/macro3/macro3.c | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | /* Copyright 2020 David Philip Barr <@davidphilipbarr> | ||
| 2 | * Copyright 2021 @filterpaper | ||
| 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 | #include "macro3.h" | ||
| 19 | |||
| 20 | #ifdef ENCODER_ENABLE | ||
| 21 | bool encoder_update_kb(uint8_t index, bool clockwise) { | ||
| 22 | if (!encoder_update_user(index, clockwise)) { return false; } | ||
| 23 | if (index == 1) { | ||
| 24 | if (clockwise) { | ||
| 25 | tap_code(KC_VOLD); | ||
| 26 | } else { | ||
| 27 | tap_code(KC_VOLU); | ||
| 28 | } | ||
| 29 | } else if (index == 0) { | ||
| 30 | if (clockwise) { | ||
| 31 | tap_code(KC_WH_D); | ||
| 32 | } else { | ||
| 33 | tap_code(KC_WH_U); | ||
| 34 | } | ||
| 35 | } | ||
| 36 | return true; | ||
| 37 | } | ||
| 38 | #endif | ||
| 39 | |||
diff --git a/keyboards/macro3/macro3.h b/keyboards/macro3/macro3.h new file mode 100644 index 000000000..12621d2c0 --- /dev/null +++ b/keyboards/macro3/macro3.h | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | /* Copyright 2020 David Philip Barr <@davidphilipbarr> | ||
| 2 | * Copyright 2021 @filterpaper | ||
| 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 | #include "quantum.h" | ||
| 19 | |||
| 20 | #define LAYOUT( \ | ||
| 21 | K00, K01, K02, K03, \ | ||
| 22 | K10, K11, K12, K13 \ | ||
| 23 | ) \ | ||
| 24 | { \ | ||
| 25 | { K00, K01, K02, K03 }, \ | ||
| 26 | { K10, K11, K12, K13 } \ | ||
| 27 | } | ||
| 28 | |||
diff --git a/keyboards/macro3/readme.md b/keyboards/macro3/readme.md new file mode 100644 index 000000000..66a142ecd --- /dev/null +++ b/keyboards/macro3/readme.md | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | # Macro3 | ||
| 2 | |||
| 3 |  | ||
| 4 | |||
| 5 | Macro3 is a low-profile macro pad with encoder support designed by [@davidphilipbarr](https://github.com/davidphilipbarr) using direct micro-controller pin wiring. | ||
| 6 | |||
| 7 | ## Keyboard Info | ||
| 8 | |||
| 9 | * Keyboard Maintainer: [davidphilipbarr](https://github.com/davidphilipbarr) | ||
| 10 | * Hardware Supported: [Macro3](https://github.com/davidphilipbarr/Macropads/tree/main/macro3) | ||
| 11 | * Hardware Availability: order PCBs with gerber file from the repository | ||
| 12 | |||
| 13 | Make example for this keyboard (after setting up your build environment): | ||
| 14 | |||
| 15 | make macro3:default | ||
| 16 | |||
| 17 | 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). | ||
| 18 | |||
| 19 | ## Bootloader | ||
| 20 | |||
| 21 | Enter the bootloader in 3 ways: | ||
| 22 | |||
| 23 | * **Bootmagic reset**: Hold down the top right key and plug in the controller. | ||
| 24 | * **Physical reset button**: Briefly press the reset button soldered on the PCB. | ||
| 25 | * **Keycode in layout**: Press the key mapped to `RESET` if it is configured. | ||
| 26 | |||
diff --git a/keyboards/macro3/rules.mk b/keyboards/macro3/rules.mk new file mode 100644 index 000000000..baba7d9d8 --- /dev/null +++ b/keyboards/macro3/rules.mk | |||
| @@ -0,0 +1,22 @@ | |||
| 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 | # 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 = no # Enable keyboard RGB underglow | ||
| 21 | AUDIO_ENABLE = no # Audio output | ||
| 22 | ENCODER_ENABLE = yes | ||
