diff options
| author | dezli <29718605+dezlidezlidezli@users.noreply.github.com> | 2020-09-22 13:03:03 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-21 22:03:03 -0700 |
| commit | bfbcfbc83e9c496abff002726f7cc07108d99003 (patch) | |
| tree | a22a1497bfe9b24fc390cdaacd25e0fc2393d21a /keyboards/minimacro5 | |
| parent | 967ed19d77ce6793dac6cd94e294fe9edff5a39b (diff) | |
| download | qmk_firmware-bfbcfbc83e9c496abff002726f7cc07108d99003.tar.gz qmk_firmware-bfbcfbc83e9c496abff002726f7cc07108d99003.zip | |
[Keyboard] Add miniMACRO5 Macropad (#10392)
* add miniMACRO5
add all nessecary files for the miniMACRO5
I have rewritten the readme, and changed the keymaps to be more simple. I have tested compiling, and everything works perfectly.
* update miniMACRO5 readme
add the make example into the readme file
* Update keyboards/minimacro5/config.h
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update keyboards/minimacro5/keymaps/default/keymap.c
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update keyboards/minimacro5/keymaps/media/keymap.c
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update keyboards/minimacro5/keymaps/media/keymap.c
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update keyboards/minimacro5/minimacro5.c
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update keyboards/minimacro5/info.json
Co-authored-by: Ryan <fauxpark@gmail.com>
* Apply suggestions from code review
applied all suggestions.
Co-authored-by: Ryan <fauxpark@gmail.com>
* drashna suggestions - enum rather than define
committed enum update by drashna
Co-authored-by: Drashna Jaelre <drashna@live.com>
* update keymap.c
incorrect brackets
Co-authored-by: dezli <m@dez.li>
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'keyboards/minimacro5')
| -rw-r--r-- | keyboards/minimacro5/config.h | 62 | ||||
| -rw-r--r-- | keyboards/minimacro5/info.json | 12 | ||||
| -rw-r--r-- | keyboards/minimacro5/keymaps/default/keymap.c | 46 | ||||
| -rw-r--r-- | keyboards/minimacro5/keymaps/media/keymap.c | 43 | ||||
| -rw-r--r-- | keyboards/minimacro5/minimacro5.c | 1 | ||||
| -rw-r--r-- | keyboards/minimacro5/minimacro5.h | 9 | ||||
| -rw-r--r-- | keyboards/minimacro5/readme.md | 15 | ||||
| -rw-r--r-- | keyboards/minimacro5/rules.mk | 23 |
8 files changed, 211 insertions, 0 deletions
diff --git a/keyboards/minimacro5/config.h b/keyboards/minimacro5/config.h new file mode 100644 index 000000000..b48b5df21 --- /dev/null +++ b/keyboards/minimacro5/config.h | |||
| @@ -0,0 +1,62 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
| 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 0xCEEB | ||
| 24 | #define PRODUCT_ID 0x0007 | ||
| 25 | #define DEVICE_VER 0x0001 | ||
| 26 | #define MANUFACTURER leafcutterlabs | ||
| 27 | #define PRODUCT miniMACRO5 | ||
| 28 | |||
| 29 | /* key matrix size */ | ||
| 30 | #define MATRIX_ROWS 1 | ||
| 31 | #define MATRIX_COLS 5 | ||
| 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 | * NO_DIODE = switches are directly connected to AVR pins | ||
| 42 | * | ||
| 43 | */ | ||
| 44 | // #define MATRIX_ROW_PINS { D0, D5 } | ||
| 45 | // #define MATRIX_COL_PINS { F1, F0, B0 } | ||
| 46 | #define DIRECT_PINS { \ | ||
| 47 | { F4, B6, B2, D7, B4 } \ | ||
| 48 | } | ||
| 49 | //speed for double tap | ||
| 50 | #define TAPPING_TERM 200 | ||
| 51 | |||
| 52 | #define UNUSED_PINS | ||
| 53 | |||
| 54 | /* rotary encoder 1,2,3 closest to usb port is 0*/ | ||
| 55 | #define ENCODERS_PAD_B { D3, F6, F7, D4, C6} | ||
| 56 | #define ENCODERS_PAD_A { F5, D2, D1, D0, E6} | ||
| 57 | #define ENCODER_RESOLUTION 2 //default/suggested | ||
| 58 | |||
| 59 | /* ws2812 RGB LED */ | ||
| 60 | #define RGB_DI_PIN B5 | ||
| 61 | #define RGBLIGHT_ANIMATIONS | ||
| 62 | #define RGBLED_NUM 5 // Number of LEDs | ||
diff --git a/keyboards/minimacro5/info.json b/keyboards/minimacro5/info.json new file mode 100644 index 000000000..1cc2a2e41 --- /dev/null +++ b/keyboards/minimacro5/info.json | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | { | ||
| 2 | "keyboard_name": "minimacro5", | ||
| 3 | "url": "", | ||
| 4 | "maintainer": "qmk", | ||
| 5 | "width": 5, | ||
| 6 | "height": 1, | ||
| 7 | "layouts": { | ||
| 8 | "LAYOUT_ortho_1x5": { | ||
| 9 | "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":5, "y":0}] | ||
| 10 | } | ||
| 11 | } | ||
| 12 | } | ||
diff --git a/keyboards/minimacro5/keymaps/default/keymap.c b/keyboards/minimacro5/keymaps/default/keymap.c new file mode 100644 index 000000000..acd7f3283 --- /dev/null +++ b/keyboards/minimacro5/keymaps/default/keymap.c | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | #include QMK_KEYBOARD_H | ||
| 2 | |||
| 3 | enum layers { | ||
| 4 | _MAIN, | ||
| 5 | }; | ||
| 6 | |||
| 7 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
| 8 | if (index == 0) { /* First encoder*/ | ||
| 9 | if (clockwise) { | ||
| 10 | tap_code(KC_1); | ||
| 11 | } else { | ||
| 12 | tap_code(KC_2); | ||
| 13 | } | ||
| 14 | } else if (index == 1) { /* Second encoder*/ | ||
| 15 | if (clockwise) { | ||
| 16 | tap_code(KC_3); | ||
| 17 | } else { | ||
| 18 | tap_code(KC_4); | ||
| 19 | } | ||
| 20 | } else if (index == 2) { /* Third encoder*/ | ||
| 21 | if (clockwise) { | ||
| 22 | tap_code(KC_5); | ||
| 23 | } else { | ||
| 24 | tap_code(KC_6); | ||
| 25 | } | ||
| 26 | } else if (index == 3) { /* Fourth encoder*/ | ||
| 27 | if (clockwise) { | ||
| 28 | tap_code(KC_7); | ||
| 29 | } else { | ||
| 30 | tap_code(KC_8); | ||
| 31 | } | ||
| 32 | } else if (index == 4) { /* Fifth encoder*/ | ||
| 33 | if (clockwise) { | ||
| 34 | tap_code(KC_9); | ||
| 35 | } else { | ||
| 36 | tap_code(KC_0); | ||
| 37 | } | ||
| 38 | } | ||
| 39 | } | ||
| 40 | |||
| 41 | // | ||
| 42 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //buttion closest to usb is first | ||
| 43 | [_MAIN] = LAYOUT_ortho_1x5( | ||
| 44 | KC_A, KC_B, KC_C, KC_D, KC_E | ||
| 45 | ) | ||
| 46 | }; | ||
diff --git a/keyboards/minimacro5/keymaps/media/keymap.c b/keyboards/minimacro5/keymaps/media/keymap.c new file mode 100644 index 000000000..f36954b07 --- /dev/null +++ b/keyboards/minimacro5/keymaps/media/keymap.c | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | #include QMK_KEYBOARD_H | ||
| 2 | |||
| 3 | #define _MAIN 0 | ||
| 4 | |||
| 5 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
| 6 | if (index == 0) { /* First encoder*/ | ||
| 7 | if (clockwise) { | ||
| 8 | tap_code(KC_VOLU); | ||
| 9 | } else { | ||
| 10 | tap_code(KC_VOLD); | ||
| 11 | } | ||
| 12 | } else if (index == 1) { /* Second encoder*/ | ||
| 13 | if (clockwise) { | ||
| 14 | tap_code(KC_3); | ||
| 15 | } else { | ||
| 16 | tap_code(KC_4); | ||
| 17 | } | ||
| 18 | } else if (index == 2) { /* Third encoder*/ | ||
| 19 | if (clockwise) { | ||
| 20 | tap_code(KC_5); | ||
| 21 | } else { | ||
| 22 | tap_code(KC_6); | ||
| 23 | } | ||
| 24 | } else if (index == 3) { /* Fourth encoder*/ | ||
| 25 | if (clockwise) { | ||
| 26 | tap_code(KC_7); | ||
| 27 | } else { | ||
| 28 | tap_code(KC_8); | ||
| 29 | } | ||
| 30 | } else if (index == 4) { /* Fifth encoder*/ | ||
| 31 | if (clockwise) { | ||
| 32 | tap_code(KC_9); | ||
| 33 | } else { | ||
| 34 | tap_code(KC_0); | ||
| 35 | } | ||
| 36 | } | ||
| 37 | } | ||
| 38 | |||
| 39 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //buttion closest to usb is first | ||
| 40 | [_MAIN] = LAYOUT_ortho_1x5( | ||
| 41 | KC_MUTE, KC_MEDIA_PREV_TRACK, KC_MEDIA_NEXT_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_STOP | ||
| 42 | ) | ||
| 43 | }; | ||
diff --git a/keyboards/minimacro5/minimacro5.c b/keyboards/minimacro5/minimacro5.c new file mode 100644 index 000000000..7f9c5af1c --- /dev/null +++ b/keyboards/minimacro5/minimacro5.c | |||
| @@ -0,0 +1 @@ | |||
| #include "minimacro5.h" | |||
diff --git a/keyboards/minimacro5/minimacro5.h b/keyboards/minimacro5/minimacro5.h new file mode 100644 index 000000000..2d61ed893 --- /dev/null +++ b/keyboards/minimacro5/minimacro5.h | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include "quantum.h" | ||
| 4 | |||
| 5 | #define LAYOUT_ortho_1x5( \ | ||
| 6 | k01, k02, k03, k04, k05\ | ||
| 7 | ) { \ | ||
| 8 | { k01, k02, k03, k04, k05 } \ | ||
| 9 | } | ||
diff --git a/keyboards/minimacro5/readme.md b/keyboards/minimacro5/readme.md new file mode 100644 index 000000000..6266d2ba3 --- /dev/null +++ b/keyboards/minimacro5/readme.md | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | # miniMACRO5 | ||
| 2 | |||
| 3 | A 5 key Macropad based on Arduino Pro Micro with support for a combination of rotary encoders and mechanical switches. | ||
| 4 | |||
| 5 |  | ||
| 6 | |||
| 7 | * Keyboard Maintainer: [LeafCutterLabs](https://github.com/LeafCutterLabs) | ||
| 8 | * Hardware Supported: Pro Micro 5V/16MHz and compatible. | ||
| 9 | * Hardware availability: PCB Files are available [here](https://github.com/LeafCutterLabs/miniMACRO5), which you can get produced. | ||
| 10 | |||
| 11 | Make example for this keyboard (after setting up your build environment): | ||
| 12 | |||
| 13 | make minimacro5: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/minimacro5/rules.mk b/keyboards/minimacro5/rules.mk new file mode 100644 index 000000000..dd66c4fbd --- /dev/null +++ b/keyboards/minimacro5/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 = no # 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 = yes # 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 #enable rotary encoders | ||
