diff options
Diffstat (limited to 'keyboards/qvex/lynepad')
-rw-r--r-- | keyboards/qvex/lynepad/config.h | 63 | ||||
-rw-r--r-- | keyboards/qvex/lynepad/info.json | 12 | ||||
-rw-r--r-- | keyboards/qvex/lynepad/keymaps/default/keymap.c | 117 | ||||
-rw-r--r-- | keyboards/qvex/lynepad/keymaps/default/readme.md | 1 | ||||
-rw-r--r-- | keyboards/qvex/lynepad/lynepad.c | 58 | ||||
-rw-r--r-- | keyboards/qvex/lynepad/lynepad.h | 37 | ||||
-rw-r--r-- | keyboards/qvex/lynepad/readme.md | 13 | ||||
-rw-r--r-- | keyboards/qvex/lynepad/rules.mk | 21 |
8 files changed, 322 insertions, 0 deletions
diff --git a/keyboards/qvex/lynepad/config.h b/keyboards/qvex/lynepad/config.h new file mode 100644 index 0000000000..d1a5c2eb0b --- /dev/null +++ b/keyboards/qvex/lynepad/config.h @@ -0,0 +1,63 @@ +/* +Copyright 2020 KemoNine + +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 <http://www.gnu.org/licenses/>. +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x5156 +#define PRODUCT_ID 0x4C50 +#define DEVICE_VER 0x0001 +#define MANUFACTURER QVEX +#define PRODUCT Lynepad + +/* key matrix size */ +#define MATRIX_ROWS 3 +#define MATRIX_COLS 4 + +/* Basic matrix config */ +#define MATRIX_ROW_PINS { C7, F7, F6} +#define MATRIX_COL_PINS { F0, F1, F4, F5 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Encoders */ +#define ENCODERS_PAD_A { D0, B5 } +#define ENCODERS_PAD_B { D1, D6 } + +/* LEDs */ +#define RGB_DI_PIN D3 +#ifdef RGB_DI_PIN +#undef RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 4 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#define RGBLIGHT_LIMIT_VAL 240 +#endif + +/* Definitions for encoder tilt/press support */ +#define ENC_TILT_THRESHOLD 1 +#define PIN_TW_SW D2 // Center +#define PIN_RJ_SW C6 // Center +#define PIN_RJ_DIR_A D4 // Up +#define PIN_RJ_DIR_B D7 // Left +#define PIN_RJ_DIR_C B6 // Down +#define PIN_RJ_DIR_D B4 // Right diff --git a/keyboards/qvex/lynepad/info.json b/keyboards/qvex/lynepad/info.json new file mode 100644 index 0000000000..405614e9f0 --- /dev/null +++ b/keyboards/qvex/lynepad/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "QVEX Lynepad", + "url": "https://www.tindie.com/products/qvex_tech/qvex-lynepad-macro-keypad/", + "maintainer": "KemoNine", + "width": 4, + "height": 3, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}] + } + } + }
\ No newline at end of file diff --git a/keyboards/qvex/lynepad/keymaps/default/keymap.c b/keyboards/qvex/lynepad/keymaps/default/keymap.c new file mode 100644 index 0000000000..37e015e624 --- /dev/null +++ b/keyboards/qvex/lynepad/keymaps/default/keymap.c @@ -0,0 +1,117 @@ +/* Copyright 2020 KemoNine + * + * 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 <http://www.gnu.org/licenses/>. + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap (Base Layer) Default Layer + * |----------------------------| + * | 1 | 2 | 3 | 4 | | + * | 5 | 6 | 7 | 8 | | + * | 9 | 10 | 11 | | + * |----------------------------| + */ +[0] = LAYOUT( + KC_MS_BTN4, KC_MS_BTN2, KC_MS_UP, KC_MS_BTN1, + KC_MS_BTN5, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, + KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2 + ) +}; + +// Standard encoder functionality +void encoder_update_user(uint8_t index, bool clockwise) { + // Process encoder rotational movements + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_AUDIO_VOL_DOWN); + } else { + tap_code(KC_AUDIO_VOL_UP); + } + } else if (index == 1) { /* Second encoder */ + if (clockwise) { + tap_code(KC_MS_WH_UP); + } else { + tap_code(KC_MS_WH_DOWN); + } + } +} + +// Encoder press / tilt event handling +// the core lynepad implementation will update the below variables on each matrix scan +// Update the various codes below for customizing the tilt / push config + +extern int16_t enc1Center; +extern int16_t enc1CenterPrev; +extern int16_t enc2Center; +extern int16_t enc2CenterPrev; +extern int16_t enc2Up; +extern int16_t enc2UpPrev; +extern int16_t enc2Down; +extern int16_t enc2DownPrev; +extern int16_t enc2Left; +extern int16_t enc2LeftPrev; +extern int16_t enc2Right; +extern int16_t enc2RightPrev; + +void matrix_scan_user(void) { + if (enc1Center != enc1CenterPrev) { + if (enc1Center < ENC_TILT_THRESHOLD) { + } + else { + reset_keyboard(); + } + } + if (enc2Center != enc2CenterPrev) { + if (enc2Center < ENC_TILT_THRESHOLD) { + register_code16(KC_MS_BTN3); + } + else { + unregister_code16(KC_MS_BTN3); + } + /* + * Encoder sets ALL values when center is pressed so bail out at this point\ + * to avoid the rest of the encoder buttons registering events + */ + return; + } + if (enc2Up != enc2UpPrev) { + if (enc2Up < ENC_TILT_THRESHOLD) { + } + else { + rgblight_increase_val_noeeprom(); + } + } + if (enc2Down != enc2DownPrev) { + if (enc2Down < ENC_TILT_THRESHOLD) { + } + else { + rgblight_decrease_val_noeeprom(); + } + } + if (enc2Left != enc2LeftPrev) { + if (enc2Left < ENC_TILT_THRESHOLD) { + } + else { + rgblight_toggle_noeeprom(); + } + } + if (enc2Right != enc2RightPrev) { + if (enc2Right < ENC_TILT_THRESHOLD) { + } + else { + rgblight_step_noeeprom(); + } + } +} diff --git a/keyboards/qvex/lynepad/keymaps/default/readme.md b/keyboards/qvex/lynepad/keymaps/default/readme.md new file mode 100644 index 0000000000..8884d1a91a --- /dev/null +++ b/keyboards/qvex/lynepad/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for lynepad diff --git a/keyboards/qvex/lynepad/lynepad.c b/keyboards/qvex/lynepad/lynepad.c new file mode 100644 index 0000000000..33620d9da3 --- /dev/null +++ b/keyboards/qvex/lynepad/lynepad.c @@ -0,0 +1,58 @@ +/* +Copyright 2020 KemoNine +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 <http://www.gnu.org/licenses/>. +*/ +#include "lynepad.h" + +void keyboard_pre_init_kb(void) { + // Encoder pins + setPinInput(PIN_TW_SW); + setPinInput(PIN_RJ_SW); + setPinInput(PIN_RJ_DIR_A); + setPinInput(PIN_RJ_DIR_C); + setPinInput(PIN_RJ_DIR_B); + setPinInput(PIN_RJ_DIR_D); + + keyboard_pre_init_user(); +} + +int16_t enc1Center = 1; +int16_t enc1CenterPrev = 1; +int16_t enc2Center = 1; +int16_t enc2CenterPrev = 1; +int16_t enc2Up = 1; +int16_t enc2UpPrev = 1; +int16_t enc2Down = 1; +int16_t enc2DownPrev = 1; +int16_t enc2Left = 1; +int16_t enc2LeftPrev = 1; +int16_t enc2Right = 1; +int16_t enc2RightPrev = 1; + +void matrix_scan_kb(void) { + enc1CenterPrev = enc1Center; + enc1Center = readPin(PIN_TW_SW); + + enc2CenterPrev = enc2Center; + enc2Center = readPin(PIN_RJ_SW); + enc2UpPrev = enc2Up; + enc2Up = readPin(PIN_RJ_DIR_A); + enc2DownPrev = enc2Down; + enc2Down = readPin(PIN_RJ_DIR_C); + enc2LeftPrev = enc2Left; + enc2Left = readPin(PIN_RJ_DIR_B); + enc2RightPrev = enc2Right; + enc2Right = readPin(PIN_RJ_DIR_D); + + // Ensure any user customizations are called (for some reason this wasn't happening by default) + matrix_scan_user(); +} diff --git a/keyboards/qvex/lynepad/lynepad.h b/keyboards/qvex/lynepad/lynepad.h new file mode 100644 index 0000000000..2a3015ceea --- /dev/null +++ b/keyboards/qvex/lynepad/lynepad.h @@ -0,0 +1,37 @@ +/* Copyright 2020 KemoNine + * + * 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 <http://www.gnu.org/licenses/>. + */ +#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( \ + k00, k01, k02, k03, \ + k10, k11, k12, k13, \ + k20, k21, k22 \ +) \ +{ \ + { k00, k01, k02, k03 }, \ + { k10, k11, k12, k13 }, \ + { k20, k21, k22, KC_NO } \ +} diff --git a/keyboards/qvex/lynepad/readme.md b/keyboards/qvex/lynepad/readme.md new file mode 100644 index 0000000000..68dd85a673 --- /dev/null +++ b/keyboards/qvex/lynepad/readme.md @@ -0,0 +1,13 @@ +# QVEX Lynepad + +Macro pad with 11 keys and 2 rotary encoders. + +* Keyboard Maintainer: [KemoNine](https://git.kemonine.info/kemonine/keyboard) +* Hardware Supported: QVEX Lynepad: macro keypad +* Hardware Availability: Tindie [Keyboard Kit](https://www.tindie.com/products/qvex_tech/qvex-lynepad-macro-keypad/) + +Make example for this macro pad (after setting up your build environment): + + make qvex/lynepad: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/qvex/lynepad/rules.mk b/keyboards/qvex/lynepad/rules.mk new file mode 100644 index 0000000000..7b05cfb9b8 --- /dev/null +++ b/keyboards/qvex/lynepad/rules.mk @@ -0,0 +1,21 @@ +# 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 = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +ENCODER_ENABLE = yes # Enable the encoders |