1
0
Fork 0

Add VIA keymap for Plaid-Pad (#10057)

* Add via keymap for Plaid-Pad

- Add VIA support for the Plaid-Pad
- Changes Vendor ID and Product ID (to follow VIA's guidelines)

* Add extra encoder pads for rev1.1

* Change Product Id from pp to PP (hex value)

* improved readme

- detailed informations about rotary encoder, bootloader and firmware

* Improved encoder informations in via keymap

* Improved encoder infos and code in default keymap

* add revision folder for rev1 and rev1.1

* change encoder assignment for defaul a via keymap

* Update keyboards/keycapsss/plaid_pad/config.h

* change revision number

* Update keyboards/keycapsss/plaid_pad/rules.mk

* Update keyboards/keycapsss/plaid_pad/rules.mk

* Update keyboards/keycapsss/plaid_pad/rules.mk

* Update keyboards/keycapsss/plaid_pad/rules.mk

* Update keyboards/keycapsss/plaid_pad/readme.md

* add license to header of *.h and *.c files

* remove the list of alternate bootloaders

- due to the pr checklist

* Update keyboards/keycapsss/plaid_pad/rules.mk
This commit is contained in:
Ben 2020-09-12 03:19:05 +02:00 committed by GitHub
parent d8d65bbf5f
commit c82865efab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 385 additions and 54 deletions

View file

@ -1,14 +1,27 @@
/* Copyright 2020 Ben Roesner (keycapsss.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0xAF12
#define DEVICE_VER 0x0001
#define VENDOR_ID 0x7983
#define PRODUCT_ID 0x5050 // "PP"
#define MANUFACTURER Keycapsss
#define PRODUCT Plaid-Pad
#define DESCRIPTION 4x4 numpad with through hole components
/* key matrix size */
#define MATRIX_ROWS 4
@ -16,11 +29,6 @@
#define MATRIX_ROW_PINS { C0, C1, C2, C3 }
#define MATRIX_COL_PINS { B0, D7, D6, D5 }
#define UNUSED_PINS { B3, B4, B5, D4}
#define ENCODERS_PAD_A { D1, B2 }
#define ENCODERS_PAD_B { D0, B1 }
#define ENCODER_RESOLUTION 4

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Ben Roesner (keycapsss.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
// place overrides here

View file

@ -28,17 +28,46 @@ void keyboard_post_init_user(void) {
}
void encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { // First encoder - top left
/*
Rev1.1 Rev1
,-----------------------, ,-----------------------,
| E1 | E2 | E3 | E4 | | E1 | | | E2 |
|-----+-----+-----+-----| |-----+-----+-----+-----|
| | | | E3 | | | | | |
|-----+-----+-----+-----| |-----+-----+-----+-----|
| | | | E2 | | | | | |
|-----+-----+-----+-----| |-----+-----+-----+-----|
| | | | E1 | | | | | |
`-----------------------' `-----------------------'
*/
// First encoder (E1)
if (index == 0) {
if (clockwise) {
tap_code(KC_RIGHT);
tap_code(KC_F17);
} else {
tap_code(KC_LEFT);
tap_code(KC_F18);
}
} else if (index == 1) { // Second encoder - top right
// Second encoder (E2)
} else if (index == 1) {
if (clockwise) {
tap_code(KC_UP);
tap_code(KC_F19);
} else {
tap_code(KC_DOWN);
tap_code(KC_F20);
}
// Third encoder (E3)
} else if (index == 2) {
if (clockwise) {
tap_code(KC_F21);
} else {
tap_code(KC_F22);
}
// Forth encoder (E4)
} else if (index == 3) {
if (clockwise) {
tap_code(KC_F23);
} else {
tap_code(KC_F24);
}
}
}

View file

@ -1,13 +0,0 @@
<img src="https://i.imgur.com/V82cMqq.png" width="200">
# Default Plaid-Pad Layout
This is the default layout for the plaid pad.
The upper left (7) and right (/) switch, can be replaced by a rotary encoder.
Encoders with built-in switch are supported and map to the original keys (7) and (/).
The upper left encoder performs a tap on "Right Arrow" (KC_RIGHT) and "Left Arrow" (KC_LEFT) when rotated clockwise and counter-clockwise in the respective direction for each step of the encoder.
The upper right encoder performs a tap on "Up Arrow" (KC_UP) and "Down Arrow" (KC_DOWN) when rotated clockwise and counter-clockwise in the respective direction for each step of the encoder.

View file

@ -0,0 +1,100 @@
/* Copyright 2020 Ben Roesner (keycapsss.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
* ,-----------------------,
* | 7 | 8 | 9 | / |
* |-----+-----+-----+-----|
* | 4 | 5 | 6 | * |
* |-----+-----+-----+-----|
* | 1 | 2 | 3 | - |
* |-----+-----+-----+-----|
* | 0 | . | = | + |
* `-----------------------'
*/
[0] = LAYOUT_ortho_4x4(
KC_P7, KC_P8, KC_P9, KC_PSLS,
KC_P4, KC_P5, KC_P6, KC_PAST,
KC_P1, KC_P2, KC_P3, KC_PMNS,
KC_P0, KC_PDOT, KC_PEQL, KC_PPLS ),
[1] = LAYOUT_ortho_4x4(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ),
[2] = LAYOUT_ortho_4x4(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
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_ortho_4x4(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ),
};
// Set LED1 state during powerup
void keyboard_post_init_user(void) {
writePinHigh(LED_RED);
}
void encoder_update_user(uint8_t index, bool clockwise) {
/*
Rev1.1 Rev1
,-----------------------, ,-----------------------,
| E1 | E2 | E3 | E4 | | E1 | | | E2 |
|-----+-----+-----+-----| |-----+-----+-----+-----|
| | | | E3 | | | | | |
|-----+-----+-----+-----| |-----+-----+-----+-----|
| | | | E2 | | | | | |
|-----+-----+-----+-----| |-----+-----+-----+-----|
| | | | E1 | | | | | |
`-----------------------' `-----------------------'
*/
// First encoder (E1)
if (index == 0) {
if (clockwise) {
tap_code(KC_F17);
} else {
tap_code(KC_F18);
}
// Second encoder (E2)
} else if (index == 1) {
if (clockwise) {
tap_code(KC_F19);
} else {
tap_code(KC_F20);
}
// Third encoder (E3)
} else if (index == 2) {
if (clockwise) {
tap_code(KC_F21);
} else {
tap_code(KC_F22);
}
// Forth encoder (E4)
} else if (index == 3) {
if (clockwise) {
tap_code(KC_F23);
} else {
tap_code(KC_F24);
}
}
}

View file

@ -0,0 +1,4 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
EXTRAKEY_ENABLE = no
MOUSEKEY_ENABLE = no

View file

@ -1 +1,17 @@
/* Copyright 2020 Ben Roesner (keycapsss.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "plaid_pad.h"

View file

@ -1,3 +1,19 @@
/* Copyright 2020 Ben Roesner (keycapsss.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "quantum.h"

View file

@ -2,24 +2,66 @@
<img src="https://i.imgur.com/Jovhxpr.jpg" width="400">
<img src="https://i.imgur.com/V82cMqq.png" width="400">
A 4x4 numpad with only through hole components.
It's a great companion to the Plaid keyboard by [hsgw](https://github.com/hsgw/) and heavily inspired by it.
A 4x4 numpad/macro pad with only through hole components. It supports up to 4 rotary encoder. The positions for the encoder are interchangeable with keyboard switches.
Below you can see the possible positions for the 4 rotary encoder (Rev1 only 2).
*If you place a encoder in the top left corner (E1), you can't use another encoder in the lower right corner.*
```
Rev1.1 Rev1
,-----------------------, ,-----------------------,
| E1 | E2 | E3 | E4 | | E1 | | | E2 |
|-----+-----+-----+-----| |-----+-----+-----+-----|
| | | | E3 | | | | | |
|-----+-----+-----+-----| |-----+-----+-----+-----|
| | | | E2 | | | | | |
|-----+-----+-----+-----| |-----+-----+-----+-----|
| | | | E1 | | | | | |
`-----------------------' `-----------------------'
```
- Encoder E1 performs a tap on `KC_F17` and `KC_F18`.
- Encoder E2 performs a tap on `KC_F19` and `KC_F20`.
- Encoder E3 performs a tap on `KC_F21` and `KC_F22`.
- Encoder E4 performs a tap on `KC_F23` and `KC_F24`.
*The F17-F24 keys are intended to be customized via [Karabiner-Elements (OSX)](https://github.com/pqrs-org/Karabiner-Elements), or [AutoHotkey](https://github.com/Lexikos/AutoHotkey_L) (WIN)*
It's a great companion to the Plaid keyboard by [hsgw](https://github.com/hsgw/) and heavily inspired by it.
* Keyboard Maintainer: BenRoe [GitHub](https://github.com/BenRoe) / [Twitter](https://twitter.com/keycapsss)
* Hardware Supported: ATmega328P with VUSB ([see Bootloader section](#Bootloader))
* Hardware Availability: [Keycapsss.com](https://keycapsss.com)
Make example for this keyboard (after setting up your build environment):
## QMK Firmware
_Bootloader and Firmware ([default keymap](https://github.com/qmk/qmk_firmware/tree/master/keyboards/keycapsss/plaid_pad)) are already on the ATmega328P chip._
Make example for this keyboard (after [setting up your build environment](https://docs.qmk.fm/#/getting_started_build_tools)):
make keycapsss/plaid_pad:default
// or
qmk compile -kb keycapsss/plaid_pad -km default
Flashing example for this keyboard:
make keycapsss/plaid_pad:default:flash
## Bootloader
- same usbasploader as Plaid ([Instruction](https://github.com/hsgw/plaid/blob/master/doc/en/bootloader.md), [Repository](https://github.com/hsgw/USBaspLoader/tree/plaid))
---
// or
qmk flash -kb keycapsss/plaid_pad -km 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).
## Bootloader
- same `usbasploader` as used for Plaid ([Instructions](https://github.com/hsgw/plaid/blob/master/doc/en/bootloader.md), [Repository](https://github.com/hsgw/USBaspLoader/tree/plaid))
### Enter bootloader mode (to flash a new firmware)
- Plug in the USB cable
- Push and hold RESET switch
- Push and hold BOOT switch
- Release RESET switch
- Release BOOT switch
or an alternative method:
- Unplug the USB cable
- Hold down the BOOT switch
- Plug in the USB cable
- Release the BOOT switch
If you succeed to enter bootloader mode, you can see usbasp in device manager, or `*** USBAsp device connected` in [QMK Toolbox](https://github.com/qmk/qmk_toolbox).

View file

@ -0,0 +1,25 @@
/* Copyright 2020 Ben Roesner (keycapsss.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#define PRODUCT Plaid-Pad Rev1
#define DEVICE_VER 0x0001
#define UNUSED_PINS { B3, B4, B5, D4}
#define ENCODERS_PAD_A { D1, B2 }
#define ENCODERS_PAD_B { D0, B1 }

View file

@ -0,0 +1,17 @@
/* Copyright 2020 Ben Roesner (keycapsss.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "rev1.h"

View file

@ -0,0 +1,19 @@
/* Copyright 2020 Ben Roesner (keycapsss.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "plaid_pad.h"

View file

@ -0,0 +1 @@
ENCODER_ENABLE = yes

View file

@ -0,0 +1,25 @@
/* Copyright 2020 Ben Roesner (keycapsss.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#define PRODUCT Plaid-Pad Rev2
#define DEVICE_VER 0x0002
#define UNUSED_PINS { }
#define ENCODERS_PAD_A { D1, B2, B4, D4 }
#define ENCODERS_PAD_B { D0, B1, B3, B5 }

View file

@ -0,0 +1,17 @@
/* Copyright 2020 Ben Roesner (keycapsss.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "rev2.h"

View file

@ -0,0 +1,19 @@
/* Copyright 2020 Ben Roesner (keycapsss.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "plaid_pad.h"

View file

@ -0,0 +1 @@
ENCODER_ENABLE = yes

View file

@ -2,19 +2,12 @@
MCU = atmega328p
# Bootloader selection
# Teensy halfkay
# Pro Micro caterina
# Atmel DFU atmel-dfu
# LUFA DFU lufa-dfu
# QMK DFU qmk-dfu
# ATmega32A bootloadHID
# ATmega328P USBasp
BOOTLOADER = USBasp
# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
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
@ -23,15 +16,11 @@ COMMAND_ENABLE = no # Commands for debug and configuration
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 on B7 by default
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
MIDI_ENABLE = no # MIDI support
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
ENCODER_ENABLE = yes
BLUETOOTH_ENABLE = no # Enable Bluetooth
AUDIO_ENABLE = no # Audio output
LAYOUTS = ortho_4x4
LAYOUTS_HAS_RGB = no
DEFAULT_FOLDER = keycapsss/plaid_pad/rev1