Skip to content

Commit a44ebb0

Browse files
authored
Merge pull request vial-kb#1 from lstubbig/macropad1x5-pretty
Add support for Macropad1x5
2 parents 05011a7 + 03d3b23 commit a44ebb0

File tree

11 files changed

+300
-0
lines changed

11 files changed

+300
-0
lines changed

keyboards/macropad1x5/config.h

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
Copyright 2021 Leon Stubbig <leonskeyboards@gmail.com>
3+
4+
This program is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU General Public License as published by
6+
the Free Software Foundation, either version 2 of the License, or
7+
(at your option) any later version.
8+
9+
This program is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU General Public License for more details.
13+
14+
You should have received a copy of the GNU General Public License
15+
along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#pragma once
19+
20+
#include "config_common.h"
21+
22+
// USB Device descriptor parameter
23+
#define VENDOR_ID 0x0801
24+
#define PRODUCT_ID 0x1133
25+
#define DEVICE_VER 0x0001
26+
#define MANUFACTURER LS Keyboards
27+
#define PRODUCT Macropad1x5 (rev1)
28+
#define DESCRIPTION 1x5 Macropad with Rotary Encoder
29+
30+
// Keyboard Matrix Assignments
31+
#define MATRIX_ROWS 1
32+
#define MATRIX_COLS 5
33+
#define DIODE_DIRECTION COL2ROW
34+
#define MATRIX_COL_PINS { D1, D7, E6, B4, B5 }
35+
#define MATRIX_ROW_PINS { F7 }
36+
37+
// layer toggle TT()
38+
#define TAPPING_TOGGLE 3
39+
40+
// encoder
41+
#define ENCODER_RESOLUTION 4
42+
#define ENCODERS_PAD_A { D0 }
43+
#define ENCODERS_PAD_B { D4 }
44+
45+
// backlight
46+
#define BACKLIGHT_PIN C6
47+
#define BACKLIGHT_LEVELS 10
48+
#define BACKLIGHT_BREATHING
49+
#define BREATHING_PERIOD 6
50+
51+
// RGB underglow
52+
#define RGB_DI_PIN F6
53+
#define RGBLED_NUM 6
54+
#define RGBLIGHT_ANIMATIONS
55+
56+
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
57+
#define DEBOUNCE 5
58+
59+
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
60+
#define LOCKING_SUPPORT_ENABLE
61+
/* Locking resynchronize hack */
62+
#define LOCKING_RESYNC_ENABLE
63+
64+
/* Vial defines*/
65+
#define DYNAMIC_KEYMAP_LAYER_COUNT 4
66+
#define VIAL_UNLOCK_COMBO_ROWS { 0, 0 }
67+
#define VIAL_UNLOCK_COMBO_COLS { 1, 4 }
68+
#define VIAL_KEYBOARD_UID {0x05, 0xE2, 0xE2, 0xAE, 0xF6, 0xED, 0xBE, 0x65}
69+
#define VIAL_ENCODER_DEFAULT { KC_VOLD, KC_VOLU, BL_DEC, BL_INC, LCTL(KC_MINUS), LCTL(KC_PLUS), KC_TRNS, KC_TRNS }

keyboards/macropad1x5/info.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"keyboard_name": "macropad1x5",
3+
"url": "",
4+
"maintainer": "lstubbig",
5+
"width": 1,
6+
"height": 5,
7+
"layouts": {
8+
"LAYOUT": {
9+
"layout": [
10+
{"x":0, "y":0},
11+
{"x":0, "y":1},
12+
{"x":0, "y":2},
13+
{"x":0, "y":3},
14+
{"x":0, "y":4}
15+
]
16+
}
17+
}
18+
}
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/* Copyright 2021 Leon Stubbig <leonskeyboards@gmail.com>
2+
*
3+
* This program is free software: you can redistribute it and/or modify
4+
* it under the terms of the GNU General Public License as published by
5+
* the Free Software Foundation, either version 2 of the License, or
6+
* (at your option) any later version.
7+
*
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
*
13+
* You should have received a copy of the GNU General Public License
14+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
*/
16+
#include QMK_KEYBOARD_H
17+
18+
// Defines names for use in layer keycodes and the keymap
19+
enum layer_names {
20+
_Media,
21+
_BL,
22+
_Extra,
23+
_Extra2
24+
};
25+
26+
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
27+
[_Media] = LAYOUT(
28+
KC_MUTE, KC_1, KC_2, KC_3, KC_4
29+
),
30+
[_BL] = LAYOUT(
31+
BL_BRTG, _______, _______, _______, BL_TOGG
32+
),
33+
[_Extra] = LAYOUT(
34+
_______, _______, _______, _______, _______
35+
),
36+
[_Extra2] = LAYOUT(
37+
_______, _______, _______, _______, _______
38+
),
39+
};
40+
41+
// #ifdef ENCODER_ENABLE
42+
void encoder_update_user(uint8_t index, bool clockwise) {
43+
if (!clockwise) {
44+
tap_code(KC_VOLD);
45+
} else {
46+
tap_code(KC_VOLU);
47+
}
48+
}
49+
// #endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Vial Keymap
2+
3+
Default keymap for the Macropad1x5. It works with [Via](https://caniusevia.com/) and [Vial](https://get.vial.today/). For use with Via the via.json needs to be loaded manually as a draft definition in the Design tab, while Vial reads the layout from the MCU. At this point the encoder is not supported in Via, the use of Vial is therefore recommended.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
VIA_ENABLE = yes
2+
VIAL_ENABLE = yes
3+
ENCODER_ENABLE = yes
4+
VIAL_ENCODERS_ENABLE = yes
5+
BACKLIGHT_ENABLE = yes
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "Macropad1x5",
3+
"vendorId": "0x0801",
4+
"productId": "0x1133",
5+
"lighting": "none",
6+
"matrix": {
7+
"rows": 1,
8+
"cols": 5
9+
},
10+
"layouts": {
11+
"keymap": [
12+
[{"y": -1, "x": 2}, "0,0", "0,1", "0,2", "0,3", "0,4"]
13+
]
14+
}
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "Macropad1x5",
3+
"vendorId": "0x0801",
4+
"productId": "0x1133",
5+
"lighting": "none",
6+
"matrix": {
7+
"rows": 1,
8+
"cols": 5
9+
},
10+
"layouts": {
11+
"keymap": [
12+
[{ "y": 0, "x": 0 },
13+
"0,0\n\n\n\n\n\n\n\n\ne",
14+
"0,1\n\n\n\n\n\n\n\n\ne"],
15+
[{"y": -1, "x": 2}, "0,0"],
16+
[{"y": -1, "x": 3.25}, "0,1", "0,2", "0,3", "0,4"]
17+
]
18+
}
19+
}

