diff options
| author | RinoSolutions <41451021+RinoSolutions@users.noreply.github.com> | 2021-04-18 23:54:07 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-18 20:54:07 -0700 |
| commit | 6b2a3a67a6a2044049b90fdd0c16ffbbd07a302a (patch) | |
| tree | 56646042c6bba98f690e9be4250b35ebdcdb808a | |
| parent | cfefecd95126e81022297b83641db750552547d9 (diff) | |
| download | qmk_firmware-6b2a3a67a6a2044049b90fdd0c16ffbbd07a302a.tar.gz qmk_firmware-6b2a3a67a6a2044049b90fdd0c16ffbbd07a302a.zip | |
[Keyboard] Adding of Monarch keyboard (#11769)
Co-authored-by: Joel Challis <git@zvecr.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Ramon Imbao <ramonimbao@gmail.com>
| -rw-r--r-- | keyboards/monarch/config.h | 77 | ||||
| -rw-r--r-- | keyboards/monarch/info.json | 18 | ||||
| -rw-r--r-- | keyboards/monarch/keymaps/default/keymap.c | 43 | ||||
| -rw-r--r-- | keyboards/monarch/keymaps/iso/keymap.c | 43 | ||||
| -rw-r--r-- | keyboards/monarch/keymaps/via/config.h | 18 | ||||
| -rw-r--r-- | keyboards/monarch/keymaps/via/keymap.c | 89 | ||||
| -rw-r--r-- | keyboards/monarch/keymaps/via/rules.mk | 1 | ||||
| -rw-r--r-- | keyboards/monarch/monarch.c | 15 | ||||
| -rw-r--r-- | keyboards/monarch/monarch.h | 69 | ||||
| -rw-r--r-- | keyboards/monarch/readme.md | 15 | ||||
| -rw-r--r-- | keyboards/monarch/rules.mk | 23 |
11 files changed, 411 insertions, 0 deletions
diff --git a/keyboards/monarch/config.h b/keyboards/monarch/config.h new file mode 100644 index 000000000..ca9e2646b --- /dev/null +++ b/keyboards/monarch/config.h | |||
| @@ -0,0 +1,77 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2021 King Keyboards www.kingkbs.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 | /* USB Device descriptor parameter */ | ||
| 21 | #define VENDOR_ID 0x4011 | ||
| 22 | #define PRODUCT_ID 0x43C1 | ||
| 23 | #define DEVICE_VER 0x0001 | ||
| 24 | #define MANUFACTURER DoCallMeKing | ||
| 25 | #define PRODUCT Monarch | ||
| 26 | |||
| 27 | /* key matrix size */ | ||
| 28 | #define MATRIX_ROWS 6 | ||
| 29 | #define MATRIX_COLS 16 | ||
| 30 | |||
| 31 | #define MATRIX_COL_PINS { A10, A9, A8, B15, B14, B13, B12, B10, B2, B1, B0, A5, A7, A4, A3, B6 } | ||
| 32 | #define MATRIX_ROW_PINS { A15, B3, B11, A2, A1, B9 } | ||
| 33 | #define DIODE_DIRECTION COL2ROW | ||
| 34 | |||
| 35 | /* Rotary encoder pins */ | ||
| 36 | #define ENCODERS_PAD_A { B4 } | ||
| 37 | #define ENCODERS_PAD_B { B5 } | ||
| 38 | #define ENCODER_RESOLUTION 1 | ||
| 39 | |||
| 40 | //LEDS A6 | ||
| 41 | #define BACKLIGHT_PIN A6 | ||
| 42 | #define BACKLIGHT_PWM_DRIVER PWMD3 | ||
| 43 | #define BACKLIGHT_PWM_CHANNEL 1 | ||
| 44 | #define BACKLIGHT_PAL_MODE 1 | ||
| 45 | #define BACKLIGHT_LEVELS 24 | ||
| 46 | #define BACKLIGHT_BREATHING | ||
| 47 | #define BREATHING_PERIOD 6 | ||
| 48 | |||
| 49 | /* define if matrix has ghost */ | ||
| 50 | //#define MATRIX_HAS_GHOST | ||
| 51 | |||
| 52 | |||
| 53 | /* Set 0 if debouncing isn't needed */ | ||
| 54 | #define DEBOUNCE 5 | ||
| 55 | |||
| 56 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
| 57 | #define LOCKING_SUPPORT_ENABLE | ||
| 58 | /* Locking resynchronize hack */ | ||
| 59 | #define LOCKING_RESYNC_ENABLE | ||
| 60 | |||
| 61 | /* | ||
| 62 | * Feature disable options | ||
| 63 | * These options are also useful to firmware size reduction. | ||
| 64 | */ | ||
| 65 | |||
| 66 | /* disable debug print */ | ||
| 67 | //#define NO_DEBUG | ||
| 68 | |||
| 69 | /* disable print */ | ||
| 70 | //#define NO_PRINT | ||
| 71 | |||
| 72 | /* disable action features */ | ||
| 73 | //#define NO_ACTION_LAYER | ||
| 74 | //#define NO_ACTION_TAPPING | ||
| 75 | //#define NO_ACTION_ONESHOT | ||
| 76 | //#define NO_ACTION_MACRO | ||
| 77 | //#define NO_ACTION_FUNCTION | ||
diff --git a/keyboards/monarch/info.json b/keyboards/monarch/info.json new file mode 100644 index 000000000..a3c5ecaba --- /dev/null +++ b/keyboards/monarch/info.json | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | { | ||
| 2 | "keyboard_name": "Monarch", | ||
| 3 | "url": "", | ||
| 4 | "maintainer": "Ramon Imbao", | ||
| 5 | "width": 16.75, | ||
| 6 | "height": 5.5, | ||
| 7 | "layouts": { | ||
| 8 | "LAYOUT_ansi": { | ||
| 9 | "layout": [{"x":0.25, "y":0.25}, {"x":1.25, "y":0.25}, {"x":2.25, "y":0.25}, {"x":3.25, "y":0.25}, {"x":4.25, "y":0.25}, {"x":5.25, "y":0.25}, {"x":6.25, "y":0.25}, {"x":7.25, "y":0.25}, {"x":8.25, "y":0.25}, {"x":9.25, "y":0.25}, {"x":10.25, "y":0.25}, {"x":11.25, "y":0.25}, {"x":12.25, "y":0.25}, {"x":13.25, "y":0.25}, {"x":14.25, "y":0.25}, {"x":15.75, "y":0.25}, {"x":0.25, "y":1.25, "w":1.5}, {"x":1.75, "y":1.25}, {"x":2.75, "y":1.25}, {"x":3.75, "y":1.25}, {"x":4.75, "y":1.25}, {"x":5.75, "y":1.25}, {"x":6.75, "y":1.25}, {"x":7.75, "y":1.25}, {"x":8.75, "y":1.25}, {"x":9.75, "y":1.25}, {"x":10.75, "y":1.25}, {"x":11.75, "y":1.25}, {"x":12.75, "y":1.25}, {"x":13.75, "y":1.25, "w":1.5}, {"x":15.75, "y":1.75}, {"x":0.25, "y":2.25, "w":1.75}, {"x":2, "y":2.25}, {"x":3, "y":2.25}, {"x":4, "y":2.25}, {"x":5, "y":2.25}, {"x":6, "y":2.25}, {"x":7, "y":2.25}, {"x":8, "y":2.25}, {"x":9, "y":2.25}, {"x":10, "y":2.25}, {"x":11, "y":2.25}, {"x":12, "y":2.25}, {"x":13, "y":2.25, "w":2.25}, {"x":15.75, "y":2.75}, {"x":0.25, "y":3.25, "w":2.25}, {"x":2.5, "y":3.25}, {"x":3.5, "y":3.25}, {"x":4.5, "y":3.25}, {"x":5.5, "y":3.25}, {"x":6.5, "y":3.25}, {"x":7.5, "y":3.25}, {"x":8.5, "y":3.25}, {"x":9.5, "y":3.25}, {"x":10.5, "y":3.25}, {"x":11.5, "y":3.25}, {"x":12.5, "y":3.25, "w":1.75}, {"x":14.5, "y":3.5}, {"x":0.25, "y":4.25, "w":1.5}, {"x":1.75, "y":4.25}, {"x":2.75, "y":4.25, "w":1.5}, {"x":4.25, "y":4.25, "w":7}, {"x":11.25, "y":4.25, "w":1.5}, {"x":13.5, "y":4.5}, {"x":14.5, "y":4.5}, {"x":15.5, "y":4.5}] | ||
| 10 | }, | ||
| 11 | "LAYOUT_iso": { | ||
| 12 | "layout": [{"x":0.25, "y":0.25}, {"x":1.25, "y":0.25}, {"x":2.25, "y":0.25}, {"x":3.25, "y":0.25}, {"x":4.25, "y":0.25}, {"x":5.25, "y":0.25}, {"x":6.25, "y":0.25}, {"x":7.25, "y":0.25}, {"x":8.25, "y":0.25}, {"x":9.25, "y":0.25}, {"x":10.25, "y":0.25}, {"x":11.25, "y":0.25}, {"x":12.25, "y":0.25}, {"x":13.25, "y":0.25}, {"x":14.25, "y":0.25}, {"x":15.75, "y":0.25}, {"x":0.25, "y":1.25, "w":1.5}, {"x":1.75, "y":1.25}, {"x":2.75, "y":1.25}, {"x":3.75, "y":1.25}, {"x":4.75, "y":1.25}, {"x":5.75, "y":1.25}, {"x":6.75, "y":1.25}, {"x":7.75, "y":1.25}, {"x":8.75, "y":1.25}, {"x":9.75, "y":1.25}, {"x":10.75, "y":1.25}, {"x":11.75, "y":1.25}, {"x":12.75, "y":1.25}, {"x":14, "y":1.25, "w":1.25, "h":2}, {"x":15.75, "y":1.75}, {"x":0.25, "y":2.25, "w":1.75}, {"x":2, "y":2.25}, {"x":3, "y":2.25}, {"x":4, "y":2.25}, {"x":5, "y":2.25}, {"x":6, "y":2.25}, {"x":7, "y":2.25}, {"x":8, "y":2.25}, {"x":9, "y":2.25}, {"x":10, "y":2.25}, {"x":11, "y":2.25}, {"x":12, "y":2.25}, {"x":13, "y":2.25}, {"x":15.75, "y":2.75}, {"x":0.25, "y":3.25, "w":1.25}, {"x":1.5, "y":3.25}, {"x":2.5, "y":3.25}, {"x":3.5, "y":3.25}, {"x":4.5, "y":3.25}, {"x":5.5, "y":3.25}, {"x":6.5, "y":3.25}, {"x":7.5, "y":3.25}, {"x":8.5, "y":3.25}, {"x":9.5, "y":3.25}, {"x":10.5, "y":3.25}, {"x":11.5, "y":3.25}, {"x":12.5, "y":3.25, "w":1.75}, {"x":14.5, "y":3.5}, {"x":0.25, "y":4.25, "w":1.5}, {"x":1.75, "y":4.25}, {"x":2.75, "y":4.25, "w":1.5}, {"x":4.25, "y":4.25, "w":7}, {"x":11.25, "y":4.25, "w":1.5}, {"x":13.5, "y":4.5}, {"x":14.5, "y":4.5}, {"x":15.5, "y":4.5}] | ||
| 13 | }, | ||
| 14 | "LAYOUT_all": { | ||
| 15 | "layout": [{"x":0.25, "y":0.25}, {"x":1.25, "y":0.25}, {"x":2.25, "y":0.25}, {"x":3.25, "y":0.25}, {"x":4.25, "y":0.25}, {"x":5.25, "y":0.25}, {"x":6.25, "y":0.25}, {"x":7.25, "y":0.25}, {"x":8.25, "y":0.25}, {"x":9.25, "y":0.25}, {"x":10.25, "y":0.25}, {"x":11.25, "y":0.25}, {"x":12.25, "y":0.25}, {"x":13.25, "y":0.25}, {"x":14.25, "y":0.25}, {"x":15.75, "y":0.25}, {"x":0.25, "y":1.25, "w":1.5}, {"x":1.75, "y":1.25}, {"x":2.75, "y":1.25}, {"x":3.75, "y":1.25}, {"x":4.75, "y":1.25}, {"x":5.75, "y":1.25}, {"x":6.75, "y":1.25}, {"x":7.75, "y":1.25}, {"x":8.75, "y":1.25}, {"x":9.75, "y":1.25}, {"x":10.75, "y":1.25}, {"x":11.75, "y":1.25}, {"x":12.75, "y":1.25}, {"x":13.75, "y":1.25, "w":1.5}, {"x":15.75, "y":1.75}, {"x":0.25, "y":2.25, "w":1.75}, {"x":2, "y":2.25}, {"x":3, "y":2.25}, {"x":4, "y":2.25}, {"x":5, "y":2.25}, {"x":6, "y":2.25}, {"x":7, "y":2.25}, {"x":8, "y":2.25}, {"x":9, "y":2.25}, {"x":10, "y":2.25}, {"x":11, "y":2.25}, {"x":12, "y":2.25}, {"x":13, "y":2.25, "w":2.25}, {"x":15.75, "y":2.75}, {"x":0.25, "y":3.25, "w":1.25}, {"x":1.5, "y":3.25}, {"x":2.5, "y":3.25}, {"x":3.5, "y":3.25}, {"x":4.5, "y":3.25}, {"x":5.5, "y":3.25}, {"x":6.5, "y":3.25}, {"x":7.5, "y":3.25}, {"x":8.5, "y":3.25}, {"x":9.5, "y":3.25}, {"x":10.5, "y":3.25}, {"x":11.5, "y":3.25}, {"x":12.5, "y":3.25, "w":1.75}, {"x":14.5, "y":3.5}, {"x":0.25, "y":4.25, "w":1.5}, {"x":1.75, "y":4.25}, {"x":2.75, "y":4.25, "w":1.5}, {"x":4.25, "y":4.25, "w":7}, {"x":11.25, "y":4.25, "w":1.5}, {"x":13.5, "y":4.5}, {"x":14.5, "y":4.5}, {"x":15.5, "y":4.5}, {"x":0.25, "y":5.25}, {"x":1.25, "y":5.25}] | ||
| 16 | } | ||
| 17 | } | ||
| 18 | } | ||
diff --git a/keyboards/monarch/keymaps/default/keymap.c b/keyboards/monarch/keymaps/default/keymap.c new file mode 100644 index 000000000..e4d4e9ef3 --- /dev/null +++ b/keyboards/monarch/keymaps/default/keymap.c | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2021 King Keyboards www.kingkbs.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 | #include QMK_KEYBOARD_H | ||
| 19 | |||
| 20 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 21 | [0] = LAYOUT_ansi( | ||
| 22 | KC_ESC, 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_BSPC, KC_MUTE, | ||
| 23 | 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_PGUP, | ||
| 24 | 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_ENT, KC_PGDN, | ||
| 25 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
| 26 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_RGHT | ||
| 27 | ), | ||
| 28 | [1] = LAYOUT_ansi( | ||
| 29 | RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, | ||
| 30 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 31 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 32 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_ON, | ||
| 33 | _______, _______, _______, BL_TOGG, _______, BL_DEC, BL_OFF, BL_INC | ||
| 34 | ) | ||
| 35 | }; | ||
| 36 | |||
| 37 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
| 38 | if (clockwise) { | ||
| 39 | tap_code(KC_VOLU); | ||
| 40 | } else { | ||
| 41 | tap_code(KC_VOLD); | ||
| 42 | } | ||
| 43 | } | ||
diff --git a/keyboards/monarch/keymaps/iso/keymap.c b/keyboards/monarch/keymaps/iso/keymap.c new file mode 100644 index 000000000..71f02675e --- /dev/null +++ b/keyboards/monarch/keymaps/iso/keymap.c | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2021 King Keyboards www.kingkbs.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 | #include QMK_KEYBOARD_H | ||
| 19 | |||
| 20 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 21 | [0] = LAYOUT_iso( | ||
| 22 | KC_ESC, 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_BSPC, KC_MUTE, | ||
| 23 | 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_ENT, KC_PGUP, | ||
| 24 | 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_NUHS, KC_PGDN, | ||
| 25 | KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
| 26 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_RGHT | ||
| 27 | ), | ||
| 28 | [1] = LAYOUT_iso( | ||
| 29 | RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, | ||
| 30 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 31 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 32 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_ON, | ||
| 33 | _______, _______, _______, BL_TOGG, _______, BL_DEC, BL_OFF, BL_INC | ||
| 34 | ) | ||
| 35 | }; | ||
| 36 | |||
| 37 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
| 38 | if (clockwise) { | ||
| 39 | tap_code(KC_VOLU); | ||
| 40 | } else { | ||
| 41 | tap_code(KC_VOLD); | ||
| 42 | } | ||
| 43 | } | ||
diff --git a/keyboards/monarch/keymaps/via/config.h b/keyboards/monarch/keymaps/via/config.h new file mode 100644 index 000000000..04a6bd6b1 --- /dev/null +++ b/keyboards/monarch/keymaps/via/config.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2021 King Keyboards www.kingkbs.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 | 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 | You should have received a copy of the GNU General Public License | ||
| 13 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #pragma once | ||
| 17 | |||
| 18 | #define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 2047 | ||
diff --git a/keyboards/monarch/keymaps/via/keymap.c b/keyboards/monarch/keymaps/via/keymap.c new file mode 100644 index 000000000..1f14b195d --- /dev/null +++ b/keyboards/monarch/keymaps/via/keymap.c | |||
| @@ -0,0 +1,89 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2021 King Keyboards www.kingkbs.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 | #include QMK_KEYBOARD_H | ||
| 19 | |||
| 20 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 21 | [0] = LAYOUT_all( | ||
| 22 | KC_ESC, 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_BSPC, KC_MUTE, | ||
| 23 | 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_PGUP, | ||
| 24 | 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_ENT, KC_PGDN, | ||
| 25 | KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
| 26 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, | ||
| 27 | KC_VOLD, KC_VOLU | ||
| 28 | ), | ||
| 29 | [1] = LAYOUT_all( | ||
| 30 | RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, | ||
| 31 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______, | ||
| 32 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 33 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_ON, | ||
| 34 | _______, _______, _______, BL_TOGG, _______, BL_DEC, BL_OFF, BL_INC, | ||
| 35 | _______, _______ | ||
| 36 | ), | ||
| 37 | [2] = LAYOUT_all( | ||
| 38 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 39 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 40 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 41 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 42 | _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 43 | _______, _______ | ||
| 44 | ), | ||
| 45 | [3] = LAYOUT_all( | ||
| 46 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 47 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 48 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 49 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 50 | _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 51 | _______, _______ | ||
| 52 | ) | ||
| 53 | }; | ||
| 54 | |||
| 55 | keyevent_t encoder_ccw = { | ||
| 56 | .key = (keypos_t){.row = 5, .col = 0}, | ||
| 57 | .pressed = false | ||
| 58 | }; | ||
| 59 | |||
| 60 | keyevent_t encoder_cw = { | ||
| 61 | .key = (keypos_t){.row = 5, .col = 1}, | ||
| 62 | .pressed = false | ||
| 63 | }; | ||
| 64 | |||
| 65 | void matrix_scan_user(void) { | ||
| 66 | if (IS_PRESSED(encoder_ccw)) { | ||
| 67 | encoder_ccw.pressed = false; | ||
| 68 | encoder_ccw.time = (timer_read() | 1); | ||
| 69 | action_exec(encoder_ccw); | ||
| 70 | } | ||
| 71 | |||
| 72 | if (IS_PRESSED(encoder_cw)) { | ||
| 73 | encoder_cw.pressed = false; | ||
| 74 | encoder_cw.time = (timer_read() | 1); | ||
| 75 | action_exec(encoder_cw); | ||
| 76 | } | ||
| 77 | } | ||
| 78 | |||
| 79 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
| 80 | if (clockwise) { | ||
| 81 | encoder_cw.pressed = true; | ||
| 82 | encoder_cw.time = (timer_read() | 1); | ||
| 83 | action_exec(encoder_cw); | ||
| 84 | } else { | ||
| 85 | encoder_ccw.pressed = true; | ||
| 86 | encoder_ccw.time = (timer_read() | 1); | ||
| 87 | action_exec(encoder_ccw); | ||
| 88 | } | ||
| 89 | } | ||
diff --git a/keyboards/monarch/keymaps/via/rules.mk b/keyboards/monarch/keymaps/via/rules.mk new file mode 100644 index 000000000..1e5b99807 --- /dev/null +++ b/keyboards/monarch/keymaps/via/rules.mk | |||
| @@ -0,0 +1 @@ | |||
| VIA_ENABLE = yes | |||
diff --git a/keyboards/monarch/monarch.c b/keyboards/monarch/monarch.c new file mode 100644 index 000000000..a054e2cae --- /dev/null +++ b/keyboards/monarch/monarch.c | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2021 King Keyboards www.kingkbs.com | ||
| 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 | This program is distributed in the hope that it will be useful, | ||
| 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 10 | GNU General Public License for more details. | ||
| 11 | You should have received a copy of the GNU General Public License | ||
| 12 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #include "monarch.h" | ||
diff --git a/keyboards/monarch/monarch.h b/keyboards/monarch/monarch.h new file mode 100644 index 000000000..7678a078a --- /dev/null +++ b/keyboards/monarch/monarch.h | |||
| @@ -0,0 +1,69 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2021 King Keyboards www.kingkbs.com | ||
| 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 | This program is distributed in the hope that it will be useful, | ||
| 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 10 | GNU General Public License for more details. | ||
| 11 | You should have received a copy of the GNU General Public License | ||
| 12 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #pragma once | ||
| 16 | |||
| 17 | #include "quantum.h" | ||
| 18 | |||
| 19 | #define XXX KC_NO | ||
| 20 | |||
| 21 | // ANSI enter | ||
| 22 | #define LAYOUT_ansi( \ | ||
| 23 | k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f, \ | ||
| 24 | k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, k1f, \ | ||
| 25 | k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, k2f, \ | ||
| 26 | k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3e, \ | ||
| 27 | k40, k41, k42, k47, k4b, k4d, k4e, k4f \ | ||
| 28 | ) { \ | ||
| 29 | { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f }, \ | ||
| 30 | { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, XXX, k1e, k1f }, \ | ||
| 31 | { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d, XXX, k2f }, \ | ||
| 32 | { k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, XXX, k3d, k3e, XXX }, \ | ||
| 33 | { k40, k41, k42, XXX, XXX, XXX, XXX, k47, XXX, XXX, XXX, k4b, XXX, k4d, k4e, k4f }, \ | ||
| 34 | { XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX }, \ | ||
| 35 | } | ||
| 36 | |||
| 37 | // ISO enter | ||
| 38 | // Split left shift | ||
| 39 | #define LAYOUT_iso( \ | ||
| 40 | k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f, \ | ||
| 41 | k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, k1f, \ | ||
| 42 | k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, k2f, \ | ||
| 43 | k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3e, \ | ||
| 44 | k40, k41, k42, k47, k4b, k4d, k4e, k4f \ | ||
| 45 | ) { \ | ||
| 46 | { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f }, \ | ||
| 47 | { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, XXX, k1e, k1f }, \ | ||
| 48 | { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d, XXX, k2f }, \ | ||
| 49 | { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, XXX, k3d, k3e, XXX }, \ | ||
| 50 | { k40, k41, k42, XXX, XXX, XXX, XXX, k47, XXX, XXX, XXX, k4b, XXX, k4d, k4e, k4f }, \ | ||
| 51 | { XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX }, \ | ||
| 52 | } | ||
| 53 | |||
| 54 | // VIA-specific layout with extra buttons for changing rotary encoder functionality | ||
| 55 | #define LAYOUT_all( \ | ||
| 56 | k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f, \ | ||
| 57 | k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, k1f, \ | ||
| 58 | k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, k2f, \ | ||
| 59 | k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3e, \ | ||
| 60 | k40, k41, k42, k47, k4b, k4d, k4e, k4f, \ | ||
| 61 | k50, k51 \ | ||
| 62 | ) { \ | ||
| 63 | { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f }, \ | ||
| 64 | { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, XXX, k1e, k1f }, \ | ||
| 65 | { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d, XXX, k2f }, \ | ||
| 66 | { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, XXX, k3d, k3e, XXX }, \ | ||
| 67 | { k40, k41, k42, XXX, XXX, XXX, XXX, k47, XXX, XXX, XXX, k4b, XXX, k4d, k4e, k4f }, \ | ||
| 68 | { k50, k51, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX }, \ | ||
| 69 | } | ||
diff --git a/keyboards/monarch/readme.md b/keyboards/monarch/readme.md new file mode 100644 index 000000000..1e22d94af --- /dev/null +++ b/keyboards/monarch/readme.md | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | # Monarch | ||
| 2 | |||
| 3 |  | ||
| 4 | |||
| 5 | A 65percent keyboard with a rotary encoder and interchangeable inserts. | ||
| 6 | |||
| 7 | * Keyboard Maintainer: [Ramon Imbao](https://github.com/ramonimbao) | ||
| 8 | * Hardware Supported: STM32F072CBT6 | ||
| 9 | * Hardware Availability: https://www.kingkbs.com | ||
| 10 | |||
| 11 | Make example for this keyboard (after setting up your build environment): | ||
| 12 | |||
| 13 | make monarch: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/monarch/rules.mk b/keyboards/monarch/rules.mk new file mode 100644 index 000000000..5536d5334 --- /dev/null +++ b/keyboards/monarch/rules.mk | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | # MCU name | ||
| 2 | MCU = STM32F072 | ||
| 3 | |||
| 4 | # Build Options | ||
| 5 | # change yes to no to disable | ||
| 6 | # | ||
| 7 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration | ||
| 8 | MOUSEKEY_ENABLE = yes # Mouse keys | ||
| 9 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
| 10 | CONSOLE_ENABLE = yes # Console for debug | ||
| 11 | COMMAND_ENABLE = yes # Commands for debug and configuration | ||
| 12 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
| 13 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | ||
| 14 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 15 | NKRO_ENABLE = yes # USB Nkey Rollover | ||
| 16 | BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality | ||
| 17 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow | ||
| 18 | BLUETOOTH_ENABLE = no # Enable Bluetooth | ||
| 19 | AUDIO_ENABLE = no # Audio output | ||
| 20 | ENCODER_ENABLE = yes | ||
| 21 | |||
| 22 | # Enter lower-power sleep mode when on the ChibiOS idle thread | ||
| 23 | OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE | ||
