aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/doodboard/duckboard/config.h4
-rw-r--r--keyboards/doodboard/duckboard/duckboard.c2
-rw-r--r--keyboards/doodboard/duckboard/duckboard.h3
-rw-r--r--keyboards/doodboard/duckboard/info.json40
-rw-r--r--keyboards/doodboard/duckboard/keymaps/default/keymap.c40
-rw-r--r--keyboards/doodboard/duckboard/readme.md10
-rw-r--r--keyboards/doodboard/duckboard_r2/config.h60
-rw-r--r--keyboards/doodboard/duckboard_r2/duckboard_r2.c17
-rw-r--r--keyboards/doodboard/duckboard_r2/duckboard_r2.h33
-rw-r--r--keyboards/doodboard/duckboard_r2/info.json39
-rw-r--r--keyboards/doodboard/duckboard_r2/keymaps/default/keymap.c120
-rw-r--r--keyboards/doodboard/duckboard_r2/keymaps/via/keymap.c130
-rw-r--r--keyboards/doodboard/duckboard_r2/keymaps/via/rules.mk2
-rw-r--r--keyboards/doodboard/duckboard_r2/readme.md17
-rw-r--r--keyboards/doodboard/duckboard_r2/rules.mk25
15 files changed, 493 insertions, 49 deletions
diff --git a/keyboards/doodboard/duckboard/config.h b/keyboards/doodboard/duckboard/config.h
index ea8a8ae5d..80c941116 100644
--- a/keyboards/doodboard/duckboard/config.h
+++ b/keyboards/doodboard/duckboard/config.h
@@ -1,4 +1,4 @@
1/* Copyright 2020 doodboard 1/* Copyright 2020-2021 doodboard
2 * 2 *
3 * This program is free software: you can redistribute it and/or modify 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 4 * it under the terms of the GNU General Public License as published by
@@ -19,7 +19,7 @@
19#include "config_common.h" 19#include "config_common.h"
20 20
21/* USB Device descriptor parameter */ 21/* USB Device descriptor parameter */
22#define VENDOR_ID 0xFEED 22#define VENDOR_ID 0x4442
23#define PRODUCT_ID 0xFF44 23#define PRODUCT_ID 0xFF44
24#define DEVICE_VER 0x0001 24#define DEVICE_VER 0x0001
25#define MANUFACTURER doodboard 25#define MANUFACTURER doodboard
diff --git a/keyboards/doodboard/duckboard/duckboard.c b/keyboards/doodboard/duckboard/duckboard.c
index af0cb24be..853e105ce 100644
--- a/keyboards/doodboard/duckboard/duckboard.c
+++ b/keyboards/doodboard/duckboard/duckboard.c
@@ -1,4 +1,4 @@
1/* Copyright 2020 doodboard 1/* Copyright 2020-2021 doodboard
2 * 2 *
3 * This program is free software: you can redistribute it and/or modify 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 4 * it under the terms of the GNU General Public License as published by
diff --git a/keyboards/doodboard/duckboard/duckboard.h b/keyboards/doodboard/duckboard/duckboard.h
index 0e753d445..c98c9a703 100644
--- a/keyboards/doodboard/duckboard/duckboard.h
+++ b/keyboards/doodboard/duckboard/duckboard.h
@@ -1,4 +1,4 @@
1/* Copyright 2020 doodboard 1/* Copyright 2020-2021 doodboard
2 * 2 *
3 * This program is free software: you can redistribute it and/or modify 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 4 * it under the terms of the GNU General Public License as published by
@@ -14,7 +14,6 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 15 */
16 16
17
18#pragma once 17#pragma once
19 18
20#include "quantum.h" 19#include "quantum.h"
diff --git a/keyboards/doodboard/duckboard/info.json b/keyboards/doodboard/duckboard/info.json
index d5193e61e..074f5c88a 100644
--- a/keyboards/doodboard/duckboard/info.json
+++ b/keyboards/doodboard/duckboard/info.json
@@ -1,35 +1,35 @@
1{ 1{
2 "keyboard_name": "duckboard", 2 "keyboard_name": "duckboard",
3 "url": "", 3 "url": "https://doodboard.xyz/",
4 "maintainer": "doodboard", 4 "maintainer": "doodboard",
5 "width": 5, 5 "width": 5,
6 "height": 5, 6 "height": 5,
7 "layouts": { 7 "layouts": {
8 "LAYOUT": { 8 "LAYOUT": {
9 "layout": [ 9 "layout": [
10 {"x": 1, "y": 0}, 10 { "x": 1, "y": 0 },
11 {"x": 2, "y": 0}, 11 { "x": 2, "y": 0 },
12 {"x": 3, "y": 0}, 12 { "x": 3, "y": 0 },
13 {"x": 4, "y": 0}, 13 { "x": 4, "y": 0 },
14 14
15 {"x": 1, "y": 1}, 15 { "x": 1, "y": 1 },
16 {"x": 2, "y": 1}, 16 { "x": 2, "y": 1 },
17 {"x": 3, "y": 1}, 17 { "x": 3, "y": 1 },
18 18
19 {"x": 1, "y": 2}, 19 { "x": 1, "y": 2 },
20 {"x": 2, "y": 2}, 20 { "x": 2, "y": 2 },
21 {"x": 3, "y": 2}, 21 { "x": 3, "y": 2 },
22 {"x": 4, "y": 1, "h": 2}, 22 { "x": 4, "y": 1, "h": 2 },
23 23
24 {"x": 1, "y": 3}, 24 { "x": 1, "y": 3 },
25 {"x": 2, "y": 3}, 25 { "x": 2, "y": 3 },
26 {"x": 3, "y": 3}, 26 { "x": 3, "y": 3 },
27 27
28 {"x": 0, "y": 4}, 28 { "x": 0, "y": 4 },
29 {"x": 1, "y": 4}, 29 { "x": 1, "y": 4 },
30 {"x": 2, "y": 4}, 30 { "x": 2, "y": 4 },
31 {"x": 3, "y": 4}, 31 { "x": 3, "y": 4 },
32 {"x": 4, "y": 3, "h": 2} 32 { "x": 4, "y": 3, "h": 2 }
33 ] 33 ]
34 } 34 }
35 } 35 }
diff --git a/keyboards/doodboard/duckboard/keymaps/default/keymap.c b/keyboards/doodboard/duckboard/keymaps/default/keymap.c
index 6684e9863..0dd9c4067 100644
--- a/keyboards/doodboard/duckboard/keymaps/default/keymap.c
+++ b/keyboards/doodboard/duckboard/keymaps/default/keymap.c
@@ -1,4 +1,4 @@
1/* Copyright 2020 doodboard 1/* Copyright 2020-2021 doodboard
2 * 2 *
3 * This program is free software: you can redistribute it and/or modify 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 4 * it under the terms of the GNU General Public License as published by
@@ -18,22 +18,24 @@
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 [0] = LAYOUT( 19 [0] = LAYOUT(
20 TG(1), KC_PSLS, KC_PAST, KC_PMNS, 20 TG(1), KC_PSLS, KC_PAST, KC_PMNS,
21 KC_P7, KC_P8, KC_P9, 21 KC_7, KC_8, KC_9,
22 KC_P4, KC_P5, KC_P6, KC_PPLS, 22 KC_4, KC_5, KC_6, KC_PPLS,
23 KC_P1, KC_P2, KC_P3, 23 KC_1, KC_2, KC_3,
24 KC_BSPC, KC_MUTE, KC_P0, KC_PDOT, KC_PENT), 24 KC_BSPC, KC_0, KC_0, KC_DOT, KC_ENT),
25 [1] = LAYOUT( 25
26 TG(1), KC_TRNS, KC_TRNS, KC_TRNS, 26 [1] = LAYOUT(
27 KC_HOME, KC_UP, KC_PGUP, 27 TG(1), KC_TRNS, KC_TRNS, KC_TRNS,
28 KC_LEFT, KC_TRNS, KC_RGHT, KC_TRNS, 28 KC_HOME, KC_UP, KC_PGUP,
29 KC_END, KC_DOWN, KC_PGDN, 29 KC_LEFT, KC_TRNS, KC_RGHT, KC_TRNS,
30 TG(2), KC_TRNS, KC_INS, KC_DEL, KC_TRNS), 30 KC_END, KC_DOWN, KC_PGDN,
31 [2] = LAYOUT( 31 TG(2), KC_TRNS, KC_INS, KC_DEL, KC_TRNS),
32 KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS, 32
33 RGB_HUI, RGB_SAI, RGB_VAI, 33 [2] = LAYOUT(
34 RGB_HUD, RGB_SAD, RGB_VAD, KC_TRNS, 34 KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS,
35 KC_TRNS, KC_TRNS, KC_TRNS, 35 RGB_HUI, RGB_SAI, RGB_VAI,
36 TG(2), RESET, KC_TRNS, KC_TRNS, KC_TRNS), 36 RGB_HUD, RGB_SAD, RGB_VAD, KC_TRNS,
37 KC_TRNS, KC_TRNS, KC_TRNS,
38 TG(2), RESET, KC_TRNS, KC_TRNS, KC_TRNS),
37}; 39};
38 40
39void encoder_update_user(uint8_t index, bool clockwise) { 41void encoder_update_user(uint8_t index, bool clockwise) {
@@ -111,8 +113,8 @@ void oled_task_user(void) {
111 113
112void keyboard_post_init_user(void) { 114void keyboard_post_init_user(void) {
113 //Customise these values to debug 115 //Customise these values to debug
114 //debug_enable=true; 116 debug_enable=true;
115 //debug_matrix=true; 117 debug_matrix=true;
116 //debug_keyboard=true; 118 //debug_keyboard=true;
117 //debug_mouse=true; 119 //debug_mouse=true;
118} 120}
diff --git a/keyboards/doodboard/duckboard/readme.md b/keyboards/doodboard/duckboard/readme.md
index d2b799ab6..866a7d4b9 100644
--- a/keyboards/doodboard/duckboard/readme.md
+++ b/keyboards/doodboard/duckboard/readme.md
@@ -1,10 +1,10 @@
1# duckboard 1# duckboard R1
2 2
3An 18-key numpad with rotary encoder and OLED support. 3An 18-key numpad with rotary encoder and OLED support.
4 4
5* Keyboard Maintainer: [doodboard](https://github.com/doodboard) 5- Keyboard Maintainer: [doodboard](https://doodboard.xyz/)
6* Hardware Supported: duckboard PCB 6- Hardware Supported: duckboard PCB
7* Hardware Availability: Private Group Buy 7- Hardware Availability: Private Group Buy
8 8
9Make example for this keyboard (after setting up your build environment): 9Make example for this keyboard (after setting up your build environment):
10 10
diff --git a/keyboards/doodboard/duckboard_r2/config.h b/keyboards/doodboard/duckboard_r2/config.h
new file mode 100644
index 000000000..10ed3c4ca
--- /dev/null
+++ b/keyboards/doodboard/duckboard_r2/config.h
@@ -0,0 +1,60 @@
1/* Copyright 2020-2021 doodboard
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
17#pragma once
18
19#include "config_common.h"
20
21/* USB Device descriptor parameter */
22#define VENDOR_ID 0x4442
23#define PRODUCT_ID 0x6462
24#define DEVICE_VER 0x0001
25#define MANUFACTURER doodboard
26#define PRODUCT duckboard
27
28/* key matrix size */
29#define MATRIX_ROWS 5
30#define MATRIX_COLS 5
31
32/* key matrix pins */
33#define MATRIX_ROW_PINS { C6, D7, E6, B4, B5 }
34#define MATRIX_COL_PINS { F7, B1, B3, B2, B6 }
35#define UNUSED_PINS
36
37#define ENCODERS_PAD_A { F6 }
38#define ENCODERS_PAD_B { F5 }
39#define ENCODER_RESOLUTION 2
40
41/* media key slowdown for windows */
42#define TAP_CODE_DELAY 20
43
44/* COL2ROW or ROW2COL */
45#define DIODE_DIRECTION COL2ROW
46
47/* number of backlight levels */
48
49/* ws2812 RGB LED */
50#define RGB_DI_PIN D3
51
52#ifdef RGBLIGHT_ENABLE
53#define RGBLED_NUM 8 // Number of LEDs
54#endif
55
56/* Set 0 if debouncing isn't needed */
57#define DEBOUNCE 5
58
59#define BOOTMAGIC_LITE_ROW 0
60#define BOOTMAGIC_LITE_COLUMN 1
diff --git a/keyboards/doodboard/duckboard_r2/duckboard_r2.c b/keyboards/doodboard/duckboard_r2/duckboard_r2.c
new file mode 100644
index 000000000..095544b9e
--- /dev/null
+++ b/keyboards/doodboard/duckboard_r2/duckboard_r2.c
@@ -0,0 +1,17 @@
1/* Copyright 2020-2021 doodboard
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
17#include "duckboard_r2.h"
diff --git a/keyboards/doodboard/duckboard_r2/duckboard_r2.h b/keyboards/doodboard/duckboard_r2/duckboard_r2.h
new file mode 100644
index 000000000..1f3c462da
--- /dev/null
+++ b/keyboards/doodboard/duckboard_r2/duckboard_r2.h
@@ -0,0 +1,33 @@
1/* Copyright 2020-2021 doodboard
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
17#pragma once
18
19#include "quantum.h"
20
21#define LAYOUT( \
22 K01, K02, K03, K04, \
23 K11, K12, K13, K14, \
24 K21, K22, K23, K24, \
25 K30, K31, K32, K33, K34, \
26 K40, K41, K42, K43, K44 \
27) { \
28 { KC_NO, K01, K02, K03, K04 }, \
29 { KC_NO, K11, K12, K13, K14 }, \
30 { KC_NO, K21, K22, K23, K24 }, \
31 { K30, K31, K32, K33, K34 }, \
32 { K40, K41, K42, K43, K44 } \
33}
diff --git a/keyboards/doodboard/duckboard_r2/info.json b/keyboards/doodboard/duckboard_r2/info.json
new file mode 100644
index 000000000..69a1b1cd1
--- /dev/null
+++ b/keyboards/doodboard/duckboard_r2/info.json
@@ -0,0 +1,39 @@
1{
2 "keyboard_name": "duckboard",
3 "url": "https://doodboard.xyz/",
4 "maintainer": "doodboard",
5 "width": 5,
6 "height": 5,
7 "layouts": {
8 "LAYOUT": {
9 "layout": [
10 { "x": 1, "y": 0 },
11 { "x": 2, "y": 0 },
12 { "x": 3, "y": 0 },
13 { "x": 4, "y": 0 },
14
15 { "x": 1, "y": 1 },
16 { "x": 2, "y": 1 },
17 { "x": 3, "y": 1 },
18 { "x": 4, "y": 1 },
19
20 { "x": 1, "y": 2 },
21 { "x": 2, "y": 2 },
22 { "x": 3, "y": 2 },
23 { "x": 4, "y": 2 },
24
25 { "x": 0, "y": 3 },
26 { "x": 1, "y": 3 },
27 { "x": 2, "y": 3 },
28 { "x": 3, "y": 3 },
29 { "x": 4, "y": 3 },
30
31 { "x": 0, "y": 4 },
32 { "x": 1, "y": 4 },
33 { "x": 2, "y": 4 },
34 { "x": 3, "y": 4 },
35 { "x": 4, "y": 4 }
36 ]
37 }
38 }
39}
diff --git a/keyboards/doodboard/duckboard_r2/keymaps/default/keymap.c b/keyboards/doodboard/duckboard_r2/keymaps/default/keymap.c
new file mode 100644
index 000000000..e782acba0
--- /dev/null
+++ b/keyboards/doodboard/duckboard_r2/keymaps/default/keymap.c
@@ -0,0 +1,120 @@
1/* Copyright 2020-2021 doodboard
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
17#include QMK_KEYBOARD_H
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 [0] = LAYOUT(
20 TG(1), KC_PSLS, KC_PAST, KC_PMNS,
21 KC_7, KC_8, KC_9, KC_PPLS,
22 KC_4, KC_5, KC_6, KC_PPLS,
23 KC_MUTE, KC_1, KC_2, KC_3, KC_ENT,
24 KC_BSPC, KC_0, KC_0, KC_DOT, KC_ENT),
25
26 [1] = LAYOUT(
27 TG(1), KC_TRNS, KC_TRNS, KC_TRNS,
28 KC_HOME, KC_UP, KC_PGUP, KC_TRNS,
29 KC_LEFT, KC_TRNS, KC_RGHT, KC_TRNS,
30 KC_TRNS, KC_END, KC_DOWN, KC_PGDN, KC_TRNS,
31 TG(2), KC_TRNS, KC_INS, KC_DEL, KC_TRNS),
32
33 [2] = LAYOUT(
34 KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS,
35 RGB_HUI, RGB_SAI, RGB_VAI, KC_TRNS,
36 RGB_HUD, RGB_SAD, RGB_VAD, KC_TRNS,
37 RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
38 TG(2), RESET, KC_TRNS, KC_TRNS, KC_TRNS),
39};
40
41void encoder_update_user(uint8_t index, bool clockwise) {
42 if (index == 0) { /* First encoder */
43 if (clockwise) {
44 tap_code(KC_VOLU);
45 } else {
46 tap_code(KC_VOLD);
47 }
48}
49}
50
51
52#ifdef OLED_DRIVER_ENABLE
53oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; }
54
55
56// WPM-responsive animation stuff here
57#define IDLE_FRAMES 2
58#define IDLE_SPEED 40 // below this wpm value your animation will idle
59
60#define ANIM_FRAME_DURATION 200 // how long each frame lasts in ms
61// #define SLEEP_TIMER 60000 // should sleep after this period of 0 wpm, needs fixing
62#define ANIM_SIZE 636 // number of bytes in array, minimize for adequate firmware size, max is 1024
63
64uint32_t anim_timer = 0;
65uint32_t anim_sleep = 0;
66uint8_t current_idle_frame = 0;
67
68// Credit to u/Pop-X- for the initial code. You can find his commit here https://github.com/qmk/qmk_firmware/pull/9264/files#diff-303f6e3a7a5ee54be0a9a13630842956R196-R333.
69static void render_anim(void) {
70 static const char PROGMEM idle[IDLE_FRAMES][ANIM_SIZE] = {
71 {
72 0, 0,192,192,192,192,192,192,192,248,248, 30, 30,254,254,248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3,255,255,255,255,255,255,255,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,127,127,255,255,255,255,255,159,159,135,135,129,129,129, 97, 97, 25, 25, 7, 7, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 97, 97,127, 1, 1, 97, 97,127, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0
73 },
74 {
75 0, 0,128,128,128,128,128,128,128,240,240, 60, 60,252,252,240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 7, 7, 7, 7, 7,255,255,254,254,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255, 63, 63, 15, 15, 3, 3, 3,195,195, 51, 51, 15, 15, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 99, 99,127, 3, 3, 99, 99,127, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0
76 }
77 };
78
79 //assumes 1 frame prep stage
80 void animation_phase(void) {
81 current_idle_frame = (current_idle_frame + 1) % IDLE_FRAMES;
82 oled_write_raw_P(idle[abs((IDLE_FRAMES-1)-current_idle_frame)], ANIM_SIZE);
83 }
84
85 if(timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) {
86 anim_timer = timer_read32();
87 animation_phase();
88 }
89 }
90
91void oled_task_user(void) {
92 render_anim();
93 oled_set_cursor(0,6);
94 oled_write_P(PSTR("DUCK\nBOARD\n"), false);
95 oled_write_P(PSTR("-----\n"), false);
96 // Host Keyboard Layer Status
97 oled_write_P(PSTR("MODE\n"), false);
98 oled_write_P(PSTR("\n"), false);
99
100 switch (get_highest_layer(layer_state)) {
101 case 0:
102 oled_write_P(PSTR("BASE\n"), false);
103 break;
104 case 1:
105 oled_write_P(PSTR("FUNC\n"), false);
106 break;
107 case 2:
108 oled_write_P(PSTR("RGB\n"), false);
109 break;
110 }
111}
112#endif
113
114void keyboard_post_init_user(void) {
115 //Customise these values to debug
116 debug_enable=true;
117 debug_matrix=true;
118 //debug_keyboard=true;
119 //debug_mouse=true;
120}
diff --git a/keyboards/doodboard/duckboard_r2/keymaps/via/keymap.c b/keyboards/doodboard/duckboard_r2/keymaps/via/keymap.c
new file mode 100644
index 000000000..00ae8fa0d
--- /dev/null
+++ b/keyboards/doodboard/duckboard_r2/keymaps/via/keymap.c
@@ -0,0 +1,130 @@
1/* Copyright 2020-2021 doodboard
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
17#include QMK_KEYBOARD_H
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 [0] = LAYOUT(
20 TG(1), KC_PSLS, KC_PAST, KC_PMNS,
21 KC_7, KC_8, KC_9, KC_PPLS,
22 KC_4, KC_5, KC_6, KC_PPLS,
23 KC_MUTE, KC_1, KC_2, KC_3, KC_ENT,
24 KC_BSPC, KC_0, KC_0, KC_DOT, KC_ENT),
25
26 [1] = LAYOUT(
27 TG(1), KC_TRNS, KC_TRNS, KC_TRNS,
28 KC_HOME, KC_UP, KC_PGUP, KC_TRNS,
29 KC_LEFT, KC_TRNS, KC_RGHT, KC_TRNS,
30 KC_TRNS, KC_END, KC_DOWN, KC_PGDN, KC_TRNS,
31 TG(2), KC_TRNS, KC_INS, KC_DEL, KC_TRNS),
32
33 [2] = LAYOUT(
34 KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS,
35 RGB_HUI, RGB_SAI, RGB_VAI, KC_TRNS,
36 RGB_HUD, RGB_SAD, RGB_VAD, KC_TRNS,
37 RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
38 TG(2), RESET, KC_TRNS, KC_TRNS, KC_TRNS),
39
40 [3] = LAYOUT(
41 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
42 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
43 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
44 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
45 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
46};
47
48void encoder_update_user(uint8_t index, bool clockwise) {
49 if (index == 0) { /* First encoder */
50 if (clockwise) {
51 tap_code(KC_VOLU);
52 } else {
53 tap_code(KC_VOLD);
54 }
55}
56}
57
58
59#ifdef OLED_DRIVER_ENABLE
60oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; }
61
62
63// WPM-responsive animation stuff here
64#define IDLE_FRAMES 2
65#define IDLE_SPEED 40 // below this wpm value your animation will idle
66
67#define ANIM_FRAME_DURATION 200 // how long each frame lasts in ms
68// #define SLEEP_TIMER 60000 // should sleep after this period of 0 wpm, needs fixing
69#define ANIM_SIZE 636 // number of bytes in array, minimize for adequate firmware size, max is 1024
70
71uint32_t anim_timer = 0;
72uint32_t anim_sleep = 0;
73uint8_t current_idle_frame = 0;
74
75// Credit to u/Pop-X- for the initial code. You can find his commit here https://github.com/qmk/qmk_firmware/pull/9264/files#diff-303f6e3a7a5ee54be0a9a13630842956R196-R333.
76static void render_anim(void) {
77 static const char PROGMEM idle[IDLE_FRAMES][ANIM_SIZE] = {
78 {
79 0, 0,192,192,192,192,192,192,192,248,248, 30, 30,254,254,248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3,255,255,255,255,255,255,255,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,127,127,255,255,255,255,255,159,159,135,135,129,129,129, 97, 97, 25, 25, 7, 7, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 97, 97,127, 1, 1, 97, 97,127, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0
80 },
81 {
82 0, 0,128,128,128,128,128,128,128,240,240, 60, 60,252,252,240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 7, 7, 7, 7, 7,255,255,254,254,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255, 63, 63, 15, 15, 3, 3, 3,195,195, 51, 51, 15, 15, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 99, 99,127, 3, 3, 99, 99,127, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0
83 }
84 };
85
86 //assumes 1 frame prep stage
87 void animation_phase(void) {
88 current_idle_frame = (current_idle_frame + 1) % IDLE_FRAMES;
89 oled_write_raw_P(idle[abs((IDLE_FRAMES-1)-current_idle_frame)], ANIM_SIZE);
90 }
91
92 if(timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) {
93 anim_timer = timer_read32();
94 animation_phase();
95 }
96 }
97
98void oled_task_user(void) {
99 render_anim();
100 oled_set_cursor(0,6);
101 oled_write_P(PSTR("DUCK\nBOARD\n"), false);
102 oled_write_P(PSTR("-----\n"), false);
103 // Host Keyboard Layer Status
104 oled_write_P(PSTR("MODE\n"), false);
105 oled_write_P(PSTR("\n"), false);
106
107 switch (get_highest_layer(layer_state)) {
108 case 0:
109 oled_write_P(PSTR("BASE\n"), false);
110 break;
111 case 1:
112 oled_write_P(PSTR("FUNC\n"), false);
113 break;
114 case 2:
115 oled_write_P(PSTR("RGB\n"), false);
116 break;
117 case 3:
118 oled_write_P(PSTR("FN2\n"), false);
119 break;
120 }
121}
122#endif
123
124void keyboard_post_init_user(void) {
125 //Customise these values to debug
126 debug_enable=true;
127 debug_matrix=true;
128 //debug_keyboard=true;
129 //debug_mouse=true;
130}
diff --git a/keyboards/doodboard/duckboard_r2/keymaps/via/rules.mk b/keyboards/doodboard/duckboard_r2/keymaps/via/rules.mk
new file mode 100644
index 000000000..36b7ba9cb
--- /dev/null
+++ b/keyboards/doodboard/duckboard_r2/keymaps/via/rules.mk
@@ -0,0 +1,2 @@
1VIA_ENABLE = yes
2LTO_ENABLE = yes
diff --git a/keyboards/doodboard/duckboard_r2/readme.md b/keyboards/doodboard/duckboard_r2/readme.md
new file mode 100644
index 000000000..8f9c77b6e
--- /dev/null
+++ b/keyboards/doodboard/duckboard_r2/readme.md
@@ -0,0 +1,17 @@
1# duckboard R2
2
3A 21-key numpad with rotary encoder and OLED support.
4
5- Keyboard Maintainer: [doodboard](https://doodboard.xyz/)
6- Hardware Supported: duckboard PCB
7- Hardware Availability: Private Group Buy
8
9Make example for this keyboard (after setting up your build environment):
10
11 make doodboard/duckboard_r2:default
12
13Flashing example for this keyboard:
14
15 make doodboard/duckboard_r2:default:flash
16
17See 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/doodboard/duckboard_r2/rules.mk b/keyboards/doodboard/duckboard_r2/rules.mk
new file mode 100644
index 000000000..09a60d8a7
--- /dev/null
+++ b/keyboards/doodboard/duckboard_r2/rules.mk
@@ -0,0 +1,25 @@
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 = no # Virtual DIP switch configuration
11MOUSEKEY_ENABLE = no # Mouse keys
12EXTRAKEY_ENABLE = yes # Audio control and System control
13CONSOLE_ENABLE = yes # Console for debug
14COMMAND_ENABLE = no # Commands for debug and configuration
15# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
16SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
18NKRO_ENABLE = yes # USB Nkey Rollover
19BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
20RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
21BLUETOOTH_ENABLE = no # Enable Bluetooth
22AUDIO_ENABLE = no # Audio output
23
24ENCODER_ENABLE = yes
25OLED_DRIVER_ENABLE = yes