diff options
| author | Brandon Schlack <brandonschlack@gmail.com> | 2020-07-26 14:32:04 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-26 22:32:04 +0100 |
| commit | a6a13f96262ef1e8c91546f24cff5067f8026c23 (patch) | |
| tree | f447259c07ca4e5d04d6e9d7e2080792a35673a2 /keyboards/keybage | |
| parent | d2be3a7339fe42629f3616a00708c5e74d84fe61 (diff) | |
| download | qmk_firmware-a6a13f96262ef1e8c91546f24cff5067f8026c23.tar.gz qmk_firmware-a6a13f96262ef1e8c91546f24cff5067f8026c23.zip | |
[Keyboard] Add Keybage folder for RadPad (#9745)
* [Keyboard] Initial Keybage/RadPad firmware
* [Keyboard] RadPad apply pull request feedback
- Change `LAYOUT_***_Encoders` to `LAYOUT_***_encoders` in <keyboard>.h
- Remove bootloader comments and unnecessary build options from rules.mk
- Use `LTO_ENABLE`
- Remove empty config.h from default keymap
- Remove trailing ` \` from keymap
* [Keyboard] RadPad fix info.json
- Change `LAYOUT_***_Encoders` to `LAYOUT_***_encoders` in info.json
* [Keyboard] Add host LED status to OLED display
* [Keyboard] Use LAYOUT_4x4_encoders, not LAYOUT
* [Keyboard] Use LAYOUT_4x4_encoders, not LAYOUT
* [Keyboard] Remove DESCRIPTION from config.h
Diffstat (limited to 'keyboards/keybage')
| -rw-r--r-- | keyboards/keybage/radpad/config.h | 67 | ||||
| -rw-r--r-- | keyboards/keybage/radpad/info.json | 82 | ||||
| -rw-r--r-- | keyboards/keybage/radpad/keymaps/default/keymap.c | 141 | ||||
| -rw-r--r-- | keyboards/keybage/radpad/keymaps/default/readme.md | 1 | ||||
| -rw-r--r-- | keyboards/keybage/radpad/radpad.c | 17 | ||||
| -rw-r--r-- | keyboards/keybage/radpad/radpad.h | 87 | ||||
| -rw-r--r-- | keyboards/keybage/radpad/readme.md | 15 | ||||
| -rw-r--r-- | keyboards/keybage/radpad/rules.mk | 25 |
8 files changed, 435 insertions, 0 deletions
diff --git a/keyboards/keybage/radpad/config.h b/keyboards/keybage/radpad/config.h new file mode 100644 index 000000000..4692b3818 --- /dev/null +++ b/keyboards/keybage/radpad/config.h | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2020 Keybage | ||
| 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 0x4253 // "BS" | ||
| 24 | #define PRODUCT_ID 0x5250 // "RP" | ||
| 25 | #define DEVICE_VER 0x0001 | ||
| 26 | #define MANUFACTURER Keybage | ||
| 27 | #define PRODUCT RadPad | ||
| 28 | |||
| 29 | /* key matrix size */ | ||
| 30 | #define MATRIX_ROWS 5 | ||
| 31 | #define MATRIX_COLS 4 | ||
| 32 | |||
| 33 | #define MATRIX_ROW_PINS { F5, B5, B6, B2, B3 } | ||
| 34 | #define MATRIX_COL_PINS { E6, B4, D7, B1 } | ||
| 35 | #define UNUSED_PINS { B0, B7, C7, D2, D3, D5, F0 } | ||
| 36 | |||
| 37 | #define DIODE_DIRECTION COL2ROW | ||
| 38 | |||
| 39 | #define ENCODERS_PAD_A { D4, F6 } | ||
| 40 | #define ENCODERS_PAD_B { C6, F7 } | ||
| 41 | |||
| 42 | #define ENCODER_RESOLUTION 2 | ||
| 43 | |||
| 44 | #define RGB_DI_PIN F4 | ||
| 45 | #ifdef RGB_DI_PIN | ||
| 46 | #define RGBLED_NUM 16 | ||
| 47 | #define RGBLIGHT_SLEEP | ||
| 48 | /*== all animations disable ==*/ | ||
| 49 | #undef RGBLIGHT_ANIMATIONS | ||
| 50 | #endif | ||
| 51 | |||
| 52 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
| 53 | #define DEBOUNCE 5 | ||
| 54 | |||
| 55 | /* disable these deprecated features by default */ | ||
| 56 | #define NO_ACTION_MACRO | ||
| 57 | #define NO_ACTION_FUNCTION | ||
| 58 | |||
| 59 | /* Bootmagic Lite key configuration */ | ||
| 60 | #define BOOTMAGIC_LITE_ROW 1 | ||
| 61 | #define BOOTMAGIC_LITE_COLUMN 3 | ||
| 62 | |||
| 63 | /* OLED Configuration */ | ||
| 64 | #ifdef OLED_DRIVER_ENABLE | ||
| 65 | #define OLED_TIMEOUT 60000 | ||
| 66 | #define OLED_LOGO_TIMEOUT 3000 // How long (in ms) the logo appears at start up | ||
| 67 | #endif | ||
diff --git a/keyboards/keybage/radpad/info.json b/keyboards/keybage/radpad/info.json new file mode 100644 index 000000000..b8f2306e1 --- /dev/null +++ b/keyboards/keybage/radpad/info.json | |||
| @@ -0,0 +1,82 @@ | |||
| 1 | { | ||
| 2 | "keyboard_name": "radpad", | ||
| 3 | "url": "", | ||
| 4 | "maintainer": "Brandon Schlack", | ||
| 5 | "width": 4, | ||
| 6 | "height": 5, | ||
| 7 | "layouts": { | ||
| 8 | "LAYOUT_4x4_encoders": { | ||
| 9 | "layout": [ | ||
| 10 | {"x":0, "y":0}, | ||
| 11 | {"x":3, "y":0}, | ||
| 12 | {"x":0, "y":1}, | ||
| 13 | {"x":1, "y":1}, | ||
| 14 | {"x":2, "y":1}, | ||
| 15 | {"x":3, "y":1}, | ||
| 16 | {"x":0, "y":2}, | ||
| 17 | {"x":1, "y":2}, | ||
| 18 | {"x":2, "y":2}, | ||
| 19 | {"x":3, "y":2}, | ||
| 20 | {"x":0, "y":3}, | ||
| 21 | {"x":1, "y":3}, | ||
| 22 | {"x":2, "y":3}, | ||
| 23 | {"x":3, "y":3}, | ||
| 24 | {"x":0, "y":4}, | ||
| 25 | {"x":1, "y":4}, | ||
| 26 | {"x":2, "y":4}, | ||
| 27 | {"x":3, "y":4} | ||
| 28 | ] | ||
| 29 | }, | ||
| 30 | "LAYOUT_4x3_encoders": { | ||
| 31 | "layout": [ | ||
| 32 | {"x":0, "y":0}, | ||
| 33 | {"x":3, "y":0}, | ||
| 34 | {"x":0, "y":1}, | ||
| 35 | {"x":1, "y":1}, | ||
| 36 | {"x":2, "y":1}, | ||
| 37 | {"x":3, "y":1}, | ||
| 38 | {"x":0, "y":2}, | ||
| 39 | {"x":1, "y":2}, | ||
| 40 | {"x":2, "y":2}, | ||
| 41 | {"x":3, "y":2}, | ||
| 42 | {"x":0, "y":3}, | ||
| 43 | {"x":1, "y":3}, | ||
| 44 | {"x":2, "y":3}, | ||
| 45 | {"x":3, "y":3} | ||
| 46 | ] | ||
| 47 | }, | ||
| 48 | "LAYOUT_3x4_encoders": { | ||
| 49 | "layout": [ | ||
| 50 | {"x":1, "y":0}, | ||
| 51 | {"x":3, "y":0}, | ||
| 52 | {"x":1, "y":1}, | ||
| 53 | {"x":2, "y":1}, | ||
| 54 | {"x":3, "y":1}, | ||
| 55 | {"x":1, "y":2}, | ||
| 56 | {"x":2, "y":2}, | ||
| 57 | {"x":3, "y":2}, | ||
| 58 | {"x":1, "y":3}, | ||
| 59 | {"x":2, "y":3}, | ||
| 60 | {"x":3, "y":3}, | ||
| 61 | {"x":1, "y":4}, | ||
| 62 | {"x":2, "y":4}, | ||
| 63 | {"x":3, "y":4} | ||
| 64 | ] | ||
| 65 | }, | ||
| 66 | "LAYOUT_3x3_encoders": { | ||
| 67 | "layout": [ | ||
| 68 | {"x":1, "y":0}, | ||
| 69 | {"x":3, "y":0}, | ||
| 70 | {"x":1, "y":1}, | ||
| 71 | {"x":2, "y":1}, | ||
| 72 | {"x":3, "y":1}, | ||
| 73 | {"x":1, "y":2}, | ||
| 74 | {"x":2, "y":2}, | ||
| 75 | {"x":3, "y":2}, | ||
| 76 | {"x":1, "y":3}, | ||
| 77 | {"x":2, "y":3}, | ||
| 78 | {"x":3, "y":3} | ||
| 79 | ] | ||
| 80 | } | ||
| 81 | } | ||
| 82 | } | ||
diff --git a/keyboards/keybage/radpad/keymaps/default/keymap.c b/keyboards/keybage/radpad/keymaps/default/keymap.c new file mode 100644 index 000000000..f5904150e --- /dev/null +++ b/keyboards/keybage/radpad/keymaps/default/keymap.c | |||
| @@ -0,0 +1,141 @@ | |||
| 1 | /* Copyright 2020 Brandon Schlack | ||
| 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 | enum layer_names { | ||
| 19 | _BASE = 0, | ||
| 20 | _FN | ||
| 21 | }; | ||
| 22 | |||
| 23 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 24 | [_BASE] = LAYOUT_4x4_encoders( | ||
| 25 | KC_MUTE, KC_MPLY, | ||
| 26 | KC_PMNS, KC_P7, KC_P8, KC_P9, | ||
| 27 | KC_PPLS, KC_P4, KC_P5, KC_P6, | ||
| 28 | KC_BSPC, KC_P1, KC_P2, KC_P3, | ||
| 29 | KC_PENT, MO(_FN), KC_P0, KC_PDOT | ||
| 30 | ), | ||
| 31 | [_FN] = LAYOUT_4x4_encoders( | ||
| 32 | _______, _______, | ||
| 33 | KC_PSLS, KC_F21, KC_F22, KC_F23, | ||
| 34 | KC_PAST, KC_F18, KC_F19, KC_F20, | ||
| 35 | KC_NLCK, KC_F15, KC_F16, KC_F17, | ||
| 36 | RESET, _______, KC_F13, KC_F14 | ||
| 37 | ) | ||
| 38 | }; | ||
| 39 | |||
| 40 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
| 41 | if (index == 0) { /* Left encoder */ | ||
| 42 | if (clockwise) { | ||
| 43 | tap_code16(KC_VOLU); | ||
| 44 | } else { | ||
| 45 | tap_code16(KC_VOLD); | ||
| 46 | } | ||
| 47 | } else if (index == 1) { /* Right encoder */ | ||
| 48 | if (clockwise) { | ||
| 49 | tap_code16(KC_MNXT); | ||
| 50 | } else { | ||
| 51 | tap_code16(KC_MPRV); | ||
| 52 | } | ||
| 53 | } | ||
| 54 | } | ||
| 55 | |||
| 56 | #ifdef OLED_DRIVER_ENABLE | ||
| 57 | static uint32_t oled_logo_timer = 0; | ||
| 58 | bool oled_logo_cleared = false; // Set to true if you don't want a logo at all | ||
| 59 | |||
| 60 | static void render_status(void) { | ||
| 61 | // Host Keyboard Layer Status | ||
| 62 | oled_write_P(PSTR("Layer: "), false); | ||
| 63 | |||
| 64 | switch (get_highest_layer(layer_state)) { | ||
| 65 | case _BASE: | ||
| 66 | oled_write_P(PSTR("Numpad\n"), false); | ||
| 67 | break; | ||
| 68 | case _FN: | ||
| 69 | oled_write_P(PSTR("Macropad\n"), false); | ||
| 70 | break; | ||
| 71 | default: | ||
| 72 | // Or use the write_ln shortcut over adding '\n' to the end of your string | ||
| 73 | oled_write_ln_P(PSTR("Some Other Layer"), false); | ||
| 74 | } | ||
| 75 | |||
| 76 | // Empty Line | ||
| 77 | oled_write_ln_P(PSTR(" "), false); | ||
| 78 | |||
| 79 | // Host Keyboard LED Status | ||
| 80 | led_t led_state = host_keyboard_led_state(); | ||
| 81 | oled_write_P(led_state.num_lock ? PSTR(" NUM ") : PSTR(" "), led_state.num_lock); | ||
| 82 | oled_write_P(led_state.caps_lock ? PSTR(" CAP ") : PSTR(" "), led_state.caps_lock); | ||
| 83 | oled_write_P(led_state.scroll_lock ? PSTR(" SCR ") : PSTR(" "), led_state.scroll_lock); | ||
| 84 | } | ||
| 85 | |||
| 86 | /* | ||
| 87 | How to convert your own image: | ||
| 88 | https://docs.splitkb.com/hc/en-us/articles/360013811280 | ||
| 89 | */ | ||
| 90 | static void render_logo(void) { | ||
| 91 | static const char radpad_logo [] PROGMEM = { | ||
| 92 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xe0, 0xe0, 0xf0, 0xf0, 0xf0, 0xf8, 0xf8, | ||
| 93 | 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf0, 0xf0, 0xf0, 0xe0, 0xc0, 0x00, 0x00, 0x00, 0x00, | ||
| 94 | 0x00, 0x00, 0x00, 0xe0, 0xf0, 0xf0, 0xf0, 0xe0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 95 | 0x60, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, | ||
| 96 | 0xc0, 0xc0, 0xe0, 0xe0, 0xe0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf8, 0xf8, 0xf8, 0xf8, | ||
| 97 | 0xf8, 0xf0, 0xf0, 0xe0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf0, 0xf0, 0xf0, 0xe0, | ||
| 98 | 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xf0, 0xf0, | ||
| 99 | 0xf0, 0xf0, 0xf0, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0xc0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 100 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, | ||
| 101 | 0xf1, 0xf8, 0xf8, 0xfc, 0xfc, 0xfe, 0x7f, 0x3f, 0x1f, 0x1f, 0x0f, 0x0f, 0x07, 0x00, 0x80, 0xe0, | ||
| 102 | 0xf8, 0xfc, 0xff, 0xff, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xfe, 0xc0, 0xc0, 0xe0, 0xe0, 0xe0, 0xc0, | ||
| 103 | 0xc0, 0xf0, 0xfd, 0xff, 0xff, 0xff, 0x3f, 0x0f, 0x01, 0x00, 0x00, 0x81, 0xc1, 0xff, 0xff, 0xff, | ||
| 104 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xf9, 0xf8, 0xfc, 0x7e, 0x7e, 0x3f, | ||
| 105 | 0x3f, 0x1f, 0x1f, 0x0f, 0x07, 0x03, 0x80, 0xc0, 0xf0, 0xfc, 0xff, 0xff, 0xff, 0xbf, 0xff, 0xff, | ||
| 106 | 0xff, 0xff, 0xe0, 0xc0, 0xc0, 0xe0, 0xe0, 0xc0, 0x80, 0xe0, 0xfd, 0xff, 0xff, 0xff, 0x7f, 0x0f, | ||
| 107 | 0x03, 0x00, 0x00, 0x81, 0xc1, 0xf3, 0xff, 0xff, 0xff, 0x7f, 0x3f, 0x0f, 0x00, 0x00, 0x00, 0x00, | ||
| 108 | 0x00, 0x00, 0x00, 0x00, 0x80, 0xf0, 0xfc, 0xff, 0xff, 0x7f, 0x1f, 0x0f, 0x03, 0x03, 0x03, 0x01, | ||
| 109 | 0x01, 0x01, 0x0f, 0x7f, 0xff, 0xff, 0xfe, 0x80, 0x00, 0xe0, 0xf0, 0xf8, 0xfc, 0xff, 0xff, 0x3f, | ||
| 110 | 0x3f, 0x1f, 0x1f, 0x0f, 0x0f, 0x0f, 0x07, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xc3, 0xe3, 0xf9, 0xff, | ||
| 111 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xfc, 0xfc, 0x7e, 0x3e, 0x3f, 0x1f, 0x1f, 0x8f, 0xe7, 0xff, | ||
| 112 | 0xff, 0xff, 0x7f, 0x3f, 0x1f, 0x0f, 0x07, 0x07, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 113 | 0x00, 0xc0, 0xf0, 0xf8, 0xfc, 0xff, 0xff, 0x7f, 0x3f, 0x1f, 0x1f, 0x0f, 0x0f, 0x0f, 0x07, 0x1f, | ||
| 114 | 0xff, 0xff, 0xff, 0xff, 0xc3, 0xe3, 0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xf8, 0xfc, | ||
| 115 | 0x7e, 0x3e, 0x3f, 0x1f, 0x1f, 0x0f, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 116 | 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 117 | 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x07, 0x07, 0x00, 0x01, 0x01, 0x03, 0x03, 0x01, 0x00, 0x00, | ||
| 118 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x03, 0x07, 0x07, 0x07, 0x07, 0x03, | ||
| 119 | 0x07, 0x03, 0x03, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x1f, 0x1f, 0x0f, | ||
| 120 | 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 121 | 0x00, 0x00, 0x01, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 122 | 0x01, 0x03, 0x03, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x03, 0x03, 0x03, 0x01, 0x01, 0x00, 0x00, | ||
| 123 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | ||
| 124 | }; | ||
| 125 | oled_write_raw_P(radpad_logo, sizeof(radpad_logo)); | ||
| 126 | } | ||
| 127 | |||
| 128 | void oled_task_user(void) { | ||
| 129 | if (oled_logo_cleared) { | ||
| 130 | render_status(); | ||
| 131 | } else { | ||
| 132 | if (timer_elapsed32(oled_logo_timer) > OLED_LOGO_TIMEOUT) { | ||
| 133 | oled_clear(); | ||
| 134 | oled_logo_cleared = true; | ||
| 135 | render_status(); | ||
| 136 | } else { | ||
| 137 | render_logo(); | ||
| 138 | } | ||
| 139 | } | ||
| 140 | } | ||
| 141 | #endif | ||
diff --git a/keyboards/keybage/radpad/keymaps/default/readme.md b/keyboards/keybage/radpad/keymaps/default/readme.md new file mode 100644 index 000000000..053bf297b --- /dev/null +++ b/keyboards/keybage/radpad/keymaps/default/readme.md | |||
| @@ -0,0 +1 @@ | |||
| # The default keymap for radpad | |||
diff --git a/keyboards/keybage/radpad/radpad.c b/keyboards/keybage/radpad/radpad.c new file mode 100644 index 000000000..4a31d8f57 --- /dev/null +++ b/keyboards/keybage/radpad/radpad.c | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | /* Copyright 2020 Brandon Schlack | ||
| 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 "radpad.h" | ||
diff --git a/keyboards/keybage/radpad/radpad.h b/keyboards/keybage/radpad/radpad.h new file mode 100644 index 000000000..be6583bb8 --- /dev/null +++ b/keyboards/keybage/radpad/radpad.h | |||
| @@ -0,0 +1,87 @@ | |||
| 1 | /* Copyright 2020 Brandon Schlack | ||
| 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 XXX KC_NO | ||
| 22 | |||
| 23 | /* This is a shortcut to help you visually see your layout. | ||
| 24 | * | ||
| 25 | * The first section contains all of the arguments representing the physical | ||
| 26 | * layout of the board and position of the keys. | ||
| 27 | * | ||
| 28 | * The second converts the arguments into a two-dimensional array which | ||
| 29 | * represents the switch matrix. | ||
| 30 | */ | ||
| 31 | #define LAYOUT_4x4_encoders( \ | ||
| 32 | k00, k03, \ | ||
| 33 | k10, k11, k12, k13, \ | ||
| 34 | k20, k21, k22, k23, \ | ||
| 35 | k30, k31, k32, k33, \ | ||
| 36 | k40, k41, k42, k43 \ | ||
| 37 | ) \ | ||
| 38 | { \ | ||
| 39 | { k00, XXX, XXX, k03 }, \ | ||
| 40 | { k10, k11, k12, k13 }, \ | ||
| 41 | { k20, k21, k22, k23 }, \ | ||
| 42 | { k30, k31, k32, k33 }, \ | ||
| 43 | { k40, k41, k42, k43 } \ | ||
| 44 | } | ||
| 45 | |||
| 46 | #define LAYOUT_4x3_encoders( \ | ||
| 47 | k00, k03, \ | ||
| 48 | k10, k11, k12, k13, \ | ||
| 49 | k20, k21, k22, k23, \ | ||
| 50 | k30, k31, k32, k33 \ | ||
| 51 | ) \ | ||
| 52 | { \ | ||
| 53 | { k00, XXX, XXX, k03 }, \ | ||
| 54 | { k10, k11, k12, k13 }, \ | ||
| 55 | { k20, k21, k22, k23 }, \ | ||
| 56 | { k30, k31, k32, k33 }, \ | ||
| 57 | { XXX, XXX, XXX, XXX } \ | ||
| 58 | } | ||
| 59 | |||
| 60 | #define LAYOUT_3x4_encoders( \ | ||
| 61 | k01, k03, \ | ||
| 62 | k11, k12, k13, \ | ||
| 63 | k21, k22, k23, \ | ||
| 64 | k31, k32, k33, \ | ||
| 65 | k41, k42, k43 \ | ||
| 66 | ) \ | ||
| 67 | { \ | ||
| 68 | { XXX, k01, XXX, k03 }, \ | ||
| 69 | { XXX, k11, k12, k13 }, \ | ||
| 70 | { XXX, k21, k22, k23 }, \ | ||
| 71 | { XXX, k31, k32, k33 }, \ | ||
| 72 | { XXX, k41, k42, k43 } \ | ||
| 73 | } | ||
| 74 | |||
| 75 | #define LAYOUT_3x3_encoders( \ | ||
| 76 | k01, k03, \ | ||
| 77 | k11, k12, k13, \ | ||
| 78 | k21, k22, k23, \ | ||
| 79 | k31, k32, k33 \ | ||
| 80 | ) \ | ||
| 81 | { \ | ||
| 82 | { XXX, k01, XXX, k03 }, \ | ||
| 83 | { XXX, k11, k12, k13 }, \ | ||
| 84 | { XXX, k21, k22, k23 }, \ | ||
| 85 | { XXX, k31, k32, k33 }, \ | ||
| 86 | { XXX, XXX, XXX, XXX } \ | ||
| 87 | } | ||
diff --git a/keyboards/keybage/radpad/readme.md b/keyboards/keybage/radpad/readme.md new file mode 100644 index 000000000..d414578c0 --- /dev/null +++ b/keyboards/keybage/radpad/readme.md | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | # RadPad | ||
| 2 | |||
| 3 |  | ||
| 4 | |||
| 5 | A DIY-focused 4x4 numpad that supports up to 2 Rotary Encoders and an OLED screen. | ||
| 6 | |||
| 7 | * Keyboard Maintainer: [Brandon Schlack](https://github.com/brandonschlack) | ||
| 8 | * Hardware Supported: Pro Micro, Elite-C, Proton C | ||
| 9 | * Hardware Availability: TBD, awaiting final protos | ||
| 10 | |||
| 11 | Make example for this keyboard (after setting up your build environment): | ||
| 12 | |||
| 13 | make keybage/radpad: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/keybage/radpad/rules.mk b/keyboards/keybage/radpad/rules.mk new file mode 100644 index 000000000..74f4c4874 --- /dev/null +++ b/keyboards/keybage/radpad/rules.mk | |||
| @@ -0,0 +1,25 @@ | |||
| 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 = 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 | ||
| 24 | OLED_DRIVER_ENABLE = yes | ||
| 25 | LTO_ENABLE = yes | ||
