diff options
| author | Daveyr <26368709+Daveyr@users.noreply.github.com> | 2021-05-14 03:00:25 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-13 19:00:25 -0700 |
| commit | 0aaddf697fb977c8457f3b0231c2f007ac1e0fb9 (patch) | |
| tree | 160a4b3ee1f1bc2541f89d7e828e87f2355d01f9 /keyboards | |
| parent | cef1d19a6ceb2ce6adad1b336946bf357dbb487f (diff) | |
| download | qmk_firmware-0aaddf697fb977c8457f3b0231c2f007ac1e0fb9.tar.gz qmk_firmware-0aaddf697fb977c8457f3b0231c2f007ac1e0fb9.zip | |
[Keyboard] added yampad configuration to keyboard subfolder (#10112)
* added yampad configuration to keyboard subfolder
* Update keyboards/yampad/config.h
Co-authored-by: Drashna Jaelre <drashna@live.com>
* Update keyboards/yampad/config.h
Co-authored-by: Drashna Jaelre <drashna@live.com>
* Update keyboards/yampad/config.h
Co-authored-by: Drashna Jaelre <drashna@live.com>
* Update keyboards/yampad/keymaps/default/keymap.c
Co-authored-by: Drashna Jaelre <drashna@live.com>
* Update keyboards/yampad/keymaps/default/keymap.c
Co-authored-by: Drashna Jaelre <drashna@live.com>
* Update keyboards/yampad/rules.mk
Co-authored-by: Drashna Jaelre <drashna@live.com>
* Update keyboards/yampad/rules.mk
Co-authored-by: Drashna Jaelre <drashna@live.com>
* Update keyboards/yampad/rules.mk
Co-authored-by: Drashna Jaelre <drashna@live.com>
* Update keyboards/yampad/keymaps/default/keymap.c
Co-authored-by: Drashna Jaelre <drashna@live.com>
* Update keyboards/yampad/keymaps/default/keymap.c
Co-authored-by: Drashna Jaelre <drashna@live.com>
* Update keyboards/yampad/config.h
Co-authored-by: Drashna Jaelre <drashna@live.com>
* Update keyboards/yampad/keymaps/default/keymap.c
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update keyboards/yampad/config.h
Co-authored-by: Drashna Jaelre <drashna@live.com>
* Update keyboards/yampad/keymaps/default/keymap.c
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update keyboards/yampad/keymaps/default/keymap.c
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update keyboards/yampad/keymaps/default/keymap.c
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update keyboards/yampad/readme.md
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update keyboards/yampad/rules.mk
Co-authored-by: Ryan <fauxpark@gmail.com>
* added debouncing algorithm, delay and a traditional layout
* added link to readme
* some missed conflicts resolved in readme and rule
* Update readme.md
* Update keyboards/yampad/keymaps/traditional/keymap.c
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update keyboards/yampad/keymaps/traditional/keymap.c
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update keyboards/yampad/keymaps/traditional/keymap.c
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update keyboards/yampad/keymaps/traditional/keymap.c
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update keyboards/yampad/readme.md
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update keyboards/yampad/keymaps/traditional/keymap.c
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update keyboards/yampad/keymaps/traditional/keymap.c
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update keyboards/yampad/keymaps/default/keymap.c
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update keyboards/yampad/keymaps/traditional/keymap.c
Co-authored-by: Drashna Jaelre <drashna@live.com>
* Update keyboards/yampad/keymaps/traditional/keymap.c
Co-authored-by: Drashna Jaelre <drashna@live.com>
* Update keyboards/yampad/keymaps/default/keymap.c
Co-authored-by: Drashna Jaelre <drashna@live.com>
* Update keyboards/yampad/keymaps/traditional/keymap.c
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update keyboards/yampad/yampad.c
As suggested
Co-authored-by: Drashna Jaelre <drashna@live.com>
* Update readme.md
Updated per suggestion
* Update keymap.c
Add MIT licence
* Update keymap.c
Added MIT licence to the traditional layout.
* Update keyboards/yampad/readme.md
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update keyboards/yampad/readme.md
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update keyboards/yampad/yampad.c
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
* Update keyboards/yampad/yampad.c
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
* make cases numerical in .c file
* corrected the bootloader in rules.mk
* Update keyboards/yampad/rules.mk
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Richard <davey.richard@gmail.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
Diffstat (limited to 'keyboards')
| -rw-r--r-- | keyboards/yampad/config.h | 85 | ||||
| -rw-r--r-- | keyboards/yampad/keymaps/default/keymap.c | 163 | ||||
| -rw-r--r-- | keyboards/yampad/keymaps/traditional/keymap.c | 163 | ||||
| -rw-r--r-- | keyboards/yampad/readme.md | 19 | ||||
| -rw-r--r-- | keyboards/yampad/rules.mk | 24 | ||||
| -rw-r--r-- | keyboards/yampad/yampad.c | 64 | ||||
| -rw-r--r-- | keyboards/yampad/yampad.h | 57 |
7 files changed, 575 insertions, 0 deletions
diff --git a/keyboards/yampad/config.h b/keyboards/yampad/config.h new file mode 100644 index 000000000..d04ae37d5 --- /dev/null +++ b/keyboards/yampad/config.h | |||
| @@ -0,0 +1,85 @@ | |||
| 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 0xFEED | ||
| 24 | #define PRODUCT_ID 0x8369 | ||
| 25 | #define DEVICE_VER 0x0001 | ||
| 26 | #define MANUFACTURER Mattia Dal Ben | ||
| 27 | #define PRODUCT Yampad | ||
| 28 | |||
| 29 | /* key matrix size */ | ||
| 30 | #define MATRIX_ROWS 5 | ||
| 31 | #define MATRIX_COLS 4 | ||
| 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 | * | ||
| 42 | */ | ||
| 43 | #define MATRIX_ROW_PINS { C6, D7, E6, B4, B5 } | ||
| 44 | #define MATRIX_COL_PINS { B1, B3, B2, B6 } | ||
| 45 | |||
| 46 | /* COL2ROW or ROW2COL */ | ||
| 47 | #define DIODE_DIRECTION COL2ROW | ||
| 48 | |||
| 49 | /* Underlight configuration */ | ||
| 50 | #define RGB_DI_PIN F4 | ||
| 51 | #define RGBLED_NUM 9 | ||
| 52 | #define RGBLIGHT_ANIMATIONS | ||
| 53 | |||
| 54 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
| 55 | #define DEBOUNCE 2 | ||
| 56 | |||
| 57 | /* define if matrix has ghost (lacks anti-ghosting diodes) */ | ||
| 58 | //#define MATRIX_HAS_GHOST | ||
| 59 | |||
| 60 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
| 61 | //#define LOCKING_SUPPORT_ENABLE | ||
| 62 | /* Locking resynchronize hack */ | ||
| 63 | //#define LOCKING_RESYNC_ENABLE | ||
| 64 | |||
| 65 | /* | ||
| 66 | * Feature disable options | ||
| 67 | * These options are also useful to firmware size reduction. | ||
| 68 | */ | ||
| 69 | |||
| 70 | /* disable debug print */ | ||
| 71 | //#define NO_DEBUG | ||
| 72 | |||
| 73 | /* disable print */ | ||
| 74 | //#define NO_PRINT | ||
| 75 | |||
| 76 | /* disable action features */ | ||
| 77 | //#define NO_ACTION_LAYER | ||
| 78 | //#define NO_ACTION_TAPPING | ||
| 79 | //#define NO_ACTION_ONESHOT | ||
| 80 | #define NO_ACTION_MACRO | ||
| 81 | #define NO_ACTION_FUNCTION | ||
| 82 | |||
| 83 | /* Bootmagic Lite key configuration */ | ||
| 84 | // #define BOOTMAGIC_LITE_ROW 0 | ||
| 85 | // #define BOOTMAGIC_LITE_COLUMN 0 | ||
diff --git a/keyboards/yampad/keymaps/default/keymap.c b/keyboards/yampad/keymaps/default/keymap.c new file mode 100644 index 000000000..dfecab17e --- /dev/null +++ b/keyboards/yampad/keymaps/default/keymap.c | |||
| @@ -0,0 +1,163 @@ | |||
| 1 | /* MIT License | ||
| 2 | |||
| 3 | Copyright (c) 2019 Mattia Dal Ben | ||
| 4 | |||
| 5 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 6 | of this software and associated documentation files (the "Software"), to deal | ||
| 7 | in the Software without restriction, including without limitation the rights | ||
| 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| 9 | copies of the Software, and to permit persons to whom the Software is | ||
| 10 | furnished to do so, subject to the following conditions: | ||
| 11 | |||
| 12 | The above copyright notice and this permission notice shall be included in all | ||
| 13 | copies or substantial portions of the Software. | ||
| 14 | |||
| 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| 21 | SOFTWARE. | ||
| 22 | */ | ||
| 23 | |||
| 24 | #include QMK_KEYBOARD_H | ||
| 25 | |||
| 26 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
| 27 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
| 28 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 29 | // entirely and just use numbers. | ||
| 30 | enum layers { | ||
| 31 | _BL, | ||
| 32 | _NV, | ||
| 33 | _FN | ||
| 34 | }; | ||
| 35 | |||
| 36 | enum custom_keycodes { | ||
| 37 | KC_DBL0 = SAFE_RANGE, | ||
| 38 | }; | ||
| 39 | |||
| 40 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 41 | /* Keymap _BL: (Base Layer) Default Layer | ||
| 42 | * ,-------------------. | ||
| 43 | * | NV | / | * |-/FN| | ||
| 44 | * |----|----|----|----| | ||
| 45 | * | 7 | 8 | 9 | | | ||
| 46 | * |----|----|----| + | | ||
| 47 | * | 4 | 5 | 6 | | | ||
| 48 | * |----|----|----|----| | ||
| 49 | * | 1 | 2 | 3 | | | ||
| 50 | * |----|----|----| En | | ||
| 51 | * | 0 | 00 | . | | | ||
| 52 | * `-------------------' | ||
| 53 | */ | ||
| 54 | [_BL] = LAYOUT( | ||
| 55 | TG(_NV), KC_PSLS, KC_PAST, LT(_FN, KC_PMNS), | ||
| 56 | KC_P7, KC_P8, KC_P9, | ||
| 57 | KC_P4, KC_P5, KC_P6, KC_PPLS, | ||
| 58 | KC_P1, KC_P2, KC_P3, | ||
| 59 | KC_P0, KC_DBL0, KC_PDOT, KC_PENT | ||
| 60 | ), | ||
| 61 | |||
| 62 | /* Keymap _NV: Navigation layer | ||
| 63 | * ,-------------------. | ||
| 64 | * |INS |HOME|PGUP| | | ||
| 65 | * |----|----|----|----| | ||
| 66 | * |DEL |END |PGDN| | | ||
| 67 | * |----|----|----| | | ||
| 68 | * | | | | | | ||
| 69 | * |----|----|----|----| | ||
| 70 | * | | UP | | | | ||
| 71 | * |----|----|----| | | ||
| 72 | * |LEFT|DOWN|RIGH| | | ||
| 73 | * `-------------------' | ||
| 74 | */ | ||
| 75 | [_NV] = LAYOUT( | ||
| 76 | KC_INS, KC_HOME, KC_PGUP, TG(_NV), | ||
| 77 | KC_DEL, KC_END, KC_PGDN, | ||
| 78 | XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
| 79 | XXXXXXX, KC_UP, XXXXXXX, | ||
| 80 | KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX | ||
| 81 | ), | ||
| 82 | |||
| 83 | /* Keymap _FN: RGB Function Layer | ||
| 84 | * ,-------------------. | ||
| 85 | * |RMOD|RGBP|RTOG| FN | | ||
| 86 | * |----|----|----|----| | ||
| 87 | * |HUD |HUI | | | | ||
| 88 | * |----|----|----| | | ||
| 89 | * |SAD |SAI | | | | ||
| 90 | * |----|----|----|----| | ||
| 91 | * |VAD |VAS | | | | ||
| 92 | * |----|----|----| | | ||
| 93 | * |RST | | | | | ||
| 94 | * `-------------------' | ||
| 95 | */ | ||
| 96 | [_FN] = LAYOUT( | ||
| 97 | RGB_MOD, RGB_M_P, RGB_TOG, _______, | ||
| 98 | RGB_HUD, RGB_HUI, XXXXXXX, | ||
| 99 | RGB_SAD, RGB_SAI, XXXXXXX, XXXXXXX, | ||
| 100 | RGB_VAD, RGB_VAI, XXXXXXX, | ||
| 101 | RESET, XXXXXXX, XXXXXXX, XXXXXXX | ||
| 102 | ), | ||
| 103 | }; | ||
| 104 | |||
| 105 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 106 | switch (keycode) { | ||
| 107 | case KC_DBL0: | ||
| 108 | if (record->event.pressed) { | ||
| 109 | SEND_STRING("00"); | ||
| 110 | } else { | ||
| 111 | // when keycode KC_DBL0 is released | ||
| 112 | } | ||
| 113 | break; | ||
| 114 | |||
| 115 | } | ||
| 116 | return true; | ||
| 117 | }; | ||
| 118 | |||
| 119 | #ifdef OLED_DRIVER_ENABLE | ||
| 120 | |||
| 121 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { | ||
| 122 | return OLED_ROTATION_270; // flips the display 270 degrees | ||
| 123 | } | ||
| 124 | |||
| 125 | void oled_task_user(void) { | ||
| 126 | // Host Keyboard Layer Status | ||
| 127 | oled_write_P(PSTR("Layer"), false); | ||
| 128 | switch (get_highest_layer(layer_state)) { | ||
| 129 | case _BL: | ||
| 130 | oled_write_ln_P(PSTR(" BAS"), false); | ||
| 131 | break; | ||
| 132 | case _NV: | ||
| 133 | oled_write_ln_P(PSTR(" NAV"), false); | ||
| 134 | break; | ||
| 135 | case _FN: | ||
| 136 | oled_write_ln_P(PSTR(" RGB"), false); | ||
| 137 | break; | ||
| 138 | default: | ||
| 139 | // Or use the write_ln shortcut over adding '\n' to the end of your string | ||
| 140 | oled_write_ln_P(PSTR(" UND"), false); | ||
| 141 | } | ||
| 142 | |||
| 143 | // Host Keyboard LED Status | ||
| 144 | led_t led_state = host_keyboard_led_state(); | ||
| 145 | oled_write_P(PSTR("-----"), false); | ||
| 146 | oled_write_P(PSTR("Stats"), false); | ||
| 147 | oled_write_P(led_state.num_lock ? PSTR("num:*") : PSTR("num:."), false); | ||
| 148 | oled_write_P(led_state.caps_lock ? PSTR("cap:*") : PSTR("cap:."), false); | ||
| 149 | oled_write_P(led_state.scroll_lock ? PSTR("scr:*") : PSTR("scr:."), false); | ||
| 150 | |||
| 151 | // Host Keyboard RGB backlight status | ||
| 152 | oled_write_P(PSTR("-----"), false); | ||
| 153 | oled_write_P(PSTR("Light"), false); | ||
| 154 | |||
| 155 | static char led_buf[30]; | ||
| 156 | snprintf(led_buf, sizeof(led_buf) - 1, "RGB:%cM: %2d\nh: %2ds: %2dv: %2d\n", | ||
| 157 | rgblight_is_enabled() ? '*' : '.', (uint8_t)rgblight_get_mode(), | ||
| 158 | (uint8_t)(rgblight_get_hue() / RGBLIGHT_HUE_STEP), | ||
| 159 | (uint8_t)(rgblight_get_sat() / RGBLIGHT_SAT_STEP), | ||
| 160 | (uint8_t)(rgblight_get_val() / RGBLIGHT_VAL_STEP)); | ||
| 161 | oled_write(led_buf, false); | ||
| 162 | } | ||
| 163 | #endif | ||
diff --git a/keyboards/yampad/keymaps/traditional/keymap.c b/keyboards/yampad/keymaps/traditional/keymap.c new file mode 100644 index 000000000..e9fd2b8ae --- /dev/null +++ b/keyboards/yampad/keymaps/traditional/keymap.c | |||
| @@ -0,0 +1,163 @@ | |||
| 1 | /* MIT License | ||
| 2 | |||
| 3 | Copyright (c) 2020 Richard Davey (Daveyr) | ||
| 4 | |||
| 5 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 6 | of this software and associated documentation files (the "Software"), to deal | ||
| 7 | in the Software without restriction, including without limitation the rights | ||
| 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| 9 | copies of the Software, and to permit persons to whom the Software is | ||
| 10 | furnished to do so, subject to the following conditions: | ||
| 11 | |||
| 12 | The above copyright notice and this permission notice shall be included in all | ||
| 13 | copies or substantial portions of the Software. | ||
| 14 | |||
| 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| 21 | SOFTWARE. | ||
| 22 | */ | ||
| 23 | |||
| 24 | #include QMK_KEYBOARD_H | ||
| 25 | |||
| 26 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
| 27 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
| 28 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 29 | // entirely and just use numbers. | ||
| 30 | enum layers { | ||
| 31 | _BL = 0, | ||
| 32 | _NV, | ||
| 33 | _FN | ||
| 34 | }; | ||
| 35 | |||
| 36 | enum custom_keycodes { | ||
| 37 | KC_DBL0 = SAFE_RANGE, | ||
| 38 | }; | ||
| 39 | |||
| 40 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 41 | /* Keymap _BL: (Base Layer) Default Layer | ||
| 42 | * ,-------------------. | ||
| 43 | * | NV | / | * |-/FN| | ||
| 44 | * |----|----|----|----| | ||
| 45 | * | 7 | 8 | 9 | | | ||
| 46 | * |----|----|----| + | | ||
| 47 | * | 4 | 5 | 6 | | | ||
| 48 | * |----|----|----|----| | ||
| 49 | * | 1 | 2 | 3 | | | ||
| 50 | * |----|----|----| En | | ||
| 51 | * | 0 | 00 | . | | | ||
| 52 | * `-------------------' | ||
| 53 | */ | ||
| 54 | [_BL] = LAYOUT( | ||
| 55 | TG(_NV), KC_PSLS, KC_PAST, LT(_FN, KC_PMNS), | ||
| 56 | KC_P7, KC_P8, KC_P9, | ||
| 57 | KC_P4, KC_P5, KC_P6, KC_PPLS, | ||
| 58 | KC_P1, KC_P2, KC_P3, | ||
| 59 | KC_P0, KC_DBL0, KC_PDOT, KC_PENT | ||
| 60 | ), | ||
| 61 | |||
| 62 | /* Keymap _NV: Navigation layer | ||
| 63 | * ,-------------------. | ||
| 64 | * |INS |BSPC| | | | ||
| 65 | * |----|----|----|----| | ||
| 66 | * |HOME| UP |PGUP| | | ||
| 67 | * |----|----|----| | | ||
| 68 | * |LEFT|DEL |RGHT| | | ||
| 69 | * |----|----|----|----| | ||
| 70 | * |END |DOWN|PGDN| | | ||
| 71 | * |----|----|----| | | ||
| 72 | * | | | | | | ||
| 73 | * `-------------------' | ||
| 74 | */ | ||
| 75 | [_NV] = LAYOUT( | ||
| 76 | KC_INS, KC_BSPACE, XXXXXXX, TG(_NV), | ||
| 77 | KC_HOME, KC_UP, KC_PGUP, | ||
| 78 | KC_LEFT, KC_DEL, KC_RGHT, XXXXXXX, | ||
| 79 | KC_END, KC_DOWN, KC_PGDN, | ||
| 80 | XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX | ||
| 81 | ), | ||
| 82 | |||
| 83 | /* Keymap _FN: RGB Function Layer | ||
| 84 | * ,-------------------. | ||
| 85 | * |RMOD|RGBP|RTOG| FN | | ||
| 86 | * |----|----|----|----| | ||
| 87 | * |HUD |HUI | | | | ||
| 88 | * |----|----|----| | | ||
| 89 | * |SAD |SAI | | | | ||
| 90 | * |----|----|----|----| | ||
| 91 | * |VAD |VAS | | | | ||
| 92 | * |----|----|----| | | ||
| 93 | * |RST | | | | | ||
| 94 | * `-------------------' | ||
| 95 | */ | ||
| 96 | [_FN] = LAYOUT( | ||
| 97 | RGB_MOD, RGB_M_P, RGB_TOG, _______, | ||
| 98 | RGB_HUD, RGB_HUI, XXXXXXX, | ||
| 99 | RGB_SAD, RGB_SAI, XXXXXXX, XXXXXXX, | ||
| 100 | RGB_VAD, RGB_VAI, XXXXXXX, | ||
| 101 | RESET, XXXXXXX, XXXXXXX, XXXXXXX | ||
| 102 | ), | ||
| 103 | }; | ||
| 104 | |||
| 105 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 106 | switch (keycode) { | ||
| 107 | case KC_DBL0: | ||
| 108 | if (record->event.pressed) { | ||
| 109 | SEND_STRING("00"); | ||
| 110 | } else { | ||
| 111 | // when keycode KC_DBL0 is released | ||
| 112 | } | ||
| 113 | break; | ||
| 114 | |||
| 115 | } | ||
| 116 | return true; | ||
| 117 | }; | ||
| 118 | |||
| 119 | #ifdef OLED_DRIVER_ENABLE | ||
| 120 | |||
| 121 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { | ||
| 122 | return OLED_ROTATION_270; // flips the display 270 degrees | ||
| 123 | } | ||
| 124 | |||
| 125 | void oled_task_user(void) { | ||
| 126 | // Host Keyboard Layer Status | ||
| 127 | oled_write_P(PSTR("Layer"), false); | ||
| 128 | switch (get_highest_layer(layer_state)) { | ||
| 129 | case _BL: | ||
| 130 | oled_write_ln_P(PSTR(" BAS"), false); | ||
| 131 | break; | ||
| 132 | case _NV: | ||
| 133 | oled_write_ln_P(PSTR(" NAV"), false); | ||
| 134 | break; | ||
| 135 | case _FN: | ||
| 136 | oled_write_ln_P(PSTR(" RGB"), false); | ||
| 137 | break; | ||
| 138 | default: | ||
| 139 | // Or use the write_ln shortcut over adding '\n' to the end of your string | ||
| 140 | oled_write_ln_P(PSTR(" UND"), false); | ||
| 141 | } | ||
| 142 | |||
| 143 | // Host Keyboard LED Status | ||
| 144 | led_t led_state = host_keyboard_led_state(); | ||
| 145 | oled_write_P(PSTR("-----"), false); | ||
| 146 | oled_write_P(PSTR("Stats"), false); | ||
| 147 | oled_write_P(led_state.num_lock ? PSTR("num:*") : PSTR("num:."), false); | ||
| 148 | oled_write_P(led_state.caps_lock ? PSTR("cap:*") : PSTR("cap:."), false); | ||
| 149 | oled_write_P(led_state.scroll_lock ? PSTR("scr:*") : PSTR("scr:."), false); | ||
| 150 | |||
| 151 | // Host Keyboard RGB backlight status | ||
| 152 | oled_write_P(PSTR("-----"), false); | ||
| 153 | oled_write_P(PSTR("Light"), false); | ||
| 154 | |||
| 155 | static char led_buf[30]; | ||
| 156 | snprintf(led_buf, sizeof(led_buf) - 1, "RGB:%cM: %2d\nh: %2ds: %2dv: %2d\n", | ||
| 157 | rgblight_is_enabled() ? '*' : '.', (uint8_t)rgblight_get_mode(), | ||
| 158 | (uint8_t)(rgblight_get_hue() / RGBLIGHT_HUE_STEP), | ||
| 159 | (uint8_t)(rgblight_get_sat() / RGBLIGHT_SAT_STEP), | ||
| 160 | (uint8_t)(rgblight_get_val() / RGBLIGHT_VAL_STEP)); | ||
| 161 | oled_write(led_buf, false); | ||
| 162 | } | ||
| 163 | #endif | ||
diff --git a/keyboards/yampad/readme.md b/keyboards/yampad/readme.md new file mode 100644 index 000000000..e6cc03d60 --- /dev/null +++ b/keyboards/yampad/readme.md | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | # Yampad | ||
| 2 | |||
| 3 |  | ||
| 4 | |||
| 5 | The Yampad project is an open-source, QMK (Quantum Mechanical Keyboard Firmware) powered, hot-swappable, RGB-backlighted, OLED featured, mechanical numpad. This repository will be used to share information about the project and instruction on how to use and assemble the Yampad. | ||
| 6 | |||
| 7 | * Keyboard Maintainer: [mattdibi](https://github.com/mattdibi) | ||
| 8 | * Hardware Supported: Pro Micro, (ATmega32u4) | ||
| 9 | * Hardware Availability: https://github.com/mattdibi/yampad | ||
| 10 | |||
| 11 | Make example for this keyboard (after setting up your build environment): | ||
| 12 | |||
| 13 | make yampad:default | ||
| 14 | |||
| 15 | Flashing example for this keyboard: | ||
| 16 | |||
| 17 | make yampad:default:flash | ||
| 18 | |||
| 19 | 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/yampad/rules.mk b/keyboards/yampad/rules.mk new file mode 100644 index 000000000..db0a8b5da --- /dev/null +++ b/keyboards/yampad/rules.mk | |||
| @@ -0,0 +1,24 @@ | |||
| 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 = no # Mouse keys | ||
| 12 | EXTRAKEY_ENABLE = no # 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 | OLED_DRIVER_ENABLE = yes | ||
| 24 | DEBOUNCE_TYPE = eager_pk | ||
diff --git a/keyboards/yampad/yampad.c b/keyboards/yampad/yampad.c new file mode 100644 index 000000000..764f48404 --- /dev/null +++ b/keyboards/yampad/yampad.c | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | |||
| 2 | /* Copyright 2019 | ||
| 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 | #include "yampad.h" | ||
| 18 | |||
| 19 | #if defined(OLED_DRIVER_ENABLE) | ||
| 20 | __attribute__((weak)) | ||
| 21 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { | ||
| 22 | return OLED_ROTATION_270; // flips the display 270 degrees | ||
| 23 | } | ||
| 24 | |||
| 25 | __attribute__((weak)) | ||
| 26 | void oled_task_user(void) { | ||
| 27 | // Host Keyboard Layer Status | ||
| 28 | oled_write_P(PSTR("Layer"), false); | ||
| 29 | switch (get_highest_layer(layer_state)) { | ||
| 30 | case 0: | ||
| 31 | oled_write_ln_P(PSTR(" BAS"), false); | ||
| 32 | break; | ||
| 33 | case 1: | ||
| 34 | oled_write_ln_P(PSTR(" NAV"), false); | ||
| 35 | break; | ||
| 36 | case 2: | ||
| 37 | oled_write_ln_P(PSTR(" RGB"), false); | ||
| 38 | break; | ||
| 39 | default: | ||
| 40 | // Or use the write_ln shortcut over adding '\n' to the end of your string | ||
| 41 | oled_write_ln_P(PSTR(" UND"), false); | ||
| 42 | } | ||
| 43 | |||
| 44 | // Host Keyboard LED Status | ||
| 45 | led_t led_state = host_keyboard_led_state(); | ||
| 46 | oled_write_P(PSTR("-----"), false); | ||
| 47 | oled_write_P(PSTR("Stats"), false); | ||
| 48 | oled_write_P(led_state.num_lock ? PSTR("num:*") : PSTR("num:."), false); | ||
| 49 | oled_write_P(led_state.caps_lock ? PSTR("cap:*") : PSTR("cap:."), false); | ||
| 50 | oled_write_P(led_state.scroll_lock ? PSTR("scr:*") : PSTR("scr:."), false); | ||
| 51 | |||
| 52 | // Host Keyboard RGB backlight status | ||
| 53 | oled_write_P(PSTR("-----"), false); | ||
| 54 | oled_write_P(PSTR("Light"), false); | ||
| 55 | |||
| 56 | static char led_buf[30]; | ||
| 57 | snprintf(led_buf, sizeof(led_buf) - 1, "RGB:%cM: %2d\nh: %2ds: %2dv: %2d\n", | ||
| 58 | rgblight_is_enabled() ? '*' : '.', (uint8_t)rgblight_get_mode(), | ||
| 59 | (uint8_t)(rgblight_get_hue() / RGBLIGHT_HUE_STEP), | ||
| 60 | (uint8_t)(rgblight_get_sat() / RGBLIGHT_SAT_STEP), | ||
| 61 | (uint8_t)(rgblight_get_val() / RGBLIGHT_VAL_STEP)); | ||
| 62 | oled_write(led_buf, false); | ||
| 63 | } | ||
| 64 | #endif | ||
diff --git a/keyboards/yampad/yampad.h b/keyboards/yampad/yampad.h new file mode 100644 index 000000000..68ec98ffd --- /dev/null +++ b/keyboards/yampad/yampad.h | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | |||
| 2 | /* Copyright 2019 | ||
| 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 | #pragma once | ||
| 18 | |||
| 19 | #include "quantum.h" | ||
| 20 | #define ___ KC_NO | ||
| 21 | |||
| 22 | /* This a shortcut to help you visually see your layout. | ||
| 23 | * | ||
| 24 | * The first section contains all of the arguments representing the physical | ||
| 25 | * layout of the board and position of the keys. | ||
| 26 | * | ||
| 27 | * The second converts the arguments into a two-dimensional array which | ||
| 28 | * represents the switch matrix. | ||
| 29 | */ | ||
| 30 | |||
| 31 | /* COSPAD numpad matrix layout | ||
| 32 | * ,-------------------. | ||
| 33 | * | 00 | 01 | 02 | 03 | | ||
| 34 | * |----|----|----|----| | ||
| 35 | * | 10 | 11 | 12 | | | ||
| 36 | * |----|----|----| 13 | | ||
| 37 | * | 20 | 21 | 22 | | | ||
| 38 | * |----|----|----|----| | ||
| 39 | * | 30 | 31 | 32 | | | ||
| 40 | * |----|----|----| 43 | | ||
| 41 | * | 40 | 41 | 42 | | | ||
| 42 | * `-------------------' | ||
| 43 | */ | ||
| 44 | #define LAYOUT( \ | ||
| 45 | k00, k01, k02, k03, \ | ||
| 46 | k10, k11, k12, \ | ||
| 47 | k20, k21, k22, k13, \ | ||
| 48 | k30, k31, k32, \ | ||
| 49 | k40, k41, k42, k43 \ | ||
| 50 | ) \ | ||
| 51 | { \ | ||
| 52 | {k00, k01, k02, k03}, \ | ||
| 53 | {k10, k11, k12, k13}, \ | ||
| 54 | {k20, k21, k22, ___}, \ | ||
| 55 | {k30, k31, k32, ___}, \ | ||
| 56 | {k40, k41, k42, k43} \ | ||
| 57 | } | ||
