From a4b36f0b4b45a09ab940910b11b9be52356c721a Mon Sep 17 00:00:00 2001 From: IreuN Date: Thu, 4 May 2023 04:07:32 +0200 Subject: [PATCH 1/6] `sofle/via` encoder map & doc handedness update (#20630) --- keyboards/sofle/keymaps/via/config.h | 5 ++-- keyboards/sofle/keymaps/via/encoder.c | 39 --------------------------- keyboards/sofle/keymaps/via/keymap.c | 10 +++++-- keyboards/sofle/keymaps/via/rules.mk | 1 + 4 files changed, 11 insertions(+), 44 deletions(-) delete mode 100644 keyboards/sofle/keymaps/via/encoder.c diff --git a/keyboards/sofle/keymaps/via/config.h b/keyboards/sofle/keymaps/via/config.h index 2806b70b0f7..68996809e71 100644 --- a/keyboards/sofle/keymaps/via/config.h +++ b/keyboards/sofle/keymaps/via/config.h @@ -17,10 +17,9 @@ #pragma once -/* The way how "handedness" is decided (which half is which), +/* By default left side is selected as master, see https://docs.qmk.fm/#/feature_split_keyboard?id=setting-handedness -for more options. -*/ +for more options. */ #if defined(KEYBOARD_sofle_rev1) // Add RGB underglow and top facing lighting diff --git a/keyboards/sofle/keymaps/via/encoder.c b/keyboards/sofle/keymaps/via/encoder.c deleted file mode 100644 index 831b3b2f3c4..00000000000 --- a/keyboards/sofle/keymaps/via/encoder.c +++ /dev/null @@ -1,39 +0,0 @@ - /* Copyright 2020 Josef Adamcik - * Modification for VIA support and RGB underglow by Jens Bonk-Wiltfang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -//Setting up what encoder rotation does. If your encoder can be pressed as a button, that function can be set in Via. - -#ifdef ENCODER_ENABLE - -bool encoder_update_user(uint8_t index, bool clockwise) { - if (index == 0) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } else if (index == 1) { - if (clockwise) { - tap_code(KC_PGDN); - } else { - tap_code(KC_PGUP); - } - } - return true; -} - -#endif diff --git a/keyboards/sofle/keymaps/via/keymap.c b/keyboards/sofle/keymaps/via/keymap.c index 4c83e58f7d1..bbb4c648263 100644 --- a/keyboards/sofle/keymaps/via/keymap.c +++ b/keyboards/sofle/keymaps/via/keymap.c @@ -17,9 +17,15 @@ #include QMK_KEYBOARD_H #include "oled.c" -#include "encoder.c" -//Default keymap. This can be changed in Via. Use oled.c and encoder.c to change beavior that Via cannot change. +#ifdef ENCODER_MAP_ENABLE +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_PGDN, KC_PGUP) }, + [1] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) }, + [2] = { ENCODER_CCW_CW(RGB_HUD, RGB_HUI), ENCODER_CCW_CW(RGB_SAD, RGB_SAI) }, + [3] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_RMOD, RGB_MOD)} +}; +#endif const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* diff --git a/keyboards/sofle/keymaps/via/rules.mk b/keyboards/sofle/keymaps/via/rules.mk index db254512afc..b57a417092d 100644 --- a/keyboards/sofle/keymaps/via/rules.mk +++ b/keyboards/sofle/keymaps/via/rules.mk @@ -6,3 +6,4 @@ EXTRAKEY_ENABLE = yes VIA_ENABLE = yes LTO_ENABLE = yes RGBLIGHT_ENABLE = yes +ENCODER_MAP_ENABLE = yes \ No newline at end of file From 7f413e9f01d5e95da9593976b4fa3fefc055a3c9 Mon Sep 17 00:00:00 2001 From: ziptyze Date: Thu, 4 May 2023 15:29:45 -0400 Subject: [PATCH 2/6] [Keyboard] Add 1upkeyboards pi50 (#20242) Co-authored-by: Drashna Jaelre Co-authored-by: Less/Rikki <86894501+lesshonor@users.noreply.github.com> Co-authored-by: Ryan --- keyboards/1upkeyboards/pi50/config.h | 71 +++++ keyboards/1upkeyboards/pi50/grid/config.h | 4 + keyboards/1upkeyboards/pi50/grid/info.json | 142 +++++++++ keyboards/1upkeyboards/pi50/grid/rules.mk | 0 keyboards/1upkeyboards/pi50/halconf.h | 7 + keyboards/1upkeyboards/pi50/info.json | 42 +++ .../pi50/keymaps/default/keymap.c | 136 +++++++++ .../pi50/keymaps/default/rules.mk | 1 + .../1upkeyboards/pi50/keymaps/via/keymap.c | 286 ++++++++++++++++++ .../1upkeyboards/pi50/keymaps/via/rules.mk | 4 + keyboards/1upkeyboards/pi50/lib/glcdfont.c | 231 ++++++++++++++ keyboards/1upkeyboards/pi50/mcuconf.h | 10 + keyboards/1upkeyboards/pi50/mit/config.h | 4 + keyboards/1upkeyboards/pi50/mit/info.json | 141 +++++++++ keyboards/1upkeyboards/pi50/mit/rules.mk | 0 keyboards/1upkeyboards/pi50/pi50.c | 242 +++++++++++++++ keyboards/1upkeyboards/pi50/readme.md | 36 +++ keyboards/1upkeyboards/pi50/rules.mk | 5 + 18 files changed, 1362 insertions(+) create mode 100644 keyboards/1upkeyboards/pi50/config.h create mode 100644 keyboards/1upkeyboards/pi50/grid/config.h create mode 100644 keyboards/1upkeyboards/pi50/grid/info.json create mode 100644 keyboards/1upkeyboards/pi50/grid/rules.mk create mode 100644 keyboards/1upkeyboards/pi50/halconf.h create mode 100644 keyboards/1upkeyboards/pi50/info.json create mode 100644 keyboards/1upkeyboards/pi50/keymaps/default/keymap.c create mode 100644 keyboards/1upkeyboards/pi50/keymaps/default/rules.mk create mode 100644 keyboards/1upkeyboards/pi50/keymaps/via/keymap.c create mode 100644 keyboards/1upkeyboards/pi50/keymaps/via/rules.mk create mode 100644 keyboards/1upkeyboards/pi50/lib/glcdfont.c create mode 100644 keyboards/1upkeyboards/pi50/mcuconf.h create mode 100644 keyboards/1upkeyboards/pi50/mit/config.h create mode 100644 keyboards/1upkeyboards/pi50/mit/info.json create mode 100644 keyboards/1upkeyboards/pi50/mit/rules.mk create mode 100644 keyboards/1upkeyboards/pi50/pi50.c create mode 100644 keyboards/1upkeyboards/pi50/readme.md create mode 100644 keyboards/1upkeyboards/pi50/rules.mk diff --git a/keyboards/1upkeyboards/pi50/config.h b/keyboards/1upkeyboards/pi50/config.h new file mode 100644 index 00000000000..2ef22f12d0b --- /dev/null +++ b/keyboards/1upkeyboards/pi50/config.h @@ -0,0 +1,71 @@ +// Copyright 2023 ziptyze +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define OLED_DISPLAY_128X32 +#define I2C1_SCL_PIN GP11 +#define I2C1_SDA_PIN GP10 +#define I2C_DRIVER I2CD1 +#define OLED_BRIGHTNESS 128 +#define OLED_FONT_H "keyboards/1upkeyboards/pi50/lib/glcdfont.c" + +#define RGB_DI_PIN GP0 +# define RGB_MATRIX_KEYPRESSES // reacts to keypresses +# define RGB_MATRIX_FRAMEBUFFER_EFFECTS +# define RGBLIGHT_LIMIT_VAL 150 +# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended +# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 +// RGB Matrix Animation modes. Explicitly enabled +// For full list of effects, see: +// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects +# define ENABLE_RGB_MATRIX_ALPHAS_MODS +# define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +# define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +# define ENABLE_RGB_MATRIX_BREATHING +# define ENABLE_RGB_MATRIX_BAND_SAT +# define ENABLE_RGB_MATRIX_BAND_VAL +# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +# define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +# define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +# define ENABLE_RGB_MATRIX_CYCLE_ALL +# define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +# define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +# define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +# define ENABLE_RGB_MATRIX_CYCLE_SPIRAL +# define ENABLE_RGB_MATRIX_DUAL_BEACON +# define ENABLE_RGB_MATRIX_RAINBOW_BEACON +# define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +# define ENABLE_RGB_MATRIX_RAINDROPS +# define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +# define ENABLE_RGB_MATRIX_HUE_BREATHING +# define ENABLE_RGB_MATRIX_HUE_PENDULUM +# define ENABLE_RGB_MATRIX_HUE_WAVE +# define ENABLE_RGB_MATRIX_PIXEL_RAIN +# define ENABLE_RGB_MATRIX_PIXEL_FLOW +# define ENABLE_RGB_MATRIX_PIXEL_FRACTAL +// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined +# define ENABLE_RGB_MATRIX_TYPING_HEATMAP +# define ENABLE_RGB_MATRIX_DIGITAL_RAIN +// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +# define ENABLE_RGB_MATRIX_SPLASH +# define ENABLE_RGB_MATRIX_MULTISPLASH +# define ENABLE_RGB_MATRIX_SOLID_SPLASH +# define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE \ No newline at end of file diff --git a/keyboards/1upkeyboards/pi50/grid/config.h b/keyboards/1upkeyboards/pi50/grid/config.h new file mode 100644 index 00000000000..0bb970a3f22 --- /dev/null +++ b/keyboards/1upkeyboards/pi50/grid/config.h @@ -0,0 +1,4 @@ +// Copyright 2023 ziptyze (@ziptyze) +// SPDX-License-Identifier: GPL-2.0-or-later + +#define RGB_MATRIX_LED_COUNT 60 \ No newline at end of file diff --git a/keyboards/1upkeyboards/pi50/grid/info.json b/keyboards/1upkeyboards/pi50/grid/info.json new file mode 100644 index 00000000000..5b23f27277a --- /dev/null +++ b/keyboards/1upkeyboards/pi50/grid/info.json @@ -0,0 +1,142 @@ +{ + "rgb_matrix": { + "layout": [ + { "flags": 1, "matrix": [0, 0], "x": 10, "y": 7 }, + { "flags": 4, "matrix": [1, 0], "x": 28, "y": 7 }, + { "flags": 4, "matrix": [0, 1], "x": 46, "y": 7 }, + { "flags": 4, "matrix": [1, 1], "x": 65, "y": 7 }, + { "flags": 4, "matrix": [0, 2], "x": 84, "y": 7 }, + { "flags": 4, "matrix": [1, 2], "x": 102, "y": 7 }, + { "flags": 4, "matrix": [0, 3], "x": 121, "y": 7 }, + { "flags": 4, "matrix": [1, 3], "x": 140, "y": 7 }, + { "flags": 4, "matrix": [0, 4], "x": 159, "y": 7 }, + { "flags": 4, "matrix": [1, 4], "x": 177, "y": 7 }, + { "flags": 4, "matrix": [0, 5], "x": 196, "y": 7 }, + { "flags": 1, "matrix": [1, 5], "x": 215, "y": 7 }, + + { "flags": 1, "matrix": [3, 5], "x": 215, "y": 19 }, + { "flags": 4, "matrix": [2, 5], "x": 196, "y": 19 }, + { "flags": 4, "matrix": [3, 4], "x": 177, "y": 19 }, + { "flags": 4, "matrix": [2, 4], "x": 159, "y": 19 }, + { "flags": 4, "matrix": [3, 3], "x": 140, "y": 19 }, + { "flags": 4, "matrix": [2, 3], "x": 121, "y": 19 }, + { "flags": 4, "matrix": [3, 2], "x": 102, "y": 19 }, + { "flags": 4, "matrix": [2, 2], "x": 84, "y": 19 }, + { "flags": 4, "matrix": [3, 1], "x": 65, "y": 19 }, + { "flags": 4, "matrix": [2, 1], "x": 46, "y": 19 }, + { "flags": 4, "matrix": [3, 0], "x": 28, "y": 19 }, + { "flags": 1, "matrix": [2, 0], "x": 9, "y": 19 }, + + { "flags": 1, "matrix": [4, 0], "x": 9, "y": 32 }, + { "flags": 4, "matrix": [5, 0], "x": 28, "y": 32 }, + { "flags": 4, "matrix": [4, 1], "x": 46, "y": 32 }, + { "flags": 4, "matrix": [5, 1], "x": 65, "y": 32 }, + { "flags": 4, "matrix": [4, 2], "x": 84, "y": 32 }, + { "flags": 4, "matrix": [5, 2], "x": 102, "y": 32 }, + { "flags": 4, "matrix": [4, 3], "x": 121, "y": 32 }, + { "flags": 4, "matrix": [5, 3], "x": 140, "y": 32 }, + { "flags": 4, "matrix": [4, 4], "x": 159, "y": 32 }, + { "flags": 4, "matrix": [5, 4], "x": 177, "y": 32 }, + { "flags": 4, "matrix": [4, 5], "x": 196, "y": 32 }, + { "flags": 1, "matrix": [5, 5], "x": 215, "y": 32 }, + + { "flags": 1, "matrix": [7, 5], "x": 215, "y": 45 }, + { "flags": 4, "matrix": [6, 5], "x": 196, "y": 45 }, + { "flags": 4, "matrix": [7, 4], "x": 177, "y": 45 }, + { "flags": 4, "matrix": [6, 4], "x": 159, "y": 45 }, + { "flags": 4, "matrix": [7, 3], "x": 140, "y": 45 }, + { "flags": 4, "matrix": [6, 3], "x": 121, "y": 45 }, + { "flags": 4, "matrix": [7, 2], "x": 102, "y": 45 }, + { "flags": 4, "matrix": [6, 2], "x": 84, "y": 45 }, + { "flags": 4, "matrix": [7, 1], "x": 65, "y": 45 }, + { "flags": 4, "matrix": [6, 1], "x": 46, "y": 45 }, + { "flags": 4, "matrix": [7, 0], "x": 28, "y": 45 }, + { "flags": 1, "matrix": [6, 0], "x": 9, "y": 45 }, + + { "flags": 1, "matrix": [8, 0], "x": 9, "y": 57 }, + { "flags": 1, "matrix": [9, 0], "x": 28, "y": 57 }, + { "flags": 1, "matrix": [8, 1], "x": 46, "y": 57 }, + { "flags": 1, "matrix": [9, 1], "x": 65, "y": 57 }, + { "flags": 1, "matrix": [8, 2], "x": 84, "y": 57 }, + { "flags": 1, "matrix": [9, 2], "x": 102, "y": 57 }, + { "flags": 1, "matrix": [9, 3], "x": 140, "y": 57 }, + { "flags": 1, "matrix": [8, 4], "x": 159, "y": 57 }, + { "flags": 1, "matrix": [9, 4], "x": 177, "y": 57 }, + { "flags": 1, "matrix": [8, 5], "x": 196, "y": 57 }, + { "flags": 1, "matrix": [9, 5], "x": 215, "y": 57 }, + { "flags": 1, "matrix": [8, 3], "x": 121, "y": 57 } + ] + }, + "layouts": { + "LAYOUT_ortho_5x12": { + "layout": [ + { "matrix": [0, 6], "x": 11, "y": 0 }, + + { "matrix": [0, 0], "x": 0, "y": 1 }, + { "matrix": [1, 0], "x": 1, "y": 1 }, + { "matrix": [0, 1], "x": 2, "y": 1 }, + { "matrix": [1, 1], "x": 3, "y": 1 }, + { "matrix": [0, 2], "x": 4, "y": 1 }, + { "matrix": [1, 2], "x": 5, "y": 1 }, + { "matrix": [0, 3], "x": 6, "y": 1 }, + { "matrix": [1, 3], "x": 7, "y": 1 }, + { "matrix": [0, 4], "x": 8, "y": 1 }, + { "matrix": [1, 4], "x": 9, "y": 1 }, + { "matrix": [0, 5], "x": 10, "y": 1 }, + { "matrix": [1, 5], "x": 11, "y": 1 }, + + { "matrix": [2, 0], "x": 0, "y": 2 }, + { "matrix": [3, 0], "x": 1, "y": 2 }, + { "matrix": [2, 1], "x": 2, "y": 2 }, + { "matrix": [3, 1], "x": 3, "y": 2 }, + { "matrix": [2, 2], "x": 4, "y": 2 }, + { "matrix": [3, 2], "x": 5, "y": 2 }, + { "matrix": [2, 3], "x": 6, "y": 2 }, + { "matrix": [3, 3], "x": 7, "y": 2 }, + { "matrix": [2, 4], "x": 8, "y": 2 }, + { "matrix": [3, 4], "x": 9, "y": 2 }, + { "matrix": [2, 5], "x": 10, "y": 2 }, + { "matrix": [3, 5], "x": 11, "y": 2 }, + + { "matrix": [4, 0], "x": 0, "y": 3 }, + { "matrix": [5, 0], "x": 1, "y": 3 }, + { "matrix": [4, 1], "x": 2, "y": 3 }, + { "matrix": [5, 1], "x": 3, "y": 3 }, + { "matrix": [4, 2], "x": 4, "y": 3 }, + { "matrix": [5, 2], "x": 5, "y": 3 }, + { "matrix": [4, 3], "x": 6, "y": 3 }, + { "matrix": [5, 3], "x": 7, "y": 3 }, + { "matrix": [4, 4], "x": 8, "y": 3 }, + { "matrix": [5, 4], "x": 9, "y": 3 }, + { "matrix": [4, 5], "x": 10, "y": 3 }, + { "matrix": [5, 5], "x": 11, "y": 3 }, + + { "matrix": [6, 0], "x": 0, "y": 4 }, + { "matrix": [7, 0], "x": 1, "y": 4 }, + { "matrix": [6, 1], "x": 2, "y": 4 }, + { "matrix": [7, 1], "x": 3, "y": 4 }, + { "matrix": [6, 2], "x": 4, "y": 4 }, + { "matrix": [7, 2], "x": 5, "y": 4 }, + { "matrix": [6, 3], "x": 6, "y": 4 }, + { "matrix": [7, 3], "x": 7, "y": 4 }, + { "matrix": [6, 4], "x": 8, "y": 4 }, + { "matrix": [7, 4], "x": 9, "y": 4 }, + { "matrix": [6, 5], "x": 10, "y": 4 }, + { "matrix": [7, 5], "x": 11, "y": 4 }, + + { "matrix": [8, 0], "x": 0, "y": 5 }, + { "matrix": [9, 0], "x": 1, "y": 5 }, + { "matrix": [8, 1], "x": 2, "y": 5 }, + { "matrix": [9, 1], "x": 3, "y": 5 }, + { "matrix": [8, 2], "x": 4, "y": 5 }, + { "matrix": [9, 2], "x": 5, "y": 5 }, + { "matrix": [8, 3], "x": 6, "y": 5 }, + { "matrix": [9, 3], "x": 7, "y": 5 }, + { "matrix": [8, 4], "x": 8, "y": 5 }, + { "matrix": [9, 4], "x": 9, "y": 5 }, + { "matrix": [8, 5], "x": 10, "y": 5 }, + { "matrix": [9, 5], "x": 11, "y": 5 } + ] + } + } +} \ No newline at end of file diff --git a/keyboards/1upkeyboards/pi50/grid/rules.mk b/keyboards/1upkeyboards/pi50/grid/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/1upkeyboards/pi50/halconf.h b/keyboards/1upkeyboards/pi50/halconf.h new file mode 100644 index 00000000000..d1bdcabdf17 --- /dev/null +++ b/keyboards/1upkeyboards/pi50/halconf.h @@ -0,0 +1,7 @@ +// Copyright 2023 ziptyze +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#define HAL_USE_I2C TRUE + +#include_next \ No newline at end of file diff --git a/keyboards/1upkeyboards/pi50/info.json b/keyboards/1upkeyboards/pi50/info.json new file mode 100644 index 00000000000..c34db685093 --- /dev/null +++ b/keyboards/1upkeyboards/pi50/info.json @@ -0,0 +1,42 @@ +{ + "keyboard_name": "pi50", + "manufacturer": "1upkeyboards", + "maintainer": "ziptyze", + "processor": "RP2040", + "bootloader": "rp2040", + "board": "GENERIC_RP_RP2040", + "usb": { + "vid": "0x6F75", + "pid": "0x5606", + "device_version": "1.0.0" + }, + "diode_direction": "COL2ROW", + "dynamic_keymap": { + "layer_count": 10 + }, + "features": { + "audio": false, + "backlight": false, + "bootmagic": true, + "command": false, + "console": false, + "extrakey": true, + "mousekey": true, + "nkro": false, + "rgb_matrix": true, + "rgblight": false + }, + "matrix_pins": { + "rows": ["GP20", "GP15", "GP19", "GP14", "GP18", "GP13", "GP17", "GP12", "GP16", "GP21"], + "cols": ["GP1", "GP2", "GP3", "GP4", "GP5", "GP6", "GP9"] + }, + "encoder": { + "enabled": true, + "rotary": [ + {"pin_a": "GP8", "pin_b": "GP7"} + ] + }, + "rgb_matrix": { + "driver": "WS2812" + } +} diff --git a/keyboards/1upkeyboards/pi50/keymaps/default/keymap.c b/keyboards/1upkeyboards/pi50/keymaps/default/keymap.c new file mode 100644 index 00000000000..8df3a613fbe --- /dev/null +++ b/keyboards/1upkeyboards/pi50/keymaps/default/keymap.c @@ -0,0 +1,136 @@ +/* Copyright 2023 ziptyze + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +enum layer_names { + _ONE = 0, + _TWO, + _THREE, + _FOUR +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ╱⎺⎺⎺⎺╲ + * |RGBTOG| + * ╲⎽⎽⎽⎽╱ + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_ONE] = LAYOUT_ortho_5x12 ( + RGB_TOG, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + MO(3), KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + + /* Lower + * ╱⎺⎺⎺⎺╲ + * | MUTE | + * ╲⎽⎽⎽⎽╱ + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_TWO] = LAYOUT_ortho_5x12 ( + KC_MUTE, + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + + /* Raise + * ╱⎺⎺⎺⎺╲ + * | MUTE | + * ╲⎽⎽⎽⎽╱ + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | Pg Up| Pg Dn| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_THREE] = LAYOUT_ortho_5x12 ( + KC_MUTE, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + + /* Adjust (Lower + Raise) + * ╱⎺⎺⎺⎺╲ + * | MUTE | + * v-----------------------RGB CONTROL------------------v ╲⎽⎽⎽⎽╱ + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| Debug| | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | |Aud cy|Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_FOUR] = LAYOUT_ortho_5x12 ( + KC_MUTE, + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, QK_BOOT, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [_ONE] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD) }, + [_TWO] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_THREE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_FOUR] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) } +}; +#endif diff --git a/keyboards/1upkeyboards/pi50/keymaps/default/rules.mk b/keyboards/1upkeyboards/pi50/keymaps/default/rules.mk new file mode 100644 index 00000000000..a40474b4d5c --- /dev/null +++ b/keyboards/1upkeyboards/pi50/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/1upkeyboards/pi50/keymaps/via/keymap.c b/keyboards/1upkeyboards/pi50/keymaps/via/keymap.c new file mode 100644 index 00000000000..ff4cb35f5a9 --- /dev/null +++ b/keyboards/1upkeyboards/pi50/keymaps/via/keymap.c @@ -0,0 +1,286 @@ +/* Copyright 2023 ziptyze + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +enum layer_names { + _ONE = 0, + _TWO, + _THREE, + _FOUR, + _FIVE, + _SIX, + _SEVEN, + _EIGHT, + _NINE, + _TEN +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ╱⎺⎺⎺⎺╲ + * |RGBTOG| + * ╲⎽⎽⎽⎽╱ + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_ONE] = LAYOUT_ortho_5x12 ( + RGB_TOG, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + MO(3), KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + + /* Lower + * ╱⎺⎺⎺⎺╲ + * | MUTE | + * ╲⎽⎽⎽⎽╱ + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_TWO] = LAYOUT_ortho_5x12 ( + KC_MUTE, + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + + /* Raise + * ╱⎺⎺⎺⎺╲ + * | MUTE | + * ╲⎽⎽⎽⎽╱ + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | Pg Up| Pg Dn| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_THREE] = LAYOUT_ortho_5x12 ( + KC_MUTE, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + + /* Adjust (Lower + Raise) + * ╱⎺⎺⎺⎺╲ + * | MUTE | + * v-----------------------RGB CONTROL------------------v ╲⎽⎽⎽⎽╱ + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| Debug| | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | |Aud cy|Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_FOUR] = LAYOUT_ortho_5x12 ( + KC_MUTE, + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, QK_BOOT, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Placeholder + * ╱⎺⎺⎺⎺╲ + * | | + * ╲⎽⎽⎽⎽╱ + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_FIVE] = LAYOUT_ortho_5x12 ( + _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Placeholder + * ╱⎺⎺⎺⎺╲ + * | | + * ╲⎽⎽⎽⎽╱ + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_SIX] = LAYOUT_ortho_5x12 ( + _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Placeholder + * ╱⎺⎺⎺⎺╲ + * | | + * ╲⎽⎽⎽⎽╱ + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_SEVEN] = LAYOUT_ortho_5x12 ( + _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Placeholder + * ╱⎺⎺⎺⎺╲ + * | | + * ╲⎽⎽⎽⎽╱ + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_EIGHT] = LAYOUT_ortho_5x12 ( + _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Placeholder + * ╱⎺⎺⎺⎺╲ + * | | + * ╲⎽⎽⎽⎽╱ + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_NINE] = LAYOUT_ortho_5x12 ( + _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Placeholder + * ╱⎺⎺⎺⎺╲ + * | | + * ╲⎽⎽⎽⎽╱ + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_TEN] = LAYOUT_ortho_5x12 ( + _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [_ONE] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD) }, + [_TWO] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_THREE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_FOUR] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_FIVE] = { ENCODER_CCW_CW(_______, _______) }, + [_SIX] = { ENCODER_CCW_CW(_______, _______) }, + [_SEVEN] = { ENCODER_CCW_CW(_______, _______) }, + [_EIGHT] = { ENCODER_CCW_CW(_______, _______) }, + [_NINE] = { ENCODER_CCW_CW(_______, _______) }, + [_TEN] = { ENCODER_CCW_CW(_______, _______) }, +}; +#endif diff --git a/keyboards/1upkeyboards/pi50/keymaps/via/rules.mk b/keyboards/1upkeyboards/pi50/keymaps/via/rules.mk new file mode 100644 index 00000000000..bf70b1f3e09 --- /dev/null +++ b/keyboards/1upkeyboards/pi50/keymaps/via/rules.mk @@ -0,0 +1,4 @@ +VIA_ENABLE = yes +LTO_ENABLE = yes + +ENCODER_MAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/1upkeyboards/pi50/lib/glcdfont.c b/keyboards/1upkeyboards/pi50/lib/glcdfont.c new file mode 100644 index 00000000000..4b354756b60 --- /dev/null +++ b/keyboards/1upkeyboards/pi50/lib/glcdfont.c @@ -0,0 +1,231 @@ +// Copyright 2022 @filterpaper +// SPDX-License-Identifier: GPL-2.0+ + +#include "progmem.h" + +static const unsigned char PROGMEM font[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, + 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, + 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, + 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, + 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, + 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, + 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, + 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, + 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, + 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, + 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, + 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, + 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, + 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, + 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, + 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, + 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, + 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, + 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, + 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, + 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, + 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xE0, 0x18, 0x02, + 0x00, 0x3C, 0x1E, 0x06, 0x0E, 0x0A, + 0x1A, 0x0E, 0x26, 0xFF, 0xBF, 0x0D, + 0x00, 0x80, 0x80, 0x81, 0xFF, 0xFE, + 0xF8, 0x01, 0x01, 0x03, 0x03, 0x03, + 0x03, 0x05, 0x05, 0x02, 0x02, 0x0A, + 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, + 0x0C, 0x04, 0x10, 0x18, 0x20, 0xC0, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xD0, 0x58, 0x78, + 0x68, 0x2C, 0x24, 0x34, 0xF4, 0xF4, + 0x3C, 0x3C, 0xFC, 0xF8, 0xF8, 0x70, + 0xF0, 0xE0, 0xE0, 0xC0, 0xC0, 0x80, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xC0, 0x7C, 0x07, 0x80, 0xE0, + 0x60, 0x64, 0xE2, 0x60, 0x10, 0x10, + 0x20, 0x22, 0x12, 0x17, 0x3F, 0x0B, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, + 0x6F, 0xFC, 0xE0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, + 0x60, 0x60, 0x70, 0x70, 0xF0, 0xF0, + 0xD0, 0xD0, 0xD0, 0xD0, 0x50, 0x50, + 0x50, 0x70, 0x78, 0x78, 0x78, 0x7C, + 0x7F, 0x7D, 0x7C, 0x5E, 0x4F, 0x44, + 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x38, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x58, 0x46, 0x47, 0x41, + 0x41, 0x01, 0x01, 0x03, 0x03, 0x42, + 0x42, 0x42, 0x46, 0x46, 0x46, 0x46, + 0x42, 0x43, 0x43, 0x73, 0x77, 0x72, + 0x70, 0x60, 0x60, 0x60, 0x60, 0x60, + 0x60, 0x61, 0x67, 0x6F, 0x7E, 0x78, + 0x78, 0x70, 0x70, 0x70, 0x70, 0x70, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, + 0x40, 0x40, 0x40, 0x48, 0x58, 0x58, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; diff --git a/keyboards/1upkeyboards/pi50/mcuconf.h b/keyboards/1upkeyboards/pi50/mcuconf.h new file mode 100644 index 00000000000..71e344bf243 --- /dev/null +++ b/keyboards/1upkeyboards/pi50/mcuconf.h @@ -0,0 +1,10 @@ +// Copyright 2023 ziptyze +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#include_next + +#undef RP_I2C_USE_I2C0 +#undef RP_I2C_USE_I2C1 +#define RP_I2C_USE_I2C0 FALSE +#define RP_I2C_USE_I2C1 TRUE \ No newline at end of file diff --git a/keyboards/1upkeyboards/pi50/mit/config.h b/keyboards/1upkeyboards/pi50/mit/config.h new file mode 100644 index 00000000000..39a6d35c05d --- /dev/null +++ b/keyboards/1upkeyboards/pi50/mit/config.h @@ -0,0 +1,4 @@ +// Copyright 2023 ziptyze (@ziptyze) +// SPDX-License-Identifier: GPL-2.0-or-later + +#define RGB_MATRIX_LED_COUNT 59 \ No newline at end of file diff --git a/keyboards/1upkeyboards/pi50/mit/info.json b/keyboards/1upkeyboards/pi50/mit/info.json new file mode 100644 index 00000000000..b65a9b2cc9f --- /dev/null +++ b/keyboards/1upkeyboards/pi50/mit/info.json @@ -0,0 +1,141 @@ +{ + "rgb_matrix": { + "layout": [ + { "flags": 1, "matrix": [0, 0], "x": 10, "y": 7 }, + { "flags": 4, "matrix": [1, 0], "x": 28, "y": 7 }, + { "flags": 4, "matrix": [0, 1], "x": 46, "y": 7 }, + { "flags": 4, "matrix": [1, 1], "x": 65, "y": 7 }, + { "flags": 4, "matrix": [0, 2], "x": 84, "y": 7 }, + { "flags": 4, "matrix": [1, 2], "x": 102, "y": 7 }, + { "flags": 4, "matrix": [0, 3], "x": 121, "y": 7 }, + { "flags": 4, "matrix": [1, 3], "x": 140, "y": 7 }, + { "flags": 4, "matrix": [0, 4], "x": 159, "y": 7 }, + { "flags": 4, "matrix": [1, 4], "x": 177, "y": 7 }, + { "flags": 4, "matrix": [0, 5], "x": 196, "y": 7 }, + { "flags": 1, "matrix": [1, 5], "x": 215, "y": 7 }, + + { "flags": 1, "matrix": [3, 5], "x": 215, "y": 19 }, + { "flags": 4, "matrix": [2, 5], "x": 196, "y": 19 }, + { "flags": 4, "matrix": [3, 4], "x": 177, "y": 19 }, + { "flags": 4, "matrix": [2, 4], "x": 159, "y": 19 }, + { "flags": 4, "matrix": [3, 3], "x": 140, "y": 19 }, + { "flags": 4, "matrix": [2, 3], "x": 121, "y": 19 }, + { "flags": 4, "matrix": [3, 2], "x": 102, "y": 19 }, + { "flags": 4, "matrix": [2, 2], "x": 84, "y": 19 }, + { "flags": 4, "matrix": [3, 1], "x": 65, "y": 19 }, + { "flags": 4, "matrix": [2, 1], "x": 46, "y": 19 }, + { "flags": 4, "matrix": [3, 0], "x": 28, "y": 19 }, + { "flags": 1, "matrix": [2, 0], "x": 9, "y": 19 }, + + { "flags": 1, "matrix": [4, 0], "x": 9, "y": 32 }, + { "flags": 4, "matrix": [5, 0], "x": 28, "y": 32 }, + { "flags": 4, "matrix": [4, 1], "x": 46, "y": 32 }, + { "flags": 4, "matrix": [5, 1], "x": 65, "y": 32 }, + { "flags": 4, "matrix": [4, 2], "x": 84, "y": 32 }, + { "flags": 4, "matrix": [5, 2], "x": 102, "y": 32 }, + { "flags": 4, "matrix": [4, 3], "x": 121, "y": 32 }, + { "flags": 4, "matrix": [5, 3], "x": 140, "y": 32 }, + { "flags": 4, "matrix": [4, 4], "x": 159, "y": 32 }, + { "flags": 4, "matrix": [5, 4], "x": 177, "y": 32 }, + { "flags": 4, "matrix": [4, 5], "x": 196, "y": 32 }, + { "flags": 1, "matrix": [5, 5], "x": 215, "y": 32 }, + + { "flags": 1, "matrix": [7, 5], "x": 215, "y": 45 }, + { "flags": 4, "matrix": [6, 5], "x": 196, "y": 45 }, + { "flags": 4, "matrix": [7, 4], "x": 177, "y": 45 }, + { "flags": 4, "matrix": [6, 4], "x": 159, "y": 45 }, + { "flags": 4, "matrix": [7, 3], "x": 140, "y": 45 }, + { "flags": 4, "matrix": [6, 3], "x": 121, "y": 45 }, + { "flags": 4, "matrix": [7, 2], "x": 102, "y": 45 }, + { "flags": 4, "matrix": [6, 2], "x": 84, "y": 45 }, + { "flags": 4, "matrix": [7, 1], "x": 65, "y": 45 }, + { "flags": 4, "matrix": [6, 1], "x": 46, "y": 45 }, + { "flags": 4, "matrix": [7, 0], "x": 28, "y": 45 }, + { "flags": 4, "matrix": [6, 0], "x": 9, "y": 45 }, + + { "flags": 1, "matrix": [8, 0], "x": 9, "y": 57 }, + { "flags": 1, "matrix": [9, 0], "x": 28, "y": 57 }, + { "flags": 1, "matrix": [8, 1], "x": 46, "y": 57 }, + { "flags": 1, "matrix": [9, 1], "x": 65, "y": 57 }, + { "flags": 1, "matrix": [8, 2], "x": 84, "y": 57 }, + { "flags": 1, "matrix": [9, 2], "x": 112, "y": 57 }, + { "flags": 1, "matrix": [9, 3], "x": 140, "y": 57 }, + { "flags": 1, "matrix": [8, 4], "x": 159, "y": 57 }, + { "flags": 1, "matrix": [9, 4], "x": 177, "y": 57 }, + { "flags": 1, "matrix": [8, 5], "x": 196, "y": 57 }, + { "flags": 1, "matrix": [9, 5], "x": 215, "y": 57 } + ] + }, + "layouts": { + "LAYOUT_ortho_5x12": { + "layout": [ + { "matrix": [0, 6], "x": 11, "y": 0 }, + + { "matrix": [0, 0], "x": 0, "y": 1 }, + { "matrix": [1, 0], "x": 1, "y": 1 }, + { "matrix": [0, 1], "x": 2, "y": 1 }, + { "matrix": [1, 1], "x": 3, "y": 1 }, + { "matrix": [0, 2], "x": 4, "y": 1 }, + { "matrix": [1, 2], "x": 5, "y": 1 }, + { "matrix": [0, 3], "x": 6, "y": 1 }, + { "matrix": [1, 3], "x": 7, "y": 1 }, + { "matrix": [0, 4], "x": 8, "y": 1 }, + { "matrix": [1, 4], "x": 9, "y": 1 }, + { "matrix": [0, 5], "x": 10, "y": 1 }, + { "matrix": [1, 5], "x": 11, "y": 1 }, + + { "matrix": [2, 0], "x": 0, "y": 2 }, + { "matrix": [3, 0], "x": 1, "y": 2 }, + { "matrix": [2, 1], "x": 2, "y": 2 }, + { "matrix": [3, 1], "x": 3, "y": 2 }, + { "matrix": [2, 2], "x": 4, "y": 2 }, + { "matrix": [3, 2], "x": 5, "y": 2 }, + { "matrix": [2, 3], "x": 6, "y": 2 }, + { "matrix": [3, 3], "x": 7, "y": 2 }, + { "matrix": [2, 4], "x": 8, "y": 2 }, + { "matrix": [3, 4], "x": 9, "y": 2 }, + { "matrix": [2, 5], "x": 10, "y": 2 }, + { "matrix": [3, 5], "x": 11, "y": 2 }, + + { "matrix": [4, 0], "x": 0, "y": 3 }, + { "matrix": [5, 0], "x": 1, "y": 3 }, + { "matrix": [4, 1], "x": 2, "y": 3 }, + { "matrix": [5, 1], "x": 3, "y": 3 }, + { "matrix": [4, 2], "x": 4, "y": 3 }, + { "matrix": [5, 2], "x": 5, "y": 3 }, + { "matrix": [4, 3], "x": 6, "y": 3 }, + { "matrix": [5, 3], "x": 7, "y": 3 }, + { "matrix": [4, 4], "x": 8, "y": 3 }, + { "matrix": [5, 4], "x": 9, "y": 3 }, + { "matrix": [4, 5], "x": 10, "y": 3 }, + { "matrix": [5, 5], "x": 11, "y": 3 }, + + { "matrix": [6, 0], "x": 0, "y": 4 }, + { "matrix": [7, 0], "x": 1, "y": 4 }, + { "matrix": [6, 1], "x": 2, "y": 4 }, + { "matrix": [7, 1], "x": 3, "y": 4 }, + { "matrix": [6, 2], "x": 4, "y": 4 }, + { "matrix": [7, 2], "x": 5, "y": 4 }, + { "matrix": [6, 3], "x": 6, "y": 4 }, + { "matrix": [7, 3], "x": 7, "y": 4 }, + { "matrix": [6, 4], "x": 8, "y": 4 }, + { "matrix": [7, 4], "x": 9, "y": 4 }, + { "matrix": [6, 5], "x": 10, "y": 4 }, + { "matrix": [7, 5], "x": 11, "y": 4 }, + + { "matrix": [8, 0], "x": 0, "y": 5 }, + { "matrix": [9, 0], "x": 1, "y": 5 }, + { "matrix": [8, 1], "x": 2, "y": 5 }, + { "matrix": [9, 1], "x": 3, "y": 5 }, + { "matrix": [8, 2], "x": 4, "y": 5 }, + { "matrix": [9, 2], "x": 5, "y": 5 }, + { "matrix": [8, 3], "x": 6, "y": 5 }, + { "matrix": [9, 3], "x": 7, "y": 5 }, + { "matrix": [8, 4], "x": 8, "y": 5 }, + { "matrix": [9, 4], "x": 9, "y": 5 }, + { "matrix": [8, 5], "x": 10, "y": 5 }, + { "matrix": [9, 5], "x": 11, "y": 5 } + ] + } + } +} diff --git a/keyboards/1upkeyboards/pi50/mit/rules.mk b/keyboards/1upkeyboards/pi50/mit/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/1upkeyboards/pi50/pi50.c b/keyboards/1upkeyboards/pi50/pi50.c new file mode 100644 index 00000000000..ea73875970b --- /dev/null +++ b/keyboards/1upkeyboards/pi50/pi50.c @@ -0,0 +1,242 @@ +/* Copyright 2023 ziptyze + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "quantum.h" +#include +#include + +#if defined(RGB_MATRIX_EFFECT) +# undef RGB_MATRIX_EFFECT +#endif // defined(RGB_MATRIX_EFFECT) + +#define RGB_MATRIX_EFFECT(x) RGB_MATRIX_EFFECT_##x, +enum { + RGB_MATRIX_EFFECT_NONE, +#include "rgb_matrix_effects.inc" +#undef RGB_MATRIX_EFFECT +#ifdef RGB_MATRIX_CUSTOM_KB +# include "rgb_matrix_kb.inc" +#endif +#ifdef RGB_MATRIX_CUSTOM_USER +# include "rgb_matrix_user.inc" +#endif +}; + +#define RGB_MATRIX_EFFECT(x) \ + case RGB_MATRIX_EFFECT_##x: \ + return #x; +const char* rgb_matrix_name(uint8_t effect) { + switch (effect) { + case RGB_MATRIX_EFFECT_NONE: + return "NONE"; +#include "rgb_matrix_effects.inc" +#undef RGB_MATRIX_EFFECT +#ifdef RGB_MATRIX_CUSTOM_KB +# include "rgb_matrix_kb.inc" +#endif +#ifdef RGB_MATRIX_CUSTOM_USER +# include "rgb_matrix_user.inc" +#endif + default: + return "UNKNOWN"; + } +} + +#ifdef OLED_ENABLE + +static uint32_t oled_logo_timer = 0; +static bool clear_logo = true; +static const char PROGMEM my_logo[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, + 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, + 0x0f, 0x0f, 0x0f, 0x1f, 0xff, 0xff, 0xff, 0x1f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, + 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xfb, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + +#endif + +#ifdef OLED_ENABLE + +void init_timer(void){ + oled_logo_timer = timer_read32(); +}; + +void user_oled_magic(void) { + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer: "), false); + + switch (get_highest_layer(layer_state)) { + case 0: + oled_write_P(PSTR("One\n"), false); + break; + case 1: + oled_write_P(PSTR("Two\n"), false); + break; + case 2: + oled_write_P(PSTR("Three\n"), false); + break; + case 3: + oled_write_P(PSTR("Four\n"), false); + break; + case 4: + oled_write_P(PSTR("Five\n"), false); + break; + case 5: + oled_write_P(PSTR("Six\n"), false); + break; + case 6: + oled_write_P(PSTR("Seven\n"), false); + break; + case 7: + oled_write_P(PSTR("Eight\n"), false); + break; + case 8: + oled_write_P(PSTR("Nine\n"), false); + break; + case 9: + oled_write_P(PSTR("Ten\n"), false); + break; + default: + // Or use the write_ln shortcut over adding '\n' to the end of your string + oled_write_ln_P(PSTR("Undefined"), false); + } + + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_write_P(led_state.caps_lock ? PSTR("Cap(x) ") : PSTR("Cap( ) "), false); + oled_write_P(led_state.num_lock ? PSTR("Num(x) ") : PSTR("Num( ) "), false); + oled_write_P(led_state.scroll_lock ? PSTR("Scrl(x)") : PSTR("Scrl( )"), false); + + char *mode_name = strdup(rgb_matrix_name(rgb_matrix_get_mode())); + if (mode_name != NULL) { + int len = strlen(mode_name); + bool capitalize_next = true; + for (int i = 0; i < len; i++) { + if (i == 21 && mode_name[i] == '_') { + continue; // Skip the underscore if it's the 22nd character + } + if (mode_name[i] == '_') { + mode_name[i] = ' '; + capitalize_next = true; + } else if (capitalize_next) { + mode_name[i] = mode_name[i] >= 'a' && mode_name[i] <= 'z' ? mode_name[i] - 'a' + 'A' : mode_name[i]; + capitalize_next = false; + } else { + mode_name[i] = mode_name[i] >= 'A' && mode_name[i] <= 'Z' ? mode_name[i] - 'A' + 'a' : mode_name[i]; + } + } + + // Add line break and spaces if necessary + if (len < 19) { + strcat(mode_name, "\n"); + for (int i = 0; i < 21; i++) { + strcat(mode_name, " "); + } + } else { + // Find the most recent ' ' before the 21st character and replace it with a line break + int break_pos = -1; + for (int i = 18; i >= 0; i--) { + if (mode_name[i] == ' ') { + break_pos = i; + break; + } + } + if (break_pos >= 0) { + mode_name[break_pos] = '\n'; + for (int i = 0; i < (21 - (len - break_pos - 1)); i++) { + strcat(mode_name, " "); + } + } else { + // No '_' found, just add spaces + for (int i = 0; i < (21 - len); i++) { + strcat(mode_name, " "); + } + } + } + + oled_write_P(PSTR(mode_name), false); + free(mode_name); + } + + +} + +void render_logo(void) { + oled_write_raw_P(my_logo, sizeof(my_logo)); +} + +void clear_screen(void) { + if (clear_logo){ + for (uint8_t i = 0; i < OLED_DISPLAY_HEIGHT; ++i) { + for (uint8_t j = 0; j < OLED_DISPLAY_WIDTH; ++j) { + oled_write_raw_byte(0x0, i*OLED_DISPLAY_WIDTH + j); + } + } + clear_logo = false; + } +} + +oled_rotation_t oled_init_kb(oled_rotation_t rotation) { + return OLED_ROTATION_180; +} + +void keyboard_post_init_kb(void) { + init_timer(); + + keyboard_post_init_user(); +} + +# define SHOW_LOGO 5000 +bool oled_task_kb(void) { + if (!oled_task_user()) { return false; } + if ((timer_elapsed32(oled_logo_timer) < SHOW_LOGO)){ + render_logo(); + }else{ + clear_screen(); + user_oled_magic(); + } + return false; +} + +#endif diff --git a/keyboards/1upkeyboards/pi50/readme.md b/keyboards/1upkeyboards/pi50/readme.md new file mode 100644 index 00000000000..7bec120f534 --- /dev/null +++ b/keyboards/1upkeyboards/pi50/readme.md @@ -0,0 +1,36 @@ +# pi50 + +The pi40 is a 5x12 ortholinear keyboard with options for a 1u or 2u spacebar using a Raspberry Pi Pico for the controller. + +It includes options for a rotary encoder, SSD1306 oled, and per-key in-switch RGB LEDs. + +All unused GPIO pins are broken out on the main pcb, as well as the available voltage pins. + +This firmware also includes the option for VIA which includes configuration options for the rotary encoder, matrix lighting, and up to 10 layers. + +Default oled configuration displays: + - current layer + - caps lock status + - num lock status + - scroll lock status + - current RGB lighting mode + +* Keyboard Maintainer: [ziptyze](https://github.com/ziptyze) +* Hardware Availability: (https://1upkeyboards.com/shop/keyboard-kits/diy-40-kits/pi50-keyboard-kit/#pcb-color) + +Make example for this keyboard (after setting up your build environment): + + make 1upkeyboards/pi50:default + +Flashing example for this keyboard: + + make 1upkeyboards/pi50:default:flash + +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). + +## Bootloader + +Enter the bootloader in 2 ways: + +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix, the top left key, and plug in the keyboard +* **BOOTSEL button**: Hold down the BOOTSEL button on the pico, and plug in the keyboard diff --git a/keyboards/1upkeyboards/pi50/rules.mk b/keyboards/1upkeyboards/pi50/rules.mk new file mode 100644 index 00000000000..ac7fc4203b8 --- /dev/null +++ b/keyboards/1upkeyboards/pi50/rules.mk @@ -0,0 +1,5 @@ +WS2812_DRIVER = vendor + +OLED_ENABLE = yes + +DEFAULT_FOLDER = 1upkeyboards/pi50/grid \ No newline at end of file From a4be9b0ccbdf5c03b97099ba9efb60a1235694f9 Mon Sep 17 00:00:00 2001 From: DeskDaily <65656486+DeskDaily@users.noreply.github.com> Date: Sat, 6 May 2023 22:46:01 +0800 Subject: [PATCH 3/6] [Keyboard] Navi60 Keymap Edit (#20758) Co-authored-by: Neil Brian Ramirez Co-authored-by: Neil Brian Ramirez --- keyboards/navi60/keymaps/default/keymap.c | 2 +- keyboards/navi60/keymaps/via/keymap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/navi60/keymaps/default/keymap.c b/keyboards/navi60/keymaps/default/keymap.c index 700d1c5ccd2..c49cc641d4a 100644 --- a/keyboards/navi60/keymaps/default/keymap.c +++ b/keyboards/navi60/keymaps/default/keymap.c @@ -22,6 +22,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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_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_LSFT, 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_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, KC_APP, KC_RGUI, KC_LCTL + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_APP, KC_RGUI, KC_RCTL ), }; \ No newline at end of file diff --git a/keyboards/navi60/keymaps/via/keymap.c b/keyboards/navi60/keymaps/via/keymap.c index 75a5c5ba6c2..4e5b6635646 100644 --- a/keyboards/navi60/keymaps/via/keymap.c +++ b/keyboards/navi60/keymaps/via/keymap.c @@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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_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_LSFT, 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_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, KC_APP, KC_RGUI, KC_LCTL + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_APP, KC_RGUI, KC_RCTL ), [1] = LAYOUT( From 88780bf710a0f9a3a204d0feebac90755a2f3fff Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Sun, 7 May 2023 00:53:14 +1000 Subject: [PATCH 4/6] Fixup QP font rendering when `--no-ascii` is specified. (#20637) --- quantum/painter/qp_draw_text.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quantum/painter/qp_draw_text.c b/quantum/painter/qp_draw_text.c index f9fb2bf08f6..20edeaf379f 100644 --- a/quantum/painter/qp_draw_text.c +++ b/quantum/painter/qp_draw_text.c @@ -233,7 +233,7 @@ static inline bool qp_drawtext_prepare_glyph_for_render(qff_font_handle_t *qff_f uint8_t glyph_width = (uint8_t)(glyph_info.value & QFF_GLYPH_WIDTH_MASK); uint32_t glyph_offset = ((glyph_info.value & QFF_GLYPH_OFFSET_MASK) >> QFF_GLYPH_WIDTH_BITS); uint32_t data_offset = sizeof(qff_font_descriptor_v1_t) // Skip the font descriptor - + sizeof(qff_ascii_glyph_table_v1_t) // Skip the ascii table + + (qff_font->has_ascii_table ? sizeof(qff_ascii_glyph_table_v1_t) : 0) // Skip the ascii table + (qff_font->num_unicode_glyphs > 0 ? (sizeof(qff_unicode_glyph_table_v1_t) + (qff_font->num_unicode_glyphs * sizeof(qff_unicode_glyph_v1_t))) : 0) // Skip the unicode table + (qff_font->has_palette ? (sizeof(qgf_palette_v1_t) + ((1 << qff_font->bpp) * sizeof(qgf_palette_entry_v1_t))) : 0) // Skip the palette + sizeof(qgf_block_header_v1_t) // Skip the data block header @@ -268,7 +268,7 @@ static inline bool qp_drawtext_prepare_glyph_for_render(qff_font_handle_t *qff_f uint8_t glyph_width = (uint8_t)(glyph_info.value & QFF_GLYPH_WIDTH_MASK); uint32_t glyph_offset = ((glyph_info.value & QFF_GLYPH_OFFSET_MASK) >> QFF_GLYPH_WIDTH_BITS); uint32_t data_offset = sizeof(qff_font_descriptor_v1_t) // Skip the font descriptor - + sizeof(qff_ascii_glyph_table_v1_t) // Skip the ascii table + + (qff_font->has_ascii_table ? sizeof(qff_ascii_glyph_table_v1_t) : 0) // Skip the ascii table + (qff_font->num_unicode_glyphs > 0 ? (sizeof(qff_unicode_glyph_table_v1_t) + (qff_font->num_unicode_glyphs * sizeof(qff_unicode_glyph_v1_t))) : 0) // Skip the unicode table + (qff_font->has_palette ? (sizeof(qgf_palette_v1_t) + ((1 << qff_font->bpp) * sizeof(qgf_palette_entry_v1_t))) : 0) // Skip the palette + sizeof(qgf_block_header_v1_t) // Skip the data block header From db229d7341ae0b0f04a25870350b817cfb966943 Mon Sep 17 00:00:00 2001 From: eatmyvenom Date: Sat, 6 May 2023 13:32:51 -0700 Subject: [PATCH 5/6] Add vnmm keymaps and userspace (#20446) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Pablo Martínez <58857054+elpekenin@users.noreply.github.com> Co-authored-by: Drashna Jaelre --- .../gmmk/gmmk2/p65/ansi/keymaps/vnmm/keymap.c | 57 +++++++ .../gmmk2/p65/ansi/keymaps/vnmm/readme.md | 10 ++ .../gmmk/gmmk2/p65/ansi/keymaps/vnmm/rules.mk | 2 + .../gmmk/pro/rev1/ansi/keymaps/vnmm/keymap.c | 65 ++++++++ .../gmmk/pro/rev1/ansi/keymaps/vnmm/readme.md | 10 ++ .../gmmk/pro/rev1/ansi/keymaps/vnmm/rules.mk | 2 + .../keychron/v1/ansi/keymaps/vnmm/keymap.c | 54 +++++++ .../keychron/v1/ansi/keymaps/vnmm/readme.md | 10 ++ .../keychron/v1/ansi/keymaps/vnmm/rules.mk | 1 + .../keychron/v2/ansi/keymaps/vnmm/keymap.c | 57 +++++++ .../keychron/v2/ansi/keymaps/vnmm/readme.md | 10 ++ .../keychron/v2/ansi/keymaps/vnmm/rules.mk | 1 + .../v3/ansi_encoder/keymaps/vnmm/keymap.c | 77 ++++++++++ .../v3/ansi_encoder/keymaps/vnmm/rules.mk | 2 + users/vnmm/config.h | 70 +++++++++ users/vnmm/keymap_user.h | 41 +++++ users/vnmm/readme.md | 10 ++ users/vnmm/rgb_matrix_user.c | 140 ++++++++++++++++++ users/vnmm/rgb_matrix_user.h | 28 ++++ users/vnmm/rules.mk | 5 + users/vnmm/vnmm.c | 23 +++ users/vnmm/vnmm.h | 21 +++ 22 files changed, 696 insertions(+) create mode 100644 keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/keymap.c create mode 100644 keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/readme.md create mode 100644 keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/rules.mk create mode 100644 keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/keymap.c create mode 100644 keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/readme.md create mode 100644 keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/rules.mk create mode 100644 keyboards/keychron/v1/ansi/keymaps/vnmm/keymap.c create mode 100644 keyboards/keychron/v1/ansi/keymaps/vnmm/readme.md create mode 100644 keyboards/keychron/v1/ansi/keymaps/vnmm/rules.mk create mode 100644 keyboards/keychron/v2/ansi/keymaps/vnmm/keymap.c create mode 100644 keyboards/keychron/v2/ansi/keymaps/vnmm/readme.md create mode 100644 keyboards/keychron/v2/ansi/keymaps/vnmm/rules.mk create mode 100644 keyboards/keychron/v3/ansi_encoder/keymaps/vnmm/keymap.c create mode 100644 keyboards/keychron/v3/ansi_encoder/keymaps/vnmm/rules.mk create mode 100644 users/vnmm/config.h create mode 100644 users/vnmm/keymap_user.h create mode 100644 users/vnmm/readme.md create mode 100644 users/vnmm/rgb_matrix_user.c create mode 100644 users/vnmm/rgb_matrix_user.h create mode 100644 users/vnmm/rules.mk create mode 100644 users/vnmm/vnmm.c create mode 100644 users/vnmm/vnmm.h diff --git a/keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/keymap.c b/keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/keymap.c new file mode 100644 index 00000000000..6d88e116743 --- /dev/null +++ b/keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/keymap.c @@ -0,0 +1,57 @@ +/* Copyright 2022 Eugenio Pastoral + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "vnmm.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap WIN_BASE: Base Layer (Default Layer) + */ +[WIN_BASE] = LAYOUT( + QK_GESC, 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_DEL, + 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, + 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, + 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, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, WIN_F, KC_LEFT, KC_DOWN, KC_RGHT), + + /* Keymap MAC_BASE: Alternate base layer available if I end up on macbook. + */ +[MAC_BASE] = LAYOUT( + QK_GESC, 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_DEL, + 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, + 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, + 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, KC_END, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MAC_F, KC_LEFT, KC_DOWN, KC_RGHT), + + + /* Keymap WIN_FN: Function Layer WIN_BASE + */ +[WIN_FN] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, _______, _______, _______, KC_PSCR, KC_SCRL, KC_PAUS, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_SPD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, _______, _______, KC_VOLU, KC_MPLY, + EE_CLR, _______, _______, QK_BOOT, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), + + /* Keymap MAC_FN: Function Layer for MAC_BASE + */ +[MAC_FN] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, _______, _______, _______, KC_PSCR, KC_SCRL, KC_PAUS, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_SPD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, _______, _______, KC_VOLU, KC_MPLY, + EE_CLR, _______, _______, QK_BOOT, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), +}; diff --git a/keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/readme.md b/keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/readme.md new file mode 100644 index 00000000000..d39bdb6e8d4 --- /dev/null +++ b/keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/readme.md @@ -0,0 +1,10 @@ +# Vnmm's ANSI GMMKV2 65% Layout + +This keymap builds on archrovisual's but with some changes and uses the default key placements + +## Features + +- Alphabet keys light up red when caps lock is on +- Pressing FN shows keys that have a definition +- Via enabled +- Quick reset with fn+space diff --git a/keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/rules.mk b/keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/rules.mk new file mode 100644 index 00000000000..96d2d189b2e --- /dev/null +++ b/keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +MOUSEKEY_ENABLE = no diff --git a/keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/keymap.c b/keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/keymap.c new file mode 100644 index 00000000000..ad8416dc0fd --- /dev/null +++ b/keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/keymap.c @@ -0,0 +1,65 @@ +/* Copyright 2021 Glorious, LLC + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H +#include "vnmm.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [WIN_BASE] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_MUTE, + KC_GRV, 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_DEL, + 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, + 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, + 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, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, WIN_F, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [MAC_BASE] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_MUTE, + KC_GRV, 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_DEL, + 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, + 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, + 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, KC_END, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, WIN_F, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [WIN_FN] = LAYOUT( + _______, DF_WIN, DF_MAC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD,RGB_VAD, RGB_SPD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, + EE_CLR, _______, _______, QK_BOOT, _______, _______, _______, KC_MPRV, _______, KC_MNXT + ), + + [MAC_FN] = LAYOUT( + _______, DF_WIN, DF_MAC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD,RGB_VAD, RGB_SPD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, + EE_CLR, _______, _______, QK_BOOT, _______, _______, _______, KC_MPRV, _______, KC_MNXT + ), +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [WIN_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [WIN_FN] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, + [MAC_FN] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, +}; +#endif diff --git a/keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/readme.md b/keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/readme.md new file mode 100644 index 00000000000..28738e9bfc2 --- /dev/null +++ b/keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/readme.md @@ -0,0 +1,10 @@ +# Vnmm's ANSI GMMK pro layout + +This keymap builds on the default but with a more sensible FN layer. + +## Features + +- Alphabet keys light up red when caps lock is on or shift is pressed +- Pressing FN shows keys that have a definition +- Via enabled +- Reset to bootloader with FN+Space diff --git a/keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/rules.mk b/keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/rules.mk new file mode 100644 index 00000000000..f1adcab005e --- /dev/null +++ b/keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/keychron/v1/ansi/keymaps/vnmm/keymap.c b/keyboards/keychron/v1/ansi/keymaps/vnmm/keymap.c new file mode 100644 index 00000000000..6f26cc8729c --- /dev/null +++ b/keyboards/keychron/v1/ansi/keymaps/vnmm/keymap.c @@ -0,0 +1,54 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "vnmm.h" + +// clang-format off + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_ansi_82( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, + KC_GRV, 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_PGUP, + 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_PGDN, + 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_HOME, + 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, + KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, MAC_F, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [MAC_FN] = LAYOUT_ansi_82( + _______, KC_BRID, KC_BRIU, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_SPI, RGB_SAI, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, + _______, RGB_RMOD, RGB_VAD, RGB_SPD, RGB_SAD, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, + _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, KC_VOLU, + EE_CLR, _______, _______, QK_BOOT, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), + + [WIN_BASE] = LAYOUT_ansi_82( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, + KC_GRV, 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_PGUP, + 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_PGDN, + 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_HOME, + 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, + KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, WIN_F, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_FN] = LAYOUT_ansi_82( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_SPI, RGB_SAI, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, + _______, RGB_RMOD, RGB_VAD, RGB_SPD, RGB_SAD, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, KC_END, + _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, KC_VOLU, + EE_CLR, _______, _______, QK_BOOT, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), +}; diff --git a/keyboards/keychron/v1/ansi/keymaps/vnmm/readme.md b/keyboards/keychron/v1/ansi/keymaps/vnmm/readme.md new file mode 100644 index 00000000000..1ee0e0b117b --- /dev/null +++ b/keyboards/keychron/v1/ansi/keymaps/vnmm/readme.md @@ -0,0 +1,10 @@ +# Vnmm's Keychron V1 ansi layout + +This keymap builds on the default but with some extras I use on all my keyboards + +## Features + +- Alphabet keys light up red when caps lock is on or shift is pressed +- Pressing either FN shows keys that have a definition +- Via enabled +- Reset to bootloader with FN+Space diff --git a/keyboards/keychron/v1/ansi/keymaps/vnmm/rules.mk b/keyboards/keychron/v1/ansi/keymaps/vnmm/rules.mk new file mode 100644 index 00000000000..1e5b99807cb --- /dev/null +++ b/keyboards/keychron/v1/ansi/keymaps/vnmm/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes diff --git a/keyboards/keychron/v2/ansi/keymaps/vnmm/keymap.c b/keyboards/keychron/v2/ansi/keymaps/vnmm/keymap.c new file mode 100644 index 00000000000..8e93b07639a --- /dev/null +++ b/keyboards/keychron/v2/ansi/keymaps/vnmm/keymap.c @@ -0,0 +1,57 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "vnmm.h" + +// clang-format off + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_ansi_67( + QK_GESC, 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_INS, + 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_DEL, + 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_HOME, + 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, + KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, MAC_F, EXT_F, KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_BASE] = LAYOUT_ansi_67( + QK_GESC, 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_INS, + 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_DEL, + 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_HOME, + 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, + KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, WIN_F, EXT_F, KC_LEFT, KC_DOWN, KC_RGHT), + + [MAC_FN] = LAYOUT_ansi_67( + KC_GRV, KC_BRID, KC_BRIU, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_SPI, RGB_SAI, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, + _______, RGB_RMOD, RGB_VAD, RGB_SPD, RGB_SAD, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, + _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, KC_VOLU, + EE_CLR, _______, _______, QK_BOOT, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), + + [WIN_FN] = LAYOUT_ansi_67( + KC_GRV, KC_BRID, KC_BRIU, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_SPI, RGB_SAI, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, + _______, RGB_RMOD, RGB_VAD, RGB_SPD, RGB_SAD, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, + _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, KC_VOLU, + EE_CLR, _______, _______, QK_BOOT, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), + + [EXTRA_FN] = LAYOUT_ansi_67( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, QK_BOOT, _______, _______, _______, _______, _______, _______) +}; diff --git a/keyboards/keychron/v2/ansi/keymaps/vnmm/readme.md b/keyboards/keychron/v2/ansi/keymaps/vnmm/readme.md new file mode 100644 index 00000000000..c4fd5e9d017 --- /dev/null +++ b/keyboards/keychron/v2/ansi/keymaps/vnmm/readme.md @@ -0,0 +1,10 @@ +# Vnmm's Keychron V2 ansi layout + +This keymap builds on the default but with some extras I use on all my keyboards + +## Features + +- Alphabet keys light up red when caps lock is on or shift is pressed +- Pressing either FN shows keys that have a definition +- Via enabled +- Reset to bootloader with FN+Space diff --git a/keyboards/keychron/v2/ansi/keymaps/vnmm/rules.mk b/keyboards/keychron/v2/ansi/keymaps/vnmm/rules.mk new file mode 100644 index 00000000000..1e5b99807cb --- /dev/null +++ b/keyboards/keychron/v2/ansi/keymaps/vnmm/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes diff --git a/keyboards/keychron/v3/ansi_encoder/keymaps/vnmm/keymap.c b/keyboards/keychron/v3/ansi_encoder/keymaps/vnmm/keymap.c new file mode 100644 index 00000000000..376a715a843 --- /dev/null +++ b/keyboards/keychron/v3/ansi_encoder/keymaps/vnmm/keymap.c @@ -0,0 +1,77 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "vnmm.h" + +// clang-format off + +#define KC_TASK LGUI(KC_TAB) +#define KC_FLXP LGUI(KC_E) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_tkl_f13_ansi( + KC_ESC, KC_BRID, KC_BRIU, KC_NO, KC_NO, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_MUTE, KC_PSCR, KC_SCRL, KC_PAUS, + KC_GRV, 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_INS, KC_HOME, KC_PGUP, + 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_DEL, KC_END, KC_PGDN, + 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_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, + KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, KC_ROPT, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_BASE] = LAYOUT_tkl_f13_ansi( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MUTE, KC_PSCR, KC_SCRL, KC_PAUS, + KC_GRV, 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_INS, KC_HOME, KC_PGUP, + 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_DEL, KC_END, KC_PGDN, + 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_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, + KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, KC_RWIN, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [MAC_FN] = LAYOUT_tkl_f13_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_SPI, RGB_SAI, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_SPD, RGB_SAD, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, + EE_CLR, _______, _______, QK_BOOT, _______, _______, _______, _______, KC_MPRV, _______, KC_MNXT), + + [WIN_FN] = LAYOUT_tkl_f13_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_SPI, RGB_SAI, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_SPD, RGB_SAD, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, + EE_CLR, _______, _______, QK_BOOT, _______, _______, _______, _______, KC_MPRV, _______, KC_MNXT), +}; + +#ifdef ENCODER_MAP_ENABLE +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [WIN_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [MAC_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, + [WIN_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, +}; +#endif // ENCODER_MAP_ENABLE + +#ifdef DIP_SWITCH_ENABLE + +bool dip_switch_update_user(uint8_t index, bool active) { + if (index == 0) { + default_layer_set(1UL << (active ? 1 : 0)); + } + return false; +} + +#endif // DIP_SWITCH_ENABLE \ No newline at end of file diff --git a/keyboards/keychron/v3/ansi_encoder/keymaps/vnmm/rules.mk b/keyboards/keychron/v3/ansi_encoder/keymaps/vnmm/rules.mk new file mode 100644 index 00000000000..f1adcab005e --- /dev/null +++ b/keyboards/keychron/v3/ansi_encoder/keymaps/vnmm/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes diff --git a/users/vnmm/config.h b/users/vnmm/config.h new file mode 100644 index 00000000000..3642c5784cd --- /dev/null +++ b/users/vnmm/config.h @@ -0,0 +1,70 @@ +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// All of these config options can be changed by keyboard in their config.h +// These are all just the defaults I like for most of my keyboards + +#ifndef RGB_MATRIX_TIMEOUT +// If the keyboard is unused for 20 minutes then just turn off RGB +# define RGB_MATRIX_TIMEOUT 1200000 // 20 minutes (20 * 60 * 1000ms) + +#endif + +#ifndef CAPS_LOCK_INDICATOR_COLOR +// When caps lock is pressed, the letter keys, caps lock, and both shift keys, will light up this color. +# define CAPS_LOCK_INDICATOR_COLOR RGB_RED +#endif + +#ifndef SHIFT_INDICATOR_COLOR +// If defined also light up alphabet keys when either shift is held +# define SHIFT_INDICATOR_COLOR RGB_WHITE +#endif + +#ifndef CAPS_LOCK_INDICATOR_OTHER +// When caps lock is pressed, all other keys will light up this color +// #define CAPS_LOCK_INDICATOR_OTHER RGB_WHITE +#endif + +#ifndef CAPS_LOCK_INDICATOR_LIGHT_ALPHAS +// All alphabet keys will light up, othe rwise just caps lock. +# define CAPS_LOCK_INDICATOR_LIGHT_ALPHAS +#endif + +#ifndef FN_LAYER_TRANSPARENT_KEYS_COLOR +// Keys not defined in the current layer will use this color +# define FN_LAYER_TRANSPARENT_KEYS_COLOR RGB_OFF +#endif + +// Keys defined in the current layer will use this color +#ifndef FN_LAYER_KEYS_COLOR +// #define FN_LAYER_KEYS_COLOR RGB_WHITE +#endif + +#ifndef CURRENT_LAYER_INDICATOR_COLOR +// If a key on a FN layer changes the default layer to the current layer, light up this color +# define CURRENT_LAYER_INDICATOR_COLOR RGB_WHITE +#endif + +#ifndef NKRO_INDICATOR_COLOR +// If NKRO is enabled, the key on the fn layer that toggles it will light up this color +# define NKRO_INDICATOR_COLOR RGB_WHITE +#endif + +// Don't light up my whole room when the pc is asleep +#ifndef RGB_DISABLE_WHEN_USB_SUSPENDED +# define RGB_DISABLE_WHEN_USB_SUSPENDED +#endif diff --git a/users/vnmm/keymap_user.h b/users/vnmm/keymap_user.h new file mode 100644 index 00000000000..2262910bccc --- /dev/null +++ b/users/vnmm/keymap_user.h @@ -0,0 +1,41 @@ +/* Copyright 2021 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#ifdef DYNAMIC_KEYMAP_LAYER_COUNT +#undef DYNAMIC_KEYMAP_LAYER_COUNT +#endif +#define DYNAMIC_KEYMAP_LAYER_COUNT 5 + +#define WIN_F MO(WIN_FN) +#define MAC_F MO(MAC_FN) +#define EXT_F MO(EXTRA_FN) + +#define DF_WIN DF(WIN_BASE) +#define DF_MAC DF(MAC_BASE) + +// clang-format off + +enum layers { + WIN_BASE, + MAC_BASE, + WIN_FN, + MAC_FN, + EXTRA_FN +}; + +// clang-format on diff --git a/users/vnmm/readme.md b/users/vnmm/readme.md new file mode 100644 index 00000000000..637e92c063a --- /dev/null +++ b/users/vnmm/readme.md @@ -0,0 +1,10 @@ +# Vnmm's stuff + +This keymap builds on archrovisual's but with some changes and uses the default key placements + +## Features + +- Alphabet keys light up red when caps lock is on or shift is on +- Pressing FN shows keys that have a definition +- Via enabled +- Quick reset with fn+space diff --git a/users/vnmm/rgb_matrix_user.c b/users/vnmm/rgb_matrix_user.c new file mode 100644 index 00000000000..c85f86782eb --- /dev/null +++ b/users/vnmm/rgb_matrix_user.c @@ -0,0 +1,140 @@ +/* + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "rgb_matrix_user.h" +#include "keymap_user.h" + +keypos_t led_index_key_position[RGB_MATRIX_LED_COUNT]; + +#ifdef SHIFT_INDICATOR_COLOR +# define is_shift_pressed (get_mods() & MOD_MASK_SHIFT) +#else +# define is_shift_pressed false +#endif + +void rgb_matrix_init_user(void) { + // Set up led_index_key_position + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + for (uint8_t col = 0; col < MATRIX_COLS; col++) { + uint8_t led_index = g_led_config.matrix_co[row][col]; + if (led_index != NO_LED) { + led_index_key_position[led_index] = (keypos_t){.row = row, .col = col}; + } + } + } +} + +bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + uint8_t current_layer = get_highest_layer(layer_state); + bool caps = host_keyboard_led_state().caps_lock; + switch (current_layer) { + case WIN_BASE: + case MAC_BASE: + // Light up letters if caps and light up letters and numbers if shift. If shift and caps light up just numbers. +#ifdef CAPS_LOCK_INDICATOR_COLOR + if (caps && !is_shift_pressed) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); +# ifdef CAPS_LOCK_INDICATOR_OTHER + rgb_matrix_set_color_by_not_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_OTHER); +# endif + } +# ifdef SHIFT_INDICATOR_COLOR + else if (is_shift_pressed && !caps) { + // Light up letters and other shift affected keys + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_shift_indicator, SHIFT_INDICATOR_COLOR); + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); + } else if (is_shift_pressed && caps) { + // Only shift affected keys light up + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_shift_indicator, SHIFT_INDICATOR_COLOR); + } +# endif // SHIFT_INDICATOR_COLOR +#endif // CAPS_LOCK_INDICATOR_COLOR + break; + default: +#ifdef FN_LAYER_TRANSPARENT_KEYS_COLOR + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, FN_LAYER_TRANSPARENT_KEYS_COLOR); +#endif +#ifdef FN_LAYER_KEYS_COLOR + rgb_matrix_set_color_by_not_keycode(led_min, led_max, current_layer, is_transparent, FN_LAYER_KEYS_COLOR); +#endif +#ifdef CURRENT_LAYER_INDICATOR_COLOR + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_default_layer, CURRENT_LAYER_INDICATOR_COLOR); +#endif +#ifdef NKRO_INDICATOR_COLOR + if (keymap_config.nkro) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_nkro_indicator, NKRO_INDICATOR_COLOR); + } +#endif + break; + } + return false; +} + +// set color of keys that match the keycode +void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue) { + for (uint8_t i = led_min; i < led_max; i++) { + uint16_t keycode = keymap_key_to_keycode(layer, led_index_key_position[i]); + if ((*is_keycode)(keycode)) { + rgb_matrix_set_color(i, red, green, blue); + } + } +} + +// set color of all leds that are not a certain keycode +void rgb_matrix_set_color_by_not_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue) { + for (uint8_t i = led_min; i < led_max; i++) { + uint16_t keycode = keymap_key_to_keycode(layer, led_index_key_position[i]); + if (!(*is_keycode)(keycode)) { + rgb_matrix_set_color(i, red, green, blue); + } + } +} + +// check if keycode is a letter or shift or caps lock +bool is_caps_lock_indicator(uint16_t keycode) { +#ifdef CAPS_LOCK_INDICATOR_LIGHT_ALPHAS + return (KC_A <= keycode && keycode <= KC_Z) || keycode == KC_CAPS || keycode == KC_LSFT || keycode == KC_RSFT; +#else + return keycode == KC_CAPS; +#endif +} + +// check if keycode is the DF to default layer +#ifdef CURRENT_LAYER_INDICATOR_COLOR +bool is_default_layer(uint16_t keycode) { + return keycode == DF(get_highest_layer(default_layer_state)); +} +#endif + +// check if keycode is the NKRO toggle +#ifdef NKRO_INDICATOR_COLOR +bool is_nkro_indicator(uint16_t keycode) { + return keycode == NK_TOGG; +} +#endif + +// check if keycode is transparent +bool is_transparent(uint16_t keycode) { + return keycode == KC_TRNS; +} + +// check if keycode is affected by shift on the number row +#ifdef SHIFT_INDICATOR_COLOR +bool is_shift_indicator(uint16_t keycode) { + return (KC_1 <= keycode && keycode <= KC_0) || keycode == KC_MINS || keycode == KC_EQL || keycode == KC_GRV || keycode == KC_BSLS || keycode == KC_LBRC || keycode == KC_RBRC || keycode == KC_SCLN || keycode == KC_QUOT || keycode == KC_COMM || keycode == KC_DOT || keycode == KC_SLSH || keycode == QK_GESC || keycode == KC_LSFT || keycode == KC_RSFT; +} +#endif diff --git a/users/vnmm/rgb_matrix_user.h b/users/vnmm/rgb_matrix_user.h new file mode 100644 index 00000000000..7fe3d8229a2 --- /dev/null +++ b/users/vnmm/rgb_matrix_user.h @@ -0,0 +1,28 @@ +/* + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +void rgb_matrix_init_user(void); + +void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue); +void rgb_matrix_set_color_by_not_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue); + +bool is_default_layer(uint16_t keycode); +bool is_nkro_indicator(uint16_t keycode); +bool is_caps_lock_indicator(uint16_t keycode); +bool is_transparent(uint16_t keycode); +bool is_shift_indicator(uint16_t keycode); diff --git a/users/vnmm/rules.mk b/users/vnmm/rules.mk new file mode 100644 index 00000000000..2b601fd3e52 --- /dev/null +++ b/users/vnmm/rules.mk @@ -0,0 +1,5 @@ +SRC += vnmm.c + +ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) + SRC += rgb_matrix_user.c +endif diff --git a/users/vnmm/vnmm.c b/users/vnmm/vnmm.c new file mode 100644 index 00000000000..a4d4a7928e0 --- /dev/null +++ b/users/vnmm/vnmm.c @@ -0,0 +1,23 @@ +/* + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "vnmm.h" + +void keyboard_post_init_user(void) { +#ifdef RGB_MATRIX_ENABLE + rgb_matrix_init_user(); +#endif +} \ No newline at end of file diff --git a/users/vnmm/vnmm.h b/users/vnmm/vnmm.h new file mode 100644 index 00000000000..03723c3debb --- /dev/null +++ b/users/vnmm/vnmm.h @@ -0,0 +1,21 @@ +/* + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "keymap_user.h" +#ifdef RGB_MATRIX_ENABLE +# include "rgb_matrix_user.h" +#endif \ No newline at end of file From 5c2e668190c98ebee37f19acbfcedf472bc461a6 Mon Sep 17 00:00:00 2001 From: leyew <102467346+itsme-zeix@users.noreply.github.com> Date: Tue, 9 May 2023 14:57:28 +0800 Subject: [PATCH 6/6] [Keyboard] Add dnworks/SBL (#20652) Co-authored-by: Less/Rikki <86894501+lesshonor@users.noreply.github.com> Co-authored-by: Drashna Jaelre --- keyboards/dnworks/sbl/config.h | 20 ++++ keyboards/dnworks/sbl/info.json | 101 ++++++++++++++++++ .../dnworks/sbl/keymaps/default/keymap.c | 33 ++++++ keyboards/dnworks/sbl/keymaps/via/keymap.c | 33 ++++++ keyboards/dnworks/sbl/keymaps/via/rules.mk | 1 + keyboards/dnworks/sbl/readme.md | 27 +++++ keyboards/dnworks/sbl/rules.mk | 1 + 7 files changed, 216 insertions(+) create mode 100644 keyboards/dnworks/sbl/config.h create mode 100644 keyboards/dnworks/sbl/info.json create mode 100644 keyboards/dnworks/sbl/keymaps/default/keymap.c create mode 100644 keyboards/dnworks/sbl/keymaps/via/keymap.c create mode 100644 keyboards/dnworks/sbl/keymaps/via/rules.mk create mode 100644 keyboards/dnworks/sbl/readme.md create mode 100644 keyboards/dnworks/sbl/rules.mk diff --git a/keyboards/dnworks/sbl/config.h b/keyboards/dnworks/sbl/config.h new file mode 100644 index 00000000000..77970ce4d34 --- /dev/null +++ b/keyboards/dnworks/sbl/config.h @@ -0,0 +1,20 @@ +/* +Copyright 2023 zeix (@itsme-zeix) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 500U diff --git a/keyboards/dnworks/sbl/info.json b/keyboards/dnworks/sbl/info.json new file mode 100644 index 00000000000..cf9f4a2dfdc --- /dev/null +++ b/keyboards/dnworks/sbl/info.json @@ -0,0 +1,101 @@ +{ + "keyboard_name": "SBL", + "maintainer": "zeix", + "manufacturer": "dnworks", + "processor": "RP2040", + "bootloader": "rp2040", + "usb": { + "vid": "0x4C23", + "pid": "0x2934", + "device_version": "0.0.1" + }, + "features": { + "bootmagic": true, + "mousekey": true, + "extrakey": true, + "console": false, + "command": false, + "nkro": true + }, + "indicators": { + "caps_lock": "GP29", + "on_state": 1 + }, + "diode_direction": "COL2ROW", + "matrix_pins": { + "rows": ["GP6","GP5","GP4","GP0","GP12"], + "cols": ["GP28","GP27","GP26","GP25","GP24","GP23","GP22","GP3","GP2","GP1","GP8","GP9","GP10","GP11","GP7"] + }, + "layouts": { + "LAYOUT": { + "layout": [ + { "matrix": [0, 0], "x": 0, "y": 0 }, + { "matrix": [0, 1], "x": 1, "y": 0 }, + { "matrix": [0, 2], "x": 2, "y": 0 }, + { "matrix": [0, 3], "x": 3, "y": 0 }, + { "matrix": [0, 4], "x": 4, "y": 0 }, + { "matrix": [0, 5], "x": 5, "y": 0 }, + { "matrix": [0, 6], "x": 6, "y": 0 }, + { "matrix": [0, 7], "x": 7, "y": 0 }, + { "matrix": [0, 8], "x": 8, "y": 0 }, + { "matrix": [0, 9], "x": 9, "y": 0 }, + { "matrix": [0, 10], "x": 10, "y": 0 }, + { "matrix": [0, 11], "x": 11, "y": 0 }, + { "matrix": [0, 12], "x": 12, "y": 0 }, + { "matrix": [0, 13], "x": 13, "y": 0 }, + { "matrix": [0, 14], "x": 14, "y": 0 }, + { "matrix": [1, 0], "w": 1.5, "x": 0, "y": 1 }, + { "matrix": [1, 1], "x": 1.5, "y": 1 }, + { "matrix": [1, 2], "x": 2.5, "y": 1 }, + { "matrix": [1, 3], "x": 3.5, "y": 1 }, + { "matrix": [1, 4], "x": 4.5, "y": 1 }, + { "matrix": [1, 5], "x": 5.5, "y": 1 }, + { "matrix": [1, 6], "x": 6.5, "y": 1 }, + { "matrix": [1, 7], "x": 7.5, "y": 1 }, + { "matrix": [1, 8], "x": 8.5, "y": 1 }, + { "matrix": [1, 9], "x": 9.5, "y": 1 }, + { "matrix": [1, 10], "x": 10.5, "y": 1 }, + { "matrix": [1, 11], "x": 11.5, "y": 1 }, + { "matrix": [1, 12], "x": 12.5, "y": 1 }, + { "matrix": [1, 13], "w": 1.5, "x": 13.5, "y": 1 }, + { "matrix": [2, 0], "w": 1.75, "x": 0, "y": 2 }, + { "matrix": [2, 1], "x": 1.75, "y": 2 }, + { "matrix": [2, 2], "x": 2.75, "y": 2 }, + { "matrix": [2, 3], "x": 3.75, "y": 2 }, + { "matrix": [2, 4], "x": 4.75, "y": 2 }, + { "matrix": [2, 5], "x": 5.75, "y": 2 }, + { "matrix": [2, 6], "x": 6.75, "y": 2 }, + { "matrix": [2, 7], "x": 7.75, "y": 2 }, + { "matrix": [2, 8], "x": 8.75, "y": 2 }, + { "matrix": [2, 9], "x": 9.75, "y": 2 }, + { "matrix": [2, 10], "x": 10.75, "y": 2 }, + { "matrix": [2, 11], "x": 11.75, "y": 2 }, + { "matrix": [2, 12], "x": 16, "y": 2 }, + { "matrix": [2, 13], "w": 2.25, "x": 12.75, "y": 2 }, + { "matrix": [3, 0], "w": 1.25, "x": 0, "y": 3 }, + { "matrix": [3, 1], "x": 1.25, "y": 3 }, + { "matrix": [3, 2], "x": 2.25, "y": 3 }, + { "matrix": [3, 3], "x": 3.25, "y": 3 }, + { "matrix": [3, 4], "x": 4.25, "y": 3 }, + { "matrix": [3, 5], "x": 5.25, "y": 3 }, + { "matrix": [3, 6], "x": 6.25, "y": 3 }, + { "matrix": [3, 7], "x": 7.25, "y": 3 }, + { "matrix": [3, 8], "x": 8.25, "y": 3 }, + { "matrix": [3, 9], "x": 9.25, "y": 3 }, + { "matrix": [3, 10], "x": 10.25, "y": 3 }, + { "matrix": [3, 11], "x": 11.25, "y": 3 }, + { "matrix": [3, 12], "w": 1.75, "x": 12.25, "y": 3 }, + { "matrix": [3, 13], "x": 14, "y": 3 }, + { "matrix": [4, 0], "w": 1.25, "x": 0, "y": 4 }, + { "matrix": [4, 1], "w": 1.25, "x": 1.25, "y": 4 }, + { "matrix": [4, 2], "w": 1.25, "x": 2.5, "y": 4 }, + { "matrix": [4, 6], "w": 6.25, "x": 3.75, "y": 4 }, + { "matrix": [4, 10], "w": 1.25, "x": 10, "y": 4 }, + { "matrix": [4, 11], "w": 1.25, "x": 11.25, "y": 4 }, + { "matrix": [4, 12], "w": 1.25, "x": 12.5, "y": 4 }, + { "matrix": [4, 13], "w": 1.25, "x": 13.75, "y": 4 } + ] + } + + } +} diff --git a/keyboards/dnworks/sbl/keymaps/default/keymap.c b/keyboards/dnworks/sbl/keymaps/default/keymap.c new file mode 100644 index 00000000000..91c381d8327 --- /dev/null +++ b/keyboards/dnworks/sbl/keymaps/default/keymap.c @@ -0,0 +1,33 @@ +/* +Copyright 2023 zeix (@itsme-zeix) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[0] = LAYOUT( + 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_BSLS, KC_BSPC, + 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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NONUS_HASH, KC_ENT, + 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, MO(1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL), + +[1] = LAYOUT( + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_DEL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; diff --git a/keyboards/dnworks/sbl/keymaps/via/keymap.c b/keyboards/dnworks/sbl/keymaps/via/keymap.c new file mode 100644 index 00000000000..91c381d8327 --- /dev/null +++ b/keyboards/dnworks/sbl/keymaps/via/keymap.c @@ -0,0 +1,33 @@ +/* +Copyright 2023 zeix (@itsme-zeix) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[0] = LAYOUT( + 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_BSLS, KC_BSPC, + 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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NONUS_HASH, KC_ENT, + 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, MO(1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL), + +[1] = LAYOUT( + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_DEL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; diff --git a/keyboards/dnworks/sbl/keymaps/via/rules.mk b/keyboards/dnworks/sbl/keymaps/via/rules.mk new file mode 100644 index 00000000000..1e5b99807cb --- /dev/null +++ b/keyboards/dnworks/sbl/keymaps/via/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes diff --git a/keyboards/dnworks/sbl/readme.md b/keyboards/dnworks/sbl/readme.md new file mode 100644 index 00000000000..0c6569f125d --- /dev/null +++ b/keyboards/dnworks/sbl/readme.md @@ -0,0 +1,27 @@ +# SBL + +![SBL](https://i.imgur.com/HqRfr4bh.jpg) + +An O ring mount 60%, akin to the otd 356mini + +* Keyboard Maintainer: [Zeix](https://github.com/itsme-zeix) +* Hardware Supported: SBL Solder PCB rev1 +* Hardware Availability: https://dnworks.co/products/sbl + +Make example for this keyboard (after setting up your build environment): + + make dnworks/sbl:default + +Flashing example for this keyboard: + + make dnworks/sbl:default:flash + +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). + +## Bootloader + +Enter the bootloader in 3 ways: + +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard +* **Physical reset button**: Short the 'USB_BOOT' button and plug in keyboard or briefly short the `RESET` and `GND` pads on the SWD header twice +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available \ No newline at end of file diff --git a/keyboards/dnworks/sbl/rules.mk b/keyboards/dnworks/sbl/rules.mk new file mode 100644 index 00000000000..7ff128fa692 --- /dev/null +++ b/keyboards/dnworks/sbl/rules.mk @@ -0,0 +1 @@ +# This file intentionally left blank \ No newline at end of file