aboutsummaryrefslogtreecommitdiff
path: root/keyboards/dumbpad/v1x
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/dumbpad/v1x')
-rw-r--r--keyboards/dumbpad/v1x/config.h42
-rw-r--r--keyboards/dumbpad/v1x/info.json16
-rw-r--r--keyboards/dumbpad/v1x/keymaps/default/keymap.c107
-rw-r--r--keyboards/dumbpad/v1x/keymaps/imchipwood/keymap.c95
-rw-r--r--keyboards/dumbpad/v1x/keymaps/numpad_media/keymap.c88
-rw-r--r--keyboards/dumbpad/v1x/readme.md15
-rw-r--r--keyboards/dumbpad/v1x/rules.mk21
-rw-r--r--keyboards/dumbpad/v1x/templates/keymap.c26
-rw-r--r--keyboards/dumbpad/v1x/v1x.c69
-rw-r--r--keyboards/dumbpad/v1x/v1x.h30
10 files changed, 509 insertions, 0 deletions
diff --git a/keyboards/dumbpad/v1x/config.h b/keyboards/dumbpad/v1x/config.h
new file mode 100644
index 000000000..0d967a6a0
--- /dev/null
+++ b/keyboards/dumbpad/v1x/config.h
@@ -0,0 +1,42 @@
1/*
2Copyright 2020 imchipwood
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#pragma once
18
19#include "config_common.h"
20
21/* USB Device descriptor parameter */
22#define DEVICE_VER 0x0010
23
24/* Column/Row IO definitions */
25#define MATRIX_ROWS 4
26#define MATRIX_COLS 5
27#define MATRIX_ROW_PINS { F4, F5, F6, F7 }
28#define MATRIX_COL_PINS { C6, D7, E6, B4, B5 }
29#define UNUSED_PINS
30
31/* Single rotary encoder */
32#define ENCODERS_PAD_A { B2 }
33#define ENCODERS_PAD_B { D4 }
34
35/* Onboard LEDs */
36#define LED_00 B6
37#define LED_01 B1
38#define LED_02 B3
39
40/* Bootmagic - hold down rotary encoder pushbutton while plugging in to enter bootloader */
41#define BOOTMAGIC_LITE_ROW 3
42#define BOOTMAGIC_LITE_COLUMN 0
diff --git a/keyboards/dumbpad/v1x/info.json b/keyboards/dumbpad/v1x/info.json
new file mode 100644
index 000000000..24c73bfec
--- /dev/null
+++ b/keyboards/dumbpad/v1x/info.json
@@ -0,0 +1,16 @@
1{
2 "keyboard_name": "dumbpad/v1x",
3 "keyboard_folder": "dumbpad/v1x",
4 "url": "https://www.github.com/imchipwood/dumbpad",
5 "maintainer": "imchipwood",
6 "layouts": {
7 "LAYOUT": {
8 "layout": [
9 {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0},
10 {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1},
11 {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2},
12 {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}
13 ]
14 }
15 }
16}
diff --git a/keyboards/dumbpad/v1x/keymaps/default/keymap.c b/keyboards/dumbpad/v1x/keymaps/default/keymap.c
new file mode 100644
index 000000000..22fbd24c0
--- /dev/null
+++ b/keyboards/dumbpad/v1x/keymaps/default/keymap.c
@@ -0,0 +1,107 @@
1/* Copyright 2020 imchipwood
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
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 /*
20 BASE LAYER
21 /-----------------------------------------------------`
22 | | 7 | 8 | 9 | Bkspc |
23 | |---------|---------|---------|---------|
24 | | 4 | 5 | 6 | Esc |
25 | |---------|---------|---------|---------|
26 | | 1 | 2 | 3 | Tab |
27 |-------------|---------|---------|---------|---------|
28 | Left mouse | TT(1) | 0 | . | Enter |
29 \-----------------------------------------------------'
30 */
31 [0] = LAYOUT(
32 KC_7, KC_8, KC_9, KC_BSPC,
33 KC_4, KC_5, KC_6, KC_ESC,
34 KC_1, KC_2, KC_3, KC_TAB,
35 KC_BTN1, TT(1), KC_0, LSFT_T(KC_DOT), KC_ENTER
36 ),
37 /*
38 SUB LAYER
39 /-----------------------------------------------------`
40 | | | | | Reset |
41 | |---------|---------|---------|---------|
42 | | | | | + |
43 | |---------|---------|---------|---------|
44 | | | | | - |
45 |-------------|---------|---------|---------|---------|
46 | LOCK | | | | = |
47 \-----------------------------------------------------'
48 */
49 [1] = LAYOUT(
50 _______, _______, _______, RESET,
51 _______, _______, _______, KC_KP_PLUS,
52 _______, _______, _______, KC_KP_MINUS,
53 KC_LOCK, _______, _______, _______, KC_EQL
54 ),
55};
56
57bool process_record_user(uint16_t keycode, keyrecord_t *record) {
58 // If console is enabled, it will print the matrix position and status of each key pressed
59/*
60#ifdef CONSOLE_ENABLE
61 uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
62#endif
63*/
64 return true;
65}
66
67void keyboard_post_init_user(void) {
68 // Customise these values to desired behaviour
69 //debug_enable = true;
70 //debug_matrix = true;
71 //debug_keyboard = true;
72 //debug_mouse = true;
73}
74
75bool encoder_update_user(uint8_t index, bool clockwise) {
76 /* Custom encoder control - handles CW/CCW turning of encoder
77 * Default behavior:
78 * main layer:
79 * CW: move mouse right
80 * CCW: move mouse left
81 * other layers:
82 * CW: = (equals/plus - increase slider in Adobe products)
83 * CCW: - (minus/underscore - decrease slider in adobe products)
84 */
85 if (index == 0) {
86 switch (get_highest_layer(layer_state)) {
87 case 0:
88 // main layer - move mouse right (CW) and left (CCW)
89 if (clockwise) {
90 tap_code(KC_MS_R);
91 } else {
92 tap_code(KC_MS_L);
93 }
94 break;
95
96 default:
97 // other layers - =/+ (quals/plus) (CW) and -/_ (minus/underscore) (CCW)
98 if (clockwise) {
99 tap_code(KC_EQL);
100 } else {
101 tap_code(KC_MINS);
102 }
103 break;
104 }
105 }
106 return true;
107}
diff --git a/keyboards/dumbpad/v1x/keymaps/imchipwood/keymap.c b/keyboards/dumbpad/v1x/keymaps/imchipwood/keymap.c
new file mode 100644
index 000000000..96a98b11c
--- /dev/null
+++ b/keyboards/dumbpad/v1x/keymaps/imchipwood/keymap.c
@@ -0,0 +1,95 @@
1/* Copyright 2020 imchipwood
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#include "imchipwood.h"
18
19enum custom_layers {
20 _BASE,
21 _SUB,
22};
23
24const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
25 /*
26 BASE LAYER
27 /-----------------------------------------------------`
28 | | 7 | 8 | 9 | Bkspc |
29 | |---------|---------|---------|---------|
30 | | 4 | 5 | 6 | + |
31 | |---------|---------|---------|---------|
32 | | 1 | 2 | 3 | * |
33 |-------------|---------|---------|---------|---------|
34 | Play/Pause | TT(SUB) | 0 | . | Enter |
35 \-----------------------------------------------------'
36 */
37 [_BASE] = LAYOUT(
38 KC_P7, KC_P8, KC_P9, KC_BSPC,
39 KC_P4, KC_P5, KC_P6, KC_KP_PLUS,
40 KC_P1, KC_P2, KC_P3, KC_KP_ASTERISK,
41 MEH_T(KC_MPLY), TT(_SUB), KC_P0, KC_PDOT, KC_KP_ENTER
42 ),
43 /*
44 SUB LAYER
45 /-----------------------------------------------------`
46 | | F7 | F8 | F9 | Del/NLK |
47 | |---------|---------|---------|---------|
48 | | F4 | F5 | F6 | - |
49 | |---------|---------|---------|---------|
50 | | F1 | F2 | F3 | / |
51 |-------------|---------|---------|---------|---------|
52 | MUTE | | LSFT | LCTL | = |
53 \-----------------------------------------------------'
54 */
55 [_SUB] = LAYOUT(
56 TD(ALT_F7), KC_F8, KC_F9, TD(DEL_NLCK),
57 KC_F4, TD(CTL_F5), KC_F6, KC_KP_MINUS,
58 KC_F1, TD(ALT_F2), KC_F3, KC_KP_SLASH,
59 KC_MUTE, _______, OSM(MOD_LSFT), OSM(MOD_LCTL), KC_KP_EQUAL
60 )
61};
62
63bool encoder_update_user(uint8_t index, bool clockwise) {
64 if (index == 0) {
65 switch (get_highest_layer(layer_state)) {
66 case _BASE:
67 // main layer - volume up/down
68 if (clockwise) {
69 tap_code(KC_VOLU);
70 } else {
71 tap_code(KC_VOLD);
72 }
73 break;
74
75 case _SUB:
76 // sub layer - next/previous track
77 if (clockwise) {
78 tap_code(KC_MNXT);
79 } else {
80 tap_code(KC_MPRV);
81 }
82 break;
83
84 default:
85 // default - volume up/down
86 if (clockwise) {
87 tap_code(KC_VOLU);
88 } else {
89 tap_code(KC_VOLD);
90 }
91 break;
92 }
93 }
94 return true;
95}
diff --git a/keyboards/dumbpad/v1x/keymaps/numpad_media/keymap.c b/keyboards/dumbpad/v1x/keymaps/numpad_media/keymap.c
new file mode 100644
index 000000000..2806a3174
--- /dev/null
+++ b/keyboards/dumbpad/v1x/keymaps/numpad_media/keymap.c
@@ -0,0 +1,88 @@
1/* Copyright 2020 imchipwood
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
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 /*
20 BASE LAYER
21 /-----------------------------------------------------`
22 | | 7 | 8 | 9 | Bkspc |
23 | |---------|---------|---------|---------|
24 | | 4 | 5 | 6 | + |
25 | |---------|---------|---------|---------|
26 | | 1 | 2 | 3 | * |
27 |-------------|---------|---------|---------|---------|
28 | Play/pause | TT(1) | 0 | . | Enter |
29 \-----------------------------------------------------'
30 */
31 [0] = LAYOUT(
32 KC_P7, KC_P8, KC_P9, KC_BSPC,
33 KC_P4, KC_P5, KC_P6, KC_KP_PLUS,
34 KC_P1, KC_P2, KC_P3, KC_KP_ASTERISK,
35 KC_MPLY, TT(1), KC_P0, KC_PDOT, KC_KP_ENTER
36 ),
37 /*
38 SUB LAYER
39 /-----------------------------------------------------`
40 | | | | | Numlock |
41 | |---------|---------|---------|---------|
42 | | | | | - |
43 | |---------|---------|---------|---------|
44 | | | | | / |
45 |-------------|---------|---------|---------|---------|
46 | MUTE | | | | = |
47 \-----------------------------------------------------'
48 */
49 [1] = LAYOUT(
50 _______, _______, _______, KC_NLCK,
51 _______, _______, _______, KC_KP_MINUS,
52 _______, _______, _______, KC_KP_SLASH,
53 KC_MUTE, _______, _______, _______, KC_KP_EQUAL
54 ),
55};
56
57void encoder_update_user(uint8_t index, bool clockwise) {
58 /* Custom encoder control - handles CW/CCW turning of encoder
59 * Default behavior:
60 * main layer:
61 * CW: volume up
62 * CCW: volume down
63 * other layers:
64 * CW: next track
65 * CCW: previous track
66 */
67 if (index == 0) {
68 switch (get_highest_layer(layer_state)) {
69 case 0:
70 // main layer - volume up (CW) and volume down (CCW)
71 if (clockwise) {
72 tap_code(KC_VOLU);
73 } else {
74 tap_code(KC_VOLD);
75 }
76 break;
77
78 default:
79 // other layers - media next (CW) and media previous (CCW)
80 if (clockwise) {
81 tap_code(KC_MNXT);
82 } else {
83 tap_code(KC_MPRV);
84 }
85 break;
86 }
87 }
88}
diff --git a/keyboards/dumbpad/v1x/readme.md b/keyboards/dumbpad/v1x/readme.md
new file mode 100644
index 000000000..260a6816a
--- /dev/null
+++ b/keyboards/dumbpad/v1x/readme.md
@@ -0,0 +1,15 @@
1# dumbpad v1.x
2
3![dumbpad](https://i.imgur.com/ND03FiFl.png)
4
5A 4x4 numpad/macropad with a rotary encoder to the left of the bottom row of keys.
6
7* Keyboard Maintainer: [imchipwood](https://github.com/imchipwood)
8* Hardware repository: [dumbpad on github](https://github.com/imchipwood/dumbpad)
9* PCB Revisions Supported: v1.0
10
11Make example for this keyboard (after setting up your build environment):
12
13 make dumbpad/v1x:default
14
15See 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/dumbpad/v1x/rules.mk b/keyboards/dumbpad/v1x/rules.mk
new file mode 100644
index 000000000..af1925613
--- /dev/null
+++ b/keyboards/dumbpad/v1x/rules.mk
@@ -0,0 +1,21 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5BOOTLOADER = caterina
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
11MOUSEKEY_ENABLE = yes # Mouse keys
12EXTRAKEY_ENABLE = yes # Audio control and System control
13CONSOLE_ENABLE = yes # Console for debug
14COMMAND_ENABLE = no # Commands for debug and configuration
15NKRO_ENABLE = no # Enable N-Key Rollover
16BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
17RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
18AUDIO_ENABLE = no # Audio output
19
20ENCODER_ENABLE = yes
21KEY_LOCK_ENABLE = yes
diff --git a/keyboards/dumbpad/v1x/templates/keymap.c b/keyboards/dumbpad/v1x/templates/keymap.c
new file mode 100644
index 000000000..6f862b822
--- /dev/null
+++ b/keyboards/dumbpad/v1x/templates/keymap.c
@@ -0,0 +1,26 @@
1#include QMK_KEYBOARD_H
2const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__};
3
4
5bool encoder_update_user(uint8_t index, bool clockwise) {
6 if (index == 0) {
7 switch (get_highest_layer(layer_state)) {
8 case 0:
9 if (clockwise) {
10 tap_code(KC_MS_R);
11 } else {
12 tap_code(KC_MS_L);
13 }
14 break;
15
16 default:
17 if (clockwise) {
18 tap_code(KC_EQL);
19 } else {
20 tap_code(KC_MINS);
21 }
22 break;
23 }
24 }
25 return true;
26}
diff --git a/keyboards/dumbpad/v1x/v1x.c b/keyboards/dumbpad/v1x/v1x.c
new file mode 100644
index 000000000..0adef0f61
--- /dev/null
+++ b/keyboards/dumbpad/v1x/v1x.c
@@ -0,0 +1,69 @@
1/* Copyright 2020 imchipwood
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 "v1x.h"
17
18void keyboard_pre_init_kb(void) {
19 // Set LED IO as outputs
20 setPinOutput(LED_00);
21 setPinOutput(LED_01);
22 setPinOutput(LED_02);
23 keyboard_pre_init_user();
24}
25
26void shutdown_user() {
27 // Shutdown LEDs
28 writePinLow(LED_00);
29 writePinLow(LED_01);
30 writePinLow(LED_02);
31}
32
33layer_state_t layer_state_set_kb(layer_state_t state) {
34 // Layer LEDs act as binary indication of current layer
35 uint8_t layer = get_highest_layer(state);
36 writePin(LED_00, layer & 0b1);
37 writePin(LED_01, (layer >> 1) & 0b1);
38 return layer_state_set_user(state);
39}
40
41// Optional override functions below.
42// You can leave any or all of these undefined.
43// These are only required if you want to perform custom actions.
44
45void matrix_init_kb(void) {
46 // put your keyboard start-up code here
47 // runs once when the firmware starts up
48 uint8_t led_delay_ms = 80;
49 for (int i = 0; i < 2; i++) {
50 writePinHigh(LED_00);
51 writePinHigh(LED_01);
52 writePinHigh(LED_02);
53 wait_ms(led_delay_ms);
54 writePinLow(LED_00);
55 writePinLow(LED_01);
56 writePinLow(LED_02);
57 if (i < 1) {
58 wait_ms(led_delay_ms);
59 }
60 }
61
62 matrix_init_user();
63}
64
65void led_set_kb(uint8_t usb_led) {
66 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
67 writePin(LED_02, !IS_LED_ON(usb_led, USB_LED_NUM_LOCK));
68 led_set_user(usb_led);
69}
diff --git a/keyboards/dumbpad/v1x/v1x.h b/keyboards/dumbpad/v1x/v1x.h
new file mode 100644
index 000000000..578250f91
--- /dev/null
+++ b/keyboards/dumbpad/v1x/v1x.h
@@ -0,0 +1,30 @@
1/* Copyright 2020 imchipwood
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#include "quantum.h"
18
19#define LAYOUT( \
20 k01, k02, k03, k04, \
21 k11, k12, k13, k14, \
22 k21, k22, k23, k24, \
23 k30, k31, k32, k33, k34 \
24) \
25{ \
26 { KC_NO, k01, k02, k03, k04 }, \
27 { KC_NO, k11, k12, k13, k14 }, \
28 { KC_NO, k21, k22, k23, k24 }, \
29 { k30, k31, k32, k33, k34 }, \
30}