keyboards/macropad1x5/macropad1x5.c

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include "macropad1x5.h"
2+
3+
void eeconfig_init_kb(void) {
4+
#ifdef BACKLIGHT_ENABLE
5+
backlight_enable();
6+
backlight_level(5);
7+
#endif
8+
#ifdef RGBLIGHT_ENABLE
9+
rgblight_enable(); // Enable RGB by default
10+
rgblight_sethsv(0, 255, 255); // Set default HSV - red hue, full saturation, full brightness
11+
#ifdef RGBLIGHT_ANIMATIONS
12+
rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL + 2); // set to RGB_RAINBOW_SWIRL by default
13+
#endif
14+
#endif
15+
16+
eeconfig_update_kb(0);
17+
eeconfig_init_user();
18+
}

keyboards/macropad1x5/macropad1x5.h

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/* Copyright 2021 Leon Stubbig <leonskeyboards@gmail.com>
2+
*
3+
* This program is free software: you can redistribute it and/or modify
4+
* it under the terms of the GNU General Public License as published by
5+
* the Free Software Foundation, either version 2 of the License, or
6+
* (at your option) any later version.
7+
*
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
*
13+
* You should have received a copy of the GNU General Public License
14+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
*/
16+
#pragma once
17+
18+
#include "quantum.h"
19+
20+
// Select revision
21+
#if defined(KEYBOARD_macropad1x5_rev01)
22+
#include "rev01.h"
23+
#elif defined(KEYBOARD_macropad1x5_rev03)
24+
#include "rev03.h"
25+
#endif
26+
27+
/* This a shortcut to help you visually see your layout.
28+
*
29+
* The first section contains all of the arguments representing the physical
30+
* layout of the board and position of the keys.
31+
*
32+
* The second converts the arguments into a two-dimensional array which
33+
* represents the switch matrix.
34+
*/
35+
#define LAYOUT( \
36+
K1, K2, K3, K4, K5 \
37+
) { \
38+
{ K1, K2, K3, K4, K5 } \
39+
}
40+
41+
// Layout for encoders without button
42+
#define LAYOUT_1x4( \
43+
K2, K3, K4, K5 \
44+
) { \
45+
{ KC_NO, K2, K3, K4, K5 } \
46+
}

keyboards/macropad1x5/readme.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Macropad1x5 by LS Keyboards and Pikatea
2+
3+
<img src="https://cdn.shopify.com/s/files/1/0322/9637/0235/products/2021-04-0216.41.40_crop_800x.jpg?v=1617378294" width="500">
4+
5+
A table-mounted acrylic macropad with a rotary encoder to the left and four mechanical switches. Supports [Via](https://caniusevia.com/) and [Vial](https://get.vial.today/).
6+
7+
Keyboard Maintainer: [Leon Stubbig](https://github.com/lstubbig)
8+
Hardware Supported: Pro Micro, Elite-C
9+
Hardware Availability: [pikatea.com](https://www.pikatea.com/products/pikatea-leon-macropad-5x1-kit)
10+
11+
Make example for this keyboard (after setting up your build environment):
12+
13+
make macropad1x5:via
14+
15+
Flash with
16+
17+
make macropad1x5:via:flash
18+
19+
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).

keyboards/macropad1x5/rules.mk

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# MCU name
2+
MCU = atmega32u4
3+
4+
# Bootloader selection
5+
# Teensy halfkay
6+
# Pro Micro caterina
7+
# Atmel DFU atmel-dfu
8+
# LUFA DFU lufa-dfu
9+
# QMK DFU qmk-dfu
10+
# ATmega32A bootloadHID
11+
# ATmega328P USBasp
12+
BOOTLOADER = caterina
13+
14+
# Build Options
15+
# change yes to no to disable
16+
#
17+
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
18+
MOUSEKEY_ENABLE = yes # Mouse keys
19+
EXTRAKEY_ENABLE = yes # Audio control and System control
20+
CONSOLE_ENABLE = no # Console for debug
21+
COMMAND_ENABLE = no # Commands for debug and configuration
22+
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
23+
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
24+
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
25+
NKRO_ENABLE = no # USB Nkey Rollover
26+
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
27+
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
28+
MIDI_ENABLE = no # MIDI support
29+
UNICODE_ENABLE = no # Unicode
30+
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
31+
AUDIO_ENABLE = no # Audio output on port C6
32+
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
33+
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
34+
ENCODER_ENABLE = yes
35+
36+
# for via
37+
LEADER_ENABLE = no
38+
KEY_LOCK_ENABLE = no
39+
TERMINAL_ENABLE = no

0 commit comments

Comments
 (0)