From c98e1694fbd1ff1234e0d7c7e00cf690188a50c1 Mon Sep 17 00:00:00 2001 From: qpockets <69164255+qpockets@users.noreply.github.com> Date: Thu, 19 Aug 2021 13:17:01 -0400 Subject: [PATCH 01/10] [Keyboard] update space_space keyboard (#13305) Co-authored-by: Drashna Jaelre Co-authored-by: Ryan --- keyboards/space_space/readme.md | 8 +- keyboards/space_space/{ => rev1}/config.h | 20 ++-- keyboards/space_space/{ => rev1}/info.json | 0 .../{ => rev1}/keymaps/big_space/config.h | 0 .../{ => rev1}/keymaps/big_space/keymap.c | 2 - .../{ => rev1}/keymaps/big_space/rules.mk | 0 .../{ => rev1}/keymaps/default/config.h | 0 .../{ => rev1}/keymaps/default/keymap.c | 2 - .../{ => rev1}/keymaps/default/rules.mk | 0 .../space_space/{ => rev1}/keymaps/readme.md | 0 keyboards/space_space/rev1/readme.md | 18 ++++ keyboards/space_space/rev1/rules.mk | 23 +++++ .../space_space/{ => rev1}/space_space.c | 0 keyboards/space_space/rev1/space_space.h | 45 +++++++++ keyboards/space_space/rev2/config.h | 59 ++++++++++++ keyboards/space_space/rev2/info.json | 92 +++++++++++++++++++ .../rev2/keymaps/big_space/config.h | 27 ++++++ .../rev2/keymaps/big_space/keymap.c | 81 ++++++++++++++++ .../rev2/keymaps/big_space/rules.mk | 1 + .../space_space/rev2/keymaps/default/config.h | 27 ++++++ .../space_space/rev2/keymaps/default/keymap.c | 77 ++++++++++++++++ .../space_space/rev2/keymaps/default/rules.mk | 1 + .../rev2/keymaps/qpockets/config.h | 27 ++++++ .../rev2/keymaps/qpockets/keymap.c | 75 +++++++++++++++ .../rev2/keymaps/qpockets/rules.mk | 1 + keyboards/space_space/rev2/readme.md | 18 ++++ keyboards/space_space/rev2/rev2.c | 35 +++++++ keyboards/space_space/rev2/rev2.h | 49 ++++++++++ keyboards/space_space/rev2/rules.mk | 23 +++++ keyboards/space_space/rules.mk | 24 +---- keyboards/space_space/space_space.h | 48 ---------- 31 files changed, 696 insertions(+), 87 deletions(-) rename keyboards/space_space/{ => rev1}/config.h (82%) rename keyboards/space_space/{ => rev1}/info.json (100%) rename keyboards/space_space/{ => rev1}/keymaps/big_space/config.h (100%) rename keyboards/space_space/{ => rev1}/keymaps/big_space/keymap.c (99%) rename keyboards/space_space/{ => rev1}/keymaps/big_space/rules.mk (100%) rename keyboards/space_space/{ => rev1}/keymaps/default/config.h (100%) rename keyboards/space_space/{ => rev1}/keymaps/default/keymap.c (99%) rename keyboards/space_space/{ => rev1}/keymaps/default/rules.mk (100%) rename keyboards/space_space/{ => rev1}/keymaps/readme.md (100%) create mode 100644 keyboards/space_space/rev1/readme.md create mode 100644 keyboards/space_space/rev1/rules.mk rename keyboards/space_space/{ => rev1}/space_space.c (100%) create mode 100644 keyboards/space_space/rev1/space_space.h create mode 100644 keyboards/space_space/rev2/config.h create mode 100644 keyboards/space_space/rev2/info.json create mode 100644 keyboards/space_space/rev2/keymaps/big_space/config.h create mode 100644 keyboards/space_space/rev2/keymaps/big_space/keymap.c create mode 100644 keyboards/space_space/rev2/keymaps/big_space/rules.mk create mode 100644 keyboards/space_space/rev2/keymaps/default/config.h create mode 100644 keyboards/space_space/rev2/keymaps/default/keymap.c create mode 100644 keyboards/space_space/rev2/keymaps/default/rules.mk create mode 100644 keyboards/space_space/rev2/keymaps/qpockets/config.h create mode 100644 keyboards/space_space/rev2/keymaps/qpockets/keymap.c create mode 100644 keyboards/space_space/rev2/keymaps/qpockets/rules.mk create mode 100644 keyboards/space_space/rev2/readme.md create mode 100644 keyboards/space_space/rev2/rev2.c create mode 100644 keyboards/space_space/rev2/rev2.h create mode 100644 keyboards/space_space/rev2/rules.mk delete mode 100644 keyboards/space_space/space_space.h diff --git a/keyboards/space_space/readme.md b/keyboards/space_space/readme.md index c0d254faac..08fa640f22 100644 --- a/keyboards/space_space/readme.md +++ b/keyboards/space_space/readme.md @@ -1,18 +1,18 @@ # space_space -![space_space](https://i.imgur.com/qdkG8K7l.jpg) +![space_space](https://i.imgur.com/SxjhzIMl.jpg) Give your space some space * Keyboard Maintainer: https://github.com/qpockets -* Hardware Availability: +* Hardware Availability: [p3dstore](https://p3dstore.com/products/space-space-acrylic-case?_pos=21&_sid=c75de6a78&_ss=r&variant=39907740844216) Make example for this keyboard (after setting up your build environment): - make space_space:default + make space_space/rev2:default Flashing example for this keyboard: - make space_space:default:flash + make space_space/rev2: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). diff --git a/keyboards/space_space/config.h b/keyboards/space_space/rev1/config.h similarity index 82% rename from keyboards/space_space/config.h rename to keyboards/space_space/rev1/config.h index 20b1180d3a..d52aad4c2b 100644 --- a/keyboards/space_space/config.h +++ b/keyboards/space_space/rev1/config.h @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - + #pragma once #include "config_common.h" @@ -28,9 +28,11 @@ /* key matrix size */ #define MATRIX_ROWS 4 #define MATRIX_COLS 11 - -#define MATRIX_ROW_PINS { F1, F4, F5, C7 } -#define MATRIX_COL_PINS { D4, B4, B5, B6, C6, F7, F6, F0, B0, E6, B1 } + +#define MATRIX_ROW_PINS \ + { F1, F4, F5, C7 } +#define MATRIX_COL_PINS \ + { D4, B4, B5, B6, C6, F7, F6, F0, B0, E6, B1 } #define UNUSED_PINS @@ -38,13 +40,15 @@ #define DIODE_DIRECTION COL2ROW /* ROTARY ENCODERS */ -#define ENCODERS_PAD_A { B3, D6 } -#define ENCODERS_PAD_B { B2, D7 } +#define ENCODERS_PAD_A \ + { B3, D6 } +#define ENCODERS_PAD_B \ + { B2, D7 } -#define ENCODER_RESOLUTIONS { 3, 4 } +#define ENCODER_RESOLUTIONS \ + { 3, 4 } //#define ENCODER_DIRECTION_FLIP - #define DEBOUNCE 7 #define LOCKING_SUPPORT_ENABLE diff --git a/keyboards/space_space/info.json b/keyboards/space_space/rev1/info.json similarity index 100% rename from keyboards/space_space/info.json rename to keyboards/space_space/rev1/info.json diff --git a/keyboards/space_space/keymaps/big_space/config.h b/keyboards/space_space/rev1/keymaps/big_space/config.h similarity index 100% rename from keyboards/space_space/keymaps/big_space/config.h rename to keyboards/space_space/rev1/keymaps/big_space/config.h diff --git a/keyboards/space_space/keymaps/big_space/keymap.c b/keyboards/space_space/rev1/keymaps/big_space/keymap.c similarity index 99% rename from keyboards/space_space/keymaps/big_space/keymap.c rename to keyboards/space_space/rev1/keymaps/big_space/keymap.c index f99925971a..62241532e8 100644 --- a/keyboards/space_space/keymaps/big_space/keymap.c +++ b/keyboards/space_space/rev1/keymaps/big_space/keymap.c @@ -13,7 +13,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - #include QMK_KEYBOARD_H enum layers{ @@ -94,7 +93,6 @@ bool encoder_update_user(uint8_t index, bool clockwise) { } } else if (index == 0) { /* right encoder */ switch(get_highest_layer(layer_state)){ - case _SYM: if (clockwise) { tap_code(KC_MPRV); diff --git a/keyboards/space_space/keymaps/big_space/rules.mk b/keyboards/space_space/rev1/keymaps/big_space/rules.mk similarity index 100% rename from keyboards/space_space/keymaps/big_space/rules.mk rename to keyboards/space_space/rev1/keymaps/big_space/rules.mk diff --git a/keyboards/space_space/keymaps/default/config.h b/keyboards/space_space/rev1/keymaps/default/config.h similarity index 100% rename from keyboards/space_space/keymaps/default/config.h rename to keyboards/space_space/rev1/keymaps/default/config.h diff --git a/keyboards/space_space/keymaps/default/keymap.c b/keyboards/space_space/rev1/keymaps/default/keymap.c similarity index 99% rename from keyboards/space_space/keymaps/default/keymap.c rename to keyboards/space_space/rev1/keymaps/default/keymap.c index 3de82fa923..6b4219b289 100644 --- a/keyboards/space_space/keymaps/default/keymap.c +++ b/keyboards/space_space/rev1/keymaps/default/keymap.c @@ -13,7 +13,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - #include QMK_KEYBOARD_H enum layers{ @@ -96,7 +95,6 @@ bool encoder_update_user(uint8_t index, bool clockwise) { } } else if (index == 0) { /* right encoder */ switch(get_highest_layer(layer_state)){ - case _SYM: if (clockwise) { tap_code(KC_MPRV); diff --git a/keyboards/space_space/keymaps/default/rules.mk b/keyboards/space_space/rev1/keymaps/default/rules.mk similarity index 100% rename from keyboards/space_space/keymaps/default/rules.mk rename to keyboards/space_space/rev1/keymaps/default/rules.mk diff --git a/keyboards/space_space/keymaps/readme.md b/keyboards/space_space/rev1/keymaps/readme.md similarity index 100% rename from keyboards/space_space/keymaps/readme.md rename to keyboards/space_space/rev1/keymaps/readme.md diff --git a/keyboards/space_space/rev1/readme.md b/keyboards/space_space/rev1/readme.md new file mode 100644 index 0000000000..4b170612e8 --- /dev/null +++ b/keyboards/space_space/rev1/readme.md @@ -0,0 +1,18 @@ +# space_space + +![space_space](https://i.imgur.com/qdkG8K7l.jpg) + +Give your space some space + +* Keyboard Maintainer: https://github.com/qpockets +* Hardware Availability: limited + +Make example for this keyboard (after setting up your build environment): + + make space_space/rev1:default + +Flashing example for this keyboard: + + make space_space/rev1: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). diff --git a/keyboards/space_space/rev1/rules.mk b/keyboards/space_space/rev1/rules.mk new file mode 100644 index 0000000000..831de6dc5c --- /dev/null +++ b/keyboards/space_space/rev1/rules.mk @@ -0,0 +1,23 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +BLUETOOTH_ENABLE = no # Enable Bluetooth +AUDIO_ENABLE = no # Audio output +ENCODER_ENABLE = yes diff --git a/keyboards/space_space/space_space.c b/keyboards/space_space/rev1/space_space.c similarity index 100% rename from keyboards/space_space/space_space.c rename to keyboards/space_space/rev1/space_space.c diff --git a/keyboards/space_space/rev1/space_space.h b/keyboards/space_space/rev1/space_space.h new file mode 100644 index 0000000000..e56068ec42 --- /dev/null +++ b/keyboards/space_space/rev1/space_space.h @@ -0,0 +1,45 @@ +/* Copyright 2020 qpockets + * + * 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 "quantum.h" + +#define XXX KC_NO + +#define LAYOUT_default( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K50, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K51, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K52, \ + K32, K33, K34, K36, K37, K38 \ +) { \ + {K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K50}, \ + {K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K51}, \ + {K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K52}, \ + {XXX, XXX, K32, K33, K34, XXX, K36, K37, K38, XXX, XXX} \ +} + +#define LAYOUT_big_space( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K50, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K51, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K52, \ + K32, K35, K38 \ +) { \ + {K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K50}, \ + {K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K51}, \ + {K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K52}, \ + {XXX, XXX, K32, XXX, XXX, K35, XXX, XXX, K38, XXX, XXX} \ +} diff --git a/keyboards/space_space/rev2/config.h b/keyboards/space_space/rev2/config.h new file mode 100644 index 0000000000..66f8f6add4 --- /dev/null +++ b/keyboards/space_space/rev2/config.h @@ -0,0 +1,59 @@ +/* Copyright 2021 qpockets + * + * 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 "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x7170 +#define PRODUCT_ID 0x7373 +#define DEVICE_VER 0x3002 +#define MANUFACTURER qpockets +#define PRODUCT space_space + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 11 + +#define MATRIX_ROW_PINS \ + { B1, B0, D5, B6 } +#define MATRIX_COL_PINS \ + { C6, F6, F1, F4, F5, E6, D6, B2, B5, D3, D2 } + +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* ROTARY ENCODERS */ +#define ENCODERS_PAD_A \ + { D7, F7 } +#define ENCODERS_PAD_B \ + { B4, C7 } + +#define ENCODER_RESOLUTION 3 +#define ENCODER_DIRECTION_FLIP + +#define DEBOUNCE 5 + +#define LOCKING_SUPPORT_ENABLE + +#define RGB_DI_PIN F0 +#define RGBLED_NUM 4 + +#define DRIVER_LED_TOTAL RGBLED_NUM +#define RGBLIGHT_DEFAULT_HUE 130 diff --git a/keyboards/space_space/rev2/info.json b/keyboards/space_space/rev2/info.json new file mode 100644 index 0000000000..b0dcdc8598 --- /dev/null +++ b/keyboards/space_space/rev2/info.json @@ -0,0 +1,92 @@ +{ + "keyboard_name": "space_space", + "url": "", + "maintainer": "qpockets", + "width": 11.5, + "height": 4.35, + "layouts": { + "LAYOUT_default": { + "layout": [ + {"label":"Q", "x":0, "y":0}, + {"label":"W", "x":1, "y":0}, + {"label":"E", "x":2, "y":0}, + {"label":"R", "x":3, "y":0}, + {"label":"T", "x":4, "y":0}, + {"label":"Delete", "x":5, "y":0, "w":1.5}, + {"label":"Y", "x":6.5, "y":0}, + {"label":"U", "x":7.5, "y":0}, + {"label":"I", "x":8.5, "y":0}, + {"label":"O", "x":9.5, "y":0}, + {"label":"P", "x":10.5, "y":0}, + {"label":"A", "x":0, "y":1}, + {"label":"S", "x":1, "y":1}, + {"label":"D", "x":2, "y":1}, + {"label":"F", "x":3, "y":1}, + {"label":"G", "x":4, "y":1}, + {"label":"Tab", "x":5, "y":1, "w":1.5}, + {"label":"H", "x":6.5, "y":1}, + {"label":"J", "x":7.5, "y":1}, + {"label":"K", "x":8.5, "y":1}, + {"label":"L", "x":9.5, "y":1}, + {"label":"\"", "x":10.5, "y":1}, + {"label":"Z", "x":0, "y":2}, + {"label":"X", "x":1, "y":2}, + {"label":"C", "x":2, "y":2}, + {"label":"V", "x":3, "y":2}, + {"label":"B", "x":4, "y":2}, + {"label":"Shift", "x":5, "y":2, "w":1.5}, + {"label":"N", "x":6.5, "y":2}, + {"label":"M", "x":7.5, "y":2}, + {"label":"<", "x":8.5, "y":2}, + {"label":">", "x":9.5, "y":2}, + {"label":"?", "x":10.5, "y":2}, + {"label":"Ctrl", "x":1.25, "y":3.35, "w":1.25}, + {"label":"Fn", "x":2.5, "y":3.35}, + {"label":"Backspace", "x":3.5, "y":3.35, "w":2}, + {"label":"Space", "x":5.5, "y":3.35, "w":2.25}, + {"label":"Gui", "x":7.75, "y":3.35}, + {"label":"Alt", "x":8.75, "y":3.35, "w":1.25} + ] + }, + "LAYOUT_big_space": { + "layout": [ + {"label":"Q", "x":0, "y":0}, + {"label":"W", "x":1, "y":0}, + {"label":"E", "x":2, "y":0}, + {"label":"R", "x":3, "y":0}, + {"label":"T", "x":4, "y":0}, + {"label":"Delete", "x":5, "y":0, "w":1.5}, + {"label":"Y", "x":6.5, "y":0}, + {"label":"U", "x":7.5, "y":0}, + {"label":"I", "x":8.5, "y":0}, + {"label":"O", "x":9.5, "y":0}, + {"label":"P", "x":10.5, "y":0}, + {"label":"A", "x":0, "y":1}, + {"label":"S", "x":1, "y":1}, + {"label":"D", "x":2, "y":1}, + {"label":"F", "x":3, "y":1}, + {"label":"G", "x":4, "y":1}, + {"label":"Tab", "x":5, "y":1, "w":1.5}, + {"label":"H", "x":6.5, "y":1}, + {"label":"J", "x":7.5, "y":1}, + {"label":"K", "x":8.5, "y":1}, + {"label":"L", "x":9.5, "y":1}, + {"label":"\"", "x":10.5, "y":1}, + {"label":"Z", "x":0, "y":2}, + {"label":"X", "x":1, "y":2}, + {"label":"C", "x":2, "y":2}, + {"label":"V", "x":3, "y":2}, + {"label":"B", "x":4, "y":2}, + {"label":"Shift", "x":5, "y":2, "w":1.5}, + {"label":"N", "x":6.5, "y":2}, + {"label":"M", "x":7.5, "y":2}, + {"label":"<", "x":8.5, "y":2}, + {"label":">", "x":9.5, "y":2}, + {"label":"?", "x":10.5, "y":2}, + {"label":"Ctrl", "x":1.25, "y":3.35, "w":1.25}, + {"label":"Space", "x":2.5, "y":3.35, "w":6.25}, + {"label":"Alt", "x":8.75, "y":3.35, "w":1.25} + ] + } + } +} diff --git a/keyboards/space_space/rev2/keymaps/big_space/config.h b/keyboards/space_space/rev2/keymaps/big_space/config.h new file mode 100644 index 0000000000..ffc2124e1b --- /dev/null +++ b/keyboards/space_space/rev2/keymaps/big_space/config.h @@ -0,0 +1,27 @@ +/* Copyright 2021 qpockets + * + * 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 + +/*Modtaps*/ +#define TAPPING_TERM 175 +#define IGNORE_MOD_TAP_INTERRUPT + +/*Combos*/ +#ifdef COMBO_ENABLE +# define COMBO_COUNT 5 +# define COMBO_TERM 50 +#endif \ No newline at end of file diff --git a/keyboards/space_space/rev2/keymaps/big_space/keymap.c b/keyboards/space_space/rev2/keymaps/big_space/keymap.c new file mode 100644 index 0000000000..a272c001b4 --- /dev/null +++ b/keyboards/space_space/rev2/keymaps/big_space/keymap.c @@ -0,0 +1,81 @@ +/* Copyright 2020 qpockets + * + * 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 layers{ + _BASE, + _SYM, + _NUM, + _NAV +}; + +enum combo_events { + COMBO_BSPC, + COMBO_ENT, + COMBO_TAB, + COMBO_ESC, + COMBO_DEL +}; +#define KC_UP_SPC LT(_SYM, KC_SPC) +#define KC_GZ LGUI_T(KC_Z) +#define KC_AA LALT_T(KC_A) +#define KC_CC LCTL_T(KC_C) +#define KC_SF LSFT_T(KC_F) +#define KC_SJ RSFT_T(KC_J) +#define KC_CCOMM RCTL_T(KC_COMM) +#define KC_AQUOT RALT_T(KC_QUOT) +#define KC_GSLSH RGUI_T(KC_SLSH) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_big_space( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_DEL, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_AA, KC_S, KC_D, KC_SF, KC_G, KC_BSPC, KC_H, KC_SJ, KC_K, KC_L, KC_AQUOT, + KC_GZ, KC_X, KC_CC, KC_V, KC_B, KC_LSFT, KC_N, KC_M, KC_CCOMM, KC_DOT, KC_GSLSH, + MO(_NAV), KC_UP_SPC, KC_RALT + ), + + [_SYM] = LAYOUT_big_space( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_TRNS, KC_CIRC, KC_AMPR, KC_ASTR, KC_EQUAL, KC_MINS, + KC_PIPE, KC_BSLS, KC_LPRN, KC_LBRC, KC_SCLN, KC_TRNS, KC_COLN, KC_RBRC, KC_RPRN, KC_PLUS, KC_UNDS, + KC_TRNS, KC_TRNS, KC_TRNS + ), + + [_NAV] = LAYOUT_big_space( + KC_HOME, KC_UP, KC_END, KC_PGUP, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSPC, + KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TAB, + KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_ENT, + KC_TRNS, KC_TRNS, KC_TRNS + ), +}; + + +#ifdef COMBO_ENABLE +const uint16_t PROGMEM combo_bspc[] = {KC_O, KC_P, COMBO_END}; +const uint16_t PROGMEM combo_ent[] = {KC_K, KC_L, COMBO_END}; +const uint16_t PROGMEM combo_tab[] = {KC_S, KC_D, COMBO_END}; +const uint16_t PROGMEM combo_esc[] = {KC_T, KC_Y, COMBO_END}; +const uint16_t PROGMEM combo_del[] = {KC_Q, KC_W, COMBO_END}; + +combo_t key_combos[COMBO_COUNT] = { + [COMBO_BSPC] = COMBO(combo_bspc,KC_BSPC), + [COMBO_ENT] = COMBO(combo_ent,KC_ENT), + [COMBO_TAB] = COMBO(combo_tab,KC_TAB), + [COMBO_ESC] = COMBO(combo_esc,KC_ESC), + [COMBO_DEL] = COMBO(combo_del,KC_DEL) +}; +#endif diff --git a/keyboards/space_space/rev2/keymaps/big_space/rules.mk b/keyboards/space_space/rev2/keymaps/big_space/rules.mk new file mode 100644 index 0000000000..ff681299e4 --- /dev/null +++ b/keyboards/space_space/rev2/keymaps/big_space/rules.mk @@ -0,0 +1 @@ +COMBO_ENABLE = yes \ No newline at end of file diff --git a/keyboards/space_space/rev2/keymaps/default/config.h b/keyboards/space_space/rev2/keymaps/default/config.h new file mode 100644 index 0000000000..0b0e89fa1f --- /dev/null +++ b/keyboards/space_space/rev2/keymaps/default/config.h @@ -0,0 +1,27 @@ +/* Copyright 2021 qpockets + * + * 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 + +/*Modtaps*/ +#define TAPPING_TERM 165 +#define IGNORE_MOD_TAP_INTERRUPT + +/*Combos*/ +#ifdef COMBO_ENABLE +# define COMBO_COUNT 5 +# define COMBO_TERM 50 +#endif \ No newline at end of file diff --git a/keyboards/space_space/rev2/keymaps/default/keymap.c b/keyboards/space_space/rev2/keymaps/default/keymap.c new file mode 100644 index 0000000000..64f34c8291 --- /dev/null +++ b/keyboards/space_space/rev2/keymaps/default/keymap.c @@ -0,0 +1,77 @@ +/* Copyright 2021 qpockets + * + * 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 layers{ + _BASE, + _SYM, + _NAV +}; + +enum combo_events { + COMBO_BSPC, + COMBO_ENT, + COMBO_TAB, + COMBO_ESC, + COMBO_DEL +}; +#define KC_DN_BSPC LT(_NAV, KC_BSPC) +#define KC_UP_SPC LT(_SYM, KC_SPC) +#define KC_SF LSFT_T(KC_F) +#define KC_SJ RSFT_T(KC_J) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_default( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_DEL, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_SF, KC_G, KC_TAB, KC_H, KC_SJ, KC_K, KC_L, KC_QUOT, + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LSFT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, + KC_LGUI, KC_LCTL, KC_DN_BSPC, KC_UP_SPC, KC_RALT, KC_MPLY + ), + + [_SYM] = LAYOUT_default( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_TRNS, KC_CIRC, KC_AMPR, KC_ASTR, KC_EQUAL, KC_MINS, + KC_PIPE, KC_BSLS, KC_LPRN, KC_LBRC, KC_SCLN, KC_TRNS, KC_COLN, KC_RBRC, KC_RPRN, KC_PLUS, KC_UNDS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + [_NAV] = LAYOUT_default( + KC_TRNS, KC_HOME, KC_UP, KC_END, KC_PGUP, RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_BSPC, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGDN, KC_TRNS, KC_F4, KC_F5, KC_F6, KC_F7, KC_TAB, + KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_LCAP, KC_F9, KC_F10, KC_F11, KC_F12, KC_ENT, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), +}; + + + + +#ifdef COMBO_ENABLE +const uint16_t PROGMEM combo_bspc[] = {KC_O, KC_P, COMBO_END}; +const uint16_t PROGMEM combo_ent[] = {KC_K, KC_L, COMBO_END}; +const uint16_t PROGMEM combo_tab[] = {KC_S, KC_D, COMBO_END}; +const uint16_t PROGMEM combo_esc[] = {KC_T, KC_Y, COMBO_END}; +const uint16_t PROGMEM combo_del[] = {KC_Q, KC_W, COMBO_END}; + +combo_t key_combos[COMBO_COUNT] = { + [COMBO_BSPC] = COMBO(combo_bspc,KC_BSPC), + [COMBO_ENT] = COMBO(combo_ent,KC_ENT), + [COMBO_TAB] = COMBO(combo_tab,KC_TAB), + [COMBO_ESC] = COMBO(combo_esc,KC_ESC), + [COMBO_DEL] = COMBO(combo_del,KC_DEL) +}; +#endif diff --git a/keyboards/space_space/rev2/keymaps/default/rules.mk b/keyboards/space_space/rev2/keymaps/default/rules.mk new file mode 100644 index 0000000000..ab1e438182 --- /dev/null +++ b/keyboards/space_space/rev2/keymaps/default/rules.mk @@ -0,0 +1 @@ +COMBO_ENABLE = yes diff --git a/keyboards/space_space/rev2/keymaps/qpockets/config.h b/keyboards/space_space/rev2/keymaps/qpockets/config.h new file mode 100644 index 0000000000..bf8c47eb3e --- /dev/null +++ b/keyboards/space_space/rev2/keymaps/qpockets/config.h @@ -0,0 +1,27 @@ +/* Copyright 2021 qpockets + * + * 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 + +/*Modtaps*/ +#define TAPPING_TERM 145 +#define IGNORE_MOD_TAP_INTERRUPT + +/*Combos*/ +#ifdef COMBO_ENABLE +# define COMBO_COUNT 5 +# define COMBO_TERM 25 +#endif diff --git a/keyboards/space_space/rev2/keymaps/qpockets/keymap.c b/keyboards/space_space/rev2/keymaps/qpockets/keymap.c new file mode 100644 index 0000000000..986e435957 --- /dev/null +++ b/keyboards/space_space/rev2/keymaps/qpockets/keymap.c @@ -0,0 +1,75 @@ +/* Copyright 2021 qpockets + * + * 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 layers{ + _BASE, + _SYM, + _NAV +}; + +enum combo_events { + COMBO_BSPC, + COMBO_ENT, + COMBO_TAB, + COMBO_ESC, + COMBO_DEL +}; +#define KC_DN_BSPC LT(_NAV, KC_BSPC) +#define KC_UP_SPC LT(_SYM, KC_SPC) +#define KC_SF LSFT_T(KC_F) +#define KC_SJ RSFT_T(KC_J) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_default( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_DEL, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_SF, KC_G, KC_LGUI, KC_H, KC_SJ, KC_K, KC_L, KC_QUOT, + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ENT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, + KC_PSCR, KC_LCTL, KC_DN_BSPC, KC_UP_SPC, KC_RALT, KC_MPLY + ), + + [_SYM] = LAYOUT_default( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_TRNS, KC_CIRC, KC_AMPR, KC_ASTR, KC_EQUAL, KC_MINS, + KC_PIPE, KC_BSLS, KC_LPRN, KC_LBRC, KC_SCLN, KC_TRNS, KC_COLN, KC_RBRC, KC_RPRN, KC_PLUS, KC_UNDS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + [_NAV] = LAYOUT_default( + KC_TRNS, KC_HOME, KC_UP, KC_END, KC_PGUP, RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_BSPC, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGDN, KC_TRNS, KC_F5, KC_F6, KC_F7, KC_F8, KC_TAB, + KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_CAPS, KC_F9, KC_F10, KC_F11, KC_F12, KC_ENT, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), +}; + + +#ifdef COMBO_ENABLE +const uint16_t PROGMEM combo_bspc[] = {KC_O, KC_P, COMBO_END}; +const uint16_t PROGMEM combo_ent[] = {KC_K, KC_L, COMBO_END}; +const uint16_t PROGMEM combo_tab[] = {KC_S, KC_D, COMBO_END}; +const uint16_t PROGMEM combo_esc[] = {KC_T, KC_Y, COMBO_END}; +const uint16_t PROGMEM combo_del[] = {KC_Q, KC_W, COMBO_END}; + +combo_t key_combos[COMBO_COUNT] = { + [COMBO_BSPC] = COMBO(combo_bspc,KC_BSPC), + [COMBO_ENT] = COMBO(combo_ent,KC_ENT), + [COMBO_TAB] = COMBO(combo_tab,KC_TAB), + [COMBO_ESC] = COMBO(combo_esc,KC_ESC), + [COMBO_DEL] = COMBO(combo_del,KC_DEL) +}; +#endif diff --git a/keyboards/space_space/rev2/keymaps/qpockets/rules.mk b/keyboards/space_space/rev2/keymaps/qpockets/rules.mk new file mode 100644 index 0000000000..ff681299e4 --- /dev/null +++ b/keyboards/space_space/rev2/keymaps/qpockets/rules.mk @@ -0,0 +1 @@ +COMBO_ENABLE = yes \ No newline at end of file diff --git a/keyboards/space_space/rev2/readme.md b/keyboards/space_space/rev2/readme.md new file mode 100644 index 0000000000..d8391a21a6 --- /dev/null +++ b/keyboards/space_space/rev2/readme.md @@ -0,0 +1,18 @@ +# space_space + +![space_space](https://i.imgur.com/SxjhzIMh.jpg) + +Give your space some space + +* Keyboard Maintainer: https://github.com/qpockets +* Hardware Availability: https://p3dstore.com/products/space-space-acrylic-case?_pos=21&_sid=c75de6a78&_ss=r&variant=39907740844216 + +Make example for this keyboard (after setting up your build environment): + + make space_space/rev2:default + +Flashing example for this keyboard: + + make space_space/rev2: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). diff --git a/keyboards/space_space/rev2/rev2.c b/keyboards/space_space/rev2/rev2.c new file mode 100644 index 0000000000..07b93b36aa --- /dev/null +++ b/keyboards/space_space/rev2/rev2.c @@ -0,0 +1,35 @@ + +/* Copyright 2021 qpockets + * + * 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 "rev2.h" + +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 1) { /* left encoder*/ + if (clockwise){ + tap_code(KC_WH_U); + } else { + tap_code(KC_WH_D); + } + } else if (index == 0) { /* right encoder */ + if (clockwise){ + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + return true; +} diff --git a/keyboards/space_space/rev2/rev2.h b/keyboards/space_space/rev2/rev2.h new file mode 100644 index 0000000000..99362b900f --- /dev/null +++ b/keyboards/space_space/rev2/rev2.h @@ -0,0 +1,49 @@ +/* Copyright 2021 qpockets + * + * 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 "quantum.h" + +#define XXX KC_NO + +#define LAYOUT_default( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K50, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K51, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K52, \ + K32, K33, K34, K36, K37, K38 \ +) \ +{ \ + {K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K50}, \ + {K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K51}, \ + {K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K52}, \ + {XXX, XXX, K32, K33, K34, XXX, K36, K37, K38, XXX, XXX} \ +} \ + +#define LAYOUT_big_space( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K50, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K51, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K52, \ + K32, K35, K38 \ +) \ +{ \ + {K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K50}, \ + {K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K51}, \ + {K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K52}, \ + {XXX, XXX, K32, XXX, XXX, K35, XXX, XXX, K38, XXX, XXX} \ +} + + diff --git a/keyboards/space_space/rev2/rules.mk b/keyboards/space_space/rev2/rules.mk new file mode 100644 index 0000000000..72a5deaf19 --- /dev/null +++ b/keyboards/space_space/rev2/rules.mk @@ -0,0 +1,23 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +BLUETOOTH_ENABLE = no # Enable Bluetooth +AUDIO_ENABLE = no # Audio output +ENCODER_ENABLE = yes diff --git a/keyboards/space_space/rules.mk b/keyboards/space_space/rules.mk index 831de6dc5c..2ca04be440 100644 --- a/keyboards/space_space/rules.mk +++ b/keyboards/space_space/rules.mk @@ -1,23 +1 @@ -# MCU name -MCU = atmega32u4 - -# Bootloader selection -BOOTLOADER = atmel-dfu - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow -BLUETOOTH_ENABLE = no # Enable Bluetooth -AUDIO_ENABLE = no # Audio output -ENCODER_ENABLE = yes +DEFAULT_FOLDER = space_space/rev2 diff --git a/keyboards/space_space/space_space.h b/keyboards/space_space/space_space.h deleted file mode 100644 index 25e9a083d1..0000000000 --- a/keyboards/space_space/space_space.h +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright 2020 qpockets - * - * 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 "quantum.h" - -#define XXX KC_NO - -#define LAYOUT_default( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K50, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K51, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K52, \ - K32, K33, K34, K36, K37, K38 \ -) \ -{ \ -{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K50 }, \ -{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K51 }, \ -{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K52 }, \ -{ XXX, XXX, K32, K33, K34, XXX, K36, K37, K38, XXX, XXX } \ -} - -#define LAYOUT_big_space( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K50, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K51, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K52, \ - K32, K35, K38 \ -) \ -{ \ -{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K50 }, \ -{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K51 }, \ -{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K52 }, \ -{ XXX, XXX, K32, XXX, XXX, K35, XXX, XXX, K38, XXX, XXX } \ -} - From 3b4c35da6b476c8777c3b492179d30260ffbf895 Mon Sep 17 00:00:00 2001 From: Alan Pocklington Date: Thu, 19 Aug 2021 18:36:20 +0100 Subject: [PATCH 02/10] [Keymap] Quark AJP10304 layout (#13290) --- .../acheron/shark/keymaps/ajp10304/readme.md | 2 +- .../atreus50/keymaps/ajp10304/config.h | 16 ++ .../atreus50/keymaps/ajp10304/keymap.c | 16 ++ .../atreus50/keymaps/ajp10304/readme.md | 2 +- keyboards/jj40/keymaps/ajp10304/readme.md | 2 +- keyboards/planck/keymaps/ajp10304/readme.md | 2 +- keyboards/quark/keymaps/ajp10304/keymap.c | 201 ++++++++++++++++++ keyboards/quark/keymaps/ajp10304/readme.md | 118 ++++++++++ keyboards/quark/keymaps/ajp10304/rules.mk | 1 + .../community/ortho_4x12/ajp10304/keymap.c | 16 ++ .../community/ortho_4x12/ajp10304/readme.md | 2 +- users/ajp10304/ajp10304.c | 16 ++ users/ajp10304/ajp10304.h | 16 ++ users/ajp10304/readme.md | 2 +- 14 files changed, 406 insertions(+), 6 deletions(-) create mode 100644 keyboards/quark/keymaps/ajp10304/keymap.c create mode 100644 keyboards/quark/keymaps/ajp10304/readme.md create mode 100644 keyboards/quark/keymaps/ajp10304/rules.mk diff --git a/keyboards/acheron/shark/keymaps/ajp10304/readme.md b/keyboards/acheron/shark/keymaps/ajp10304/readme.md index 73e5b831e0..c172321624 100644 --- a/keyboards/acheron/shark/keymaps/ajp10304/readme.md +++ b/keyboards/acheron/shark/keymaps/ajp10304/readme.md @@ -1,5 +1,5 @@ # AJP10304 Custom Shark Layout -# Also available for the Planck, JJ40 and Atreus50 +# Also available for the Planck, Quark, JJ40 and Atreus50 **Note:** In the tables below where there are two characters on a key, the second is the output when shift is applied. diff --git a/keyboards/handwired/atreus50/keymaps/ajp10304/config.h b/keyboards/handwired/atreus50/keymaps/ajp10304/config.h index f5e6bbabe6..4f15c56269 100644 --- a/keyboards/handwired/atreus50/keymaps/ajp10304/config.h +++ b/keyboards/handwired/atreus50/keymaps/ajp10304/config.h @@ -1,3 +1,19 @@ +/* Copyright 2021 Alan Pocklington + * + * 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 . + */ + #ifndef CONFIG_USER_H #define CONFIG_USER_H diff --git a/keyboards/handwired/atreus50/keymaps/ajp10304/keymap.c b/keyboards/handwired/atreus50/keymaps/ajp10304/keymap.c index 46a5995d0d..2b0616ad7e 100644 --- a/keyboards/handwired/atreus50/keymaps/ajp10304/keymap.c +++ b/keyboards/handwired/atreus50/keymaps/ajp10304/keymap.c @@ -1,3 +1,19 @@ +/* Copyright 2021 Alan Pocklington + * + * 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 "keymap_uk.h" #include "ajp10304.h" diff --git a/keyboards/handwired/atreus50/keymaps/ajp10304/readme.md b/keyboards/handwired/atreus50/keymaps/ajp10304/readme.md index 5c6a703a8e..4f1bac8da9 100644 --- a/keyboards/handwired/atreus50/keymaps/ajp10304/readme.md +++ b/keyboards/handwired/atreus50/keymaps/ajp10304/readme.md @@ -1,5 +1,5 @@ # AJP10304 Custom Atreus50 Layout -# Also available for the Planck, Shark and JJ40 +# Also available for the Planck, Shark, Quark and JJ40 **Note:** In the tables below where there are two characters on a key, the second is the output when shift is applied. diff --git a/keyboards/jj40/keymaps/ajp10304/readme.md b/keyboards/jj40/keymaps/ajp10304/readme.md index 345fbccf60..7336b1994b 100644 --- a/keyboards/jj40/keymaps/ajp10304/readme.md +++ b/keyboards/jj40/keymaps/ajp10304/readme.md @@ -1,5 +1,5 @@ # AJP10304 Custom JJ40 Layout -# Also available for the Planck, Shark and Atreus50 +# Also available for the Planck, Shark, Quark and Atreus50 **Note:** In the tables below where there are two characters on a key, the second is the output when shift is applied. diff --git a/keyboards/planck/keymaps/ajp10304/readme.md b/keyboards/planck/keymaps/ajp10304/readme.md index 6ea8f0061d..97f0a00931 100644 --- a/keyboards/planck/keymaps/ajp10304/readme.md +++ b/keyboards/planck/keymaps/ajp10304/readme.md @@ -1,5 +1,5 @@ # AJP10304 Custom Planck Layout -# Also available for the Shark, JJ40 and Atreus50 +# Also available for the Shark, Quark, JJ40 and Atreus50 **Note:** In the tables below where there are two characters on a key, the second is the output when shift is applied. diff --git a/keyboards/quark/keymaps/ajp10304/keymap.c b/keyboards/quark/keymaps/ajp10304/keymap.c new file mode 100644 index 0000000000..c55e99af79 --- /dev/null +++ b/keyboards/quark/keymaps/ajp10304/keymap.c @@ -0,0 +1,201 @@ +/* Copyright 2021 Alan Pocklington + * + * 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 "ajp10304.h" +#include "keymap_uk.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ;: | Enter| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shft | Z | X | C | V | B | N | M | ,< | .> | /? | Shft | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | Shift| MENU | Ctrl | Fn2 | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( + LT(_NUMPAD, KC_ESC), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC , + MT(MOD_LSFT, KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, MT(MOD_RSFT, KC_ENT) , + KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSHIFT , + MO(_FUNC), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_LSHIFT, KC_BTN2, KC_RCTL, MO(_FUNC2) +), + +/* Function + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | 1! | 2" | 3£ | 4$ | 5% | 6^ | 7& | 8* | 9( | 0) | ~ |INSERT| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| \| | `¬ | #~ | * | -_ | =+ | \| | [{ | ]} | '@ |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Mouse | MENU | Alt | Ctrl | Fn | + * `-----------------------------------------------------------------------------------' + */ +[_FUNC] = LAYOUT_ortho_4x12( + 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_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, UK_TILD, KC_INSERT , + KC_LSHIFT, KC_NONUS_BSLASH, KC_GRAVE, KC_NONUS_HASH, KC_PAST, KC_MINS, KC_EQL, KC_BSLASH, KC_LBRC, KC_RBRC, KC_QUOT, MT(MOD_RSFT, KC_ENT) , + _______, _______, _______, _______, _______, _______, _______, MO(_MOUSE), _______, _______, _______, _______ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | 1! | 2" | 3£ | 4$ | 5% | 6^ | 7& | 8* | 9( | 0) | DEL | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ! | " | £ | $ | % | ^ | & | * | ( | ) |WrdDel|WrdBks| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| \| | `¬ | #~ | '@ | -_ | =+ | #~ | [{ | ]} | '@ |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | |Lower | Del |Space | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, KC_BSPC , + LSFT(KC_1), LSFT(KC_2), LSFT(KC_3), LSFT(KC_4), LSFT(KC_5), LSFT(KC_6), LSFT(KC_7), LSFT(KC_8), LSFT(KC_9), LSFT(KC_0), LCTL(KC_DEL), LCTL(KC_BSPC) , + KC_LSPO, KC_NONUS_BSLASH, KC_GRAVE, KC_NONUS_HASH, KC_QUOT, KC_MINS, KC_EQL, KC_NONUS_HASH, KC_LBRC, KC_RBRC, KC_QUOT, MT(MOD_RSFT, KC_ENT) , + _______, _______, _______, _______, _______, KC_DEL, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | |WRDSEL| [ | ] | | | PGUP | HOME |PGDOWN| |PRNTSC| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ` | | | ( | ) | | | HOME | UP | END | |ZOOM +| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | { | } | | |< | LEFT | DOWN |RIGHT | >| |ZOOM -| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Mouse| | | | | Alt | Enter|Raise | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( + KC_GRV, XXXXXXX, M_WORD_SEL, KC_LBRC, KC_RBRC, XXXXXXX, XXXXXXX, KC_PGUP, KC_HOME, KC_PGDOWN, XXXXXXX, KC_PSCREEN , + KC_GRV, XXXXXXX, XXXXXXX, LSFT(KC_9), LSFT(KC_0), XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, XXXXXXX, LCTL(LSFT(KC_EQL)) , + _______, XXXXXXX, XXXXXXX, LSFT(KC_LBRC), LSFT(KC_RBRC), XXXXXXX, LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), LCTL(KC_MINS) , + MO(_MOUSE), _______, _______, _______, _______, KC_LALT, KC_ENT, _______, XXXXXXX, _______, _______, _______ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | ???? | Reset|Qwerty| | | REC1 | REC2 | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | CAPS | | | | | PLAY1| PLAY2| Mute | Vol+ | Play | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | PC/MC| | | | | STOP | STOP | Prev | Vol- | Next | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( + M_CUSTOM, RESET, QWERTY, BL_ON, BL_OFF, DYN_REC_START1, DYN_REC_START2, _______, _______, _______, _______, KC_DEL , + KC_CAPS, RGB_TOG, RGB_MOD, RGB_VAD, RGB_VAI, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, KC_AUDIO_MUTE, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, _______, _______ , + TG(_MAC), RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, DYN_REC_STOP, DYN_REC_STOP, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK, _______, _______ , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Mouse + * ,-----------------------------------------------------------------------------------. + * | ESC | | | | | | | | BTN3 | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ACC0 | ACC1 | ACC2 | | | | | BTN1 | UP | BTN2 | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | ACC0 | ACC1 | ACC2 | | | | | LEFT | DOWN |RIGHT | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_MOUSE] = LAYOUT_ortho_4x12( + KC_ESC , _______, _______, _______, _______, _______, _______, _______, KC_MS_BTN3, _______, _______, _______, + KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, _______, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, _______, _______, + KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, _______, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Num Pad + * ,-----------------------------------------------------------------------------------. + * | ESC | | | | | |NMLOCK| 7 | 8 | 9 | / | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | 4 | 5 | 6 | * | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | 1 | 2 | 3 | + | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | 0 | . | , | - | | + * `-----------------------------------------------------------------------------------' + */ +[_NUMPAD] = LAYOUT_ortho_4x12( + _______, _______, _______, _______, _______, _______, KC_NLCK, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_SLASH, _______, + _______, _______, _______, _______, _______, _______, _______, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_ASTERISK, _______, + _______, _______, _______, _______, _______, _______, _______, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_PLUS, _______, + _______, _______, _______, _______, _______, _______, _______, KC_KP_0, KC_KP_DOT, KC_COMM, KC_KP_MINUS, _______ +), + +/* Function 2 (Right hand side) + * ,-----------------------------------------------------------------------------------. + * | | |WRDSEL| | | | LNDEL| | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | LNSEL| DUP | | | | |LNJOIN| | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | UNDO | CUT | COPY | PASTE| | | | | | | MODE | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_FUNC2] = LAYOUT_ortho_4x12( + _______, _______, M_WORD_SEL, _______, _______, _______, M_LINE_DEL, _______, _______, _______, _______, _______, + _______, _______, M_LINE_SEL, M_DUP, _______, _______, _______, M_JOIN, _______, _______, _______, _______, + _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), _______, _______, _______, _______, _______, _______, M_MODE, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MAC]= LAYOUT_ortho_4x12( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + MFNC, _______, _______, _______, MLWR, _______, _______, MRSE, _______, _______, _______, MFNC2 +), + +[_MLWR] = LAYOUT_ortho_4x12( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MRSE] = LAYOUT_ortho_4x12( + _______, _______, M_WORD_SEL_MAC, _______, _______, _______, _______, _______, _______, _______, _______, _______ , + _______, _______, _______, _______, _______, _______, _______, LCTL(KC_A), _______, LCTL(KC_E), _______, LGUI(KC_EQL) , + _______, _______, _______, _______, _______, _______, LALT(KC_LEFT), _______, _______, _______, LALT(KC_RIGHT), LGUI(KC_MINS) , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MFNC]= LAYOUT_ortho_4x12( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGUI(KC_PENT) , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MFNC2] = LAYOUT_ortho_4x12( + _______, _______, M_WORD_SEL_MAC, _______, _______, _______, M_LINE_DEL_MAC, _______, _______, _______, _______, _______, + _______, _______, M_LINE_SEL_MAC, M_DUP_MAC, _______, _______, _______, M_JOIN_MAC, _______, _______, _______, _______, + _______, LGUI(KC_Z), LGUI(KC_X), LGUI(KC_C), LGUI(KC_V), _______, _______, _______, _______, _______, _______, M_MODE_MAC, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; diff --git a/keyboards/quark/keymaps/ajp10304/readme.md b/keyboards/quark/keymaps/ajp10304/readme.md new file mode 100644 index 0000000000..12090ccd44 --- /dev/null +++ b/keyboards/quark/keymaps/ajp10304/readme.md @@ -0,0 +1,118 @@ +# AJP10304 Custom Quark Layout +# Also available for the Planck, JJ40 and Atreus50 + +**Note:** In the tables below where there are two characters on a key, +the second is the output when shift is applied. + +**Note:** The below tables assume a UK layout. + +#### Flashing + +`make quark:ajp10304:flash` + +##### Main Qwerty Layer + +* Tab: when held, operates as shift. +* Enter: when held, operates as shift. +* MENU: perform right-click + +| | | | | | | | | | | | | +| ---- |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| ----:| +| Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | +| Tab | A | S | D | F | G | H | J | K | L | ;: | Enter| +| Shft | Z | X | C | V | B | N | M | ,< | .> | /? | Shft | +| Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | Shift| MENU | Ctrl | Fn2 | + +##### Function Layer +Activated when `fn` held in the above `qwerty` layer. + +| | | | | | | | | | | | | +| :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| +| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | +| 1! | 2" | 3£ | 4$ | 5% | 6^ | 7& | 8* | 9( | 0) | ~ |INSERT| +| Shift | \| | `¬ | #~ | * | -_ | =+ | \| | [{ | ]} | '@ |Shift | +| Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Mouse | MENU | Alt | Ctrl | Fn2 | + +##### Lower Layer +Activated when `Lower` is held in the above `qwerty` layer. + +* Numbers are along the top row, their shifted counterparts are on row 2. +* WrdBks: `backspace` with `ctrl` applied. I.e. delete a word. +* WrdDel: `delete` with `ctrl` applied. I.e. forward delete a word. + +| | | | | | | | | | | | | +| :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| +| 1! | 2" | 3£ | 4$ | 5% | 6^ | 7& | 8* | 9( | 0) | DEL | Bksp | +| ! | " | £ | $ | % | ^ | & | * | ( | ) |WrdDel|WrdBks| +| Shift | \| | `¬ | #~ | '@ | -_ | =+ | #~ | [{ | ]} | '@ |Shift | +| | | | |Lower | Del |Space | | Next | Vol- | Vol+ | Play | + +##### Raise Layer +Activated when `Raise` is held in the above `qwerty` layer. + +* Preferred layer for typing brackets. +* Allows for cursor navigation to be used solely with the right hand. +* WRDSEL: Select the word where the cursor is. +* |< and >|: Apply `ctrl` to `left` and `right` respectively for word jumping. + +| | | | | | | | | | | | | +| :---: |:----:| :---:| :---:| :---:| :---:| :---: | :---:| :---:| :---:| :---: | :---:| +| ` | |WRDSEL| [ | ] | | | PGUP | HOME |PGDOWN| |PRNTSC| +| ` | | | ( | ) | | | HOME | UP | END | |ZOOM +| +| | | | { | } | ||<| LEFT | DOWN |RIGHT |>||ZOOM -| +| Mouse | | | | | Alt | Enter |Raise | | | | | + +##### Lower + Raise +Activated when `Lower` and `Raise` are held together in the above `qwerty` layer. + +* Audio controls in the same position as cursor keys from the `Raise` layer. +* ????: Runs a macro for outputting a text string. Do not use this store passwords. +* Reset: Enter bootloader for flashing firmware to the keyboard. +* CAPS: Toggle caps lock. +* Macro functions: Allows recording of macros. To start recording the macro, press either REC1 or REC2. +To finish the recording, press STOP. To replay the macro, press either PLAY1 or PLAY2. +* MAC: Toggle MAC OS extensions to layers. This allows MLWR to be enabled with LOWER, +MRSE with RAISE, MFNC with FUNC and MFNC2 with FUNC2 respectively. + +| | | | | | | | | | | | | +| :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| +| ???? | Reset|Qwerty| | | REC1 | REC2 | | | | | Del | +| CAPS | | | | | PLAY1|PLAY2 | Mute | Vol+ | Play | | | +| MAC | | | | | STOP1|STOP2 | Prev | Vol- | Next | | | +| | | | | | | | | DYN | | | | + +##### Function 2 Layer +Activated when `fn` held in the above `qwerty` layer. +* WRDSEL: Select the word where the cursor is. +* LNDEL: Delete the line where the cursor is. +* LNSEL: Select the line where the cursor is. +* DUP: Duplicate the selected text. +* LNJOIN: Join the line where the cursor is with the following line. +* MODE: Print either `PC` or `OSX` depending on what layer mode is active. + +| | | | | | | | | | | | | +| :---: | :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| +| | |WRDSEL| | | | LNDEL| | | | | | +| | | LNSEL| DUP | | | | |LNJOIN| | | | +| | UNDO | CUT | COPY | PASTE| | | | | | | MODE | +| | | | | | | | | | | | | + +##### Mouse Layer +Activated when `fn` and `raise` held together. + +| | | | | | | | | | | | | +| :---: | :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| +| ESC | | | | | | | | BTN3 | | | | +| ACC0 | ACC1 | ACC2 | | | | | BTN1 | UP | BTN2 | | | +| ACC0 | ACC1 | ACC2 | | | | | LEFT | DOWN | RIGHT| | | +| | | | | | | | | | | | | + +##### Number Pad Layout +Activated when holding `Esc` key. + +| | | | | | | | | | | | | +| :---: | :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| +| | | | | | |NMLOCK| 7 | 8 | 9 | / | | +| | | | | | | | 4 | 5 | 6 | * | | +| | | | | | | | 1 | 2 | 3 | + | | +| | | | | | | | 0 | . | , | - | | diff --git a/keyboards/quark/keymaps/ajp10304/rules.mk b/keyboards/quark/keymaps/ajp10304/rules.mk new file mode 100644 index 0000000000..6c605daecf --- /dev/null +++ b/keyboards/quark/keymaps/ajp10304/rules.mk @@ -0,0 +1 @@ +MOUSEKEY_ENABLE = yes diff --git a/layouts/community/ortho_4x12/ajp10304/keymap.c b/layouts/community/ortho_4x12/ajp10304/keymap.c index 3badce2eaf..c55e99af79 100644 --- a/layouts/community/ortho_4x12/ajp10304/keymap.c +++ b/layouts/community/ortho_4x12/ajp10304/keymap.c @@ -1,3 +1,19 @@ +/* Copyright 2021 Alan Pocklington + * + * 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 "ajp10304.h" #include "keymap_uk.h" diff --git a/layouts/community/ortho_4x12/ajp10304/readme.md b/layouts/community/ortho_4x12/ajp10304/readme.md index 6f2330f943..be6afa6fe4 100644 --- a/layouts/community/ortho_4x12/ajp10304/readme.md +++ b/layouts/community/ortho_4x12/ajp10304/readme.md @@ -1,5 +1,5 @@ # AJP10304 Ortho 4x12 Layout -# For Planck, Shark, JJ40 and Atreus50 +# For Planck, Shark, Quark, JJ40 and Atreus50 **Note:** In the tables below where there are two characters on a key, the second is the output when shift is applied. diff --git a/users/ajp10304/ajp10304.c b/users/ajp10304/ajp10304.c index 9cae65d5cf..dd13787d63 100644 --- a/users/ajp10304/ajp10304.c +++ b/users/ajp10304/ajp10304.c @@ -1,3 +1,19 @@ +/* Copyright 2021 Alan Pocklington + * + * 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 "ajp10304.h" bool process_record_user(uint16_t keycode, keyrecord_t *record) { diff --git a/users/ajp10304/ajp10304.h b/users/ajp10304/ajp10304.h index b96e00fc4e..ec1ed11c04 100644 --- a/users/ajp10304/ajp10304.h +++ b/users/ajp10304/ajp10304.h @@ -1,3 +1,19 @@ +/* Copyright 2021 Alan Pocklington + * + * 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 ajp10304_layers { diff --git a/users/ajp10304/readme.md b/users/ajp10304/readme.md index 8e1a438aa8..2ac0a69964 100644 --- a/users/ajp10304/readme.md +++ b/users/ajp10304/readme.md @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . # AJP10304 Custom 40% Layout -# For the Planck, Shark, JJ40 and Atreus50 +# For the Planck, Shark, Quark, JJ40 and Atreus50 **Note:** In the tables below where there are two characters on a key, the second is the output when shift is applied. From 425e1e665dc3c114fc42878f2b6a9d3225e5e6b5 Mon Sep 17 00:00:00 2001 From: jfescobar18 <81986725+jfescobar18@users.noreply.github.com> Date: Thu, 19 Aug 2021 12:39:30 -0500 Subject: [PATCH 03/10] [Keyboard] Dumbpad VIA support added (#13512) Co-authored-by: Ryan --- keyboards/dumbpad/config.h | 23 ++- keyboards/dumbpad/dumbpad.c | 59 +++++++ keyboards/dumbpad/dumbpad.h | 39 +++++ keyboards/dumbpad/info.json | 18 +++ keyboards/dumbpad/keymaps/default/keymap.c | 89 +++++++++++ keyboards/dumbpad/keymaps/via/keymap.c | 175 +++++++++++++++++++++ keyboards/dumbpad/keymaps/via/rules.mk | 3 + keyboards/dumbpad/rules.mk | 26 ++- 8 files changed, 427 insertions(+), 5 deletions(-) create mode 100644 keyboards/dumbpad/dumbpad.c create mode 100644 keyboards/dumbpad/dumbpad.h create mode 100644 keyboards/dumbpad/info.json create mode 100644 keyboards/dumbpad/keymaps/default/keymap.c create mode 100644 keyboards/dumbpad/keymaps/via/keymap.c create mode 100644 keyboards/dumbpad/keymaps/via/rules.mk diff --git a/keyboards/dumbpad/config.h b/keyboards/dumbpad/config.h index 5a1a1c92b8..7322d1bbb5 100644 --- a/keyboards/dumbpad/config.h +++ b/keyboards/dumbpad/config.h @@ -21,14 +21,29 @@ along with this program. If not, see . /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x0913 +#define DEVICE_VER 0x0007 #define MANUFACTURER imchipwood #define PRODUCT dumbpad /* Column/Row IO definitions */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 5 +#define MATRIX_ROW_PINS { F4, F5, F6, F7 } +#define MATRIX_COL_PINS { C6, D7, E6, B4, B5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 5 +/* Single rotary encoder */ +#define ENCODERS_PAD_A { B2, D0 } +#define ENCODERS_PAD_B { D4, D1 } +#define ENCODER_RESOLUTIONS { 4, 4 } -/* Reduce tapdance required taps from 5 to 2 */ -#define TAPPING_TOGGLE 2 +/* Onboard LEDs */ +#define LED_00 B3 +#define LED_01 B1 + +/* Bootmagic - hold down rotary encoder pushbutton while plugging in to enter bootloader */ +#define BOOTMAGIC_LITE_ROW 3 +#define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/dumbpad/dumbpad.c b/keyboards/dumbpad/dumbpad.c new file mode 100644 index 0000000000..b575662a87 --- /dev/null +++ b/keyboards/dumbpad/dumbpad.c @@ -0,0 +1,59 @@ +/* Copyright 2019 Chip + * + * 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 "dumbpad.h" + +void keyboard_pre_init_kb(void) { + // Set LED IO as outputs + setPinOutput(LED_00); + setPinOutput(LED_01); + keyboard_pre_init_user(); +} + +void shutdown_user() { + // Shutdown LEDs + writePinLow(LED_00); + writePinLow(LED_01); +} + +layer_state_t layer_state_set_kb(layer_state_t state) { + // Layer LEDs act as binary indication of current layer + uint8_t layer = get_highest_layer(state); + writePin(LED_00, layer & 0b1); + writePin(LED_01, (layer >> 1) & 0b1); + return layer_state_set_user(state); +} + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + uint8_t led_delay_ms = 80; + for (int i = 0; i < 2; i++) { + writePinHigh(LED_00); + writePinHigh(LED_01); + wait_ms(led_delay_ms); + writePinLow(LED_00); + writePinLow(LED_01); + if (i < 1) { + wait_ms(led_delay_ms); + } + } + + matrix_init_user(); +} diff --git a/keyboards/dumbpad/dumbpad.h b/keyboards/dumbpad/dumbpad.h new file mode 100644 index 0000000000..b7c7694e30 --- /dev/null +++ b/keyboards/dumbpad/dumbpad.h @@ -0,0 +1,39 @@ +/* Copyright 2019 Chip + * + * 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 "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k01, k02, k03, k04, \ + k11, k12, k13, k14, \ + k21, k22, k23, k24, \ + k30, k31, k32, k33, k34 \ +) \ +{ \ + { KC_NO, k01, k02, k03, k04 }, \ + { KC_NO, k11, k12, k13, k14 }, \ + { KC_NO, k21, k22, k23, k24 }, \ + { k30, k31, k32, k33, k34 }, \ +} diff --git a/keyboards/dumbpad/info.json b/keyboards/dumbpad/info.json new file mode 100644 index 0000000000..82a53d852b --- /dev/null +++ b/keyboards/dumbpad/info.json @@ -0,0 +1,18 @@ +{ + "keyboard_name": "dumbpad", + "keyboard_folder": "dumbpad", + "url": "https://www.github.com/imchipwood/dumbpad", + "maintainer": "imchipwood", + "width": 5, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, + {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, + {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, + {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3} + ] + } + } +} diff --git a/keyboards/dumbpad/keymaps/default/keymap.c b/keyboards/dumbpad/keymaps/default/keymap.c new file mode 100644 index 0000000000..9263af428d --- /dev/null +++ b/keyboards/dumbpad/keymaps/default/keymap.c @@ -0,0 +1,89 @@ +/* Copyright 2020 imchipwood + * + * 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] = { + /* + BASE LAYER + /-----------------------------------------------------` + | | 7 | 8 | 9 | Bkspc | + | |---------|---------|---------|---------| + | | 4 | 5 | 6 | Esc | + | |---------|---------|---------|---------| + | | 1 | 2 | 3 | Tab | + |-------------|---------|---------|---------|---------| + | Left mouse | TT(1) | 0 | . | Enter | + \-----------------------------------------------------' + */ + [0] = LAYOUT( + KC_7, KC_8, KC_9, KC_BSPC, + KC_4, KC_5, KC_6, KC_ESC, + KC_1, KC_2, KC_3, KC_TAB, + KC_BTN1, TT(1), KC_0, LSFT_T(KC_DOT), KC_ENTER + ), + /* + SUB LAYER + /-----------------------------------------------------` + | | | | | Reset | + | |---------|---------|---------|---------| + | | | | | + | + | |---------|---------|---------|---------| + | | | | | - | + |-------------|---------|---------|---------|---------| + | LOCK | | | | = | + \-----------------------------------------------------' + */ + [1] = LAYOUT( + _______, _______, _______, RESET, + _______, _______, _______, KC_KP_PLUS, + _______, _______, _______, KC_KP_MINUS, + KC_LOCK, _______, _______, _______, KC_EQL + ), +}; + +bool encoder_update_user(uint8_t index, bool clockwise) { + /* Custom encoder control - handles CW/CCW turning of encoder + * Default behavior: + * main layer: + * CW: move mouse right + * CCW: move mouse left + * other layers: + * CW: = (equals/plus - increase slider in Adobe products) + * CCW: - (minus/underscore - decrease slider in adobe products) + */ + if (index == 0) { + switch (get_highest_layer(layer_state)) { + case 0: + // main layer - move mouse right (CW) and left (CCW) + if (clockwise) { + tap_code(KC_MS_R); + } else { + tap_code(KC_MS_L); + } + break; + + default: + // other layers - =/+ (quals/plus) (CW) and -/_ (minus/underscore) (CCW) + if (clockwise) { + tap_code(KC_EQL); + } else { + tap_code(KC_MINS); + } + break; + } + } + return true; +} diff --git a/keyboards/dumbpad/keymaps/via/keymap.c b/keyboards/dumbpad/keymaps/via/keymap.c new file mode 100644 index 0000000000..d9f997531a --- /dev/null +++ b/keyboards/dumbpad/keymaps/via/keymap.c @@ -0,0 +1,175 @@ +/* Copyright 2019 imchipwood + * + * 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] = { + /* + BASE LAYER + /-----------------------------------------------------` + | | 7 | 8 | 9 | Bkspc | + | |---------|---------|---------|---------| + | | 4 | 5 | 6 | Esc | + | |---------|---------|---------|---------| + | | 1 | 2 | 3 | Tab | + |-------------|---------|---------|---------|---------| + | Left mouse | MO(1) | 0 | . | Enter | + \-----------------------------------------------------' + */ + [0] = LAYOUT( + KC_7, KC_8, KC_9, KC_BSPC, + KC_4, KC_5, KC_6, KC_ESC, + KC_1, KC_2, KC_3, KC_TAB, + KC_BTN1, MO(1), KC_0, KC_PDOT, KC_ENTER + ), + /* + SUB LAYER + /-----------------------------------------------------` + | | | | | Reset | + | |---------|---------|---------|---------| + | | | | | + | + | |---------|---------|---------|---------| + | | | | | - | + |-------------|---------|---------|---------|---------| + | LOCK | | MO(2) | | = | + \-----------------------------------------------------' + */ + [1] = LAYOUT( + _______, _______, _______, RESET, + _______, _______, _______, KC_KP_PLUS, + _______, _______, _______, KC_KP_MINUS, + KC_MUTE, _______, MO(2) , _______, KC_EQL + ), + + /* + DEBUG LAYER + /-----------------------------------------------------` + | | | | | Reset | + | |---------|---------|---------|---------| + | | | | | | + | |---------|---------|---------|---------| + | | | | | | + |-------------|---------|---------|---------|---------| + | | | | | | + \-----------------------------------------------------' + */ + [2] = LAYOUT( + _______, _______, _______, RESET, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, MO(3) , _______ + ), + + /* + EXTRA LAYER + /-----------------------------------------------------` + | | | | | | + | |---------|---------|---------|---------| + | | | | | | + | |---------|---------|---------|---------| + | | | | | | + |-------------|---------|---------|---------|---------| + | | | | | | + \-----------------------------------------------------' + */ + [3] = LAYOUT( + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, _______ + ), +}; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + switch (get_highest_layer(layer_state)) { + case 0: + // sub layer - Scroll + if (clockwise) { + tap_code(KC_MS_WH_DOWN); + } else { + tap_code(KC_MS_WH_UP); + } + break; + + case 1: + // main layer - Volume + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + break; + + case 2: + // debug layer - Change track + if (clockwise) { + tap_code(KC_MNXT); + } else { + tap_code(KC_MPRV); + } + break; + + default: + // any other layer Scroll + if (clockwise) { + tap_code(KC_MS_WH_DOWN); + } else { + tap_code(KC_MS_WH_UP); + } + break; + } + } + else if (index == 1) { + switch (get_highest_layer(layer_state)) { + case 0: + // sub layer - Volume + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + break; + + case 1: + // main layer - Scroll + if (clockwise) { + tap_code(KC_MS_WH_DOWN); + } else { + tap_code(KC_MS_WH_UP); + } + break; + + case 2: + // debug layer - Brightness + if (clockwise) { + tap_code(KC_BRID); + } else { + tap_code(KC_BRIU); + } + break; + + default: + // any other layer Scroll + if (clockwise) { + tap_code(KC_MS_WH_DOWN); + } else { + tap_code(KC_MS_WH_UP); + } + break; + } + } + return true; +} diff --git a/keyboards/dumbpad/keymaps/via/rules.mk b/keyboards/dumbpad/keymaps/via/rules.mk new file mode 100644 index 0000000000..4650c471e5 --- /dev/null +++ b/keyboards/dumbpad/keymaps/via/rules.mk @@ -0,0 +1,3 @@ +CONSOLE_ENABLE = no +LTO_ENABLE = yes +VIA_ENABLE = yes \ No newline at end of file diff --git a/keyboards/dumbpad/rules.mk b/keyboards/dumbpad/rules.mk index 87ec1ab01b..309e3d48c0 100644 --- a/keyboards/dumbpad/rules.mk +++ b/keyboards/dumbpad/rules.mk @@ -1 +1,25 @@ -DEFAULT_FOLDER = dumbpad/v0x +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = caterina + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +BLUETOOTH_ENABLE = no # Enable Bluetooth +AUDIO_ENABLE = no # Audio output + +ENCODER_ENABLE = yes +KEY_LOCK_ENABLE = yes From 98af5bc64e6148915cebcfdd607119b9feefe90d Mon Sep 17 00:00:00 2001 From: jonavin <71780717+Jonavin@users.noreply.github.com> Date: Thu, 19 Aug 2021 13:45:49 -0400 Subject: [PATCH 04/10] [Keymap] Add jonavin user space / common functions (#13876) Co-authored-by: Drashna Jaelre Co-authored-by: Ryan Co-authored-by: Jonavin <=> --- keyboards/gmmk/pro/keymaps/jonavin/keymap.c | 187 +------------- keyboards/gmmk/pro/keymaps/jonavin/readme.md | 13 + keyboards/gmmk/pro/keymaps/jonavin/rules.mk | 5 + .../keebio/quefrency/keymaps/jonavin/keymap.c | 81 ++---- .../quefrency/keymaps/jonavin/readme.md | 7 + .../keebio/quefrency/keymaps/jonavin/rules.mk | 3 + .../mercutio/keymaps/jonavin/keymap.c | 47 +--- .../mercutio/keymaps/jonavin/readme.md | 7 + .../mercutio/keymaps/jonavin/rules.mk | 3 + users/jonavin/config.h | 30 +++ users/jonavin/jonavin.c | 231 ++++++++++++++++++ users/jonavin/jonavin.h | 82 +++++++ users/jonavin/readme.md | 76 ++++++ users/jonavin/rules.mk | 13 + 14 files changed, 500 insertions(+), 285 deletions(-) create mode 100644 users/jonavin/config.h create mode 100644 users/jonavin/jonavin.c create mode 100644 users/jonavin/jonavin.h create mode 100644 users/jonavin/readme.md create mode 100644 users/jonavin/rules.mk diff --git a/keyboards/gmmk/pro/keymaps/jonavin/keymap.c b/keyboards/gmmk/pro/keymaps/jonavin/keymap.c index 8b37449576..edca78cd17 100644 --- a/keyboards/gmmk/pro/keymaps/jonavin/keymap.c +++ b/keyboards/gmmk/pro/keymaps/jonavin/keymap.c @@ -17,36 +17,7 @@ along with this program. If not, see . #include QMK_KEYBOARD_H #include "rgb_matrix_map.h" - -#define ARRAYSIZE(arr) sizeof(arr)/sizeof(arr[0]) - -enum custom_layers { - _BASE, - _FN1, - _MO2, - _MO3, -}; - -enum custom_keycodes { - KC_00 = SAFE_RANGE, - KC_WINLCK, //Toggles Win key on and off - RGB_TOI, // Timeout idle time up - RGB_TOD, // Timeout idle time down -}; - -// Tap Dance Definitions -enum custom_tapdance { - TD_LSFT_CAPSLOCK, -}; - -qk_tap_dance_action_t tap_dance_actions[] = { - // Tap once for shift, twice for Caps Lock - [TD_LSFT_CAPSLOCK] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS), -}; - -#define KC_LSFTCAPS TD(TD_LSFT_CAPSLOCK) - -bool _isWinKeyDisabled = false; +#include "jonavin.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -63,8 +34,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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_INS, 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, - TT(_MO2), 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_LSFTCAPS, 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, + TT(_LOWER), 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_LSFTCAPSWIN, 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, MO(_FN1),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), @@ -77,7 +48,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_WINLCK, _______, _______, _______, _______, _______, RGB_SPD, RGB_RMOD, RGB_SPI ), - [_MO2] = LAYOUT( + [_LOWER] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_P0, KC_PMNS, KC_PPLS, _______, _______, _______, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, KC_TAB, KC_P4, KC_P5, KC_P6, KC_PDOT, _______, _______, _______, KC_HOME, @@ -86,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, KC_BSPC, _______, _______, _______, RCTL(KC_LEFT), RCTL(KC_PGDN), RCTL(KC_RIGHT) ), - [_MO3] = LAYOUT( + [_RAISE] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -98,139 +69,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -// TIMEOUTS -#define TIMEOUT_THRESHOLD_DEFAULT 5 // default timeout minutes -#define TIMEOUT_THRESHOLD_MAX 140 // upper limits (2 hours and 10 minutes -- no rgb indicators above this value) -static uint16_t timeout_timer = 0; -static uint16_t timeout_counter = 0; //in minute intervals -static uint16_t timeout_threshold = TIMEOUT_THRESHOLD_DEFAULT; - -void timeout_reset_timer(void) { - timeout_timer = timer_read(); - timeout_counter = 0; -}; - -void timeout_update_threshold(bool increase) { - if (increase && timeout_threshold < TIMEOUT_THRESHOLD_MAX) timeout_threshold++; - if (!increase && timeout_threshold > 0) timeout_threshold--; -}; - - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_00: - if (record->event.pressed) { - // when keycode KC_00 is pressed - SEND_STRING("00"); - } else { - // when keycode KC_00 is released - } - break; - case KC_WINLCK: - if (record->event.pressed) { - _isWinKeyDisabled = !_isWinKeyDisabled; //toggle status - if(_isWinKeyDisabled) { - process_magic(GUI_OFF, record); - } else { - process_magic(GUI_ON, record); - } - } else unregister_code16(keycode); - break; - case RGB_TOI: - if(record->event.pressed) { - timeout_update_threshold(true); - } else unregister_code16(keycode); - break; - case RGB_TOD: - if(record->event.pressed) { - timeout_update_threshold(false); //decrease timeout - } else unregister_code16(keycode); - break; - default: - if (record->event.pressed) { //reset activity timer - #ifdef RGB_MATRIX_ENABLE - rgb_matrix_enable(); - #endif - timeout_reset_timer(); - } - break; - } - return true; -}; - -void matrix_scan_user(void) { - if (timeout_threshold > 0) { - if (timer_elapsed(timeout_timer) >= 60000) { // 1 minute tick - timeout_counter++; - timeout_timer = timer_read(); - } - #ifdef RGB_MATRIX_ENABLE - if (timeout_threshold > 0 && timeout_counter >= timeout_threshold) { - rgb_matrix_disable_noeeprom(); - } - #endif - } // timeout_threshold = 0 will disable timeout -}; - - -#ifdef ENCODER_ENABLE // Encoder Functionality - uint8_t selected_layer = 0; - - bool encoder_update_user(uint8_t index, bool clockwise) { - if ( clockwise ) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) ) { // If you are holding L shift, encoder changes layers - if(selected_layer < 3) { - selected_layer ++; - layer_move(selected_layer); - } - } else if (keyboard_report->mods & MOD_BIT(KC_RSFT) ) { // If you are holding R shift, Page up - unregister_mods(MOD_BIT(KC_LSFT)); - register_code(KC_PGDN); - register_mods(MOD_BIT(KC_LSFT)); - } else if (keyboard_report->mods & MOD_BIT(KC_LCTL)) { // if holding Left Ctrl, navigate next word - tap_code16(LCTL(KC_RGHT)); - } else if (keyboard_report->mods & MOD_BIT(KC_LALT)) { // if holding Left Alt, change media next track - tap_code(KC_MEDIA_NEXT_TRACK); - } else { - switch (selected_layer) { - case _FN1: - timeout_update_threshold(true); - break; - default: - tap_code(KC_VOLU); // Otherwise it just changes volume - break; - } - } - } else { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) ) { - if (selected_layer > 0) { - selected_layer --; - layer_move(selected_layer); - } - } else if (keyboard_report->mods & MOD_BIT(KC_RSFT) ) { - unregister_mods(MOD_BIT(KC_LSFT)); - register_code(KC_PGUP); - register_mods(MOD_BIT(KC_LSFT)); - } else if (keyboard_report->mods & MOD_BIT(KC_LCTL)) { // if holding Left Ctrl, navigate previous word - tap_code16(LCTL(KC_LEFT)); - } else if (keyboard_report->mods & MOD_BIT(KC_LALT)) { // if holding Left Alt, change media previous track - tap_code(KC_MEDIA_PREV_TRACK); - } else { - switch (selected_layer) { - case _FN1: - timeout_update_threshold(false); - break; - default: - tap_code(KC_VOLD); - break; - } - } - } - - return true; - } -#endif - #ifdef RGB_MATRIX_ENABLE // Capslock, Scroll lock and Numlock indicator on Left side lights. void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { @@ -247,7 +85,7 @@ void matrix_scan_user(void) { rgb_matrix_set_color(LED_L6, RGB_RED); rgb_matrix_set_color(LED_L7, RGB_RED); } - if (_isWinKeyDisabled) { + if (keymap_config.no_gui) { rgb_matrix_set_color(LED_LWIN, RGB_RED); //light up Win key when disabled } switch(get_highest_layer(layer_state)){ // special handling per layer @@ -258,6 +96,7 @@ void matrix_scan_user(void) { rgb_matrix_set_color(LED_FN, RGB_RED); //FN key // Add RGB Timeout Indicator -- shows 0 to 139 using F row and num row; larger numbers using 16bit code + uint16_t timeout_threshold = get_timeout_threshold(); if (timeout_threshold <= 10) rgb_matrix_set_color(LED_LIST_FUNCROW[timeout_threshold], RGB_RED); else if (timeout_threshold < 140) { rgb_matrix_set_color(LED_LIST_FUNCROW[(timeout_threshold / 10)], RGB_RED); @@ -268,7 +107,7 @@ void matrix_scan_user(void) { rgb_matrix_set_color(LED_LIST_NUMROW[12], RGB_RED); } break; - case _MO2: + case _LOWER: for (uint8_t i=0; ievent.pressed) { - // when keycode DOUBLEZERO is pressed - SEND_STRING("00"); - } else { - // when keycode DOUBLEZERO is released - } - break; - case KC_WINLCK: - if (record->event.pressed) { - _isWinKeyDisabled = !_isWinKeyDisabled; //toggle status - if(_isWinKeyDisabled) { - process_magic(GUI_OFF, record); - } else { - process_magic(GUI_ON, record); - } - } else unregister_code16(keycode); - break; - } +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + // process_record_user() moved to userspace return true; }; @@ -183,22 +135,19 @@ bool encoder_update_user(uint8_t index, bool clockwise) { bool led_update_user(led_t led_state) { rgblight_set_layer_state(_rgbCAPS, led_state.caps_lock); - rgblight_set_layer_state(_rgbWINLOCK, _isWinKeyDisabled); + rgblight_set_layer_state(_rgbWINLOCK, keymap_config.no_gui); return true; } layer_state_t layer_state_set_user(layer_state_t state) { rgblight_set_layer_state(_rgbFN, layer_state_cmp(state, _FN1)); - rgblight_set_layer_state(_rgbNUMPAD, layer_state_cmp(state, _MO2)); + rgblight_set_layer_state(_rgbNUMPAD, layer_state_cmp(state, _LOWER)); return state; } #endif // RGBLIGHT_ENABLE -void keyboard_post_init_user(void) { - - if (IS_HOST_LED_ON(USB_LED_NUM_LOCK)) { // turn on Num lock by defautl so that the numpad layer always has predictable results - tap_code(KC_NUMLOCK); - } +void keyboard_post_init_keymap(void) { + // keyboard_post_init_user() moved to userspace #ifdef RGBLIGHT_ENABLE rgblight_mode(1); // single colour mode rgblight_setrgb(RGB_GODSPEED); // Default startup colour diff --git a/keyboards/keebio/quefrency/keymaps/jonavin/readme.md b/keyboards/keebio/quefrency/keymaps/jonavin/readme.md index c782d26c07..4833c5b626 100644 --- a/keyboards/keebio/quefrency/keymaps/jonavin/readme.md +++ b/keyboards/keebio/quefrency/keymaps/jonavin/readme.md @@ -18,6 +18,13 @@ - Add capslock indicator, win key lock indicator - Fn and layer 2 indicators using RGB underglow +rules.mk OPTIONS - Active features from userspace +STARTUP_NUMLOCK_ON = yes + - turns on NUMLOCK by default + +TD_LSFT_CAPSLOCK_ENABLE = yes + - This will enable double tap on Left Shift to toggle CAPSLOCK when using KC_LSFTCAPS + ## All layers diagram Default Layer diff --git a/keyboards/keebio/quefrency/keymaps/jonavin/rules.mk b/keyboards/keebio/quefrency/keymaps/jonavin/rules.mk index eff3d692ee..f27873bb80 100644 --- a/keyboards/keebio/quefrency/keymaps/jonavin/rules.mk +++ b/keyboards/keebio/quefrency/keymaps/jonavin/rules.mk @@ -4,3 +4,6 @@ LTO_ENABLE = yes MOUSEKEY_ENABLE = no TAP_DANCE_ENABLE = yes + +TD_LSFT_CAPSLOCK_ENABLE = yes +STARTUP_NUMLOCK_ON = yes diff --git a/keyboards/mechwild/mercutio/keymaps/jonavin/keymap.c b/keyboards/mechwild/mercutio/keymaps/jonavin/keymap.c index ed321e79b9..ddde6d6525 100755 --- a/keyboards/mechwild/mercutio/keymaps/jonavin/keymap.c +++ b/keyboards/mechwild/mercutio/keymaps/jonavin/keymap.c @@ -18,35 +18,7 @@ #include QMK_KEYBOARD_H #include - -enum custom_layers { - _BASE, - _FN1, - _LOWER, - _RAISE, -}; - -enum custom_keycodes { - ENCFUNC = SAFE_RANGE, // encoder function keys - KC_WINLCK, //Toggles Win key on and off -}; - -// Tap Dance Definitions -enum custom_tapdance { - TD_LSFT_CAPSLOCK, -}; - -qk_tap_dance_action_t tap_dance_actions[] = { - // Tap once for shift, twice for Caps Lock - [TD_LSFT_CAPSLOCK] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS), -}; - -bool _isWinKeyDisabled = false; - -#define KC_LSFTCAPS TD(TD_LSFT_CAPSLOCK) -#define KC_CAD LALT(LCTL(KC_DEL)) -#define KC_AF4 LALT(KC_F4) -#define KC_TASK LCTL(LSFT(KC_ESC)) +#include "jonavin.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = LAYOUT_all( @@ -113,13 +85,12 @@ static void set_selectedkey(uint8_t idx) { } -void keyboard_post_init_user(void) { +void keyboard_post_init_keymap(void) { // Call the keyboard post init code. - //selectedkey_rec = keyselection[selectedkey_idx]; set_selectedkey(selectedkey_idx); } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case ENCFUNC: if (record->event.pressed) { @@ -128,16 +99,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { // when keycode is released } break; - case KC_WINLCK: - if (record->event.pressed) { - _isWinKeyDisabled = !_isWinKeyDisabled; //toggle status - if(_isWinKeyDisabled) { - process_magic(GUI_OFF, record); - } else { - process_magic(GUI_ON, record); - } - } else unregister_code16(keycode); - break; } return true; }; @@ -274,7 +235,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { default: oled_write_P(PSTR("Layer ?"), false); // Should never display, here as a catchall } - oled_write_P(_isWinKeyDisabled ? PSTR(" WL") : PSTR(" "), false); + oled_write_P(keymap_config.no_gui ? PSTR(" WL") : PSTR(" "), false); oled_set_cursor(8,3); if (get_highest_layer(layer_state) == selected_layer) { oled_write_P(PSTR(" "), false); diff --git a/keyboards/mechwild/mercutio/keymaps/jonavin/readme.md b/keyboards/mechwild/mercutio/keymaps/jonavin/readme.md index 730bee8897..6255dadd05 100644 --- a/keyboards/mechwild/mercutio/keymaps/jonavin/readme.md +++ b/keyboards/mechwild/mercutio/keymaps/jonavin/readme.md @@ -38,6 +38,13 @@ Features While holding Left Alt, media next track or previous track +rules.mk OPTIONS - Active features from userspace +STARTUP_NUMLOCK_ON = yes + - turns on NUMLOCK by default + +TD_LSFT_CAPSLOCK_ENABLE = yes + - This will enable double tap on Left Shift to toggle CAPSLOCK when using KC_LSFTCAPS + Default Layers ![image](https://user-images.githubusercontent.com/71780717/127014682-3aa05136-6dc7-4a40-9be1-89a5b584848a.png) diff --git a/keyboards/mechwild/mercutio/keymaps/jonavin/rules.mk b/keyboards/mechwild/mercutio/keymaps/jonavin/rules.mk index 550e84c809..0b76c6e57c 100644 --- a/keyboards/mechwild/mercutio/keymaps/jonavin/rules.mk +++ b/keyboards/mechwild/mercutio/keymaps/jonavin/rules.mk @@ -3,3 +3,6 @@ VIA_ENABLE = yes MOUSEKEY_ENABLE = yes WPM_ENABLE = yes TAP_DANCE_ENABLE = yes + +TD_LSFT_CAPSLOCK_ENABLE = yes +STARTUP_NUMLOCK_ON = yes diff --git a/users/jonavin/config.h b/users/jonavin/config.h new file mode 100644 index 0000000000..4f4568f700 --- /dev/null +++ b/users/jonavin/config.h @@ -0,0 +1,30 @@ +/* Copyright 2021 Jonavin Eng + * + * 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 TAPPING_TOGGLE 2 // TT () set to two taps + +/* Handle GRAVESC combo keys */ +#define GRAVE_ESC_ALT_OVERRIDE // Always send Escape if Alt is pressed +#define GRAVE_ESC_CTRL_OVERRIDE // Always send Escape if Control is pressed + +#define TAPPING_TERM 180 + +#ifdef RGB_MATRIX_ENABLE + #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_COLOR + #define RGB_DISABLE_WHEN_USB_SUSPENDED true +#endif diff --git a/users/jonavin/jonavin.c b/users/jonavin/jonavin.c new file mode 100644 index 0000000000..d5fdb2a1eb --- /dev/null +++ b/users/jonavin/jonavin.c @@ -0,0 +1,231 @@ + +/* Copyright 2021 Jonavin Eng @Jonavin + +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 "jonavin.h" + + +#ifdef TD_LSFT_CAPSLOCK_ENABLE + // Tap once for shift, twice for Caps Lock but only if Win Key in not disabled + void dance_LSFT_finished(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1 || keymap_config.no_gui) { + register_code16(KC_LSFT); + } else { + register_code(KC_CAPS); + } + } + + void dance_LSFT_reset(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1 || keymap_config.no_gui) { + unregister_code16(KC_LSFT); + } else { + unregister_code(KC_CAPS); + } + } + + qk_tap_dance_action_t tap_dance_actions[] = { + // Tap once for shift, twice for Caps Lock + [TD_LSFT_CAPSLOCK] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS), + [TD_LSFT_CAPS_WIN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_LSFT_finished, dance_LSFT_reset), + }; +#endif // TD_LSFT_CAPSLOCK_ENABLE + +// TIMEOUTS +#ifdef IDLE_TIMEOUT_ENABLE + static uint16_t timeout_timer = 0; + static uint16_t timeout_counter = 0; //in minute intervals + static uint16_t timeout_threshold = TIMEOUT_THRESHOLD_DEFAULT; + + uint16_t get_timeout_threshold(void) { + return timeout_threshold; + } + + void timeout_reset_timer(void) { + timeout_timer = timer_read(); + timeout_counter = 0; + }; + + void timeout_update_threshold(bool increase) { + if (increase && timeout_threshold < TIMEOUT_THRESHOLD_MAX) timeout_threshold++; + if (!increase && timeout_threshold > 0) timeout_threshold--; + }; + + void timeout_tick_timer(void) { + if (timeout_threshold > 0) { + if (timer_elapsed(timeout_timer) >= 60000) { // 1 minute tick + timeout_counter++; + timeout_timer = timer_read(); + } + #ifdef RGB_MATRIX_ENABLE + if (timeout_threshold > 0 && timeout_counter >= timeout_threshold) { + rgb_matrix_disable_noeeprom(); + } + #endif + } // timeout_threshold = 0 will disable timeout + } + + __attribute__((weak)) void matrix_scan_keymap(void) {} + + void matrix_scan_user(void) { + timeout_tick_timer(); + matrix_scan_keymap(); + } +#endif // IDLE_TIMEOUT_ENABLE + + +#if defined(ENCODER_ENABLE) && defined(ENCODER_DEFAULTACTIONS_ENABLE) // Encoder Functionality + #ifndef DYNAMIC_KEYMAP_LAYER_COUNT + #define DYNAMIC_KEYMAP_LAYER_COUNT 4 //default in case this is not already defined elsewhere + #endif + #ifndef ENCODER_DEFAULTACTIONS_INDEX + #define ENCODER_DEFAULTACTIONS_INDEX 0 // can select encoder index if there are multiple encoders + #endif + +uint8_t selected_layer = 0; + +__attribute__((weak)) bool encoder_update_keymap(uint8_t index, bool clockwise) { return true; } + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (!encoder_update_keymap(index, clockwise)) { return false; } + if (index != ENCODER_DEFAULTACTIONS_INDEX) {return true;} // exit if the index doesn't match + if ( clockwise ) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) ) { // If you are holding L shift, encoder changes layers + if(selected_layer < (DYNAMIC_KEYMAP_LAYER_COUNT - 1)) { + selected_layer ++; + layer_move(selected_layer); + } + } else if (keyboard_report->mods & MOD_BIT(KC_RSFT) ) { // If you are holding R shift, Page up + unregister_mods(MOD_BIT(KC_RSFT)); + register_code(KC_PGDN); + register_mods(MOD_BIT(KC_RSFT)); + } else if (keyboard_report->mods & MOD_BIT(KC_LCTL)) { // if holding Left Ctrl, navigate next word + tap_code16(LCTL(KC_RGHT)); + } else if (keyboard_report->mods & MOD_BIT(KC_LALT)) { // if holding Left Alt, change media next track + tap_code(KC_MEDIA_NEXT_TRACK); + } else { + switch (selected_layer) { + case _FN1: + #ifdef IDLE_TIMEOUT_ENABLE + timeout_update_threshold(true); + #endif + break; + default: + tap_code(KC_VOLU); // Otherwise it just changes volume + break; + } + } + } else { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) ) { + if (selected_layer > 0) { + selected_layer --; + layer_move(selected_layer); + } + } else if (keyboard_report->mods & MOD_BIT(KC_RSFT) ) { + unregister_mods(MOD_BIT(KC_RSFT)); + register_code(KC_PGUP); + register_mods(MOD_BIT(KC_RSFT)); + } else if (keyboard_report->mods & MOD_BIT(KC_LCTL)) { // if holding Left Ctrl, navigate previous word + tap_code16(LCTL(KC_LEFT)); + } else if (keyboard_report->mods & MOD_BIT(KC_LALT)) { // if holding Left Alt, change media previous track + tap_code(KC_MEDIA_PREV_TRACK); + } else { + switch (selected_layer) { + case _FN1: + #ifdef IDLE_TIMEOUT_ENABLE + timeout_update_threshold(false); + #endif + break; + default: + tap_code(KC_VOLD); + break; + } + } + } + + return true; + } +#endif // ENCODER_ENABLE + + +// PROCESS KEY CODES +__attribute__ ((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_keymap(keycode, record)) { return false; } + switch (keycode) { + case KC_00: + if (record->event.pressed) { + // when keycode KC_00 is pressed + SEND_STRING("00"); + } else unregister_code16(keycode); + break; + case KC_WINLCK: + if (record->event.pressed) { + keymap_config.no_gui = !keymap_config.no_gui; //toggle status + } else unregister_code16(keycode); + break; + +#ifdef IDLE_TIMEOUT_ENABLE + case RGB_TOI: + if(record->event.pressed) { + timeout_update_threshold(true); + } else unregister_code16(keycode); + break; + case RGB_TOD: + if(record->event.pressed) { + timeout_update_threshold(false); //decrease timeout + } else unregister_code16(keycode); + break; +#endif // IDLE_TIMEOUT_ENABLE + + default: + if (record->event.pressed) { + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_enable(); + #endif + #ifdef IDLE_TIMEOUT_ENABLE + timeout_reset_timer(); //reset activity timer + #endif + } + break; + } + return true; +}; + + +// Turn on/off NUM LOCK if current state is different +void activate_numlock(bool turn_on) { + if (IS_HOST_LED_ON(USB_LED_NUM_LOCK) != turn_on) { + tap_code(KC_NUMLOCK); + } +} + + +// INITIAL STARTUP + +__attribute__ ((weak)) void keyboard_post_init_keymap(void) {} + +void keyboard_post_init_user(void) { + keyboard_post_init_keymap(); + #ifdef STARTUP_NUMLOCK_ON + activate_numlock(true); // turn on Num lock by default so that the numpad layer always has predictable results + #endif // STARTUP_NUMLOC_ON + #ifdef IDLE_TIMEOUT_ENABLE + timeout_timer = timer_read(); // set inital time for ide timeout + #endif +} diff --git a/users/jonavin/jonavin.h b/users/jonavin/jonavin.h new file mode 100644 index 0000000000..894feddfd9 --- /dev/null +++ b/users/jonavin/jonavin.h @@ -0,0 +1,82 @@ + +/* Copyright 2021 Jonavin Eng @Jonavin + +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 MACROS +#define ARRAYSIZE(arr) sizeof(arr)/sizeof(arr[0]) + + +// LAYERS +enum custom_user_layers { + _BASE, + _FN1, + _LOWER, + _RAISE, +}; + +// KEYCODES +enum custom_user_keycodes { + KC_00 = SAFE_RANGE, + ENCFUNC, + KC_WINLCK, //Toggles Win key on and off + RGB_TOI, // Timeout idle time up + RGB_TOD, // Timeout idle time down +}; + +#define KC_CAD LALT(LCTL(KC_DEL)) +#define KC_AF4 LALT(KC_F4) +#define KC_TASK LCTL(LSFT(KC_ESC)) + + +#ifdef TD_LSFT_CAPSLOCK_ENABLE + // Tap Dance Definitions + enum custom_tapdance { + TD_LSFT_CAPSLOCK, + TD_LSFT_CAPS_WIN + }; + + #define KC_LSFTCAPS TD(TD_LSFT_CAPSLOCK) + #define KC_LSFTCAPSWIN TD(TD_LSFT_CAPS_WIN) +#else // regular Shift + #define KC_LSFTCAPS KC_LSFT +#endif // TD_LSFT_CAPSLOCK_ENABLE + + + +#ifdef RGB_MATRIX_ENABLE +//RGB custom colours + #define RGB_GODSPEED 0x00, 0xE4, 0xFF // colour for matching keycaps + #define RGB_NAUTILUS 0x00, 0xA4, 0xA9 // Nautilus Font colours +#endif + + +// IDLE TIMEOUTS +#ifdef IDLE_TIMEOUT_ENABLE + #define TIMEOUT_THRESHOLD_DEFAULT 5 // default timeout minutes + #define TIMEOUT_THRESHOLD_MAX 140 // upper limits (2 hours and 10 minutes -- no rgb indicators above this value) + + //prototype functions + uint16_t get_timeout_threshold(void); + void timeout_reset_timer(void); + void timeout_update_threshold(bool increase); + void timeout_tick_timer(void); +#endif //IDLE_TIMEOUT_ENABLE + + +// OTHER FUNCTION PROTOTYPE +void activate_numlock(bool turn_on); diff --git a/users/jonavin/readme.md b/users/jonavin/readme.md new file mode 100644 index 0000000000..97fff6520c --- /dev/null +++ b/users/jonavin/readme.md @@ -0,0 +1,76 @@ +Copyright 2021 Jonavin Eng @Jonavin + +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 . + +LAYERS: + 0 = _BASE + 1 = _FN1 + 2 = _LOWER + 3 = _RAISE + +KEYCODES: + KC_CAD Ctrl-Alt-Del + KC_AF4 Alt-F4 + KC_TASK Windows Task Manager (Ctrl-Shift-Esc) + LSFT_CAPSLOCK When LSFT_CAPSLOCK_ENABLE is defined, hold for Shift double tap for CAPSLOCK; otherwise, just Shift + KC_00 double zero "00" + KC_WINLCK toggles LGui/Win key lock + RGB_TOI Increase Timeout idle time threshold + RGB_TOD Decrease Timeout idle time threshold + +ENABLE FEATURES your keymap rules.mk + +STARTUP_NUMLOCK_ON = yes + turns on NUMLOCK by default + +ENCODER_DEFAULTACTIONS_ENABLE = yes + Enabled default encoder funtions + When enabled, use this in the keymap for an additional encoder processing + bool encoder_update_keymap(uint8_t index, bool clockwise) + + OPTION: set ENCODER_DEFAULTACTIONS_INDEX to the encoder number if the encoder is not index 0 + +TD_LSFT_CAPSLOCK_ENABLE = yes + This will enable double tap on Left Shift to toggle CAPSLOCK + KC_LSFTCAPS to bind to left Shift to enable feature + KC_LSFTCAPSWIN does the same thing but will not turn on CAPS when Win Lkey is disabled + +IDLE_TIMEOUT_ENABLE = yes + Enables Timer functionality; for RGB idle timeouts that can be changed dynamically + When enabled, use this in the keymap for an additional matrix processing + void matrix_scan_keymap(void) + + Functions: + u16int_t get_timeout_threshold(void) // returns the current timeout threshold + void timeout_update_threshold(bool increase) // change threshold: true = increase, false = decrease + void timeout_reset_timer(void) // resets timer (put in process_record_user if you override it) + void timeout_tick_timer(void) // registers time ticks (put in maxtrix_scan_user if you override it) + +Other Functions: + - activate_numlock(bool turn_on) // true = turn on NUM LOCK, false = off + +KEYMAP LEVEL ADDITIONAL PROCESSING FUNCTIONS + bool process_record_keymap(uint16_t keycode, keyrecord_t *record) + void keyboard_post_init_keymap(void) + +LIST OF COMPATIBLE KEYMAPS + - gmmk/pro + - gmmk/pro/ansi + - keebio/quefrency/rev3 + - mechwild/mercutio + - mechwild/murphpad (*) + - mechwild/OBE (*) + - nopunin10did/kastenwagen (*) + + (*) coming soon diff --git a/users/jonavin/rules.mk b/users/jonavin/rules.mk new file mode 100644 index 0000000000..4e9ee08ff7 --- /dev/null +++ b/users/jonavin/rules.mk @@ -0,0 +1,13 @@ +SRC += jonavin.c +ifeq ($(strip $(ENCODER_DEFAULTACTIONS_ENABLE)), yes) + OPT_DEFS += -DENCODER_DEFAULTACTIONS_ENABLE +endif +ifeq ($(strip $(TD_LSFT_CAPSLOCK_ENABLE)), yes) + OPT_DEFS += -DTD_LSFT_CAPSLOCK_ENABLE +endif +ifeq ($(strip $(IDLE_TIMEOUT_ENABLE)), yes) + OPT_DEFS += -DIDLE_TIMEOUT_ENABLE +endif +ifeq ($(strip $(STARTUP_NUMLOCK_ON)), yes) + OPT_DEFS += -DSTARTUP_NUMLOCK_ON +endif From 9aedf515c094b0c2d77417d9559062a5717d0d8e Mon Sep 17 00:00:00 2001 From: James Young <18669334+noroadsleft@users.noreply.github.com> Date: Thu, 19 Aug 2021 17:46:22 +0000 Subject: [PATCH 05/10] kb-elmo Noah AVR Community Layout support and Configurator fix (#14078) * noah_avr.h: use QMK 3-character notation for matrix positions * Community Layout support, Stage 1 - rename LAYOUT_ansi to LAYOUT_65_ansi_blocker - rename LAYOUT_ansi_splitbs to LAYOUT_65_ansi_blocker_split_bs - enable Community Layout support * info.json: add line breaks between rows * info.json: correct LAYOUT_iso data - unsplit the Backspace - change ANSI Enter to ISO Enter - split the left Shift * Community Layout support, Stage 2 - rename LAYOUT_iso to LAYOUT_65_iso_blocker - update Community Layout support * Community Layout support, Stage 3 - add LAYOUT_65_iso_blocker_split_bs - update Community Layout support * noah_avr.h: add matrix diagram --- keyboards/kb_elmo/noah_avr/info.json | 110 ++++++++++++++- .../kb_elmo/noah_avr/keymaps/default/keymap.c | 4 +- keyboards/kb_elmo/noah_avr/noah_avr.h | 125 +++++++++++------- keyboards/kb_elmo/noah_avr/rules.mk | 2 + 4 files changed, 182 insertions(+), 59 deletions(-) diff --git a/keyboards/kb_elmo/noah_avr/info.json b/keyboards/kb_elmo/noah_avr/info.json index 8560d4b867..571291d37e 100644 --- a/keyboards/kb_elmo/noah_avr/info.json +++ b/keyboards/kb_elmo/noah_avr/info.json @@ -4,6 +4,11 @@ "maintainer": "kb-elmo", "width": 16, "height": 5, + "layout_aliases": { + "LAYOUT_ansi": "LAYOUT_65_ansi_blocker", + "LAYOUT_ansi_splitbs": "LAYOUT_65_ansi_blocker_split_bs", + "LAYOUT_iso": "LAYOUT_65_iso_blocker" + }, "layouts": { "LAYOUT_all": { "layout": [ @@ -23,6 +28,7 @@ {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, + {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, @@ -38,6 +44,7 @@ {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, + {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, @@ -52,6 +59,7 @@ {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, + {"x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"x":2.25, "y":3}, @@ -67,6 +75,7 @@ {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, + {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, @@ -78,7 +87,7 @@ {"x":15, "y":4} ] }, - "LAYOUT_ansi": { + "LAYOUT_65_ansi_blocker": { "layout": [ {"x":0, "y":0}, {"x":1, "y":0}, @@ -95,6 +104,7 @@ {"x":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":15, "y":0}, + {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, @@ -110,6 +120,7 @@ {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, + {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, @@ -124,6 +135,7 @@ {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, + {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, @@ -138,6 +150,7 @@ {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, + {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, @@ -149,7 +162,7 @@ {"x":15, "y":4} ] }, - "LAYOUT_ansi_splitbs": { + "LAYOUT_65_ansi_blocker_split_bs": { "layout": [ {"x":0, "y":0}, {"x":1, "y":0}, @@ -167,6 +180,7 @@ {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, + {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, @@ -182,6 +196,7 @@ {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, + {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, @@ -196,6 +211,7 @@ {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, + {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, @@ -210,6 +226,7 @@ {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, + {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, @@ -221,7 +238,83 @@ {"x":15, "y":4} ] }, - "LAYOUT_iso": { + "LAYOUT_65_iso_blocker": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6, "y":0}, + {"x":7, "y":0}, + {"x":8, "y":0}, + {"x":9, "y":0}, + {"x":10, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0, "w":2}, + {"x":15, "y":0}, + + {"x":0, "y":1, "w":1.5}, + {"x":1.5, "y":1}, + {"x":2.5, "y":1}, + {"x":3.5, "y":1}, + {"x":4.5, "y":1}, + {"x":5.5, "y":1}, + {"x":6.5, "y":1}, + {"x":7.5, "y":1}, + {"x":8.5, "y":1}, + {"x":9.5, "y":1}, + {"x":10.5, "y":1}, + {"x":11.5, "y":1}, + {"x":12.5, "y":1}, + {"x":15, "y":1}, + + {"x":0, "y":2, "w":1.75}, + {"x":1.75, "y":2}, + {"x":2.75, "y":2}, + {"x":3.75, "y":2}, + {"x":4.75, "y":2}, + {"x":5.75, "y":2}, + {"x":6.75, "y":2}, + {"x":7.75, "y":2}, + {"x":8.75, "y":2}, + {"x":9.75, "y":2}, + {"x":10.75, "y":2}, + {"x":11.75, "y":2}, + {"x":12.75, "y":2}, + {"x":13.75, "y":1, "w":1.25, "h":2}, + {"x":15, "y":2}, + + {"x":0, "y":3, "w":1.25}, + {"x":1.25, "y":3}, + {"x":2.25, "y":3}, + {"x":3.25, "y":3}, + {"x":4.25, "y":3}, + {"x":5.25, "y":3}, + {"x":6.25, "y":3}, + {"x":7.25, "y":3}, + {"x":8.25, "y":3}, + {"x":9.25, "y":3}, + {"x":10.25, "y":3}, + {"x":11.25, "y":3}, + {"x":12.25, "y":3, "w":1.75}, + {"x":14, "y":3}, + {"x":15, "y":3}, + + {"x":0, "y":4, "w":1.25}, + {"x":1.25, "y":4, "w":1.25}, + {"x":2.5, "y":4, "w":1.25}, + {"x":3.75, "y":4, "w":6.25}, + {"x":10, "y":4, "w":1.25}, + {"x":11.25, "y":4, "w":1.25}, + {"x":13, "y":4}, + {"x":14, "y":4}, + {"x":15, "y":4} + ] + }, + "LAYOUT_65_iso_blocker_split_bs": { "layout": [ {"x":0, "y":0}, {"x":1, "y":0}, @@ -239,6 +332,7 @@ {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, + {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, @@ -252,8 +346,8 @@ {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, - {"x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, + {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, @@ -266,9 +360,12 @@ {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, - {"x":12.75, "y":2, "w":2.25}, + {"x":12.75, "y":2}, + {"x":13.75, "y":1, "w":1.25, "h":2}, {"x":15, "y":2}, - {"x":0, "y":3, "w":2.25}, + + {"x":0, "y":3, "w":1.25}, + {"x":1.25, "y":3}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, @@ -282,6 +379,7 @@ {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, + {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, diff --git a/keyboards/kb_elmo/noah_avr/keymaps/default/keymap.c b/keyboards/kb_elmo/noah_avr/keymaps/default/keymap.c index 6dae99e2b0..1c4dde03bb 100644 --- a/keyboards/kb_elmo/noah_avr/keymaps/default/keymap.c +++ b/keyboards/kb_elmo/noah_avr/keymaps/default/keymap.c @@ -16,14 +16,14 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_ansi( + [0] = LAYOUT_65_ansi_blocker( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_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_HOME, 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_PGUP, 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_PGDN, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT ), - [1] = LAYOUT_ansi( + [1] = LAYOUT_65_ansi_blocker( 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/kb_elmo/noah_avr/noah_avr.h b/keyboards/kb_elmo/noah_avr/noah_avr.h index a816a30d0f..66a85afa61 100644 --- a/keyboards/kb_elmo/noah_avr/noah_avr.h +++ b/keyboards/kb_elmo/noah_avr/noah_avr.h @@ -18,68 +18,91 @@ #include "quantum.h" -#define ____ KC_NO +#define ___ KC_NO -/* This is a shortcut to help you visually see your layout. - * - * The first section contains all of the arguments representing the physical - * layout of the board and position of the keys. - * - * The second converts the arguments into a two-dimensional array which - * represents the switch matrix. +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───────┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0A │0B │0C │0D │0E │0F │ │0D │ 2u Backspace + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ └─┬─────┤ + * │10 │11 │12 │13 │14 │15 │16 │17 │18 │19 │1A │1B │1C │1D │1F │ │ │ + * 2.25u ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ ┌──┴┐2D │ ISO Enter + * LShift │20 │21 │22 │23 │24 │25 │26 │27 │28 │29 │2A │2B │2D │2F │ │1D │ │ + * ┌────────┐ ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ └───┴────┘ + * │30 │ │30 │31 │32 │33 │34 │35 │36 │37 │38 │39 │3A │3B │3C │3D │3F │ + * └────────┘ ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │40 │41 │42 │46 │4B │4C │ │4D │4E │4F │ + * └────┴────┴────┴────────────────────────┴────┴────┴─┴───┴───┴───┘ + * ┌─────┬───┬─────┬───────────────────────────┬─────┐ + * │40 │41 │42 │46 │4C │ Tsangan + * └─────┴───┴─────┴───────────────────────────┴─────┘ */ + #define LAYOUT_all( \ - k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, k013, k014, k015, \ - k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k113, k115, \ - k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, k211, k213, k215, \ - k300, k301, k302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, k315, \ - k400, k401, k402, k406, k411, k412, k413, k414, k415 \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1F, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2D, k2F, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3F, \ + k40, k41, k42, k46, k4B, k4C, k4D, k4E, k4F \ ) { \ - { k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, k013, k014, k015 }, \ - { k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k113, ____, k115 }, \ - { k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, k211, ____, k213, ____, k215 }, \ - { k300, k301, k302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, ____, k315 }, \ - { k400, k401, k402, ____, ____, ____, k406, ____, ____, ____, ____, k411, k412, k413, k414, k415 } \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, ___, k1F }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, ___, k2D, ___, k2F }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, ___, k3F }, \ + { k40, k41, k42, ___, ___, ___, k46, ___, ___, ___, ___, k4B, k4C, k4D, k4E, k4F } \ } -#define LAYOUT_ansi( \ - k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, k013, k015, \ - k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k113, k115, \ - k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, k211, k213, k215, \ - k300, k302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, k315, \ - k400, k401, k402, k406, k411, k412, k413, k414, k415 \ +#define LAYOUT_65_ansi_blocker( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0F, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1F, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2D, k2F, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3F, \ + k40, k41, k42, k46, k4B, k4C, k4D, k4E, k4F \ ) { \ - { k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, k013, ____, k015 }, \ - { k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k113, ____, k115 }, \ - { k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, k211, ____, k213, ____, k215 }, \ - { k300, ____, k302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, ____, k315 }, \ - { k400, k401, k402, ____, ____, ____, k406, ____, ____, ____, ____, k411, k412, k413, k414, k415 } \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, ___, k0F }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, ___, k1F }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, ___, k2D, ___, k2F }, \ + { k30, ___, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, ___, k3F }, \ + { k40, k41, k42, ___, ___, ___, k46, ___, ___, ___, ___, k4B, k4C, k4D, k4E, k4F } \ } -#define LAYOUT_ansi_splitbs( \ - k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, k013, k014, k015, \ - k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k113, k115, \ - k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, k211, k213, k215, \ - k300, k302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, k315, \ - k400, k401, k402, k406, k411, k412, k413, k414, k415 \ +#define LAYOUT_65_ansi_blocker_split_bs( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1F, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2D, k2F, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3F, \ + k40, k41, k42, k46, k4B, k4C, k4D, k4E, k4F \ ) { \ - { k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, k013, k014, k015 }, \ - { k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k113, ____, k115 }, \ - { k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, k211, ____, k213, ____, k215 }, \ - { k300, ____, k302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, ____, k315 }, \ - { k400, k401, k402, ____, ____, ____, k406, ____, ____, ____, ____, k411, k412, k413, k414, k415 } \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, ___, k1F }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, ___, k2D, ___, k2F }, \ + { k30, ___, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, ___, k3F }, \ + { k40, k41, k42, ___, ___, ___, k46, ___, ___, ___, ___, k4B, k4C, k4D, k4E, k4F } \ } -#define LAYOUT_iso( \ - k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, k013, k015, \ - k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k115, \ - k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, k211, k113, k213, k215, \ - k300, k301, k302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, k315, \ - k400, k401, k402, k406, k411, k412, k413, k414, k415 \ +#define LAYOUT_65_iso_blocker( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0F, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1F, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k1D, k2D, k2F, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3F, \ + k40, k41, k42, k46, k4B, k4C, k4D, k4E, k4F \ ) { \ - { k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, k013, ____, k015 }, \ - { k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k113, ____, k115 }, \ - { k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, k211, ____, k213, ____, k215 }, \ - { k300, k301, k302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, ____, k315 }, \ - { k400, k401, k402, ____, ____, ____, k406, ____, ____, ____, ____, k411, k412, k413, k414, k415 } \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, ___, k0F }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, ___, k1F }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, ___, k2D, ___, k2F }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, ___, k3F }, \ + { k40, k41, k42, ___, ___, ___, k46, ___, ___, ___, ___, k4B, k4C, k4D, k4E, k4F } \ +} + +#define LAYOUT_65_iso_blocker_split_bs( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1F, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k1D, k2D, k2F, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3F, \ + k40, k41, k42, k46, k4B, k4C, k4D, k4E, k4F \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, ___, k1F }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, ___, k2D, ___, k2F }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, ___, k3F }, \ + { k40, k41, k42, ___, ___, ___, k46, ___, ___, ___, ___, k4B, k4C, k4D, k4E, k4F } \ } diff --git a/keyboards/kb_elmo/noah_avr/rules.mk b/keyboards/kb_elmo/noah_avr/rules.mk index 38ce53e309..c82741ffc6 100644 --- a/keyboards/kb_elmo/noah_avr/rules.mk +++ b/keyboards/kb_elmo/noah_avr/rules.mk @@ -20,3 +20,5 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow BLUETOOTH_ENABLE = no # Enable Bluetooth AUDIO_ENABLE = no # Audio output + +LAYOUTS = 65_ansi_blocker 65_ansi_blocker_split_bs 65_iso_blocker 65_iso_blocker_split_bs From c039796d9d6d341f16600b7032df056c0959df06 Mon Sep 17 00:00:00 2001 From: James Young <18669334+noroadsleft@users.noreply.github.com> Date: Thu, 19 Aug 2021 17:47:10 +0000 Subject: [PATCH 06/10] keebzdotnet F-Me Configurator fixes and codebase touch-up (#14077) * rename LAYOUT to LAYOUT_all * add info.json * override DYNAMIC_KEYMAP_LAYER_COUNT for via keymap The via keymap only initialized two layers without overriding the default value of DYNAMIC_KEYMAP_LAYER_COUNT (4). This commit sets DYNAMIC_KEYMAP_LAYER_COUNT for the via keymap to 2. --- keyboards/keebzdotnet/fme/fme.h | 2 +- keyboards/keebzdotnet/fme/info.json | 31 +++++++++++++++++++ .../keebzdotnet/fme/keymaps/default/keymap.c | 4 +-- .../keebzdotnet/fme/keymaps/via/config.h | 19 ++++++++++++ .../keebzdotnet/fme/keymaps/via/keymap.c | 4 +-- 5 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 keyboards/keebzdotnet/fme/info.json create mode 100644 keyboards/keebzdotnet/fme/keymaps/via/config.h diff --git a/keyboards/keebzdotnet/fme/fme.h b/keyboards/keebzdotnet/fme/fme.h index 912adf6451..ff8da5d409 100644 --- a/keyboards/keebzdotnet/fme/fme.h +++ b/keyboards/keebzdotnet/fme/fme.h @@ -20,7 +20,7 @@ along with this program. If not, see . #define ___ KC_NO -#define LAYOUT( \ +#define LAYOUT_all( \ k00, k13, k14, k12, k10, \ k11, k04, k02, k03, \ k22, k32, k21, k01 \ diff --git a/keyboards/keebzdotnet/fme/info.json b/keyboards/keebzdotnet/fme/info.json new file mode 100644 index 0000000000..2889cfa2d5 --- /dev/null +++ b/keyboards/keebzdotnet/fme/info.json @@ -0,0 +1,31 @@ +{ + "keyboard_name": "FMe", + "url": "", + "maintainer": "keebzdotnet", + "height": 4, + "width": 5, + "layout_aliases": { + "LAYOUT": "LAYOUT_all" + }, + "layouts": { + "LAYOUT_all": { + "layout": [ + {"label":"k00", "x":0, "y":0}, + {"label":"k13", "x":1, "y":0}, + {"label":"k14", "x":2, "y":0}, + {"label":"k12", "x":3, "y":0}, + {"label":"k10", "x":4, "y":0}, + + {"label":"k11", "x":0.25, "y":1}, + {"label":"k04", "x":1.25, "y":1}, + {"label":"k02", "x":2.25, "y":1}, + {"label":"k03", "x":3.25, "y":1, "w":1.75}, + + {"label":"k22", "x":0.25, "y":2, "w":2.75}, + {"label":"k32", "x":3, "y":3}, + {"label":"k21", "x":3, "y":2, "w":2}, + {"label":"k01", "x":4, "y":3} + ] + } + } +} diff --git a/keyboards/keebzdotnet/fme/keymaps/default/keymap.c b/keyboards/keebzdotnet/fme/keymaps/default/keymap.c index d6b52efd0f..a66b64eef0 100644 --- a/keyboards/keebzdotnet/fme/keymaps/default/keymap.c +++ b/keyboards/keebzdotnet/fme/keymaps/default/keymap.c @@ -17,13 +17,13 @@ along with this program. If not, see . #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT( + [0] = LAYOUT_all( KC_F, KC_U, KC_C, KC_K, KC_BSPC, KC_Y, KC_O, KC_U, MO(1), KC_SPC, KC_SPC, KC_SPC, KC_SPC ), - [1] = LAYOUT( + [1] = LAYOUT_all( RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS diff --git a/keyboards/keebzdotnet/fme/keymaps/via/config.h b/keyboards/keebzdotnet/fme/keymaps/via/config.h new file mode 100644 index 0000000000..651c46be21 --- /dev/null +++ b/keyboards/keebzdotnet/fme/keymaps/via/config.h @@ -0,0 +1,19 @@ +/* Copyright 2021 QMK / James Young (@noroadsleft) + * + * 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 DYNAMIC_KEYMAP_LAYER_COUNT 2 diff --git a/keyboards/keebzdotnet/fme/keymaps/via/keymap.c b/keyboards/keebzdotnet/fme/keymaps/via/keymap.c index d6b52efd0f..a66b64eef0 100644 --- a/keyboards/keebzdotnet/fme/keymaps/via/keymap.c +++ b/keyboards/keebzdotnet/fme/keymaps/via/keymap.c @@ -17,13 +17,13 @@ along with this program. If not, see . #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT( + [0] = LAYOUT_all( KC_F, KC_U, KC_C, KC_K, KC_BSPC, KC_Y, KC_O, KC_U, MO(1), KC_SPC, KC_SPC, KC_SPC, KC_SPC ), - [1] = LAYOUT( + [1] = LAYOUT_all( RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS From 8200804e96d1914ebad1948b52d6e1cec2e3ffcc Mon Sep 17 00:00:00 2001 From: kb-elmo Date: Thu, 19 Aug 2021 20:12:34 +0200 Subject: [PATCH 07/10] [Keyboard] Add Voice65 (#13744) Co-authored-by: Drashna Jaelre Co-authored-by: Ryan --- keyboards/owlab/voice65/hotswap/config.h | 90 ++++ keyboards/owlab/voice65/hotswap/halconf.h | 21 + keyboards/owlab/voice65/hotswap/hotswap.c | 451 +++++++++++++++++ keyboards/owlab/voice65/hotswap/hotswap.h | 46 ++ keyboards/owlab/voice65/hotswap/info.json | 80 +++ .../voice65/hotswap/keymaps/default/keymap.c | 36 ++ .../voice65/hotswap/keymaps/via/keymap.c | 51 ++ .../voice65/hotswap/keymaps/via/rules.mk | 2 + keyboards/owlab/voice65/hotswap/mcuconf.h | 22 + keyboards/owlab/voice65/hotswap/readme.md | 21 + keyboards/owlab/voice65/hotswap/rules.mk | 26 + keyboards/owlab/voice65/soldered/config.h | 89 ++++ keyboards/owlab/voice65/soldered/halconf.h | 21 + keyboards/owlab/voice65/soldered/info.json | 442 +++++++++++++++++ .../voice65/soldered/keymaps/default/keymap.c | 36 ++ .../voice65/soldered/keymaps/via/keymap.c | 50 ++ .../voice65/soldered/keymaps/via/rules.mk | 2 + keyboards/owlab/voice65/soldered/mcuconf.h | 22 + keyboards/owlab/voice65/soldered/readme.md | 21 + keyboards/owlab/voice65/soldered/rules.mk | 28 ++ keyboards/owlab/voice65/soldered/soldered.c | 455 ++++++++++++++++++ keyboards/owlab/voice65/soldered/soldered.h | 116 +++++ 22 files changed, 2128 insertions(+) create mode 100644 keyboards/owlab/voice65/hotswap/config.h create mode 100644 keyboards/owlab/voice65/hotswap/halconf.h create mode 100644 keyboards/owlab/voice65/hotswap/hotswap.c create mode 100644 keyboards/owlab/voice65/hotswap/hotswap.h create mode 100644 keyboards/owlab/voice65/hotswap/info.json create mode 100644 keyboards/owlab/voice65/hotswap/keymaps/default/keymap.c create mode 100644 keyboards/owlab/voice65/hotswap/keymaps/via/keymap.c create mode 100644 keyboards/owlab/voice65/hotswap/keymaps/via/rules.mk create mode 100644 keyboards/owlab/voice65/hotswap/mcuconf.h create mode 100644 keyboards/owlab/voice65/hotswap/readme.md create mode 100644 keyboards/owlab/voice65/hotswap/rules.mk create mode 100644 keyboards/owlab/voice65/soldered/config.h create mode 100644 keyboards/owlab/voice65/soldered/halconf.h create mode 100644 keyboards/owlab/voice65/soldered/info.json create mode 100644 keyboards/owlab/voice65/soldered/keymaps/default/keymap.c create mode 100644 keyboards/owlab/voice65/soldered/keymaps/via/keymap.c create mode 100644 keyboards/owlab/voice65/soldered/keymaps/via/rules.mk create mode 100644 keyboards/owlab/voice65/soldered/mcuconf.h create mode 100644 keyboards/owlab/voice65/soldered/readme.md create mode 100644 keyboards/owlab/voice65/soldered/rules.mk create mode 100644 keyboards/owlab/voice65/soldered/soldered.c create mode 100644 keyboards/owlab/voice65/soldered/soldered.h diff --git a/keyboards/owlab/voice65/hotswap/config.h b/keyboards/owlab/voice65/hotswap/config.h new file mode 100644 index 0000000000..4b6e8d8b83 --- /dev/null +++ b/keyboards/owlab/voice65/hotswap/config.h @@ -0,0 +1,90 @@ +/* +Copyright 2021 kb-elmo + +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 "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4F53 +#define PRODUCT_ID 0x564F +#define DEVICE_VER 0x0001 +#define MANUFACTURER Owl Studio +#define PRODUCT Voice65 Hotswap + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* Keyboard Matrix Assignments */ +#define MATRIX_ROW_PINS { B0, B1, B2, B10, B11 } +#define MATRIX_COL_PINS { A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A15, B8, B9, B12, B13 } + +/* COL2ROW, ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* NKRO */ +#ifdef NKRO_ENABLE +# define FORCE_NKRO +#endif + +/* RGB stripe */ +#define RGB_DI_PIN B15 +#ifdef RGB_DI_PIN +# define RGBLIGHT_EFFECT_ALTERNATING +# define RGBLIGHT_EFFECT_BREATHING +# define RGBLIGHT_EFFECT_CHRISTMAS +# define RGBLIGHT_EFFECT_KNIGHT +# define RGBLIGHT_EFFECT_RAINBOW_MOOD +# define RGBLIGHT_EFFECT_RAINBOW_SWIRL +# define RGBLIGHT_EFFECT_SNAKE +# define RGBLIGHT_EFFECT_STATIC_GRADIENT +# define RGBLIGHT_EFFECT_TWINKLE +# define RGBLED_NUM 20 +# define RGBLIGHT_HUE_STEP 8 +# define RGBLIGHT_SAT_STEP 8 +# define RGBLIGHT_VAL_STEP 10 +# define RGBLIGHT_LIMIT_VAL 180 +# define OWL_VOLUME_RANGE 50 +#endif + +/* RGB matrix */ +#ifdef RGB_MATRIX_ENABLE +# define USE_I2CV2 +# define RGB_MATRIX_DISABLE_KEYCODES +# define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects +# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended +# define RGB_MATRIX_KEYPRESSES +# define RGB_MATRIX_LED_PROCESS_LIMIT 4 +# define RGB_MATRIX_LED_FLUSH_LIMIT 26 +# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 +# define RGB_MATRIX_STARTUP_VAL 128 +# define DRIVER_ADDR_1 0b0110000 +# define DRIVER_ADDR_2 0b0110000 +# define DRIVER_COUNT 2 +# define DRIVER_1_LED_TOTAL 67 +# define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL +#endif + +/* Encoder */ +#define ENCODERS_PAD_A { B4 } +#define ENCODERS_PAD_B { B5 } +#define ENCODER_RESOLUTION 4 +#define TAP_CODE_DELAY 10 diff --git a/keyboards/owlab/voice65/hotswap/halconf.h b/keyboards/owlab/voice65/hotswap/halconf.h new file mode 100644 index 0000000000..f88be48211 --- /dev/null +++ b/keyboards/owlab/voice65/hotswap/halconf.h @@ -0,0 +1,21 @@ +/* Copyright 2021 kb-elmo + * + * 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 HAL_USE_I2C TRUE + +#include_next diff --git a/keyboards/owlab/voice65/hotswap/hotswap.c b/keyboards/owlab/voice65/hotswap/hotswap.c new file mode 100644 index 0000000000..343daafeb2 --- /dev/null +++ b/keyboards/owlab/voice65/hotswap/hotswap.c @@ -0,0 +1,451 @@ +/* Copyright 2021 kb-elmo + * + * 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 "hotswap.h" + +#ifdef RGB_MATRIX_ENABLE +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { + {0, CS3_SW1, CS2_SW1, CS1_SW1}, /* RGB0-ESC ROW0*/ + {0, CS6_SW1, CS5_SW1, CS4_SW1}, /* RGB1-1 */ + {0, CS9_SW1, CS8_SW1, CS7_SW1}, /* RGB2-2 */ + {0, CS12_SW1, CS11_SW1, CS10_SW1}, /* RGB3-3 */ + {0, CS15_SW1, CS14_SW1, CS13_SW1}, /* RGB4-4 */ + {0, CS18_SW1, CS17_SW1, CS16_SW1}, /* RGB5-5 */ + {0, CS21_SW1, CS20_SW1, CS19_SW1}, /* RGB6-6 */ + {0, CS24_SW1, CS23_SW1, CS22_SW1}, /* RGB7-7 */ + {0, CS27_SW1, CS26_SW1, CS25_SW1}, /* RGB8-8 */ + {0, CS30_SW1, CS29_SW1, CS28_SW1}, /* RGB9-9 */ + {0, CS33_SW1, CS32_SW1, CS31_SW1}, /* RGB10-0 */ + {0, CS36_SW1, CS35_SW1, CS34_SW1}, /* RGB11--- */ + {0, CS39_SW1, CS38_SW1, CS37_SW1}, /* RGB12-+= */ + {0, CS36_SW6, CS35_SW6, CS34_SW6}, /* RGB13-BS */ + {0, CS27_SW7, CS26_SW7, CS25_SW7}, /* RGB14-DEL */ + {0, CS3_SW2, CS2_SW2, CS1_SW2}, /* RGB15-TAB ----ROW1*/ + {0, CS6_SW2, CS5_SW2, CS4_SW2}, /* RGB16-Q */ + {0, CS9_SW2, CS8_SW2, CS7_SW2}, /* RGB17-W */ + {0, CS12_SW2, CS11_SW2, CS10_SW2}, /* RGB18-E */ + {0, CS15_SW2, CS14_SW2, CS13_SW2}, /* RGB19-R */ + {0, CS18_SW2, CS17_SW2, CS16_SW2}, /* RGB20-T */ + {0, CS21_SW2, CS20_SW2, CS19_SW2}, /* RGB21-Y */ + {0, CS24_SW2, CS23_SW2, CS22_SW2}, /* RGB22-U */ + {0, CS27_SW2, CS26_SW2, CS25_SW2}, /* RGB23-I */ + {0, CS30_SW2, CS29_SW2, CS28_SW2}, /* RGB24-O */ + {0, CS33_SW2, CS32_SW2, CS31_SW2}, /* RGB25-P */ + {0, CS36_SW2, CS35_SW2, CS34_SW2}, /* RGB26-[ */ + {0, CS39_SW2, CS38_SW2, CS37_SW2}, /* RGB27-] */ + {0, CS39_SW6, CS38_SW6, CS37_SW6}, /* RGB28-\ */ + {0, CS30_SW7, CS29_SW7, CS28_SW7}, /* RGB29-PGUP */ + {0, CS3_SW3, CS2_SW3, CS1_SW3}, /* RGB30-CAPS---ROW2*/ + {0, CS6_SW3, CS5_SW3, CS4_SW3}, /* RGB31-A-- */ + {0, CS9_SW3, CS8_SW3, CS7_SW3}, /* RGB32-S-- */ + {0, CS12_SW3, CS11_SW3, CS10_SW3}, /* RGB33-D-- */ + {0, CS15_SW3, CS14_SW3, CS13_SW3}, /* RGB34-F-- */ + {0, CS18_SW3, CS17_SW3, CS16_SW3}, /* RGB35-G-- */ + {0, CS21_SW3, CS20_SW3, CS19_SW3}, /* RGB36-H-- */ + {0, CS24_SW3, CS23_SW3, CS22_SW3}, /* RGB37-J-- */ + {0, CS27_SW3, CS26_SW3, CS25_SW3}, /* RGB38-K-- */ + {0, CS30_SW3, CS29_SW3, CS28_SW3}, /* RGB39-L-- */ + {0, CS33_SW3, CS32_SW3, CS31_SW3}, /* RGB40-;:- */ + {0, CS36_SW3, CS35_SW3, CS34_SW3}, /* RGB41-''- */ + {0, CS39_SW3, CS38_SW3, CS37_SW3}, /* RGB42-ENTER- */ + {0, CS33_SW7, CS32_SW7, CS31_SW7}, /* RGB43-PGDN */ + {0, CS3_SW4, CS2_SW4, CS1_SW4}, /* RGB44-LSF --ROW3*/ + {0, CS6_SW4, CS5_SW4, CS4_SW4}, /* RGB45-Z -*/ + {0, CS9_SW4, CS8_SW4, CS7_SW4}, /* RGB46-X -*/ + {0, CS12_SW4, CS11_SW4, CS10_SW4}, /* RGB47-C -*/ + {0, CS15_SW4, CS14_SW4, CS13_SW4}, /* RGB48-V -*/ + {0, CS18_SW4, CS17_SW4, CS16_SW4}, /* RGB49-B -*/ + {0, CS21_SW4, CS20_SW4, CS19_SW4}, /* RGB50-N -*/ + {0, CS24_SW4, CS23_SW4, CS22_SW4}, /* RGB51-M -*/ + {0, CS27_SW4, CS26_SW4, CS25_SW4}, /* RGB52-,< -*/ + {0, CS30_SW4, CS29_SW4, CS28_SW4}, /* RGB53->. -*/ + {0, CS33_SW4, CS32_SW4, CS31_SW4}, /* RGB54-? -*/ + {0, CS36_SW4, CS35_SW4, CS34_SW4}, /* RGB55-RSF -*/ + {0, CS39_SW4, CS38_SW4, CS37_SW4}, /* RGB56-UP -*/ + {0, CS36_SW7, CS35_SW7, CS34_SW7}, /* RGB57--MO-- */ + {0, CS3_SW5, CS2_SW5, CS1_SW5}, /* RGB58-lct-- row4*/ + {0, CS6_SW5, CS5_SW5, CS4_SW5}, /* RGB59-lwin- */ + {0, CS9_SW5, CS8_SW5, CS7_SW5}, /* RGB60-lalt- */ + {0, CS18_SW5, CS17_SW5, CS16_SW5}, /* RGB61-sp- */ + {0, CS30_SW5, CS29_SW5, CS28_SW5}, /* RGB62-ralt- */ + {0, CS33_SW5, CS32_SW5, CS31_SW5}, /* RGB63-rct- */ + {0, CS36_SW5, CS35_SW5, CS34_SW5}, /* RGB64-left- */ + {0, CS39_SW5, CS38_SW5, CS37_SW5}, /* RGB65-dn- */ + {0, CS39_SW7, CS38_SW7, CS37_SW7}, /* RGB66-right- */ +}; + +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, + { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 }, + { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, NO_LED, 43 }, + { 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, NO_LED, 56, 57 }, + { 58, 59, 60, NO_LED, NO_LED, 61, NO_LED, NO_LED, NO_LED, 62, 63, 64, NO_LED, 65, 66 } +}, { + { 0, 0 }, { 16, 0 }, { 32, 0 }, { 48, 0 }, { 64, 0 }, { 80, 0 }, { 96, 0 }, { 112, 0 }, { 128, 0 }, { 144, 0 }, { 160, 0 }, { 176, 0 }, { 192, 0 }, { 208, 0 }, { 224, 0 }, + { 2, 16 }, { 18, 16 }, { 34, 16 }, { 50, 16 }, { 66, 16 }, { 82, 16 }, { 98, 16 }, { 114, 16 }, { 130, 16 }, { 146, 16 }, { 162, 16 }, { 178, 16 }, { 194, 16 }, { 210, 16 }, { 224, 16 }, + { 4, 32 }, { 20, 32 }, { 36, 32 }, { 52, 32 }, { 68, 32 }, { 84, 32 }, { 100, 32 }, { 116, 32 }, { 132, 32 }, { 148, 32 }, { 164, 32 }, { 180, 32 }, { 196, 32 }, { 224, 32 }, + { 8, 48 }, { 24, 48 }, { 40, 48 }, { 56, 48 }, { 72, 48 }, { 88, 48 }, { 104, 48 }, { 120, 48 }, { 136, 48 }, { 152, 48 }, { 168, 48 }, { 184, 48 }, { 208, 48 }, { 224, 48 }, + { 2, 64 }, { 18, 64 }, { 34, 64 }, { 82, 64 }, { 146, 64 }, { 162, 64 }, { 178, 64 }, { 210, 64 }, { 224, 64 } +}, { + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, + } +}; + + +#endif + +__attribute__ ((weak)) +void rgb_matrix_indicators_user(void) +{ + if (host_keyboard_led_state().caps_lock) + { + rgb_matrix_set_color(31, 255, 255, 255); + } else { + rgb_matrix_set_color(31, 0, 0, 0); + } +} + +enum encoder_modes{ + ENCODER_MODE_ONE = 0, + ENCODER_MODE_TWO, + ENCODER_MODE_THREE, +}; + +keyboard_config_t keyboard_config; +rgblight_config_t rgblight_config; + +uint8_t pre_hue, pre_sat, pre_val; +uint8_t previous_rgb_mode = 0; +uint8_t dir_hue, dir_sat; + +bool encoder_in = false; +uint32_t encoder_timer; + +bool encoder_ani_start= false; +uint32_t encoder_ani_timer = 0; + +bool encoder_direction_start = false; +uint32_t encoder_direction_timer = 0; + + +bool lizm_restart_snake = false; +void rgblight_snake_restart(uint8_t hue, uint8_t sat, uint8_t val){ + lizm_restart_snake = true; // restart signal to local each effect + rgblight_config.hue = hue; + rgblight_config.sat = sat; + rgblight_config.val = val; +} + + +void keyboard_post_init_kb(void){ + keyboard_config.raw = eeconfig_read_kb(); + if( keyboard_config.encoder_mode_index > ENCODER_MODE_THREE ){ + keyboard_config.encoder_mode_index = ENCODER_MODE_ONE; + eeconfig_update_kb(keyboard_config.raw); + } +} + +void switch_encoder_mode(uint8_t mode){ + switch(mode){ + case ENCODER_MODE_ONE: + dir_hue = 88; + dir_sat = 255; + break; + + case ENCODER_MODE_TWO: + dir_hue = 0; + dir_sat = 240; + break; + + case ENCODER_MODE_THREE: + dir_hue = 176; + dir_sat = 255; + break; + } + rgblight_sethsv_noeeprom(dir_hue,dir_sat,pre_val); +} + + +void init_encoder_mode(uint8_t mode){ + previous_rgb_mode = rgblight_get_mode(); + pre_hue = rgblight_get_hue(); + pre_sat = rgblight_get_sat(); + pre_val = rgblight_get_val(); + encoder_in = true; + + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + + switch_encoder_mode(mode); +} + + +void set_encoder_mode(uint8_t mode){ + if(encoder_in == false){ + init_encoder_mode(mode); + }else{ + switch_encoder_mode(mode); + } + eeconfig_update_kb(keyboard_config.raw); + encoder_timer = timer_read32(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case RGB_MOD: + case RGB_RMOD: + case RGB_HUI: + case RGB_HUD: + case RGB_SAI: + case RGB_SAD: + case RGB_VAI: + case RGB_VAD: + + if(encoder_in){ + return false; + } + break; + + case KC_F13: + rgb_matrix_toggle(); + break; + + case KC_F14: + rgb_matrix_step(); + break; + + case KC_F15: + rgb_matrix_step_reverse(); + break; + + case KC_F16: + rgb_matrix_increase_hue(); //Increase the hue for effect range LEDs + break; + + case KC_F17: + rgb_matrix_decrease_hue(); //Decrease the hue for effect range LEDs + break; + + case KC_F18: + rgb_matrix_increase_sat(); //Increase the saturation for effect range LEDs + break; + + case KC_F19: + rgb_matrix_decrease_sat(); //Decrease the saturation for effect range LEDs + break; + + case KC_F20: + rgb_matrix_increase_val(); //Increase the value for effect range LEDs + break; + + case KC_F21: + rgb_matrix_decrease_val();//Decrease the value for effect range LEDs + break; + + case KC_F22: //change encoder mode upward + + if(!encoder_direction_start){ + if(keyboard_config.encoder_mode_index < ENCODER_MODE_THREE){ + keyboard_config.encoder_mode_index++; + } + else{ + keyboard_config.encoder_mode_index = ENCODER_MODE_ONE; + } + set_encoder_mode(keyboard_config.encoder_mode_index); + } + return false; + + case KC_F23: + if(!encoder_direction_start){ + if(keyboard_config.encoder_mode_index > ENCODER_MODE_ONE){ + keyboard_config.encoder_mode_index--; + } + else{ + keyboard_config.encoder_mode_index = ENCODER_MODE_THREE; + } + set_encoder_mode(keyboard_config.encoder_mode_index); + } + return false; + + default: + break; + } + } + return process_record_user(keycode, record); +} + + +void matrix_scan_kb(void) { + if(encoder_in){ + if(timer_elapsed32(encoder_timer) > 5000){ + rgblight_mode(previous_rgb_mode); + rgblight_sethsv(pre_hue, pre_sat, pre_val); + encoder_in = false; + } + } + + if(encoder_ani_start){ + if(timer_elapsed32(encoder_ani_timer) > VOLUME_ANIMATION_TIMER){ + encoder_ani_start = false; + rgblight_sethsv_noeeprom(0,0,0); + } + } + + if(encoder_direction_start){ + if(timer_elapsed32(encoder_direction_timer) > (VOLUME_ANIMATION_TIMER+1500)){ + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + rgblight_sethsv_noeeprom(dir_hue, dir_sat, pre_val); + encoder_direction_start = false; + } + } + matrix_scan_user(); +} + + +void set_volume_animation(bool increase){ + if(!encoder_ani_start){ + rgblight_snake_restart(dir_hue, dir_sat, pre_val); + } + + if(increase){ + rgblight_mode_noeeprom(17); + } else { + rgblight_mode_noeeprom(18); + } + + encoder_ani_timer = timer_read32(); + encoder_direction_timer = encoder_ani_timer; + encoder_ani_start = true; + encoder_direction_start = true; +} + + +bool encoder_update_kb(uint8_t index, bool clockwise) { + uint8_t layer_now = keyboard_config.encoder_mode_index +1; + uint16_t encoder_cw_keycode = keymap_key_to_keycode(layer_now, (keypos_t){.row=2, .col=1 }); + uint16_t encoder_ccw_keycode = keymap_key_to_keycode(layer_now, (keypos_t){.row=2, .col=2 }); + if (index == 0) { /* First encoder */ + if(encoder_in == false){ + init_encoder_mode(keyboard_config.encoder_mode_index); + } + + if (!clockwise) { + switch(encoder_cw_keycode) { + + case KC_F13: + rgb_matrix_toggle(); + break; + + case KC_F14: + rgb_matrix_step(); + break; + + case KC_F15: + rgb_matrix_step_reverse(); + break; + + case KC_F16: + rgb_matrix_increase_hue(); //Increase the hue for effect range LEDs + break; + + case KC_F17: + rgb_matrix_decrease_hue(); //Decrease the hue for effect range LEDs + break; + + case KC_F18: + rgb_matrix_increase_sat(); //Increase the saturation for effect range LEDs + break; + + case KC_F19: + rgb_matrix_decrease_sat(); //Decrease the saturation for effect range LEDs + break; + + case KC_F20: + rgb_matrix_increase_val(); //Increase the value for effect range LEDs + break; + + case KC_F21: + rgb_matrix_decrease_val();//Decrease the value for effect range LEDs + break; + + case KC_VOLU: + case KC_VOLD: + tap_code(encoder_cw_keycode); + break; + + default: + tap_code(encoder_cw_keycode); + break; + } + set_volume_animation(true); + } else { + switch(encoder_ccw_keycode) { + + case KC_F13: + rgb_matrix_toggle(); + break; + + case KC_F14: + rgb_matrix_step(); + break; + + case KC_F15: + rgb_matrix_step_reverse(); + break; + + case KC_F16: + rgb_matrix_increase_hue(); //Increase the hue for effect range LEDs + break; + + case KC_F17: + rgb_matrix_decrease_hue(); //Decrease the hue for effect range LEDs + break; + + case KC_F18: + rgb_matrix_increase_sat(); //Increase the saturation for effect range LEDs + break; + + case KC_F19: + rgb_matrix_decrease_sat(); //Decrease the saturation for effect range LEDs + break; + + case KC_F20: + rgb_matrix_increase_val(); //Increase the value for effect range LEDs + break; + + case KC_F21: + rgb_matrix_decrease_val();//Decrease the value for effect range LEDs + break; + + case KC_VOLU: + case KC_VOLD: + tap_code(encoder_ccw_keycode); + break; + + default: + tap_code(encoder_ccw_keycode); + break; + } + set_volume_animation(false); + } + encoder_timer = timer_read32(); + } + return true; +} diff --git a/keyboards/owlab/voice65/hotswap/hotswap.h b/keyboards/owlab/voice65/hotswap/hotswap.h new file mode 100644 index 0000000000..cae25af596 --- /dev/null +++ b/keyboards/owlab/voice65/hotswap/hotswap.h @@ -0,0 +1,46 @@ +/* Copyright 2021 kb-elmo + * + * 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 "quantum.h" + +#define ____ KC_NO + +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K400, K401, K402, K405, K409, K410, K411, K413, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, ____, K214 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, ____, K313, K314 }, \ + { K400, K401, K402, ____, ____, K405, ____, ____, ____, K409, K410, K411, ____, K413, K414 } \ +} + +typedef union { + uint32_t raw; + struct { + uint8_t encoder_mode_index :8; + }; +} keyboard_config_t; + +extern keyboard_config_t keyboard_config; + +#define VOLUME_ANIMATION_TIMER 580 diff --git a/keyboards/owlab/voice65/hotswap/info.json b/keyboards/owlab/voice65/hotswap/info.json new file mode 100644 index 0000000000..93cc3521c4 --- /dev/null +++ b/keyboards/owlab/voice65/hotswap/info.json @@ -0,0 +1,80 @@ +{ + "keyboard_name": "voice65 hotswap", + "url": "https://www.popkeyboard.com/products/67968vn00mzx", + "maintainer": "kb-elmo", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6, "y":0}, + {"x":7, "y":0}, + {"x":8, "y":0}, + {"x":9, "y":0}, + {"x":10, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0, "w":2}, + {"x":15, "y":0}, + {"x":0, "y":1, "w":1.5}, + {"x":1.5, "y":1}, + {"x":2.5, "y":1}, + {"x":3.5, "y":1}, + {"x":4.5, "y":1}, + {"x":5.5, "y":1}, + {"x":6.5, "y":1}, + {"x":7.5, "y":1}, + {"x":8.5, "y":1}, + {"x":9.5, "y":1}, + {"x":10.5, "y":1}, + {"x":11.5, "y":1}, + {"x":12.5, "y":1}, + {"x":13.5, "y":1, "w":1.5}, + {"x":15, "y":1}, + {"x":0, "y":2, "w":1.75}, + {"x":1.75, "y":2}, + {"x":2.75, "y":2}, + {"x":3.75, "y":2}, + {"x":4.75, "y":2}, + {"x":5.75, "y":2}, + {"x":6.75, "y":2}, + {"x":7.75, "y":2}, + {"x":8.75, "y":2}, + {"x":9.75, "y":2}, + {"x":10.75, "y":2}, + {"x":11.75, "y":2}, + {"x":12.75, "y":2, "w":2.25}, + {"x":15, "y":2}, + {"x":0, "y":3, "w":2.25}, + {"x":2.25, "y":3}, + {"x":3.25, "y":3}, + {"x":4.25, "y":3}, + {"x":5.25, "y":3}, + {"x":6.25, "y":3}, + {"x":7.25, "y":3}, + {"x":8.25, "y":3}, + {"x":9.25, "y":3}, + {"x":10.25, "y":3}, + {"x":11.25, "y":3}, + {"x":12.25, "y":3, "w":1.75}, + {"x":14, "y":3}, + {"x":15, "y":3}, + {"x":0, "y":4, "w":1.25}, + {"x":1.25, "y":4, "w":1.25}, + {"x":2.5, "y":4, "w":1.25}, + {"x":3.75, "y":4, "w":6.25}, + {"x":10, "y":4, "w":1.25}, + {"x":11.25, "y":4, "w":1.25}, + {"x":13, "y":4}, + {"x":14, "y":4}, + {"x":15, "y":4} + ] + } + } +} diff --git a/keyboards/owlab/voice65/hotswap/keymaps/default/keymap.c b/keyboards/owlab/voice65/hotswap/keymaps/default/keymap.c new file mode 100644 index 0000000000..406da3d701 --- /dev/null +++ b/keyboards/owlab/voice65/hotswap/keymaps/default/keymap.c @@ -0,0 +1,36 @@ +/* Copyright 2021 kb-elmo + * + * 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 + +// How long (in ms) to wait between animation steps for the snake mode +const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 35, 20}; + +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_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, MO(1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = 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, KC_TRNS, RESET, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_HOME, + 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_END, + KC_TRNS, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_TRNS, KC_TRNS, KC_F22, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F23, KC_TRNS + ) +}; diff --git a/keyboards/owlab/voice65/hotswap/keymaps/via/keymap.c b/keyboards/owlab/voice65/hotswap/keymaps/via/keymap.c new file mode 100644 index 0000000000..c058aad5e5 --- /dev/null +++ b/keyboards/owlab/voice65/hotswap/keymaps/via/keymap.c @@ -0,0 +1,51 @@ +/* Copyright 2021 kb-elmo + * + * 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 + +// How long (in ms) to wait between animation steps for the snake mode +const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 35, 20}; + +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_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, MO(1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = 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, KC_TRNS, RESET, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_HOME, + 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_END, + KC_TRNS, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_TRNS, KC_TRNS, KC_F22, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F23, KC_TRNS + ), + [2] = LAYOUT( + 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, 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 + ), + [3] = LAYOUT( + 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, 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/owlab/voice65/hotswap/keymaps/via/rules.mk b/keyboards/owlab/voice65/hotswap/keymaps/via/rules.mk new file mode 100644 index 0000000000..36b7ba9cbc --- /dev/null +++ b/keyboards/owlab/voice65/hotswap/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +LTO_ENABLE = yes diff --git a/keyboards/owlab/voice65/hotswap/mcuconf.h b/keyboards/owlab/voice65/hotswap/mcuconf.h new file mode 100644 index 0000000000..808ff76540 --- /dev/null +++ b/keyboards/owlab/voice65/hotswap/mcuconf.h @@ -0,0 +1,22 @@ +/* Copyright 2021 kb-elmo + * + * 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_next + +#undef STM32_I2C_USE_I2C1 +#define STM32_I2C_USE_I2C1 TRUE diff --git a/keyboards/owlab/voice65/hotswap/readme.md b/keyboards/owlab/voice65/hotswap/readme.md new file mode 100644 index 0000000000..3eb26792e3 --- /dev/null +++ b/keyboards/owlab/voice65/hotswap/readme.md @@ -0,0 +1,21 @@ +# Voice65 - hotswap PCB + +![voice65](https://i.imgur.com/okI07scl.jpg) + +A 65% with an LED strip and a scroll wheel + +* Keyboard Maintainer: [kb-elmo](https://github.com/kb-elmo) +* Hardware Supported: Voice65 hotswap PCB +* Hardware Availability: Ended groupbuy: https://www.popkeyboard.com/products/67968vn00mzx + +Make example for this keyboard (after setting up your build environment): + + make owlab/voice65/hotswap:default + +Flashing example for this keyboard: + + make owlab/voice65/hotswap:default:flash + +**Bootloader:** Press the physical reset button on the bottom side of the PCB (labeled SW1) or hold down ESC while plugging in the board. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/owlab/voice65/hotswap/rules.mk b/keyboards/owlab/voice65/hotswap/rules.mk new file mode 100644 index 0000000000..7f1bc2ed9d --- /dev/null +++ b/keyboards/owlab/voice65/hotswap/rules.mk @@ -0,0 +1,26 @@ +# MCU name +MCU = STM32F303 + +# Bootloader selection +BOOTLOADER = stm32-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +BLUETOOTH_ENABLE = no # Enable Bluetooth +AUDIO_ENABLE = no # Audio output +ENCODER_ENABLE = yes # Rotary encoder + +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = IS31FL3741 diff --git a/keyboards/owlab/voice65/soldered/config.h b/keyboards/owlab/voice65/soldered/config.h new file mode 100644 index 0000000000..bb7ec6102c --- /dev/null +++ b/keyboards/owlab/voice65/soldered/config.h @@ -0,0 +1,89 @@ +/* +Copyright 2021 kb-elmo + +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 "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4F53 +#define PRODUCT_ID 0x5657 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Owl Studio +#define PRODUCT Voice65 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* Keyboard Matrix Assignments */ +#define MATRIX_ROW_PINS { B0, B1, B2, B10, B11 } +#define MATRIX_COL_PINS { A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A15, B8, B9, B12, B13 } + +/* COL2ROW, ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 +/* NKRO */ +#ifdef NKRO_ENABLE +# define FORCE_NKRO +#endif + +/* RGB stripe */ +#define RGB_DI_PIN B15 +#ifdef RGB_DI_PIN +# define RGBLIGHT_EFFECT_ALTERNATING +# define RGBLIGHT_EFFECT_BREATHING +# define RGBLIGHT_EFFECT_CHRISTMAS +# define RGBLIGHT_EFFECT_KNIGHT +# define RGBLIGHT_EFFECT_RAINBOW_MOOD +# define RGBLIGHT_EFFECT_RAINBOW_SWIRL +# define RGBLIGHT_EFFECT_SNAKE +# define RGBLIGHT_EFFECT_STATIC_GRADIENT +# define RGBLIGHT_EFFECT_TWINKLE +# define RGBLED_NUM 20 +# define RGBLIGHT_HUE_STEP 8 +# define RGBLIGHT_SAT_STEP 8 +# define RGBLIGHT_VAL_STEP 10 +# define RGBLIGHT_LIMIT_VAL 180 +# define OWL_VOLUME_RANGE 50 +#endif + +/* RGB matrix*/ +#ifdef RGB_MATRIX_ENABLE +# define USE_I2CV2 +# define RGB_MATRIX_DISABLE_KEYCODES +# define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects +# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended +# define RGB_MATRIX_KEYPRESSES +# define RGB_MATRIX_LED_PROCESS_LIMIT 4 +# define RGB_MATRIX_LED_FLUSH_LIMIT 26 +# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 +# define RGB_MATRIX_STARTUP_VAL 128 +# define DRIVER_ADDR_1 0b0110000 +# define DRIVER_ADDR_2 0b0110000 +# define DRIVER_COUNT 2 +# define DRIVER_1_LED_TOTAL 71 +# define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL +#endif + +/* Encoder */ +#define ENCODERS_PAD_A { B4 } +#define ENCODERS_PAD_B { B5 } +#define ENCODER_RESOLUTION 4 +#define TAP_CODE_DELAY 10 diff --git a/keyboards/owlab/voice65/soldered/halconf.h b/keyboards/owlab/voice65/soldered/halconf.h new file mode 100644 index 0000000000..f88be48211 --- /dev/null +++ b/keyboards/owlab/voice65/soldered/halconf.h @@ -0,0 +1,21 @@ +/* Copyright 2021 kb-elmo + * + * 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 HAL_USE_I2C TRUE + +#include_next diff --git a/keyboards/owlab/voice65/soldered/info.json b/keyboards/owlab/voice65/soldered/info.json new file mode 100644 index 0000000000..40d49a7a99 --- /dev/null +++ b/keyboards/owlab/voice65/soldered/info.json @@ -0,0 +1,442 @@ +{ + "keyboard_name": "voice65 soldered", + "url": "https://www.popkeyboard.com/products/67968vn00mzx", + "maintainer": "kb-elmo", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6, "y":0}, + {"x":7, "y":0}, + {"x":8, "y":0}, + {"x":9, "y":0}, + {"x":10, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0}, + {"x":14, "y":0}, + {"x":15, "y":0}, + {"x":0, "y":1, "w":1.5}, + {"x":1.5, "y":1}, + {"x":2.5, "y":1}, + {"x":3.5, "y":1}, + {"x":4.5, "y":1}, + {"x":5.5, "y":1}, + {"x":6.5, "y":1}, + {"x":7.5, "y":1}, + {"x":8.5, "y":1}, + {"x":9.5, "y":1}, + {"x":10.5, "y":1}, + {"x":11.5, "y":1}, + {"x":12.5, "y":1}, + {"x":13.5, "y":1, "w":1.5}, + {"x":15, "y":1}, + {"x":0, "y":2, "w":1.75}, + {"x":1.75, "y":2}, + {"x":2.75, "y":2}, + {"x":3.75, "y":2}, + {"x":4.75, "y":2}, + {"x":5.75, "y":2}, + {"x":6.75, "y":2}, + {"x":7.75, "y":2}, + {"x":8.75, "y":2}, + {"x":9.75, "y":2}, + {"x":10.75, "y":2}, + {"x":11.75, "y":2}, + {"x":12.75, "y":2, "w":2.25}, + {"x":15, "y":2}, + {"x":0, "y":3, "w":1.25}, + {"x":1.25, "y":3}, + {"x":2.25, "y":3}, + {"x":3.25, "y":3}, + {"x":4.25, "y":3}, + {"x":5.25, "y":3}, + {"x":6.25, "y":3}, + {"x":7.25, "y":3}, + {"x":8.25, "y":3}, + {"x":9.25, "y":3}, + {"x":10.25, "y":3}, + {"x":11.25, "y":3}, + {"x":12.25, "y":3, "w":1.75}, + {"x":14, "y":3}, + {"x":15, "y":3}, + {"x":0, "y":4, "w":1.25}, + {"x":1.25, "y":4, "w":1.25}, + {"x":2.5, "y":4, "w":1.25}, + {"x":3.75, "y":4, "w":2.25}, + {"x":6, "y":4, "w":1.25}, + {"x":7.25, "y":4, "w":2.75}, + {"x":10, "y":4, "w":1.25}, + {"x":11.25, "y":4, "w":1.25}, + {"x":13, "y":4}, + {"x":14, "y":4}, + {"x":15, "y":4} + ] + }, + "LAYOUT_65_ansi_blocker": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6, "y":0}, + {"x":7, "y":0}, + {"x":8, "y":0}, + {"x":9, "y":0}, + {"x":10, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0, "w":2}, + {"x":15, "y":0}, + {"x":0, "y":1, "w":1.5}, + {"x":1.5, "y":1}, + {"x":2.5, "y":1}, + {"x":3.5, "y":1}, + {"x":4.5, "y":1}, + {"x":5.5, "y":1}, + {"x":6.5, "y":1}, + {"x":7.5, "y":1}, + {"x":8.5, "y":1}, + {"x":9.5, "y":1}, + {"x":10.5, "y":1}, + {"x":11.5, "y":1}, + {"x":12.5, "y":1}, + {"x":13.5, "y":1, "w":1.5}, + {"x":15, "y":1}, + {"x":0, "y":2, "w":1.75}, + {"x":1.75, "y":2}, + {"x":2.75, "y":2}, + {"x":3.75, "y":2}, + {"x":4.75, "y":2}, + {"x":5.75, "y":2}, + {"x":6.75, "y":2}, + {"x":7.75, "y":2}, + {"x":8.75, "y":2}, + {"x":9.75, "y":2}, + {"x":10.75, "y":2}, + {"x":11.75, "y":2}, + {"x":12.75, "y":2, "w":2.25}, + {"x":15, "y":2}, + {"x":0, "y":3, "w":2.25}, + {"x":2.25, "y":3}, + {"x":3.25, "y":3}, + {"x":4.25, "y":3}, + {"x":5.25, "y":3}, + {"x":6.25, "y":3}, + {"x":7.25, "y":3}, + {"x":8.25, "y":3}, + {"x":9.25, "y":3}, + {"x":10.25, "y":3}, + {"x":11.25, "y":3}, + {"x":12.25, "y":3, "w":1.75}, + {"x":14, "y":3}, + {"x":15, "y":3}, + {"x":0, "y":4, "w":1.25}, + {"x":1.25, "y":4, "w":1.25}, + {"x":2.5, "y":4, "w":1.25}, + {"x":3.75, "y":4, "w":6.25}, + {"x":10, "y":4, "w":1.25}, + {"x":11.25, "y":4, "w":1.25}, + {"x":13, "y":4}, + {"x":14, "y":4}, + {"x":15, "y":4} + ] + }, + "LAYOUT_65_ansi_blocker_split_bs": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6, "y":0}, + {"x":7, "y":0}, + {"x":8, "y":0}, + {"x":9, "y":0}, + {"x":10, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0}, + {"x":14, "y":0}, + {"x":15, "y":0}, + {"x":0, "y":1, "w":1.5}, + {"x":1.5, "y":1}, + {"x":2.5, "y":1}, + {"x":3.5, "y":1}, + {"x":4.5, "y":1}, + {"x":5.5, "y":1}, + {"x":6.5, "y":1}, + {"x":7.5, "y":1}, + {"x":8.5, "y":1}, + {"x":9.5, "y":1}, + {"x":10.5, "y":1}, + {"x":11.5, "y":1}, + {"x":12.5, "y":1}, + {"x":13.5, "y":1, "w":1.5}, + {"x":15, "y":1}, + {"x":0, "y":2, "w":1.75}, + {"x":1.75, "y":2}, + {"x":2.75, "y":2}, + {"x":3.75, "y":2}, + {"x":4.75, "y":2}, + {"x":5.75, "y":2}, + {"x":6.75, "y":2}, + {"x":7.75, "y":2}, + {"x":8.75, "y":2}, + {"x":9.75, "y":2}, + {"x":10.75, "y":2}, + {"x":11.75, "y":2}, + {"x":12.75, "y":2, "w":2.25}, + {"x":15, "y":2}, + {"x":0, "y":3, "w":2.25}, + {"x":2.25, "y":3}, + {"x":3.25, "y":3}, + {"x":4.25, "y":3}, + {"x":5.25, "y":3}, + {"x":6.25, "y":3}, + {"x":7.25, "y":3}, + {"x":8.25, "y":3}, + {"x":9.25, "y":3}, + {"x":10.25, "y":3}, + {"x":11.25, "y":3}, + {"x":12.25, "y":3, "w":1.75}, + {"x":14, "y":3}, + {"x":15, "y":3}, + {"x":0, "y":4, "w":1.25}, + {"x":1.25, "y":4, "w":1.25}, + {"x":2.5, "y":4, "w":1.25}, + {"x":3.75, "y":4, "w":6.25}, + {"x":10, "y":4, "w":1.25}, + {"x":11.25, "y":4, "w":1.25}, + {"x":13, "y":4}, + {"x":14, "y":4}, + {"x":15, "y":4} + ] + }, + "LAYOUT_65_ansi_blocker_tsangan": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6, "y":0}, + {"x":7, "y":0}, + {"x":8, "y":0}, + {"x":9, "y":0}, + {"x":10, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0, "w":2}, + {"x":15, "y":0}, + {"x":0, "y":1, "w":1.5}, + {"x":1.5, "y":1}, + {"x":2.5, "y":1}, + {"x":3.5, "y":1}, + {"x":4.5, "y":1}, + {"x":5.5, "y":1}, + {"x":6.5, "y":1}, + {"x":7.5, "y":1}, + {"x":8.5, "y":1}, + {"x":9.5, "y":1}, + {"x":10.5, "y":1}, + {"x":11.5, "y":1}, + {"x":12.5, "y":1}, + {"x":13.5, "y":1, "w":1.5}, + {"x":15, "y":1}, + {"x":0, "y":2, "w":1.75}, + {"x":1.75, "y":2}, + {"x":2.75, "y":2}, + {"x":3.75, "y":2}, + {"x":4.75, "y":2}, + {"x":5.75, "y":2}, + {"x":6.75, "y":2}, + {"x":7.75, "y":2}, + {"x":8.75, "y":2}, + {"x":9.75, "y":2}, + {"x":10.75, "y":2}, + {"x":11.75, "y":2}, + {"x":12.75, "y":2, "w":2.25}, + {"x":15, "y":2}, + {"x":0, "y":3, "w":2.25}, + {"x":2.25, "y":3}, + {"x":3.25, "y":3}, + {"x":4.25, "y":3}, + {"x":5.25, "y":3}, + {"x":6.25, "y":3}, + {"x":7.25, "y":3}, + {"x":8.25, "y":3}, + {"x":9.25, "y":3}, + {"x":10.25, "y":3}, + {"x":11.25, "y":3}, + {"x":12.25, "y":3, "w":1.75}, + {"x":14, "y":3}, + {"x":15, "y":3}, + {"x":0, "y":4, "w":1.5}, + {"x":1.5, "y":4}, + {"x":2.5, "y":4, "w":1.5}, + {"x":4, "y":4, "w":7}, + {"x":11, "y":4, "w":1.5}, + {"x":13, "y":4}, + {"x":14, "y":4}, + {"x":15, "y":4} + ] + }, + "LAYOUT_65_iso_blocker": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6, "y":0}, + {"x":7, "y":0}, + {"x":8, "y":0}, + {"x":9, "y":0}, + {"x":10, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0, "w":2}, + {"x":15, "y":0}, + {"x":0, "y":1, "w":1.5}, + {"x":1.5, "y":1}, + {"x":2.5, "y":1}, + {"x":3.5, "y":1}, + {"x":4.5, "y":1}, + {"x":5.5, "y":1}, + {"x":6.5, "y":1}, + {"x":7.5, "y":1}, + {"x":8.5, "y":1}, + {"x":9.5, "y":1}, + {"x":10.5, "y":1}, + {"x":11.5, "y":1}, + {"x":12.5, "y":1}, + {"x":15, "y":1}, + {"x":0, "y":2, "w":1.75}, + {"x":1.75, "y":2}, + {"x":2.75, "y":2}, + {"x":3.75, "y":2}, + {"x":4.75, "y":2}, + {"x":5.75, "y":2}, + {"x":6.75, "y":2}, + {"x":7.75, "y":2}, + {"x":8.75, "y":2}, + {"x":9.75, "y":2}, + {"x":10.75, "y":2}, + {"x":11.75, "y":2}, + {"x":12.75, "y":2}, + {"x":13.75, "y":1, "w":1.25, "h":2}, + {"x":15, "y":2}, + {"x":0, "y":3, "w":1.25}, + {"x":1.25, "y":3}, + {"x":2.25, "y":3}, + {"x":3.25, "y":3}, + {"x":4.25, "y":3}, + {"x":5.25, "y":3}, + {"x":6.25, "y":3}, + {"x":7.25, "y":3}, + {"x":8.25, "y":3}, + {"x":9.25, "y":3}, + {"x":10.25, "y":3}, + {"x":11.25, "y":3}, + {"x":12.25, "y":3, "w":1.75}, + {"x":14, "y":3}, + {"x":15, "y":3}, + {"x":0, "y":4, "w":1.25}, + {"x":1.25, "y":4, "w":1.25}, + {"x":2.5, "y":4, "w":1.25}, + {"x":3.75, "y":4, "w":6.25}, + {"x":10, "y":4, "w":1.25}, + {"x":11.25, "y":4, "w":1.25}, + {"x":13, "y":4}, + {"x":14, "y":4}, + {"x":15, "y":4} + ] + }, + "LAYOUT_65_iso_blocker_split_bs": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6, "y":0}, + {"x":7, "y":0}, + {"x":8, "y":0}, + {"x":9, "y":0}, + {"x":10, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0}, + {"x":14, "y":0}, + {"x":15, "y":0}, + {"x":0, "y":1, "w":1.5}, + {"x":1.5, "y":1}, + {"x":2.5, "y":1}, + {"x":3.5, "y":1}, + {"x":4.5, "y":1}, + {"x":5.5, "y":1}, + {"x":6.5, "y":1}, + {"x":7.5, "y":1}, + {"x":8.5, "y":1}, + {"x":9.5, "y":1}, + {"x":10.5, "y":1}, + {"x":11.5, "y":1}, + {"x":12.5, "y":1}, + {"x":15, "y":1}, + {"x":0, "y":2, "w":1.75}, + {"x":1.75, "y":2}, + {"x":2.75, "y":2}, + {"x":3.75, "y":2}, + {"x":4.75, "y":2}, + {"x":5.75, "y":2}, + {"x":6.75, "y":2}, + {"x":7.75, "y":2}, + {"x":8.75, "y":2}, + {"x":9.75, "y":2}, + {"x":10.75, "y":2}, + {"x":11.75, "y":2}, + {"x":12.75, "y":2}, + {"x":13.75, "y":1, "w":1.25, "h":2}, + {"x":15, "y":2}, + {"x":0, "y":3, "w":1.25}, + {"x":1.25, "y":3}, + {"x":2.25, "y":3}, + {"x":3.25, "y":3}, + {"x":4.25, "y":3}, + {"x":5.25, "y":3}, + {"x":6.25, "y":3}, + {"x":7.25, "y":3}, + {"x":8.25, "y":3}, + {"x":9.25, "y":3}, + {"x":10.25, "y":3}, + {"x":11.25, "y":3}, + {"x":12.25, "y":3, "w":1.75}, + {"x":14, "y":3}, + {"x":15, "y":3}, + {"x":0, "y":4, "w":1.25}, + {"x":1.25, "y":4, "w":1.25}, + {"x":2.5, "y":4, "w":1.25}, + {"x":3.75, "y":4, "w":6.25}, + {"x":10, "y":4, "w":1.25}, + {"x":11.25, "y":4, "w":1.25}, + {"x":13, "y":4}, + {"x":14, "y":4}, + {"x":15, "y":4} + ] + } + } +} diff --git a/keyboards/owlab/voice65/soldered/keymaps/default/keymap.c b/keyboards/owlab/voice65/soldered/keymaps/default/keymap.c new file mode 100644 index 0000000000..617b60dcf7 --- /dev/null +++ b/keyboards/owlab/voice65/soldered/keymaps/default/keymap.c @@ -0,0 +1,36 @@ +/* Copyright 2021 kb-elmo + * + * 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 + +// How long (in ms) to wait between animation steps for the snake mode +const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 35, 20}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_65_ansi_blocker( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_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, MO(1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT_65_ansi_blocker( + 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, KC_TRNS, RESET, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_HOME, + 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_END, + KC_TRNS, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_TRNS, KC_TRNS, KC_F22, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F23, KC_TRNS + ) +}; diff --git a/keyboards/owlab/voice65/soldered/keymaps/via/keymap.c b/keyboards/owlab/voice65/soldered/keymaps/via/keymap.c new file mode 100644 index 0000000000..9b3715e113 --- /dev/null +++ b/keyboards/owlab/voice65/soldered/keymaps/via/keymap.c @@ -0,0 +1,50 @@ +/* Copyright 2021 kb-elmo + * + * 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 + +// How long (in ms) to wait between animation steps for the snake mode +const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 35, 20}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_all( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_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_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, MO(1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT_all( + 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, KC_TRNS, KC_TRNS, RESET, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_HOME, + 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_END, + KC_TRNS, KC_TRNS, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_TRNS, KC_TRNS, KC_F22, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F23, KC_TRNS + ), + [2] = LAYOUT_all( + 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, 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 + ), + [3] = LAYOUT_all( + 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, 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/owlab/voice65/soldered/keymaps/via/rules.mk b/keyboards/owlab/voice65/soldered/keymaps/via/rules.mk new file mode 100644 index 0000000000..36b7ba9cbc --- /dev/null +++ b/keyboards/owlab/voice65/soldered/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +LTO_ENABLE = yes diff --git a/keyboards/owlab/voice65/soldered/mcuconf.h b/keyboards/owlab/voice65/soldered/mcuconf.h new file mode 100644 index 0000000000..808ff76540 --- /dev/null +++ b/keyboards/owlab/voice65/soldered/mcuconf.h @@ -0,0 +1,22 @@ +/* Copyright 2021 kb-elmo + * + * 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_next + +#undef STM32_I2C_USE_I2C1 +#define STM32_I2C_USE_I2C1 TRUE diff --git a/keyboards/owlab/voice65/soldered/readme.md b/keyboards/owlab/voice65/soldered/readme.md new file mode 100644 index 0000000000..6299c905ea --- /dev/null +++ b/keyboards/owlab/voice65/soldered/readme.md @@ -0,0 +1,21 @@ +# Voice65 - soldered PCB + +![voice65](https://i.imgur.com/okI07scl.jpg) + +A 65% with an LED strip and a scroll wheel + +* Keyboard Maintainer: [kb-elmo](https://github.com/kb-elmo) +* Hardware Supported: Voice65 soldered PCB +* Hardware Availability: Ended groupbuy: https://www.popkeyboard.com/products/67968vn00mzx + +Make example for this keyboard (after setting up your build environment): + + make owlab/voice65/soldered:default + +Flashing example for this keyboard: + + make owlab/voice65/soldered:default:flash + +**Bootloader:** Press the physical reset button on the bottom side of the PCB (labeled SW1) or hold down ESC while plugging in the board. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/owlab/voice65/soldered/rules.mk b/keyboards/owlab/voice65/soldered/rules.mk new file mode 100644 index 0000000000..dba1a7a650 --- /dev/null +++ b/keyboards/owlab/voice65/soldered/rules.mk @@ -0,0 +1,28 @@ +# MCU name +MCU = STM32F303 + +# Bootloader selection +BOOTLOADER = stm32-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +BLUETOOTH_ENABLE = no # Enable Bluetooth +AUDIO_ENABLE = no # Audio output +ENCODER_ENABLE = yes # Rotary encoder + +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = IS31FL3741 + +LAYOUTS = 65_ansi_blocker 65_ansi_blocker_split_bs 65_ansi_blocker_tsangan 65_iso_blocker 65_iso_blocker_split_bs diff --git a/keyboards/owlab/voice65/soldered/soldered.c b/keyboards/owlab/voice65/soldered/soldered.c new file mode 100644 index 0000000000..06288eb0a8 --- /dev/null +++ b/keyboards/owlab/voice65/soldered/soldered.c @@ -0,0 +1,455 @@ +/* Copyright 2021 kb-elmo + * + * 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 "soldered.h" + +#ifdef RGB_MATRIX_ENABLE +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { + {0, CS3_SW1, CS2_SW1, CS1_SW1}, /* RGB0-ESC ROW0*/ + {0, CS6_SW1, CS5_SW1, CS4_SW1}, /* RGB1-1 */ + {0, CS9_SW1, CS8_SW1, CS7_SW1}, /* RGB2-2 */ + {0, CS12_SW1, CS11_SW1, CS10_SW1}, /* RGB3-3 */ + {0, CS15_SW1, CS14_SW1, CS13_SW1}, /* RGB4-4 */ + {0, CS18_SW1, CS17_SW1, CS16_SW1}, /* RGB5-5 */ + {0, CS21_SW1, CS20_SW1, CS19_SW1}, /* RGB6-6 */ + {0, CS24_SW1, CS23_SW1, CS22_SW1}, /* RGB7-7 */ + {0, CS27_SW1, CS26_SW1, CS25_SW1}, /* RGB8-8 */ + {0, CS30_SW1, CS29_SW1, CS28_SW1}, /* RGB9-9 */ + {0, CS33_SW1, CS32_SW1, CS31_SW1}, /* RGB10-0 */ + {0, CS36_SW1, CS35_SW1, CS34_SW1}, /* RGB11--- */ + {0, CS39_SW6, CS38_SW6, CS37_SW6}, /* RGB12-+= */ + {0, CS36_SW6, CS35_SW6, CS34_SW6}, /* RGB13-BS */ + {0, CS27_SW6, CS26_SW6, CS25_SW6}, /* RGB14-BACKSPACE SPLIT */ + {0, CS36_SW8, CS35_SW8, CS34_SW8}, /* RGB15-DEL */ + {0, CS3_SW2, CS2_SW2, CS1_SW2}, /* RGB16-TAB ----ROW1*/ + {0, CS6_SW2, CS5_SW2, CS4_SW2}, /* RGB17-Q */ + {0, CS9_SW2, CS8_SW2, CS7_SW2}, /* RGB18-W */ + {0, CS12_SW2, CS11_SW2, CS10_SW2}, /* RGB19-E */ + {0, CS15_SW2, CS14_SW2, CS13_SW2}, /* RGB20-R */ + {0, CS18_SW2, CS17_SW2, CS16_SW2}, /* RGB21-T */ + {0, CS21_SW2, CS20_SW2, CS19_SW2}, /* RGB22-Y */ + {0, CS24_SW2, CS23_SW2, CS22_SW2}, /* RGB23-U */ + {0, CS27_SW2, CS26_SW2, CS25_SW2}, /* RGB24-I */ + {0, CS30_SW2, CS29_SW2, CS28_SW2}, /* RGB25-O */ + {0, CS33_SW2, CS32_SW2, CS31_SW2}, /* RGB26-P */ + {0, CS36_SW2, CS35_SW2, CS34_SW2}, /* RGB27-[ */ + {0, CS39_SW7, CS38_SW7, CS37_SW7}, /* RGB28-] */ + {0, CS36_SW7, CS35_SW7, CS34_SW7}, /* RGB29-\ */ + {0, CS27_SW7, CS26_SW7, CS25_SW7}, /* RGB30-PGUP */ + {0, CS3_SW3, CS2_SW3, CS1_SW3}, /* RGB31-CAPS---ROW2*/ + {0, CS6_SW3, CS5_SW3, CS4_SW3}, /* RGB32-A-- */ + {0, CS9_SW3, CS8_SW3, CS7_SW3}, /* RGB33-S-- */ + {0, CS12_SW3, CS11_SW3, CS10_SW3}, /* RGB34-D-- */ + {0, CS15_SW3, CS14_SW3, CS13_SW3}, /* RGB35-F-- */ + {0, CS18_SW3, CS17_SW3, CS16_SW3}, /* RGB36-G-- */ + {0, CS21_SW3, CS20_SW3, CS19_SW3}, /* RGB37-H-- */ + {0, CS24_SW3, CS23_SW3, CS22_SW3}, /* RGB38-J-- */ + {0, CS27_SW3, CS26_SW3, CS25_SW3}, /* RGB39-K-- */ + {0, CS30_SW3, CS29_SW3, CS28_SW3}, /* RGB40-L-- */ + {0, CS33_SW3, CS32_SW3, CS31_SW3}, /* RGB41-;:- */ + {0, CS36_SW3, CS35_SW3, CS34_SW3}, /* RGB42-''- */ + {0, CS39_SW8, CS38_SW8, CS37_SW8}, /* RGB43-ENTER- */ + {0, CS27_SW8, CS26_SW8, CS25_SW8}, /* RGB44-PGDN */ + {0, CS3_SW4, CS2_SW4, CS1_SW4}, /* RGB45-LSF --ROW3*/ + {0, CS6_SW4, CS5_SW4, CS4_SW4}, /* RGB46-LSF split -*/ + {0, CS9_SW4, CS8_SW4, CS7_SW4}, /* RGB47-Z -*/ + {0, CS12_SW4, CS11_SW4, CS10_SW4}, /* RGB48-X -*/ + {0, CS15_SW4, CS14_SW4, CS13_SW4}, /* RGB49-C -*/ + {0, CS18_SW4, CS17_SW4, CS16_SW4}, /* RGB50-V -*/ + {0, CS21_SW4, CS20_SW4, CS19_SW4}, /* RGB51-B -*/ + {0, CS24_SW4, CS23_SW4, CS22_SW4}, /* RGB52-N -*/ + {0, CS27_SW4, CS26_SW4, CS25_SW4}, /* RGB53-M -*/ + {0, CS30_SW4, CS29_SW4, CS28_SW4}, /* RGB54-<, -*/ + {0, CS33_SW4, CS32_SW4, CS31_SW4}, /* RGB55->. -*/ + {0, CS36_SW4, CS35_SW4, CS34_SW4}, /* RGB56-?/ -*/ + {0, CS39_SW9, CS38_SW9, CS37_SW9}, /* RGB57-RSF -*/ + {0, CS36_SW9, CS35_SW9, CS34_SW9}, /* RGB58-UP -*/ + {0, CS27_SW9, CS26_SW9, CS25_SW9}, /* RGB59--MO-- */ + {0, CS3_SW5, CS2_SW5, CS1_SW5}, /* RGB60-lct-- row4*/ + {0, CS6_SW5, CS5_SW5, CS4_SW5}, /* RGB61-lwin- */ + {0, CS9_SW5, CS8_SW5, CS7_SW5}, /* RGB62-lalt- */ + {0, CS12_SW5, CS11_SW5, CS10_SW5}, /* RGB63-sp2.25- */ + {0, CS15_SW5, CS14_SW5, CS13_SW5}, /* RGB64-sp7U6.25U1.25U- */ + {0, CS21_SW5, CS20_SW5, CS19_SW5}, /* RGB65-sp2.75U- */ + {0, CS30_SW5, CS29_SW5, CS28_SW5}, /* RGB66-ralt- */ + {0, CS33_SW5, CS32_SW5, CS31_SW5}, /* RGB67-rctrl- */ + {0, CS36_SW5, CS35_SW5, CS34_SW5}, /* RGB68-left- */ + {0, CS39_SW5, CS38_SW5, CS37_SW5}, /* RGB69-dn- */ + {0, CS27_SW5, CS26_SW5, CS25_SW5}, /* RGB70-right- */ +}; + +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, + { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 }, + { 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 15, 44 }, + { 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59 }, + { 60, 61, 62, 63, 64, NO_LED, 65, NO_LED, NO_LED, 66, 67, 68, 69, NO_LED, 70 } +}, { + { 0, 0 }, { 15, 0 }, { 30, 0 }, { 45, 0 }, { 60, 0 }, { 75, 0 }, { 90, 0 }, { 105, 0 }, { 120, 0 }, { 135, 0 }, { 150, 0 }, { 165, 0}, { 180, 0}, { 195, 0 }, { 209, 0 }, { 224, 0 }, + { 2, 16 }, { 18, 16 }, { 34, 16 }, { 50, 16 }, { 66, 16 }, { 82, 16 }, { 98, 16 }, { 114, 16 }, { 130, 16 }, { 146, 16 }, { 162, 16 }, { 178, 16 }, { 194, 16 }, { 208, 16 }, { 224, 16 }, + { 2, 32 }, { 20, 32 }, { 36, 32 }, { 52, 32 }, { 68, 32 }, { 84, 32 }, { 100, 32 }, { 116, 32 }, { 132, 32 }, { 148, 32 }, { 164, 32 }, { 180, 32 }, { 202, 32 }, { 224, 32 }, + { 0, 48 }, { 16, 48 }, { 32, 48 }, { 48, 48 }, { 64, 48 }, { 80, 48 }, { 96, 48 }, { 112, 48 }, { 128, 48 }, { 144, 48 }, { 160, 48 }, { 176, 48 }, { 192, 48 }, { 208, 48 }, { 224, 48 }, + { 0, 64 }, { 20, 64 }, { 40, 64 }, { 60, 64 }, { 95, 64 }, { 132, 64 }, { 152, 64 }, { 172, 64 }, { 192, 64 }, { 208, 64 }, { 224, 64 } +}, { + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + } +}; + + +#endif + +__attribute__ ((weak)) +void rgb_matrix_indicators_user(void) +{ + if (host_keyboard_led_state().caps_lock) + { + rgb_matrix_set_color(31, 255, 255, 255); + } else { + rgb_matrix_set_color(31, 0, 0, 0); + } +} + +enum encoder_modes{ + ENCODER_MODE_ONE = 0, + ENCODER_MODE_TWO, + ENCODER_MODE_THREE, +}; + +keyboard_config_t keyboard_config; +rgblight_config_t rgblight_config; + +uint8_t pre_hue, pre_sat, pre_val; +uint8_t previous_rgb_mode = 0; +uint8_t dir_hue, dir_sat; + +bool encoder_in = false; +uint32_t encoder_timer; + +bool encoder_ani_start= false; +uint32_t encoder_ani_timer = 0; + +bool encoder_direction_start = false; +uint32_t encoder_direction_timer = 0; + + +bool lizm_restart_snake = false; +void rgblight_snake_restart(uint8_t hue, uint8_t sat, uint8_t val){ + lizm_restart_snake = true; // restart signal to local each effect + rgblight_config.hue = hue; + rgblight_config.sat = sat; + rgblight_config.val = val; +} + + +void keyboard_post_init_kb(void){ + keyboard_config.raw = eeconfig_read_kb(); + if( keyboard_config.encoder_mode_index > ENCODER_MODE_THREE ){ + keyboard_config.encoder_mode_index = ENCODER_MODE_ONE; + eeconfig_update_kb(keyboard_config.raw); + } +} + +void switch_encoder_mode(uint8_t mode){ + switch(mode){ + case ENCODER_MODE_ONE: + dir_hue = 88; + dir_sat = 255; + break; + + case ENCODER_MODE_TWO: + dir_hue = 0; + dir_sat = 240; + break; + + case ENCODER_MODE_THREE: + dir_hue = 176; + dir_sat = 255; + break; + } + rgblight_sethsv_noeeprom(dir_hue,dir_sat,pre_val); +} + + +void init_encoder_mode(uint8_t mode){ + previous_rgb_mode = rgblight_get_mode(); + pre_hue = rgblight_get_hue(); + pre_sat = rgblight_get_sat(); + pre_val = rgblight_get_val(); + encoder_in = true; + + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + + switch_encoder_mode(mode); +} + + +void set_encoder_mode(uint8_t mode){ + if(encoder_in == false){ + init_encoder_mode(mode); + }else{ + switch_encoder_mode(mode); + } + eeconfig_update_kb(keyboard_config.raw); + encoder_timer = timer_read32(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case RGB_MOD: + case RGB_RMOD: + case RGB_HUI: + case RGB_HUD: + case RGB_SAI: + case RGB_SAD: + case RGB_VAI: + case RGB_VAD: + + if(encoder_in){ + return false; + } + break; + + case KC_F13: + rgb_matrix_toggle(); + break; + + case KC_F14: + rgb_matrix_step(); + break; + + case KC_F15: + rgb_matrix_step_reverse(); + break; + + case KC_F16: + rgb_matrix_increase_hue(); //Increase the hue for effect range LEDs + break; + + case KC_F17: + rgb_matrix_decrease_hue(); //Decrease the hue for effect range LEDs + break; + + case KC_F18: + rgb_matrix_increase_sat(); //Increase the saturation for effect range LEDs + break; + + case KC_F19: + rgb_matrix_decrease_sat(); //Decrease the saturation for effect range LEDs + break; + + case KC_F20: + rgb_matrix_increase_val(); //Increase the value for effect range LEDs + break; + + case KC_F21: + rgb_matrix_decrease_val();//Decrease the value for effect range LEDs + break; + + case KC_F22: //change encoder mode upward + + if(!encoder_direction_start){ + if(keyboard_config.encoder_mode_index < ENCODER_MODE_THREE){ + keyboard_config.encoder_mode_index++; + } + else{ + keyboard_config.encoder_mode_index = ENCODER_MODE_ONE; + } + set_encoder_mode(keyboard_config.encoder_mode_index); + } + return false; + + case KC_F23: + if(!encoder_direction_start){ + if(keyboard_config.encoder_mode_index > ENCODER_MODE_ONE){ + keyboard_config.encoder_mode_index--; + } + else{ + keyboard_config.encoder_mode_index = ENCODER_MODE_THREE; + } + set_encoder_mode(keyboard_config.encoder_mode_index); + } + return false; + + default: + break; + } + } + return process_record_user(keycode, record); +} + + +void matrix_scan_kb(void) { + if(encoder_in){ + if(timer_elapsed32(encoder_timer) > 5000){ + rgblight_mode(previous_rgb_mode); + rgblight_sethsv(pre_hue, pre_sat, pre_val); + encoder_in = false; + } + } + + if(encoder_ani_start){ + if(timer_elapsed32(encoder_ani_timer) > VOLUME_ANIMATION_TIMER){ + encoder_ani_start = false; + rgblight_sethsv_noeeprom(0,0,0); + } + } + + if(encoder_direction_start){ + if(timer_elapsed32(encoder_direction_timer) > (VOLUME_ANIMATION_TIMER+1500)){ + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + rgblight_sethsv_noeeprom(dir_hue, dir_sat, pre_val); + encoder_direction_start = false; + } + } + matrix_scan_user(); +} + + +void set_volume_animation(bool increase){ + if(!encoder_ani_start){ + rgblight_snake_restart(dir_hue, dir_sat, pre_val); + } + + if(increase){ + rgblight_mode_noeeprom(17); + } else { + rgblight_mode_noeeprom(18); + } + + encoder_ani_timer = timer_read32(); + encoder_direction_timer = encoder_ani_timer; + encoder_ani_start = true; + encoder_direction_start = true; +} + + +bool encoder_update_kb(uint8_t index, bool clockwise) { + uint8_t layer_now = keyboard_config.encoder_mode_index +1; + uint16_t encoder_cw_keycode = keymap_key_to_keycode(layer_now, (keypos_t){.row=2, .col=1 }); + uint16_t encoder_ccw_keycode = keymap_key_to_keycode(layer_now, (keypos_t){.row=2, .col=2 }); + if (index == 0) { /* First encoder */ + if(encoder_in == false){ + init_encoder_mode(keyboard_config.encoder_mode_index); + } + + if (!clockwise) { + switch(encoder_cw_keycode) { + + case KC_F13: + rgb_matrix_toggle(); + break; + + case KC_F14: + rgb_matrix_step(); + break; + + case KC_F15: + rgb_matrix_step_reverse(); + break; + + case KC_F16: + rgb_matrix_increase_hue(); //Increase the hue for effect range LEDs + break; + + case KC_F17: + rgb_matrix_decrease_hue(); //Decrease the hue for effect range LEDs + break; + + case KC_F18: + rgb_matrix_increase_sat(); //Increase the saturation for effect range LEDs + break; + + case KC_F19: + rgb_matrix_decrease_sat(); //Decrease the saturation for effect range LEDs + break; + + case KC_F20: + rgb_matrix_increase_val(); //Increase the value for effect range LEDs + break; + + case KC_F21: + rgb_matrix_decrease_val();//Decrease the value for effect range LEDs + break; + + case KC_VOLU: + case KC_VOLD: + tap_code(encoder_cw_keycode); + break; + + default: + tap_code(encoder_cw_keycode); + break; + } + set_volume_animation(true); + } else { + switch(encoder_ccw_keycode) { + + case KC_F13: + rgb_matrix_toggle(); + break; + + case KC_F14: + rgb_matrix_step(); + break; + + case KC_F15: + rgb_matrix_step_reverse(); + break; + + case KC_F16: + rgb_matrix_increase_hue(); //Increase the hue for effect range LEDs + break; + + case KC_F17: + rgb_matrix_decrease_hue(); //Decrease the hue for effect range LEDs + break; + + case KC_F18: + rgb_matrix_increase_sat(); //Increase the saturation for effect range LEDs + break; + + case KC_F19: + rgb_matrix_decrease_sat(); //Decrease the saturation for effect range LEDs + break; + + case KC_F20: + rgb_matrix_increase_val(); //Increase the value for effect range LEDs + break; + + case KC_F21: + rgb_matrix_decrease_val();//Decrease the value for effect range LEDs + break; + + case KC_VOLU: + case KC_VOLD: + tap_code(encoder_ccw_keycode); + break; + + default: + tap_code(encoder_ccw_keycode); + break; + } + set_volume_animation(false); + } + encoder_timer = timer_read32(); + } + return true; +} diff --git a/keyboards/owlab/voice65/soldered/soldered.h b/keyboards/owlab/voice65/soldered/soldered.h new file mode 100644 index 0000000000..0d50056002 --- /dev/null +++ b/keyboards/owlab/voice65/soldered/soldered.h @@ -0,0 +1,116 @@ +/* Copyright 2021 kb-elmo + * + * 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 "quantum.h" + +#define ____ KC_NO + +#define LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K213, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ + K400, K401, K402, K403, K404, K406, K409, K410, K411, K412, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ + { K400, K401, K402, K403, K404, ____, K406, ____, ____, K409, K410, K411, K412, ____, K414 } \ +} + +#define LAYOUT_65_ansi_blocker( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K213, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ + K400, K401, K402, K404, K409, K410, K411, K412, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, ____ }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ + { K300, ____, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ + { K400, K401, K402, ____, K404, ____, ____, ____, ____, K409, K410, K411, K412, ____, K414 } \ +} + +#define LAYOUT_65_ansi_blocker_split_bs( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K213, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ + K400, K401, K402, K404, K409, K410, K411, K412, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ + { K300, ____, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ + { K400, K401, K402, ____, K404, ____, ____, ____, ____, K409, K410, K411, K412, ____, K414 } \ +} + +#define LAYOUT_65_ansi_blocker_tsangan( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K213, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ + K400, K401, K402, K404, K410, K411, K412, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ + { K300, ____, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ + { K400, K401, K402, ____, K404, ____, ____, ____, ____, ____, K410, K411, K412, ____, K414 } \ +} + +#define LAYOUT_65_iso_blocker( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K213, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K113, K212, K214, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ + K400, K401, K402, K404, K409, K410, K411, K412, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, ____ }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ + { K400, K401, K402, ____, K404, ____, ____, ____, ____, K409, K410, K411, K412, ____, K414 } \ +} + +#define LAYOUT_65_iso_blocker_split_bs( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K213, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K113, K212, K214, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ + K400, K401, K402, K404, K409, K410, K411, K412, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ + { K400, K401, K402, ____, K404, ____, ____, ____, ____, K409, K410, K411, K412, ____, K414 } \ +} + +typedef union { + uint32_t raw; + struct { + uint8_t encoder_mode_index :8; + }; +} keyboard_config_t; + +extern keyboard_config_t keyboard_config; + +#define VOLUME_ANIMATION_TIMER 580 From 1bfbaae533fd4716407a5f381df1a3b317963a92 Mon Sep 17 00:00:00 2001 From: weteor <79446655+weteor@users.noreply.github.com> Date: Thu, 19 Aug 2021 20:13:00 +0200 Subject: [PATCH 08/10] [Keyboard] add 3w6 (#13746) --- keyboards/3w6/info.json | 56 ++++ keyboards/3w6/keymaps/default/keymap.c | 69 +++++ .../keymaps/manna-harbour_miryoku/config.h | 32 ++ .../keymaps/manna-harbour_miryoku/keymap.c | 17 ++ keyboards/3w6/readme.md | 45 +++ keyboards/3w6/rev1/config.h | 63 ++++ keyboards/3w6/rev1/matrix.c | 280 ++++++++++++++++++ keyboards/3w6/rev1/readme.md | 32 ++ keyboards/3w6/rev1/rev1.c | 17 ++ keyboards/3w6/rev1/rev1.h | 44 +++ keyboards/3w6/rev1/rules.mk | 29 ++ keyboards/3w6/rev2/config.h | 63 ++++ .../rev2/keymaps/default_pimoroni/config.h | 21 ++ .../rev2/keymaps/default_pimoroni/keymap.c | 70 +++++ .../default_pimoroni/pimoroni_trackball.c | 177 +++++++++++ .../default_pimoroni/pimoroni_trackball.h | 35 +++ .../rev2/keymaps/default_pimoroni/rules.mk | 3 + keyboards/3w6/rev2/matrix.c | 275 +++++++++++++++++ keyboards/3w6/rev2/readme.md | 38 +++ keyboards/3w6/rev2/rev2.c | 17 ++ keyboards/3w6/rev2/rev2.h | 44 +++ keyboards/3w6/rev2/rules.mk | 29 ++ 22 files changed, 1456 insertions(+) create mode 100644 keyboards/3w6/info.json create mode 100644 keyboards/3w6/keymaps/default/keymap.c create mode 100644 keyboards/3w6/keymaps/manna-harbour_miryoku/config.h create mode 100644 keyboards/3w6/keymaps/manna-harbour_miryoku/keymap.c create mode 100644 keyboards/3w6/readme.md create mode 100644 keyboards/3w6/rev1/config.h create mode 100644 keyboards/3w6/rev1/matrix.c create mode 100644 keyboards/3w6/rev1/readme.md create mode 100644 keyboards/3w6/rev1/rev1.c create mode 100644 keyboards/3w6/rev1/rev1.h create mode 100644 keyboards/3w6/rev1/rules.mk create mode 100644 keyboards/3w6/rev2/config.h create mode 100644 keyboards/3w6/rev2/keymaps/default_pimoroni/config.h create mode 100644 keyboards/3w6/rev2/keymaps/default_pimoroni/keymap.c create mode 100644 keyboards/3w6/rev2/keymaps/default_pimoroni/pimoroni_trackball.c create mode 100644 keyboards/3w6/rev2/keymaps/default_pimoroni/pimoroni_trackball.h create mode 100644 keyboards/3w6/rev2/keymaps/default_pimoroni/rules.mk create mode 100644 keyboards/3w6/rev2/matrix.c create mode 100644 keyboards/3w6/rev2/readme.md create mode 100644 keyboards/3w6/rev2/rev2.c create mode 100644 keyboards/3w6/rev2/rev2.h create mode 100644 keyboards/3w6/rev2/rules.mk diff --git a/keyboards/3w6/info.json b/keyboards/3w6/info.json new file mode 100644 index 0000000000..5a0e9be2f4 --- /dev/null +++ b/keyboards/3w6/info.json @@ -0,0 +1,56 @@ +{ + "keyboard_name": "3w6", + "url": "https://github.com/weteor/3W6/", + "maintainer": "weteor", + "width": 13, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label": "k00", "x": 0, "y": 0.8}, + {"label": "k01", "x": 1, "y": 0.2}, + {"label": "k02", "x": 2, "y": 0}, + {"label": "k03", "x": 3, "y": 0.2}, + {"label": "k04", "x": 4, "y": 0.4}, + + {"label": "k05", "x": 8, "y": 0.4}, + {"label": "k06", "x": 9, "y": 0.2}, + {"label": "k07", "x": 10, "y": 0}, + {"label": "k08", "x": 11, "y": 0.2}, + {"label": "k09", "x": 12, "y": 0.8}, + + {"label": "k10", "x": 0, "y": 1.8}, + {"label": "k11", "x": 1, "y": 1.2}, + {"label": "k12", "x": 2, "y": 1}, + {"label": "k13", "x": 3, "y": 1.2}, + {"label": "k14", "x": 4, "y": 1.4}, + + {"label": "k15", "x": 8, "y": 1.4}, + {"label": "k16", "x": 9, "y": 1.2}, + {"label": "k17", "x": 10, "y": 1}, + {"label": "k18", "x": 11, "y": 1.2}, + {"label": "k19", "x": 12, "y": 1.8}, + + {"label": "k20", "x": 0, "y": 2.8}, + {"label": "k21", "x": 1, "y": 2.2}, + {"label": "k22", "x": 2, "y": 2}, + {"label": "k23", "x": 3, "y": 2.2}, + {"label": "k24", "x": 4, "y": 2.4}, + + {"label": "k25", "x": 8, "y": 2.4}, + {"label": "k26", "x": 9, "y": 2.2}, + {"label": "k27", "x": 10, "y": 2}, + {"label": "k28", "x": 11, "y": 2.2}, + {"label": "k29", "x": 12, "y": 2.8}, + + {"label": "k32", "x": 3.2, "y": 3.6}, + {"label": "k33", "x": 4.2, "y": 3.6}, + {"label": "k34", "x": 5.2, "y": 3.8}, + + {"label": "k35", "x": 6.8, "y": 3.8}, + {"label": "k36", "x": 7.8, "y": 3.6}, + {"label": "k37", "x": 8.8, "y": 3.6} + ] + } + } +} diff --git a/keyboards/3w6/keymaps/default/keymap.c b/keyboards/3w6/keymaps/default/keymap.c new file mode 100644 index 0000000000..029173b674 --- /dev/null +++ b/keyboards/3w6/keymaps/default/keymap.c @@ -0,0 +1,69 @@ +/* Copyright 2021 weteor + * + * 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 layers +{ + _ALPHA_QWERTY = 0, + _ALPHA_COLEMAK, + _SYM, + _NAV, + _NUM, + _CFG, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + + [_ALPHA_QWERTY] = LAYOUT( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, + LSFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH), + + LCTL_T(KC_ESC), LT(_NUM,KC_SPC), LT(_NAV, KC_TAB), LT(_SYM, KC_BSPC), KC_ENT, LALT_T(KC_DEL) + ), + [_ALPHA_COLEMAK] = LAYOUT( + KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, + KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, + LSFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SCLN), + LCTL_T(KC_ENT), LT(_NUM,KC_SPC), LT(_NAV, KC_TAB), LT(_SYM, KC_BSPC), KC_ENT, LALT_T(KC_DEL) + ), + [_SYM] = LAYOUT( + KC_GRV , KC_CIRC, KC_AT, KC_DLR, KC_TILD, KC_AMPR, KC_EXLM, KC_PIPE, KC_UNDS, KC_HASH, + KC_SLSH, KC_LBRC, KC_LCBR, KC_LPRN, KC_EQL, KC_ASTR, KC_RPRN, KC_RCBR, KC_RBRC, KC_BSLS, + _______, KC_QUES, KC_PLUS, KC_PERC, XXXXXXX, XXXXXXX, XXXXXXX, KC_MINS, XXXXXXX, _______, + XXXXXXX, MO(_CFG), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ), + [_NAV] = LAYOUT( + XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, XXXXXXX, XXXXXXX, KC_PGDN, KC_UP, KC_PGUP, KC_DEL, + KC_MPRV, KC_MPLY, KC_MSTP, KC_MNXT, XXXXXXX, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MO(_CFG), XXXXXXX + ), + [_NUM] = LAYOUT( + XXXXXXX, KC_F9, KC_F10, KC_F11, KC_F12, KC_PPLS, KC_P7, KC_P8, KC_P9, KC_PSLS, + XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8, KC_P0, KC_P4, KC_P5, KC_P6, KC_PDOT, + XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_PMNS, KC_P1, KC_P2, KC_P3, KC_PAST, + XXXXXXX, XXXXXXX, XXXXXXX, KC_PEQL, KC_PENT, XXXXXXX + ), + [_CFG] = LAYOUT( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,DF(_ALPHA_QWERTY), DF(_ALPHA_COLEMAK), + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ), +}; diff --git a/keyboards/3w6/keymaps/manna-harbour_miryoku/config.h b/keyboards/3w6/keymaps/manna-harbour_miryoku/config.h new file mode 100644 index 0000000000..fb567ad7d3 --- /dev/null +++ b/keyboards/3w6/keymaps/manna-harbour_miryoku/config.h @@ -0,0 +1,32 @@ +/* Copyright 2021 weteor + * + * 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 . + */ + +// generated from users/manna-harbour_miryoku/miryoku.org -*- buffer-read-only: t -*- + +#pragma once + +#define LAYOUT_miryoku( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, \ + N30, N31, K32, K33, K34, K35, K36, K37, N38, N39 \ +) \ +LAYOUT( \ +K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \ +K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, \ +K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, \ + K32, K33, K34, K35, K36, K37 \ +) diff --git a/keyboards/3w6/keymaps/manna-harbour_miryoku/keymap.c b/keyboards/3w6/keymaps/manna-harbour_miryoku/keymap.c new file mode 100644 index 0000000000..74df5e0fe1 --- /dev/null +++ b/keyboards/3w6/keymaps/manna-harbour_miryoku/keymap.c @@ -0,0 +1,17 @@ +/* Copyright 2021 weteor + * + * 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 . + */ + +// generated from users/manna-harbour_miryoku/miryoku.org -*- buffer-read-only: t -*- diff --git a/keyboards/3w6/readme.md b/keyboards/3w6/readme.md new file mode 100644 index 0000000000..5878376bde --- /dev/null +++ b/keyboards/3w6/readme.md @@ -0,0 +1,45 @@ +# 3W6 + +![3W6](https://raw.githubusercontent.com/weteor/3W6/main/images/3w6_rev2_1s.jpg) + +The 3w6 is a low profile, split ortholinear keyboard with 36 keys. + +I needed a keyboard for work and wasn't really satisfied with the available alternatives (namely Corne, Kyria and Ferris), mostly because they are either rather large and/or don't have the spacing I would like. + +The 3w6 is designed to be a simple, realiable, cheap and small keyboard to be taken everywhere. + +There are currently two revisions: +* Rev1: + - onboard microcontroller (ATMega32U4) + - USB-C connector Board <-> PC + - USB-C connectors between both split halfs + - choc spacing (18x17mm) + - aggressive pinky stagger + - support for Choc V1 switches +* Rev2: + - everything Rev1 did + - additional middle plate (2mm) + - support for [Pimoroni Trackball](https://shop.pimoroni.com/products/trackball-breakout) instead of outer thumb switch on right half, needs midplate + - mounting holes for [Tenting Puck](https://splitkb.com/collections/keyboard-parts/products/tenting-puck), only usable without mid or switchplate + +--- + +* Keyboard Maintainer: [weteor](https://github.com/weteor) +* Hardware Supported: + * 3w6 rev1 + * 3w6 rev2 (with Pimoroni support) +* Hardware Availability: + * make one yourself: [Design and Productionfiles](https://github.com/weteor/3w6) + * maintainer is selling kits when available +--- +To reach the bootloader, connect the board to the PC and push the reset button on left half. + +Make examples for this keyboard (after setting up your build environment): + + make 3w6/rev1:default + make 3w6/rev2:default + make 3w6/rev2:default_pimoroni + + --- + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/3w6/rev1/config.h b/keyboards/3w6/rev1/config.h new file mode 100644 index 0000000000..1f0bab97fa --- /dev/null +++ b/keyboards/3w6/rev1/config.h @@ -0,0 +1,63 @@ +/* +Copyright 2021 weteor + +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 + + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x4658 +#define DEVICE_VER 0x0001 +#define MANUFACTURER weteor +#define PRODUCT 3w6 + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 10 + +#define MATRIX_ROWS_PER_SIDE (MATRIX_ROWS / 2) +#define MATRIX_COLS_PER_SIDE (MATRIX_COLS / 2) + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * + */ +#define MATRIX_ROW_PINS_L { B0, B1, B2, B4} +#define MATRIX_COL_PINS_L { B3, E6, F7, B6, B5 } +#define UNUSED_PINS_L { B7, C6, C7, D2, D3, D4, D5, D6, D7, F0, F1, F4, F5, F6 } + +#define MATRIX_ROW_PINS_R { P10, P11, P12, P05 } +#define MATRIX_COL_PINS_R { P06, P13, P14, P01, P00 } +#define UNUSED_PINS_R { P02, P03, P04, P07, P15, P16, P17 } + + +/* COL2ROW, ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* disable these deprecated features by default */ +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + diff --git a/keyboards/3w6/rev1/matrix.c b/keyboards/3w6/rev1/matrix.c new file mode 100644 index 0000000000..7262fd22e6 --- /dev/null +++ b/keyboards/3w6/rev1/matrix.c @@ -0,0 +1,280 @@ +/* +Copyright 2013 Oleg Kostyuk + 2020 Pierre Chevalier + 2021 weteor + +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 . +*/ + +/* + * This code was heavily inspired by the ergodox_ez keymap, and modernized + * to take advantage of the quantum.h microcontroller agnostics gpio control + * abstractions and use the macros defined in config.h for the wiring as opposed + * to repeating that information all over the place. + */ + +#include QMK_KEYBOARD_H +#include "i2c_master.h" + +extern i2c_status_t tca9555_status; +#define I2C_TIMEOUT 1000 + +// I2C address: +// All address pins of the tca9555 are connected to the ground +// | 0 | 1 | 0 | 0 | A2 | A1 | A0 | +// | 0 | 1 | 0 | 0 | 0 | 0 | 0 | +#define I2C_ADDR 0b0100000 +#define I2C_ADDR_WRITE ((I2C_ADDR << 1) | I2C_WRITE) +#define I2C_ADDR_READ ((I2C_ADDR << 1) | I2C_READ) + +// Register addresses +#define IODIRA 0x06 // i/o direction register +#define IODIRB 0x07 +#define IREGP0 0x00 // GPIO pull-up resistor register +#define IREGP1 0x01 +#define OREGP0 0x02 // general purpose i/o port register (write modifies OLAT) +#define OREGP1 0x03 + +bool i2c_initialized = 0; +i2c_status_t tca9555_status = I2C_ADDR; + +uint8_t init_tca9555(void) { + print("starting init"); + tca9555_status = I2C_ADDR; + + // I2C subsystem + if (i2c_initialized == 0) { + i2c_init(); // on pins D(1,0) + i2c_initialized = true; + wait_ms(I2C_TIMEOUT); + } + + // set pin direction + // - unused : input : 1 + // - input : input : 1 + // - driving : output : 0 + tca9555_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); + if (tca9555_status) goto out; + tca9555_status = i2c_write(IODIRA, I2C_TIMEOUT); + if (tca9555_status) goto out; + // This means: write on pin 5 of port 0, read on rest + tca9555_status = i2c_write(0b11011111, I2C_TIMEOUT); + if (tca9555_status) goto out; + // This means: we will write on pins 0 to 2 on port 1. read rest + tca9555_status = i2c_write(0b11111000, I2C_TIMEOUT); + if (tca9555_status) goto out; + +out: + i2c_stop(); + return tca9555_status; +} + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; // debounced values + +static matrix_row_t read_cols(uint8_t row); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + +static uint8_t tca9555_reset_loop; + +void matrix_init_custom(void) { + // initialize row and col + + tca9555_status = init_tca9555(); + + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + } +} + +void matrix_power_up(void) { + tca9555_status = init_tca9555(); + + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + } +} + +// Reads and stores a row, returning +// whether a change occurred. +static inline bool store_matrix_row(matrix_row_t current_matrix[], uint8_t index) { + matrix_row_t temp = read_cols(index); + if (current_matrix[index] != temp) { + current_matrix[index] = temp; + return true; + } + return false; +} + +bool matrix_scan_custom(matrix_row_t current_matrix[]) { + if (tca9555_status) { // if there was an error + if (++tca9555_reset_loop == 0) { + // since tca9555_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans + // this will be approx bit more frequent than once per second + dprint("trying to reset tca9555\n"); + tca9555_status = init_tca9555(); + if (tca9555_status) { + dprint("right side not responding\n"); + } else { + dprint("right side attached\n"); + } + } + } + + bool changed = false; + for (uint8_t i = 0; i < MATRIX_ROWS_PER_SIDE; i++) { + // select rows from left and right hands + uint8_t left_index = i; + uint8_t right_index = i + MATRIX_ROWS_PER_SIDE; + select_row(left_index); + select_row(right_index); + + // we don't need a 30us delay anymore, because selecting a + // left-hand row requires more than 30us for i2c. + + changed |= store_matrix_row(current_matrix, left_index); + changed |= store_matrix_row(current_matrix, right_index); + + unselect_rows(); + } + + return changed; +} + +static void init_cols(void) { + // init on tca9555 + // not needed, already done as part of init_tca9555() + + // init on mcu + pin_t matrix_col_pins_mcu[MATRIX_COLS_PER_SIDE] = MATRIX_COL_PINS_L; + for (int pin_index = 0; pin_index < MATRIX_COLS_PER_SIDE; pin_index++) { + pin_t pin = matrix_col_pins_mcu[pin_index]; + setPinInput(pin); + writePinHigh(pin); + } +} + +static matrix_row_t read_cols(uint8_t row) { + if (row < MATRIX_ROWS_PER_SIDE) { + pin_t matrix_col_pins_mcu[MATRIX_COLS_PER_SIDE] = MATRIX_COL_PINS_L; + matrix_row_t current_row_value = 0; + // For each col... + for (uint8_t col_index = 0; col_index < MATRIX_COLS_PER_SIDE; col_index++) { + // Select the col pin to read (active low) + uint8_t pin_state = readPin(matrix_col_pins_mcu[col_index]); + + // Populate the matrix row with the state of the col pin + current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); + } + return current_row_value; + } else { + if (tca9555_status) { // if there was an error + return 0; + } else { + uint8_t data = 0; + uint8_t port0 = 0; + uint8_t port1 = 0; + tca9555_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); + if (tca9555_status) goto out; + tca9555_status = i2c_write(IREGP0, I2C_TIMEOUT); + if (tca9555_status) goto out; + tca9555_status = i2c_start(I2C_ADDR_READ, I2C_TIMEOUT); + if (tca9555_status) goto out; + tca9555_status = i2c_read_ack(I2C_TIMEOUT); + if (tca9555_status < 0) goto out; + port0 = (uint8_t)tca9555_status; + tca9555_status = i2c_read_nack(I2C_TIMEOUT); + if (tca9555_status < 0) goto out; + port1 = (uint8_t)tca9555_status; + + // The initial state was all ones and any depressed key at a given column for the currently selected row will have its bit flipped to zero. + // The return value is a row as represented in the generic matrix code were the rightmost bits represent the lower columns and zeroes represent non-depressed keys while ones represent depressed keys. + // Since the pins are not ordered sequentially, we have to build the correct dataset from the two ports. Refer to the schematic to see where every pin is connected. + data |= ( port0 & 0x01 ); + data |= ( port0 & 0x02 ); + data |= ( port1 & 0x10 ) >> 2; + data |= ( port1 & 0x08 ); + data |= ( port0 & 0x40 ) >> 2; + data = ~(data); + + tca9555_status = I2C_STATUS_SUCCESS; + out: + i2c_stop(); + return data; + } + } +} + +static void unselect_rows(void) { + // no need to unselect on tca9555, because the select step sets all + // the other row bits high, and it's not changing to a different + // direction + + // unselect rows on microcontroller + pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_L; + for (int pin_index = 0; pin_index < MATRIX_ROWS_PER_SIDE; pin_index++) { + pin_t pin = matrix_row_pins_mcu[pin_index]; + setPinInput(pin); + writePinLow(pin); + } +} + +static void select_row(uint8_t row) { + uint8_t port0 = 0xff; + uint8_t port1 = 0xff; + + if (row < MATRIX_ROWS_PER_SIDE) { + // select on atmega32u4 + pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_L; + pin_t pin = matrix_row_pins_mcu[row]; + setPinOutput(pin); + writePinLow(pin); + } else { + // select on tca9555 + if (tca9555_status) { // if there was an error + // do nothing + } else { + switch(row) { + case 4: port1 &= ~(1 << 0); break; + case 5: port1 &= ~(1 << 1); break; + case 6: port1 &= ~(1 << 2); break; + case 7: port0 &= ~(1 << 5); break; + default: break; + } + + tca9555_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); + if (tca9555_status) goto out; + tca9555_status = i2c_write(OREGP0, I2C_TIMEOUT); + if (tca9555_status) goto out; + tca9555_status = i2c_write(port0, I2C_TIMEOUT); + if (tca9555_status) goto out; + tca9555_status = i2c_write(port1, I2C_TIMEOUT); + if (tca9555_status) goto out; + // Select the desired row by writing a byte for the entire GPIOB bus where only the bit representing the row we want to select is a zero (write instruction) and every other bit is a one. + // Note that the row - MATRIX_ROWS_PER_SIDE reflects the fact that being on the right hand, the columns are numbered from MATRIX_ROWS_PER_SIDE to MATRIX_ROWS, but the pins we want to write to are indexed from zero up on the GPIOB bus. + out: + i2c_stop(); + } + } +} diff --git a/keyboards/3w6/rev1/readme.md b/keyboards/3w6/rev1/readme.md new file mode 100644 index 0000000000..4d806f9222 --- /dev/null +++ b/keyboards/3w6/rev1/readme.md @@ -0,0 +1,32 @@ +# 3W6 + +![3W6](https://raw.githubusercontent.com/weteor/3W6/main/images/3w6_1s.jpg) +![3W6](https://raw.githubusercontent.com/weteor/3W6/main/images/3w6_3s.jpg) + +The 3w6 is a low profile, split ortholinear keyboard with 36 keys. + +* Rev1: + - onboard microcontroller (ATMega32U4) + - USB-C connector Board <-> PC + - USB-C connectors between both split halfs + - choc spacing (18x17mm) + - aggressive pinky stagger + - support for Choc V1 switches + +--- + +* Keyboard Maintainer: [weteor](https://github.com/weteor) +* Hardware Supported: + * 3w6 rev1 +* Hardware Availability (this is an older version, current revision is rev2): + * make one yourself: [Design and Productionfiles](https://github.com/weteor/3w6) +--- +To reach the bootloader, connect the board to the PC and push the reset button on left half. + +Make examples for this keyboard (after setting up your build environment): + + make 3w6/rev1:default + + --- + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/3w6/rev1/rev1.c b/keyboards/3w6/rev1/rev1.c new file mode 100644 index 0000000000..3944ec3b13 --- /dev/null +++ b/keyboards/3w6/rev1/rev1.c @@ -0,0 +1,17 @@ +/* Copyright 2021 weteor + * + * 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 "rev1.h" diff --git a/keyboards/3w6/rev1/rev1.h b/keyboards/3w6/rev1/rev1.h new file mode 100644 index 0000000000..ba881ca431 --- /dev/null +++ b/keyboards/3w6/rev1/rev1.h @@ -0,0 +1,44 @@ +/* Copyright 2021 weteor + * + * 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 "quantum.h" + +/* This is a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09,\ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19,\ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29,\ + k32, k33, k34, k35, k36, k37\ +) { \ + { k00, k01, k02, k03, k04 }, \ + { k10, k11, k12, k13, k14 }, \ + { k20, k21, k22, k23, k24 }, \ + { KC_NO, KC_NO, k32, k33, k34 }, \ + \ + { k05, k06, k07, k08, k09 }, \ + { k15, k16, k17, k18, k19 }, \ + { k25, k26, k27, k28, k29 }, \ + { k35, k36, k37, KC_NO, KC_NO }, \ +} diff --git a/keyboards/3w6/rev1/rules.mk b/keyboards/3w6/rev1/rules.mk new file mode 100644 index 0000000000..d4876dde77 --- /dev/null +++ b/keyboards/3w6/rev1/rules.mk @@ -0,0 +1,29 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +BLUETOOTH_ENABLE = no # Enable Bluetooth +AUDIO_ENABLE = no # Audio output +UNICODE_ENABLE = yes +CUSTOM_MATRIX = lite +NO_USB_STARTUP_CHECK = yes +LTO_ENABLE = no + +SRC += matrix.c +QUANTUM_LIB_SRC += i2c_master.c diff --git a/keyboards/3w6/rev2/config.h b/keyboards/3w6/rev2/config.h new file mode 100644 index 0000000000..d191360607 --- /dev/null +++ b/keyboards/3w6/rev2/config.h @@ -0,0 +1,63 @@ +/* +Copyright 2021 weteor + +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 + + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x4658 +#define DEVICE_VER 0x0002 +#define MANUFACTURER weteor +#define PRODUCT 3w6 + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 10 + +#define MATRIX_ROWS_PER_SIDE (MATRIX_ROWS / 2) +#define MATRIX_COLS_PER_SIDE (MATRIX_COLS / 2) + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * + */ +#define MATRIX_ROW_PINS_L { B0, B1, B2, B4} +#define MATRIX_COL_PINS_L { B3, E6, F7, B6, B5 } +#define UNUSED_PINS_L { B7, C6, C7, D2, D3, D4, D5, D6, D7, F0, F1, F4, F5, F6 } + +#define MATRIX_ROW_PINS_R { P10, P11, P12, P05 } +#define MATRIX_COL_PINS_R { P06, P13, P14, P01, P00 } +#define UNUSED_PINS_R { P02, P03, P04, P07, P15, P16, P17 } + + +/* COL2ROW, ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* disable these deprecated features by default */ +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + diff --git a/keyboards/3w6/rev2/keymaps/default_pimoroni/config.h b/keyboards/3w6/rev2/keymaps/default_pimoroni/config.h new file mode 100644 index 0000000000..45c9d5154e --- /dev/null +++ b/keyboards/3w6/rev2/keymaps/default_pimoroni/config.h @@ -0,0 +1,21 @@ +/* Copyright 2021 weteor + * + * 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 PIMORONI_TRACKBALL_INVERT_Y +#define PIMORONI_TRACKBALL_ROTATE + diff --git a/keyboards/3w6/rev2/keymaps/default_pimoroni/keymap.c b/keyboards/3w6/rev2/keymaps/default_pimoroni/keymap.c new file mode 100644 index 0000000000..a5b8c6006a --- /dev/null +++ b/keyboards/3w6/rev2/keymaps/default_pimoroni/keymap.c @@ -0,0 +1,70 @@ +/* +Copyright 2021 weteor + +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 layers +{ + _ALPHA_QWERTY = 0, + _ALPHA_COLEMAK, + _SYM, + _NAV, + _NUM, + _CFG, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + +[_ALPHA_QWERTY] = LAYOUT( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, + LSFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH), + + LCTL_T(KC_ESC), LT(_NUM,KC_SPC), LT(_NAV, KC_TAB), LT(_SYM, KC_BSPC), KC_ENT, LALT_T(KC_DEL) + ), + [_ALPHA_COLEMAK] = LAYOUT( + KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, + KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, + LSFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SCLN), + LCTL_T(KC_ENT), LT(_NUM,KC_SPC), LT(_NAV, KC_TAB), LT(_SYM, KC_BSPC), KC_ENT, LALT_T(KC_DEL) + ), + [_SYM] = LAYOUT( + KC_GRV , KC_CIRC, KC_AT, KC_DLR, KC_TILD, KC_AMPR, KC_EXLM, KC_PIPE, KC_UNDS, KC_HASH, + KC_SLSH, KC_LBRC, KC_LCBR, KC_LPRN, KC_EQL, KC_ASTR, KC_RPRN, KC_RCBR, KC_RBRC, KC_BSLS, + _______, KC_QUES, KC_PLUS, KC_PERC, XXXXXXX, XXXXXXX, XXXXXXX, KC_MINS, XXXXXXX, _______, + XXXXXXX, MO(_CFG), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ), + [_NAV] = LAYOUT( + XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, XXXXXXX, XXXXXXX, KC_PGDN, KC_UP, KC_PGUP, KC_DEL, + KC_MPRV, KC_MPLY, KC_MSTP, KC_MNXT, XXXXXXX, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MO(_CFG), XXXXXXX + ), + [_NUM] = LAYOUT( + XXXXXXX, KC_F9, KC_F10, KC_F11, KC_F12, KC_PPLS, KC_P7, KC_P8, KC_P9, KC_PSLS, + XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8, KC_P0, KC_P4, KC_P5, KC_P6, KC_PDOT, + XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_PMNS, KC_P1, KC_P2, KC_P3, KC_PAST, + XXXXXXX, XXXXXXX, XXXXXXX, KC_PEQL, KC_PENT, XXXXXXX + ), + [_CFG] = LAYOUT( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,DF(_ALPHA_QWERTY), DF(_ALPHA_COLEMAK), + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ), +}; diff --git a/keyboards/3w6/rev2/keymaps/default_pimoroni/pimoroni_trackball.c b/keyboards/3w6/rev2/keymaps/default_pimoroni/pimoroni_trackball.c new file mode 100644 index 0000000000..c4f4a0441a --- /dev/null +++ b/keyboards/3w6/rev2/keymaps/default_pimoroni/pimoroni_trackball.c @@ -0,0 +1,177 @@ +/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * 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 "pimoroni_trackball.h" +#include "i2c_master.h" + +static uint8_t scrolling = 0; +static int16_t x_offset = 0; +static int16_t y_offset = 0; +static int16_t h_offset = 0; +static int16_t v_offset = 0; +static float precisionSpeed = 1; + +static uint16_t i2c_timeout_timer; + +#ifndef I2C_TIMEOUT +# define I2C_TIMEOUT 100 +#endif +#ifndef I2C_WAITCHECK +# define I2C_WAITCHECK 1000 +#endif +#ifndef MOUSE_DEBOUNCE +# define MOUSE_DEBOUNCE 5 +#endif + +void trackball_set_rgbw(uint8_t red, uint8_t green, uint8_t blue, uint8_t white) { + uint8_t data[] = {0x00, red, green, blue, white}; + i2c_transmit(TRACKBALL_WRITE, data, sizeof(data), I2C_TIMEOUT); +} + +int16_t mouse_offset(uint8_t positive, uint8_t negative, int16_t scale) { + int16_t offset = (int16_t)positive - (int16_t)negative; + int16_t magnitude = (int16_t)(scale * offset * offset * precisionSpeed); + return offset < 0 ? -magnitude : magnitude; +} + +void update_member(int8_t* member, int16_t* offset) { + if (*offset > 127) { + *member = 127; + *offset -= 127; + } else if (*offset < -127) { + *member = -127; + *offset += 127; + } else { + *member = *offset; + *offset = 0; + } +} + +__attribute__((weak)) void trackball_check_click(bool pressed, report_mouse_t* mouse) { + if (pressed) { + mouse->buttons |= MOUSE_BTN1; + } else { + mouse->buttons &= ~MOUSE_BTN1; + } +} + +bool process_record_kb(uint16_t keycode, keyrecord_t* record) { + if (true) { + xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed); + } + + + if (!process_record_user(keycode, record)) { return false; } + +/* If Mousekeys is disabled, then use handle the mouse button + * keycodes. This makes things simpler, and allows usage of + * the keycodes in a consistent manner. But only do this if + * Mousekeys is not enable, so it's not handled twice. + */ +#ifndef MOUSEKEY_ENABLE + if (IS_MOUSEKEY_BUTTON(keycode)) { + report_mouse_t currentReport = pointing_device_get_report(); + if (record->event.pressed) { + currentReport.buttons |= 1 << (keycode - KC_MS_BTN1); + } else { + currentReport.buttons &= ~(1 << (keycode - KC_MS_BTN1)); + } + pointing_device_set_report(currentReport); + pointing_device_send(); + } +#endif + + return true; +} + +void trackball_register_button(bool pressed, enum mouse_buttons button) { + report_mouse_t currentReport = pointing_device_get_report(); + if (pressed) { + currentReport.buttons |= button; + } else { + currentReport.buttons &= ~button; + } + pointing_device_set_report(currentReport); +} + +float trackball_get_precision(void) { return precisionSpeed; } +void trackball_set_precision(float precision) { precisionSpeed = precision; } +bool trackball_is_scrolling(void) { return scrolling; } +void trackball_set_scrolling(bool scroll) { scrolling = scroll; } + + +__attribute__((weak)) void pointing_device_init(void) { trackball_set_rgbw(0x80, 0x00, 0x00, 0x00); } + +void pointing_device_task(void) { + static bool debounce; + static uint16_t debounce_timer; + uint8_t state[5] = {}; + if (timer_elapsed(i2c_timeout_timer) > I2C_WAITCHECK) { + if (i2c_readReg(TRACKBALL_WRITE, 0x04, state, 5, I2C_TIMEOUT) == I2C_STATUS_SUCCESS) { + if (!state[4] && !debounce) { + if (scrolling) { +#ifdef PIMORONI_TRACKBALL_INVERT_X + h_offset += mouse_offset(state[2], state[3], 1); +#else + h_offset -= mouse_offset(state[2], state[3], 1); +#endif +#ifdef PIMORONI_TRACKBALL_INVERT_Y + v_offset += mouse_offset(state[1], state[0], 1); +#else + v_offset -= mouse_offset(state[1], state[0], 1); +#endif + } else { +#ifdef PIMORONI_TRACKBALL_INVERT_X + x_offset -= mouse_offset(state[2], state[3], 5); +#else + x_offset += mouse_offset(state[2], state[3], 5); +#endif +#ifdef PIMORONI_TRACKBALL_INVERT_Y + y_offset -= mouse_offset(state[1], state[0], 5); +#else + y_offset += mouse_offset(state[1], state[0], 5); +#endif + } + } else { + if (state[4]) { + debounce = true; + debounce_timer = timer_read(); + } + } + } else { + i2c_timeout_timer = timer_read(); + } + } + + if (timer_elapsed(debounce_timer) > MOUSE_DEBOUNCE) debounce = false; + + report_mouse_t mouse = pointing_device_get_report(); + // trackball_check_click(state[4] & (1 << 7), &mouse); + +#ifndef PIMORONI_TRACKBALL_ROTATE + update_member(&mouse.x, &x_offset); + update_member(&mouse.y, &y_offset); + update_member(&mouse.h, &h_offset); + update_member(&mouse.v, &v_offset); +#else + update_member(&mouse.x, &y_offset); + update_member(&mouse.y, &x_offset); + update_member(&mouse.h, &v_offset); + update_member(&mouse.v, &h_offset); +#endif + pointing_device_set_report(mouse); + pointing_device_send(); +} diff --git a/keyboards/3w6/rev2/keymaps/default_pimoroni/pimoroni_trackball.h b/keyboards/3w6/rev2/keymaps/default_pimoroni/pimoroni_trackball.h new file mode 100644 index 0000000000..cfcd5a47a1 --- /dev/null +++ b/keyboards/3w6/rev2/keymaps/default_pimoroni/pimoroni_trackball.h @@ -0,0 +1,35 @@ +/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * 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 "quantum.h" +#include "pointing_device.h" + +#ifndef TRACKBALL_ADDRESS +# define TRACKBALL_ADDRESS 0x0A +#endif +#define TRACKBALL_WRITE ((TRACKBALL_ADDRESS << 1) | I2C_WRITE) +#define TRACKBALL_READ ((TRACKBALL_ADDRESS << 1) | I2C_READ) + +void trackball_set_rgbw(uint8_t red, uint8_t green, uint8_t blue, uint8_t white); +void trackball_check_click(bool pressed, report_mouse_t *mouse); +void trackball_register_button(bool pressed, enum mouse_buttons button); + +float trackball_get_precision(void); +void trackball_set_precision(float precision); +bool trackball_is_scrolling(void); +void trackball_set_scrolling(bool scroll); \ No newline at end of file diff --git a/keyboards/3w6/rev2/keymaps/default_pimoroni/rules.mk b/keyboards/3w6/rev2/keymaps/default_pimoroni/rules.mk new file mode 100644 index 0000000000..231a883719 --- /dev/null +++ b/keyboards/3w6/rev2/keymaps/default_pimoroni/rules.mk @@ -0,0 +1,3 @@ +POINTING_DEVICE_ENABLE = yes +SRC += pimoroni_trackball.c +MOUSEKEY_ENABLE = no diff --git a/keyboards/3w6/rev2/matrix.c b/keyboards/3w6/rev2/matrix.c new file mode 100644 index 0000000000..5bc967bedd --- /dev/null +++ b/keyboards/3w6/rev2/matrix.c @@ -0,0 +1,275 @@ +/* +Copyright 2013 Oleg Kostyuk + 2020 Pierre Chevalier + 2021 weteor + +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 . +*/ + +/* + * This code was heavily inspired by the ergodox_ez keymap, and modernized + * to take advantage of the quantum.h microcontroller agnostics gpio control + * abstractions and use the macros defined in config.h for the wiring as opposed + * to repeating that information all over the place. + */ + +#include QMK_KEYBOARD_H +#include "i2c_master.h" + +extern i2c_status_t tca9555_status; +#define I2C_TIMEOUT 1000 + +// I2C address: +// All address pins of the tca9555 are connected to the ground +// | 0 | 1 | 0 | 0 | A2 | A1 | A0 | +// | 0 | 1 | 0 | 0 | 0 | 0 | 0 | +#define I2C_ADDR 0b0100000 +#define I2C_ADDR_WRITE ((I2C_ADDR << 1) | I2C_WRITE) +#define I2C_ADDR_READ ((I2C_ADDR << 1) | I2C_READ) + +// Register addresses +#define IODIRA 0x06 // i/o direction register +#define IODIRB 0x07 +#define IREGP0 0x00 // GPIO pull-up resistor register +#define IREGP1 0x01 +#define OREGP0 0x02 // general purpose i/o port register (write modifies OLAT) +#define OREGP1 0x03 + +bool i2c_initialized = 0; +i2c_status_t tca9555_status = I2C_ADDR; + +uint8_t init_tca9555(void) { + print("starting init"); + tca9555_status = I2C_ADDR; + + // I2C subsystem + if (i2c_initialized == 0) { + i2c_init(); // on pins D(1,0) + i2c_initialized = true; + wait_ms(I2C_TIMEOUT); + } + + // set pin direction + // - unused : input : 1 + // - input : input : 1 + // - driving : output : 0 + tca9555_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); + if (tca9555_status) goto out; + tca9555_status = i2c_write(IODIRA, I2C_TIMEOUT); + if (tca9555_status) goto out; + // This means: read all pins of port 0 + tca9555_status = i2c_write(0b11111111, I2C_TIMEOUT); + if (tca9555_status) goto out; + // This means: we will write on pins 0 to 3 on port 1. read rest + tca9555_status = i2c_write(0b11110000, I2C_TIMEOUT); + if (tca9555_status) goto out; + +out: + i2c_stop(); + return tca9555_status; +} + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; // debounced values + +static matrix_row_t read_cols(uint8_t row); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + +static uint8_t tca9555_reset_loop; + +void matrix_init_custom(void) { + // initialize row and col + + tca9555_status = init_tca9555(); + + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + } +} + +void matrix_power_up(void) { + tca9555_status = init_tca9555(); + + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + } +} + +// Reads and stores a row, returning +// whether a change occurred. +static inline bool store_matrix_row(matrix_row_t current_matrix[], uint8_t index) { + matrix_row_t temp = read_cols(index); + if (current_matrix[index] != temp) { + current_matrix[index] = temp; + return true; + } + return false; +} + +bool matrix_scan_custom(matrix_row_t current_matrix[]) { + if (tca9555_status) { // if there was an error + if (++tca9555_reset_loop == 0) { + // since tca9555_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans + // this will be approx bit more frequent than once per second + dprint("trying to reset tca9555\n"); + tca9555_status = init_tca9555(); + if (tca9555_status) { + dprint("right side not responding\n"); + } else { + dprint("right side attached\n"); + } + } + } + + bool changed = false; + for (uint8_t i = 0; i < MATRIX_ROWS_PER_SIDE; i++) { + // select rows from left and right hands + uint8_t left_index = i; + uint8_t right_index = i + MATRIX_ROWS_PER_SIDE; + select_row(left_index); + select_row(right_index); + + // we don't need a 30us delay anymore, because selecting a + // left-hand row requires more than 30us for i2c. + + changed |= store_matrix_row(current_matrix, left_index); + changed |= store_matrix_row(current_matrix, right_index); + + unselect_rows(); + } + + return changed; +} + +static void init_cols(void) { + // init on tca9555 + // not needed, already done as part of init_tca9555() + + // init on mcu + pin_t matrix_col_pins_mcu[MATRIX_COLS_PER_SIDE] = MATRIX_COL_PINS_L; + for (int pin_index = 0; pin_index < MATRIX_COLS_PER_SIDE; pin_index++) { + pin_t pin = matrix_col_pins_mcu[pin_index]; + setPinInput(pin); + writePinHigh(pin); + } +} + +static matrix_row_t read_cols(uint8_t row) { + if (row < MATRIX_ROWS_PER_SIDE) { + pin_t matrix_col_pins_mcu[MATRIX_COLS_PER_SIDE] = MATRIX_COL_PINS_L; + matrix_row_t current_row_value = 0; + // For each col... + for (uint8_t col_index = 0; col_index < MATRIX_COLS_PER_SIDE; col_index++) { + // Select the col pin to read (active low) + uint8_t pin_state = readPin(matrix_col_pins_mcu[col_index]); + + // Populate the matrix row with the state of the col pin + current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); + } + return current_row_value; + } else { + if (tca9555_status) { // if there was an error + return 0; + } else { + uint8_t data = 0; + uint8_t port0 = 0; + tca9555_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); + if (tca9555_status) goto out; + tca9555_status = i2c_write(IREGP0, I2C_TIMEOUT); + if (tca9555_status) goto out; + tca9555_status = i2c_start(I2C_ADDR_READ, I2C_TIMEOUT); + if (tca9555_status) goto out; + tca9555_status = i2c_read_nack(I2C_TIMEOUT); + if (tca9555_status < 0) goto out; + + port0 = ~(uint8_t)tca9555_status; + + // We read all the pins on GPIOA. + // The initial state was all ones and any depressed key at a given column for the currently selected row will have its bit flipped to zero. + // The return value is a row as represented in the generic matrix code were the rightmost bits represent the lower columns and zeroes represent non-depressed keys while ones represent depressed keys. + // the pins connected to eact columns are sequential, but in reverse order, and counting from zero down (col 5 -> GPIO04, col6 -> GPIO03 and so on). + data |= ( port0 & 0x01 ) << 4; + data |= ( port0 & 0x02 ) << 2; + data |= ( port0 & 0x04 ); + data |= ( port0 & 0x08 ) >> 2; + data |= ( port0 & 0x10 ) >> 4; + + tca9555_status = I2C_STATUS_SUCCESS; + out: + i2c_stop(); + + return data; + } + } +} + +static void unselect_rows(void) { + // no need to unselect on tca9555, because the select step sets all + // the other row bits high, and it's not changing to a different + // direction + + // unselect rows on microcontroller + pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_L; + for (int pin_index = 0; pin_index < MATRIX_ROWS_PER_SIDE; pin_index++) { + pin_t pin = matrix_row_pins_mcu[pin_index]; + setPinInput(pin); + writePinLow(pin); + } +} + +static void select_row(uint8_t row) { + uint8_t port1 = 0xff; + + if (row < MATRIX_ROWS_PER_SIDE) { + // select on atmega32u4 + pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_L; + pin_t pin = matrix_row_pins_mcu[row]; + setPinOutput(pin); + writePinLow(pin); + } else { + // select on tca9555 + if (tca9555_status) { // if there was an error + // do nothing + } else { + switch(row) { + case 4: port1 &= ~(1 << 0); break; + case 5: port1 &= ~(1 << 1); break; + case 6: port1 &= ~(1 << 2); break; + case 7: port1 &= ~(1 << 3); break; + default: break; + } + + // Select the desired row by writing a byte for the entire GPIOB bus where only the bit representing the row we want to select is a zero (write instruction) and every other bit is a one. + // Note that the row - MATRIX_ROWS_PER_SIDE reflects the fact that being on the right hand, the columns are numbered from MATRIX_ROWS_PER_SIDE to MATRIX_ROWS, but the pins we want to write to are indexed from zero up on the GPIOB bus. + tca9555_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); + if (tca9555_status) goto out; + tca9555_status = i2c_write(OREGP1, I2C_TIMEOUT); + if (tca9555_status) goto out; + tca9555_status = i2c_write(port1, I2C_TIMEOUT); + if (tca9555_status) goto out; + out: + i2c_stop(); + } + } +} diff --git a/keyboards/3w6/rev2/readme.md b/keyboards/3w6/rev2/readme.md new file mode 100644 index 0000000000..a17c2fd6be --- /dev/null +++ b/keyboards/3w6/rev2/readme.md @@ -0,0 +1,38 @@ +# 3W6 + +![3W6_rev2](https://raw.githubusercontent.com/weteor/3W6/main/images/3w6_rev2_2s.jpg) +![3W6_rev2](https://raw.githubusercontent.com/weteor/3W6/main/images/3w6_rev2_1s.jpg) + +The 3w6 is a low profile, split ortholinear keyboard with 36 keys. + +* Rev2: + - onboard microcontroller (ATMega32U4) + - USB-C connector Board <-> PC + - USB-C connectors between both split halfs + - choc spacing (18x17mm) + - aggressive pinky stagger + - support for Choc V1 switches + - files for midplate (1.6 to 2mm) + - support for [Pimoroni Trackball](https://shop.pimoroni.com/products/trackball-breakout) instead of outer thumb switch on right half, needs midplate + - mounting holes for [Tenting Puck](https://splitkb.com/collections/keyboard-parts/products/tenting-puck), only usable without mid or switchplate + +--- + +* Keyboard Maintainer: [weteor](https://github.com/weteor) +* Hardware Supported: + * 3w6 rev2 (with Pimoroni support) +* Hardware Availability: + * make one yourself: [Design and Productionfiles](https://github.com/weteor/3w6) + * maintainer is selling kits when available + +--- +To reach the bootloader, connect the board to the PC and push the reset button on left half. + +Make examples for this keyboard (after setting up your build environment): + + make 3w6/rev2:default + make 3w6/rev2:default_pimoroni + + --- + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/3w6/rev2/rev2.c b/keyboards/3w6/rev2/rev2.c new file mode 100644 index 0000000000..17bfb9b8a7 --- /dev/null +++ b/keyboards/3w6/rev2/rev2.c @@ -0,0 +1,17 @@ +/* Copyright 2021 weteor + * + * 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 "rev2.h" diff --git a/keyboards/3w6/rev2/rev2.h b/keyboards/3w6/rev2/rev2.h new file mode 100644 index 0000000000..ba881ca431 --- /dev/null +++ b/keyboards/3w6/rev2/rev2.h @@ -0,0 +1,44 @@ +/* Copyright 2021 weteor + * + * 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 "quantum.h" + +/* This is a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09,\ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19,\ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29,\ + k32, k33, k34, k35, k36, k37\ +) { \ + { k00, k01, k02, k03, k04 }, \ + { k10, k11, k12, k13, k14 }, \ + { k20, k21, k22, k23, k24 }, \ + { KC_NO, KC_NO, k32, k33, k34 }, \ + \ + { k05, k06, k07, k08, k09 }, \ + { k15, k16, k17, k18, k19 }, \ + { k25, k26, k27, k28, k29 }, \ + { k35, k36, k37, KC_NO, KC_NO }, \ +} diff --git a/keyboards/3w6/rev2/rules.mk b/keyboards/3w6/rev2/rules.mk new file mode 100644 index 0000000000..d4876dde77 --- /dev/null +++ b/keyboards/3w6/rev2/rules.mk @@ -0,0 +1,29 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +BLUETOOTH_ENABLE = no # Enable Bluetooth +AUDIO_ENABLE = no # Audio output +UNICODE_ENABLE = yes +CUSTOM_MATRIX = lite +NO_USB_STARTUP_CHECK = yes +LTO_ENABLE = no + +SRC += matrix.c +QUANTUM_LIB_SRC += i2c_master.c From c59212821918736504074da24f33108551e8bdde Mon Sep 17 00:00:00 2001 From: Yaroslav Smirnov Date: Thu, 19 Aug 2021 21:15:30 +0300 Subject: [PATCH 09/10] [Keyboard] Add Elrgo S to keyboards/handwired (#13893) Co-authored-by: Drashna Jaelre Co-authored-by: Ryan --- keyboards/handwired/elrgo_s/config.h | 58 ++++++++++++++++++ keyboards/handwired/elrgo_s/elrgo_s.c | 17 ++++++ keyboards/handwired/elrgo_s/elrgo_s.h | 38 ++++++++++++ keyboards/handwired/elrgo_s/info.json | 59 +++++++++++++++++++ .../elrgo_s/keymaps/default/config.h | 22 +++++++ .../elrgo_s/keymaps/default/keymap.c | 58 ++++++++++++++++++ keyboards/handwired/elrgo_s/readme.md | 28 +++++++++ keyboards/handwired/elrgo_s/rules.mk | 23 ++++++++ 8 files changed, 303 insertions(+) create mode 100644 keyboards/handwired/elrgo_s/config.h create mode 100644 keyboards/handwired/elrgo_s/elrgo_s.c create mode 100644 keyboards/handwired/elrgo_s/elrgo_s.h create mode 100644 keyboards/handwired/elrgo_s/info.json create mode 100644 keyboards/handwired/elrgo_s/keymaps/default/config.h create mode 100644 keyboards/handwired/elrgo_s/keymaps/default/keymap.c create mode 100644 keyboards/handwired/elrgo_s/readme.md create mode 100644 keyboards/handwired/elrgo_s/rules.mk diff --git a/keyboards/handwired/elrgo_s/config.h b/keyboards/handwired/elrgo_s/config.h new file mode 100644 index 0000000000..b2ef4681e5 --- /dev/null +++ b/keyboards/handwired/elrgo_s/config.h @@ -0,0 +1,58 @@ +/* +Copyright 2021 Yaroslav Smirnov + * + * 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 "config_common.h" + +// Rows are doubled-up for splits +#define MATRIX_ROWS 8 +#define MATRIX_COLS 6 + +// Wiring of each half +#define MATRIX_ROW_PINS { B1, B3, B2, B6 } +#define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } +// Reversed sort + +#define DIODE_DIRECTION COL2ROW + +/* USB Device descriptor parameter */ +#define PRODUCT Elrgo S +#define MANUFACTURER Eloren +#define VENDOR_ID 0x454C +#define PRODUCT_ID 0x3436 +#define DEVICE_VER 0x0001 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/handwired/elrgo_s/elrgo_s.c b/keyboards/handwired/elrgo_s/elrgo_s.c new file mode 100644 index 0000000000..32640da061 --- /dev/null +++ b/keyboards/handwired/elrgo_s/elrgo_s.c @@ -0,0 +1,17 @@ +/* Copyright 2021 Yaroslav Smirnov + * + * 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 "elrgo_s.h" diff --git a/keyboards/handwired/elrgo_s/elrgo_s.h b/keyboards/handwired/elrgo_s/elrgo_s.h new file mode 100644 index 0000000000..0fb2b58e51 --- /dev/null +++ b/keyboards/handwired/elrgo_s/elrgo_s.h @@ -0,0 +1,38 @@ +/* Copyright 2021 Yaroslav Smirnov + * + * 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 "quantum.h" + + +#define LAYOUT_split_3x6_5(\ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L31, L32, L33, L34, L35, R30, R31, R32, R33, R34 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + {KC_NO, L31, L32, L33, L34, L35}, \ + \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { R30, R31, R32, R33, R34, KC_NO} \ +} diff --git a/keyboards/handwired/elrgo_s/info.json b/keyboards/handwired/elrgo_s/info.json new file mode 100644 index 0000000000..0b561049e1 --- /dev/null +++ b/keyboards/handwired/elrgo_s/info.json @@ -0,0 +1,59 @@ +{ + "keyboard_name": "Elrgo S", + "url": "", + "maintainer": "qmk", + "width": 17, + "height": 4, + "layouts": { + "LAYOUT_split_3x6_5": { + "layout": [ + {"label":"L00", "x":0, "y":0}, + {"label":"L01", "x":1, "y":0}, + {"label":"L02", "x":2, "y":0}, + {"label":"L03", "x":3, "y":0}, + {"label":"L04", "x":4, "y":0}, + {"label":"L05", "x":5, "y":0}, + {"label":"R00", "x":9, "y":0}, + {"label":"R01", "x":10, "y":0}, + {"label":"R02", "x":11, "y":0}, + {"label":"R03", "x":12, "y":0}, + {"label":"R04", "x":13, "y":0}, + {"label":"R05", "x":14, "y":0}, + {"label":"L10", "x":0, "y":1}, + {"label":"L11", "x":1, "y":1}, + {"label":"L12", "x":2, "y":1}, + {"label":"L13", "x":3, "y":1}, + {"label":"L14", "x":4, "y":1}, + {"label":"L15", "x":5, "y":1}, + {"label":"R10", "x":9, "y":1}, + {"label":"R11", "x":10, "y":1}, + {"label":"R12", "x":11, "y":1}, + {"label":"R13", "x":12, "y":1}, + {"label":"R14", "x":13, "y":1}, + {"label":"R15", "x":14, "y":1}, + {"label":"L20", "x":0, "y":2}, + {"label":"L21", "x":1, "y":2}, + {"label":"L22", "x":2, "y":2}, + {"label":"L23", "x":3, "y":2}, + {"label":"L24", "x":4, "y":2}, + {"label":"L25", "x":5, "y":2}, + {"label":"R20", "x":9, "y":2}, + {"label":"R21", "x":10, "y":2}, + {"label":"R22", "x":11, "y":2}, + {"label":"R23", "x":12, "y":2}, + {"label":"R24", "x":13, "y":2}, + {"label":"R25", "x":14, "y":2}, + {"label":"L31", "x":3, "y":3}, + {"label":"L32", "x":4, "y":3}, + {"label":"L33", "x":5, "y":3}, + {"label":"L34", "x":6, "y":3}, + {"label":"L35", "x":6, "y":2}, + {"label":"R30", "x":8, "y":2}, + {"label":"R31", "x":8, "y":3}, + {"label":"R32", "x":9, "y":3}, + {"label":"R33", "x":10, "y":3}, + {"label":"R34", "x":11, "y":3} + ] + } + } +} diff --git a/keyboards/handwired/elrgo_s/keymaps/default/config.h b/keyboards/handwired/elrgo_s/keymaps/default/config.h new file mode 100644 index 0000000000..f3ef42b9b4 --- /dev/null +++ b/keyboards/handwired/elrgo_s/keymaps/default/config.h @@ -0,0 +1,22 @@ +/* Copyright 2021 Yaroslav Smirnov + * + * 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 USE_SERIAL + +#define MASTER_LEFT +// #define MASTER_RIGHT diff --git a/keyboards/handwired/elrgo_s/keymaps/default/keymap.c b/keyboards/handwired/elrgo_s/keymaps/default/keymap.c new file mode 100644 index 0000000000..572edbf0b8 --- /dev/null +++ b/keyboards/handwired/elrgo_s/keymaps/default/keymap.c @@ -0,0 +1,58 @@ +/* Copyright 2021 Yaroslav Smirnov + * + * 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 layers { _QWERTY, _LOWER, _RAISE, _ADJUST }; + +#define LOWER TT(_LOWER) +#define RAISE MO(_RAISE) + +#define M_SHLL LCTL(KC_LSFT) +#define M_SHLA LCTL(KC_LALT) +#define M_BBSLS LSFT(KC_BSLS) +#define M_FLEFT LCTL(KC_LEFT) +#define M_FRIGHT LCTL(KC_RIGHT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_split_3x6_5( + KC_ESC , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSPC , + KC_LBRC , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN , KC_QUOT , + KC_RBRC , KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_GRAVE, + KC_LGUI , KC_LCTL , KC_LSFT , LOWER , M_SHLL , M_SHLA , RAISE , KC_SPC , KC_LALT , KC_ENT + ), + + [_LOWER] = LAYOUT_split_3x6_5( + KC_ESC , KC_PDOT , KC_PMNS , KC_PPLS , KC_MINS , KC_EQL , KC_MUTE , KC_MSTP , KC_MPLY , KC_MPRV , KC_MNXT , KC_BSPC , + KC_PAST , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , + KC_PSLS , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , + KC_LGUI , KC_LCTL , KC_LSFT , KC_TRNS , M_SHLL , M_SHLA , KC_TRNS , KC_SPC , KC_LALT , KC_ENT + ), + + [_RAISE] = LAYOUT_split_3x6_5( + KC_ESC , KC_PDOT , M_BBSLS , KC_BSLS , LSFT(KC_MINS), LSFT(KC_EQL), KC_HOME , KC_WH_L , KC_UP , KC_WH_R , KC_PGUP , KC_BSPC , + KC_TAB , LSFT(KC_1), LSFT(KC_2), LSFT(KC_3), LSFT(KC_4) , LSFT(KC_5) , M_FLEFT , KC_LEFT , KC_DOWN , KC_RIGHT, M_FRIGHT, KC_DEL , + LSFT(KC_TAB), LSFT(KC_6), LSFT(KC_7), LSFT(KC_8), LSFT(KC_9) , LSFT(KC_0) , KC_END , KC_F22 , KC_F23 , KC_CAPS , KC_PGDN , MO(_ADJUST), + KC_LGUI , KC_LCTL , KC_LSFT , KC_LALT , M_SHLL , M_SHLA , KC_TRNS , KC_SPC , KC_RALT , KC_ENT + ), + + [_ADJUST] = LAYOUT_split_3x6_5( + KC_NO , KC_SLEP , KC_VOLU , KC_BRIU , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NLCK , + KC_NO , KC_WAKE , KC_VOLD , KC_BRID , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , + KC_NO , KC_NO , KC_NO , KC_F13 , KC_F14 , KC_F15 , KC_F16 , KC_F17 , KC_F18 , KC_NO , KC_NO , MO(_ADJUST), + RESET , KC_NO , KC_NO , KC_TRNS , KC_NO , KC_NO , KC_TRNS , KC_TRNS , KC_NO , KC_NO + ) +}; diff --git a/keyboards/handwired/elrgo_s/readme.md b/keyboards/handwired/elrgo_s/readme.md new file mode 100644 index 0000000000..5fb5ab6acb --- /dev/null +++ b/keyboards/handwired/elrgo_s/readme.md @@ -0,0 +1,28 @@ +# Elrgo S Split Keyboard + +This is a fork of the VOID Ergo S with QMK Configurator support. + +Elrgo S uses 2x Arduino Pro Micro (ATmega32U4) with 3D printed case. + +[Building guide, models for 3D printing](https://github.com/Eloren1/Elrgo_S) + +* Keyboard Maintainer: [Eloren](https://github.com/Eloren1) +* Hardware Supported: Arduino Pro Micro +* Hardware Availability: [Open Source](https://github.com/Eloren1/Elrgo_S) + +Make example for this keyboard (after setting up your build environment): + + make handwired/elrgo_s:default + +Flashing example for this keyboard: + + make handwired/elrgo_s: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: + +* **Physical reset button**: Briefly press the button through the hole on the left side of the case. +* **Keycode in layout**: Press the key mapped to `RESET` if it is available diff --git a/keyboards/handwired/elrgo_s/rules.mk b/keyboards/handwired/elrgo_s/rules.mk new file mode 100644 index 0000000000..ed3ed34a49 --- /dev/null +++ b/keyboards/handwired/elrgo_s/rules.mk @@ -0,0 +1,23 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = caterina + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +BLUETOOTH_ENABLE = no # Enable Bluetooth +AUDIO_ENABLE = no # Audio output +SPLIT_KEYBOARD = yes From f4f679779e1404d9dc34c64823b9eb993bfa7ab3 Mon Sep 17 00:00:00 2001 From: GG <72414103+spbgzh@users.noreply.github.com> Date: Thu, 19 Aug 2021 21:17:54 +0300 Subject: [PATCH 10/10] [Keyboard] Add Mammoth20x (#14014) --- keyboards/wuque/mammoth20x/config.h | 54 +++++++++++++++++ keyboards/wuque/mammoth20x/info.json | 41 +++++++++++++ .../wuque/mammoth20x/keymaps/default/keymap.c | 36 +++++++++++ .../mammoth20x/keymaps/default/readme.md | 1 + .../wuque/mammoth20x/keymaps/via/keymap.c | 52 ++++++++++++++++ .../wuque/mammoth20x/keymaps/via/readme.md | 1 + .../wuque/mammoth20x/keymaps/via/rules.mk | 2 + keyboards/wuque/mammoth20x/mammoth20x.c | 59 +++++++++++++++++++ keyboards/wuque/mammoth20x/mammoth20x.h | 36 +++++++++++ keyboards/wuque/mammoth20x/readme.md | 22 +++++++ keyboards/wuque/mammoth20x/rules.mk | 24 ++++++++ 11 files changed, 328 insertions(+) create mode 100644 keyboards/wuque/mammoth20x/config.h create mode 100644 keyboards/wuque/mammoth20x/info.json create mode 100644 keyboards/wuque/mammoth20x/keymaps/default/keymap.c create mode 100644 keyboards/wuque/mammoth20x/keymaps/default/readme.md create mode 100644 keyboards/wuque/mammoth20x/keymaps/via/keymap.c create mode 100644 keyboards/wuque/mammoth20x/keymaps/via/readme.md create mode 100644 keyboards/wuque/mammoth20x/keymaps/via/rules.mk create mode 100644 keyboards/wuque/mammoth20x/mammoth20x.c create mode 100644 keyboards/wuque/mammoth20x/mammoth20x.h create mode 100644 keyboards/wuque/mammoth20x/readme.md create mode 100644 keyboards/wuque/mammoth20x/rules.mk diff --git a/keyboards/wuque/mammoth20x/config.h b/keyboards/wuque/mammoth20x/config.h new file mode 100644 index 0000000000..a29ab2cb21 --- /dev/null +++ b/keyboards/wuque/mammoth20x/config.h @@ -0,0 +1,54 @@ +/* +Copyright 2021 wuquestudio + +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 "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xB06B +#define PRODUCT_ID 0x0005 +#define DEVICE_VER 0x0001 +#define MANUFACTURER wuque studio +#define PRODUCT mammoth20x + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 4 + +#define MATRIX_ROW_PINS { D5, F0, F1, F4, F5, F6 } +#define MATRIX_COL_PINS { B0, B1, E6, F7 } + +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* 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 + +/* Enable encoder */ +#define ENCODERS_PAD_A { D3 } +#define ENCODERS_PAD_B { D2 } + +#define ENCODERS 1 +// Note: array is { col, row ) +#define ENCODERS_CW_KEY { { 3, 2 } } +#define ENCODERS_CCW_KEY { { 3, 4 } } diff --git a/keyboards/wuque/mammoth20x/info.json b/keyboards/wuque/mammoth20x/info.json new file mode 100644 index 0000000000..c889aa36b0 --- /dev/null +++ b/keyboards/wuque/mammoth20x/info.json @@ -0,0 +1,41 @@ +{ + "keyboard_name": "mammoth20x", + "url": "https://shop.wuquestudio.com/", + "maintainer": "spbgzh", + "width": 4, + "height": 6, + "layouts": { + "LAYOUT_default": { + "layout": [ + { "label": "Esc", "x": 0, "y": 0 }, + { "label": "Pause", "x": 1, "y": 0 }, + { "label": "Delete", "x": 2, "y": 0 }, + { "label": "E", "x": 3.5, "y": 0 }, + + { "label": "Num", "x": 0, "y": 1 }, + { "label": "/", "x": 1, "y": 1 }, + { "label": "*", "x": 2, "y": 1 }, + { "label": "-", "x": 3, "y": 1 }, + + { "label": "7", "x": 0, "y": 2 }, + { "label": "8", "x": 1, "y": 2 }, + { "label": "9", "x": 2, "y": 2 }, + { "label": "LeftEncode", "x": 3, "y": 0, "w": 0.5 }, + + { "label": "4", "x": 0, "y": 3 }, + { "label": "5", "x": 1, "y": 3 }, + { "label": "6", "x": 2, "y": 3 }, + { "label": "+", "x": 3, "y": 2, "h": 2 }, + + { "label": "1", "x": 0, "y": 4 }, + { "label": "2", "x": 1, "y": 4 }, + { "label": "3", "x": 2, "y": 4 }, + { "label": "RightEncode", "x": 4.5, "y": 0, "w" : 0.25 }, + + { "label": "0", "x": 0, "y": 5, "w": 2 }, + { "label": ".", "x": 2, "y": 5 }, + { "label": "Enter", "x": 3, "y": 4,"h":2 } + ] + } + } +} diff --git a/keyboards/wuque/mammoth20x/keymaps/default/keymap.c b/keyboards/wuque/mammoth20x/keymaps/default/keymap.c new file mode 100644 index 0000000000..77946f373d --- /dev/null +++ b/keyboards/wuque/mammoth20x/keymaps/default/keymap.c @@ -0,0 +1,36 @@ +/* Copyright 2021 wuquestudio + * + * 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_default( + KC_ESC, KC_PAUS, KC_DEL, KC_MUTE, + KC_LNUM, KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, KC_VOLU, + KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_P1, KC_P2, KC_P3, KC_VOLD, + KC_P0, KC_PDOT, KC_PENT + ), + [1] = LAYOUT_default( + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______ + ), +}; diff --git a/keyboards/wuque/mammoth20x/keymaps/default/readme.md b/keyboards/wuque/mammoth20x/keymaps/default/readme.md new file mode 100644 index 0000000000..5bad9b4558 --- /dev/null +++ b/keyboards/wuque/mammoth20x/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for mammoth20x diff --git a/keyboards/wuque/mammoth20x/keymaps/via/keymap.c b/keyboards/wuque/mammoth20x/keymaps/via/keymap.c new file mode 100644 index 0000000000..c8c434a60b --- /dev/null +++ b/keyboards/wuque/mammoth20x/keymaps/via/keymap.c @@ -0,0 +1,52 @@ +/* Copyright 2021 wuquestudio + * + * 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_default( + KC_ESC, KC_PAUS, KC_DEL, KC_MUTE, + KC_LNUM, KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, KC_VOLU, + KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_P1, KC_P2, KC_P3, KC_VOLD, + KC_P0, KC_PDOT, KC_PENT + ), + [1] = LAYOUT_default( + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______ + ), + [2] = LAYOUT_default( + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______ + ), + [3] = LAYOUT_default( + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______ + ), +}; diff --git a/keyboards/wuque/mammoth20x/keymaps/via/readme.md b/keyboards/wuque/mammoth20x/keymaps/via/readme.md new file mode 100644 index 0000000000..fcd4ba857f --- /dev/null +++ b/keyboards/wuque/mammoth20x/keymaps/via/readme.md @@ -0,0 +1 @@ +# The via keymap for mammoth20x diff --git a/keyboards/wuque/mammoth20x/keymaps/via/rules.mk b/keyboards/wuque/mammoth20x/keymaps/via/rules.mk new file mode 100644 index 0000000000..36b7ba9cbc --- /dev/null +++ b/keyboards/wuque/mammoth20x/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +LTO_ENABLE = yes diff --git a/keyboards/wuque/mammoth20x/mammoth20x.c b/keyboards/wuque/mammoth20x/mammoth20x.c new file mode 100644 index 0000000000..da6ccecd3b --- /dev/null +++ b/keyboards/wuque/mammoth20x/mammoth20x.c @@ -0,0 +1,59 @@ +/* Copyright 2021 wuquestudio + * + * 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 "mammoth20x.h" + + +static uint8_t encoder_state[ENCODERS] = {0}; +static keypos_t encoder_cw[ENCODERS] = ENCODERS_CW_KEY; +static keypos_t encoder_ccw[ENCODERS] = ENCODERS_CCW_KEY; + +void encoder_action_unregister(void) +{ + for (int index = 0; index < ENCODERS; ++index) + { + if (encoder_state[index]) + { + keyevent_t encoder_event = (keyevent_t){ + .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index], + .pressed = false, + .time = (timer_read() | 1)}; + encoder_state[index] = 0; + action_exec(encoder_event); + } + } +} +void encoder_action_register(uint8_t index, bool clockwise) +{ + keyevent_t encoder_event = (keyevent_t){ + .key = clockwise ? encoder_cw[index] : encoder_ccw[index], + .pressed = true, + .time = (timer_read() | 1)}; + encoder_state[index] = (clockwise ^ 1) | (clockwise << 1); + action_exec(encoder_event); +} + +void matrix_scan_kb(void) +{ + encoder_action_unregister(); + matrix_scan_user(); +} + +bool encoder_update_kb(uint8_t index, bool clockwise) +{ + encoder_action_register(index, clockwise); + return true; +}; diff --git a/keyboards/wuque/mammoth20x/mammoth20x.h b/keyboards/wuque/mammoth20x/mammoth20x.h new file mode 100644 index 0000000000..cd0d8d4789 --- /dev/null +++ b/keyboards/wuque/mammoth20x/mammoth20x.h @@ -0,0 +1,36 @@ +/* Copyright 2021 wuquestudio + * + * 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 "quantum.h" + +#define LAYOUT_default( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, \ + K30, K31, K32, K33, \ + K40, K41, K42, K43, \ + K50, K52, K53 \ +) { \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, K23 }, \ + { K30, K31, K32, K33 }, \ + { K40, K41, K42, K43 }, \ + { K50, KC_NO, K52, K53 }, \ +} + diff --git a/keyboards/wuque/mammoth20x/readme.md b/keyboards/wuque/mammoth20x/readme.md new file mode 100644 index 0000000000..4b731a159c --- /dev/null +++ b/keyboards/wuque/mammoth20x/readme.md @@ -0,0 +1,22 @@ +# mammoth20x +​ +More Info at[wuquestudio](https://shop.wuquestudio.com/). +​ +* Keyboard Maintainer: [spbgzh](https://github.com/spbgzh) +* Hardware Supported: mammoth20x Standard +* Hardware Availability: [mammoth20x](https://shop.wuquestudio.com/) +​ +Make example for this keyboard (after setting up your build environment): + + make wuque/mammoth20x:default + +Flashing example for this keyboard: + + make wuque/mammoth20x:default:flash + +To reset the board into bootloader mode, do one of the following: + +* Tap the Reset switch mounted on the PCB +* Hold the Esc key while connecting the USB cable (also erases persistent settings) + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/wuque/mammoth20x/rules.mk b/keyboards/wuque/mammoth20x/rules.mk new file mode 100644 index 0000000000..8431b98173 --- /dev/null +++ b/keyboards/wuque/mammoth20x/rules.mk @@ -0,0 +1,24 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +BLUETOOTH_ENABLE = no # Enable Bluetooth +AUDIO_ENABLE = no # Audio output +ENCODER_ENABLE = yes # Enable Encoder +