aboutsummaryrefslogtreecommitdiff
path: root/keyboards/maxr1998
diff options
context:
space:
mode:
authorMax Rumpf <max.rumpf1998@gmail.com>2019-06-26 22:42:14 +0200
committerDrashna Jaelre <drashna@live.com>2019-06-26 13:42:14 -0700
commit49699294b63b1fd36c504d4949dd6fbb19442cf3 (patch)
tree96fa9c5a2a7cd0f947d38ad6b7517ece55d1f94c /keyboards/maxr1998
parentd4ff836d6449b442e6f5ddc31678a489d0f6b3d6 (diff)
downloadqmk_firmware-49699294b63b1fd36c504d4949dd6fbb19442cf3.tar.gz
qmk_firmware-49699294b63b1fd36c504d4949dd6fbb19442cf3.zip
[Keyboard] Add Pulse 4k, a macropad by Maxr1998 (#6195)
* Add Pulse 4k, a macropad by Maxr1998 * Some config tweaks * Remove image note * Add license headers * Fix media keys * Remove Play/pause again as it doesn't work on Linux
Diffstat (limited to 'keyboards/maxr1998')
-rw-r--r--keyboards/maxr1998/pulse4k/config.h76
-rw-r--r--keyboards/maxr1998/pulse4k/info.json20
-rw-r--r--keyboards/maxr1998/pulse4k/keymaps/default/keymap.c48
-rw-r--r--keyboards/maxr1998/pulse4k/keymaps/default/rules.mk0
-rw-r--r--keyboards/maxr1998/pulse4k/pulse4k.c61
-rw-r--r--keyboards/maxr1998/pulse4k/pulse4k.h33
-rw-r--r--keyboards/maxr1998/pulse4k/readme.md11
-rw-r--r--keyboards/maxr1998/pulse4k/rules.mk33
8 files changed, 282 insertions, 0 deletions
diff --git a/keyboards/maxr1998/pulse4k/config.h b/keyboards/maxr1998/pulse4k/config.h
new file mode 100644
index 000000000..cb4eab699
--- /dev/null
+++ b/keyboards/maxr1998/pulse4k/config.h
@@ -0,0 +1,76 @@
1/*
2Copyright (C) 2012-2019 Jun Wako <wakojun@gmail.com>, Maxr1998 <max.rumpf1998@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along 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 0xFEED
24#define PRODUCT_ID 0x6060
25#define DEVICE_VER 0x0001
26#define MANUFACTURER Maxr1998
27#define PRODUCT Pulse 4k
28#define DESCRIPTION A four-key macropad
29
30/* Key matrix size */
31#define MATRIX_ROWS 2
32#define MATRIX_COLS 3
33
34/* Matrix pins */
35#define MATRIX_ROW_PINS { B4, E6 }
36#define MATRIX_COL_PINS { B7, B3, F0 }
37#define UNUSED_PINS
38
39/* COL2ROW or ROW2COL */
40#define DIODE_DIRECTION COL2ROW
41
42/* Set 0 if debouncing isn't needed */
43#define DEBOUNCE 5
44
45/* Rotary encoders */
46#define NUMBER_OF_ENCODERS 2
47#define ENCODERS_PAD_A { D2, F6 }
48#define ENCODERS_PAD_B { D3, F5 }
49#define ENCODER_RESOLUTION 4
50
51/* Combo setup */
52#define COMBO_COUNT 1
53#define COMBO_TERM 150
54
55/* RGB LED Setup */
56#define RGB_DI_PIN F7 // pin the DI on the WS2812B is hooked-up to
57#define RGBLIGHT_ANIMATIONS // run RGB animations
58#define RGBLED_NUM 2 // number of LEDs
59
60/*
61 * Feature disable options
62 * These options are also useful to firmware size reduction.
63 */
64
65/* disable debug print */
66//#define NO_DEBUG
67
68/* disable print */
69//#define NO_PRINT
70
71/* disable action features */
72//#define NO_ACTION_LAYER
73//#define NO_ACTION_TAPPING
74//#define NO_ACTION_ONESHOT
75//#define NO_ACTION_MACRO
76//#define NO_ACTION_FUNCTION
diff --git a/keyboards/maxr1998/pulse4k/info.json b/keyboards/maxr1998/pulse4k/info.json
new file mode 100644
index 000000000..0ac4f063c
--- /dev/null
+++ b/keyboards/maxr1998/pulse4k/info.json
@@ -0,0 +1,20 @@
1{
2 "keyboard_name": "Pulse 4k",
3 "keyboard_folder": "maxr1998/pulse4k",
4 "url": "https://github.com/Maxr1998/Pulse_4k",
5 "maintainer": "Maxr1998",
6 "width": 3,
7 "height": 2,
8 "layouts": {
9 "LAYOUT_pulse4k": {
10 "key_count": 6,
11 "layout": [
12 { "w": 1, "x": 0, "y": 0 },
13 { "w": 1, "x": 1, "y": 0 },
14 { "w": 1, "x": 2, "y": 0 },
15 { "w": 1, "x": 0, "y": 1 },
16 { "w": 1, "x": 1, "y": 1 },
17 { "w": 1, "x": 2, "y": 1 } ]
18 }
19 }
20}
diff --git a/keyboards/maxr1998/pulse4k/keymaps/default/keymap.c b/keyboards/maxr1998/pulse4k/keymaps/default/keymap.c
new file mode 100644
index 000000000..873c87d1f
--- /dev/null
+++ b/keyboards/maxr1998/pulse4k/keymaps/default/keymap.c
@@ -0,0 +1,48 @@
1/*
2Copyright (C) 2019 Maxr1998 <max.rumpf1998@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#include QMK_KEYBOARD_H
19
20enum layers {
21 DEFAULT
22};
23
24const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
25 [DEFAULT] = {
26 { KC_END, KC_UP, KC_MUTE },
27 { KC_LEFT, KC_DOWN, KC_RGHT }
28 }
29};
30
31void matrix_init_user(void) {
32}
33
34void encoder_one_update(bool clockwise) {
35 if (clockwise) {
36 tap_code(KC_PGDN);
37 } else {
38 tap_code(KC_PGUP);
39 }
40}
41
42void encoder_two_update(bool clockwise) {
43 if (clockwise) {
44 tap_code(KC_VOLU);
45 } else {
46 tap_code(KC_VOLD);
47 }
48}
diff --git a/keyboards/maxr1998/pulse4k/keymaps/default/rules.mk b/keyboards/maxr1998/pulse4k/keymaps/default/rules.mk
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/keyboards/maxr1998/pulse4k/keymaps/default/rules.mk
diff --git a/keyboards/maxr1998/pulse4k/pulse4k.c b/keyboards/maxr1998/pulse4k/pulse4k.c
new file mode 100644
index 000000000..ee3d41ccd
--- /dev/null
+++ b/keyboards/maxr1998/pulse4k/pulse4k.c
@@ -0,0 +1,61 @@
1/*
2Copyright (C) 2019 Maxr1998 <max.rumpf1998@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#include "pulse4k.h"
19#include "rgblight.h"
20
21enum combo_events {
22 LED_ADJUST
23};
24
25const uint16_t PROGMEM led_adjust_combo[] = {KC_LEFT, KC_RGHT, COMBO_END};
26
27combo_t key_combos[COMBO_COUNT] = {
28 [LED_ADJUST] = COMBO_ACTION(led_adjust_combo)
29};
30
31bool led_adjust_active = false;
32
33void matrix_init_kb(void) {
34 matrix_init_user();
35}
36
37void process_combo_event(uint8_t combo_index, bool pressed) {
38 if (combo_index == LED_ADJUST) {
39 led_adjust_active = pressed;
40 }
41}
42
43void encoder_update_kb(uint8_t index, bool clockwise) {
44 if (index == 0) {
45 if (led_adjust_active) {
46 if (clockwise) {
47 rgblight_increase_val();
48 } else {
49 rgblight_decrease_val();
50 }
51 } else encoder_one_update(clockwise);
52 } else if (index == 1) {
53 if (led_adjust_active) {
54 if (clockwise) {
55 rgblight_increase_hue();
56 } else {
57 rgblight_decrease_hue();
58 }
59 } else encoder_two_update(clockwise);
60 }
61}
diff --git a/keyboards/maxr1998/pulse4k/pulse4k.h b/keyboards/maxr1998/pulse4k/pulse4k.h
new file mode 100644
index 000000000..7c34870d6
--- /dev/null
+++ b/keyboards/maxr1998/pulse4k/pulse4k.h
@@ -0,0 +1,33 @@
1/*
2Copyright (C) 2019 Maxr1998 <max.rumpf1998@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#pragma once
19
20#include "quantum.h"
21
22#define LAYOUT( \
23 k00, k01, k02, \
24 k10, k11, k12 \
25) \
26{ \
27 { k00, k01, k02 }, \
28 { k10, k11, k12 }, \
29}
30
31void encoder_one_update(bool clockwise);
32
33void encoder_two_update(bool clockwise);
diff --git a/keyboards/maxr1998/pulse4k/readme.md b/keyboards/maxr1998/pulse4k/readme.md
new file mode 100644
index 000000000..3a552188d
--- /dev/null
+++ b/keyboards/maxr1998/pulse4k/readme.md
@@ -0,0 +1,11 @@
1# Pulse 4k
2A four-key macropad with two rotary encoders, developed by Maxr1998, [fully open-source](https://github.com/Maxr1998/Pulse_4k).
3
4Keyboard Maintainer: [Maxr1998](https://github.com/Maxr1998)
5Hardware Availability: DIY from the [open-source design files](https://github.com/Maxr1998/Pulse_4k), potential official distribution in the future
6
7Make example for this keyboard (after setting up your build environment):
8
9 make maxr1998/pulse4k:default
10
11See 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/maxr1998/pulse4k/rules.mk b/keyboards/maxr1998/pulse4k/rules.mk
new file mode 100644
index 000000000..644666221
--- /dev/null
+++ b/keyboards/maxr1998/pulse4k/rules.mk
@@ -0,0 +1,33 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader
5# This definition is optional, and if your keyboard supports multiple bootloaders of
6# different sizes, comment this out, and the correct address will be loaded
7# automatically (+60). See bootloader.mk for all options.
8BOOTLOADER = atmel-dfu
9
10# Interrupt driven control endpoint task(+60)
11OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
12
13# Build Options
14# change to "no" to disable the options, or define them in the Makefile in
15# the appropriate keymap folder that will get included automatically
16#
17BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000)
18MOUSEKEY_ENABLE = no # Mouse keys(+4700)
19ENCODER_ENABLE = yes # Rotary encoders
20EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
21CONSOLE_ENABLE = yes # Console for debug(+400)
22COMMAND_ENABLE = no # Commands for debug and configuration
23COMBO_ENABLE = yes # Key combo feature
24NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
25BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
26MIDI_ENABLE = no # MIDI controls
27AUDIO_ENABLE = no # Audio output on port C6
28UNICODE_ENABLE = no # Unicode
29BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
30RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
31API_SYSEX_ENABLE = no
32SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
33