aboutsummaryrefslogtreecommitdiff
path: root/keyboards/doodboard
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/doodboard')
-rw-r--r--keyboards/doodboard/duckboard/config.h57
-rw-r--r--keyboards/doodboard/duckboard/duckboard.c17
-rw-r--r--keyboards/doodboard/duckboard/duckboard.h33
-rw-r--r--keyboards/doodboard/duckboard/info.json34
-rw-r--r--keyboards/doodboard/duckboard/keymaps/default/keymap.c122
-rw-r--r--keyboards/doodboard/duckboard/readme.md17
-rw-r--r--keyboards/doodboard/duckboard/rules.mk22
-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.json37
-rw-r--r--keyboards/doodboard/duckboard_r2/keymaps/default/keymap.c122
-rw-r--r--keyboards/doodboard/duckboard_r2/keymaps/via/keymap.c132
-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.mk22
16 files changed, 744 insertions, 0 deletions
diff --git a/keyboards/doodboard/duckboard/config.h b/keyboards/doodboard/duckboard/config.h
new file mode 100644
index 000000000..80c941116
--- /dev/null
+++ b/keyboards/doodboard/duckboard/config.h
@@ -0,0 +1,57 @@
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 0xFF44
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 { F5 }
38#define ENCODERS_PAD_B { F6 }
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
diff --git a/keyboards/doodboard/duckboard/duckboard.c b/keyboards/doodboard/duckboard/duckboard.c
new file mode 100644
index 000000000..853e105ce
--- /dev/null
+++ b/keyboards/doodboard/duckboard/duckboard.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.h"
diff --git a/keyboards/doodboard/duckboard/duckboard.h b/keyboards/doodboard/duckboard/duckboard.h
new file mode 100644
index 000000000..c98c9a703
--- /dev/null
+++ b/keyboards/doodboard/duckboard/duckboard.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, \
24 K21, K22, K23, K24, \
25 K31, K32, K33, \
26 K40, K41, K42, K43, K44 \
27) { \
28 { KC_NO, K01, K02, K03, K04 }, \
29 { KC_NO, K11, K12, K13, KC_NO }, \
30 { KC_NO, K21, K22, K23, K24 }, \
31 { KC_NO, K31, K32, K33, KC_NO }, \
32 { K40, K41, K42, K43, K44 } \
33}
diff --git a/keyboards/doodboard/duckboard/info.json b/keyboards/doodboard/duckboard/info.json
new file mode 100644
index 000000000..69dde7790
--- /dev/null
+++ b/keyboards/doodboard/duckboard/info.json
@@ -0,0 +1,34 @@
1{
2 "keyboard_name": "duckboard",
3 "url": "https://doodboard.xyz/",
4 "maintainer": "doodboard",
5 "layouts": {
6 "LAYOUT": {
7 "layout": [
8 { "x": 1, "y": 0 },
9 { "x": 2, "y": 0 },
10 { "x": 3, "y": 0 },
11 { "x": 4, "y": 0 },
12
13 { "x": 1, "y": 1 },
14 { "x": 2, "y": 1 },
15 { "x": 3, "y": 1 },
16
17 { "x": 1, "y": 2 },
18 { "x": 2, "y": 2 },
19 { "x": 3, "y": 2 },
20 { "x": 4, "y": 1, "h": 2 },
21
22 { "x": 1, "y": 3 },
23 { "x": 2, "y": 3 },
24 { "x": 3, "y": 3 },
25
26 { "x": 0, "y": 4 },
27 { "x": 1, "y": 4 },
28 { "x": 2, "y": 4 },
29 { "x": 3, "y": 4 },
30 { "x": 4, "y": 3, "h": 2 }
31 ]
32 }
33 }
34}
diff --git a/keyboards/doodboard/duckboard/keymaps/default/keymap.c b/keyboards/doodboard/duckboard/keymaps/default/keymap.c
new file mode 100644
index 000000000..b4e6207ae
--- /dev/null
+++ b/keyboards/doodboard/duckboard/keymaps/default/keymap.c
@@ -0,0 +1,122 @@
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,
22 KC_4, KC_5, KC_6, KC_PPLS,
23 KC_1, KC_2, KC_3,
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,
29 KC_LEFT, KC_TRNS, KC_RGHT, KC_TRNS,
30 KC_END, KC_DOWN, KC_PGDN,
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,
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),
39};
40
41bool 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 return true;
50}
51
52
53#ifdef OLED_ENABLE
54oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; }
55
56
57// WPM-responsive animation stuff here
58#define IDLE_FRAMES 2
59#define IDLE_SPEED 40 // below this wpm value your animation will idle
60
61#define ANIM_FRAME_DURATION 200 // how long each frame lasts in ms
62// #define SLEEP_TIMER 60000 // should sleep after this period of 0 wpm, needs fixing
63#define ANIM_SIZE 636 // number of bytes in array, minimize for adequate firmware size, max is 1024
64
65uint32_t anim_timer = 0;
66uint32_t anim_sleep = 0;
67uint8_t current_idle_frame = 0;
68
69// 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.
70static void render_anim(void) {
71 static const char PROGMEM idle[IDLE_FRAMES][ANIM_SIZE] = {
72 {
73 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
74 },
75 {
76 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
77 }
78 };
79
80 //assumes 1 frame prep stage
81 void animation_phase(void) {
82 current_idle_frame = (current_idle_frame + 1) % IDLE_FRAMES;
83 oled_write_raw_P(idle[abs((IDLE_FRAMES-1)-current_idle_frame)], ANIM_SIZE);
84 }
85
86 if(timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) {
87 anim_timer = timer_read32();
88 animation_phase();
89 }
90 }
91
92bool oled_task_user(void) {
93 render_anim();
94 oled_set_cursor(0,6);
95 oled_write_P(PSTR("DUCK\nBOARD\n"), false);
96 oled_write_P(PSTR("-----\n"), false);
97 // Host Keyboard Layer Status
98 oled_write_P(PSTR("MODE\n"), false);
99 oled_write_P(PSTR("\n"), false);
100
101 switch (get_highest_layer(layer_state)) {
102 case 0:
103 oled_write_P(PSTR("BASE\n"), false);
104 break;
105 case 1:
106 oled_write_P(PSTR("FUNC\n"), false);
107 break;
108 case 2:
109 oled_write_P(PSTR("RGB\n"), false);
110 break;
111 }
112 return false;
113}
114#endif
115
116void keyboard_post_init_user(void) {
117 //Customise these values to debug
118 debug_enable=true;
119 debug_matrix=true;
120 //debug_keyboard=true;
121 //debug_mouse=true;
122}
diff --git a/keyboards/doodboard/duckboard/readme.md b/keyboards/doodboard/duckboard/readme.md
new file mode 100644
index 000000000..866a7d4b9
--- /dev/null
+++ b/keyboards/doodboard/duckboard/readme.md
@@ -0,0 +1,17 @@
1# duckboard R1
2
3An 18-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:default
12
13Flashing example for this keyboard:
14
15 make doodboard/duckboard: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/rules.mk b/keyboards/doodboard/duckboard/rules.mk
new file mode 100644
index 000000000..3aaae9d19
--- /dev/null
+++ b/keyboards/doodboard/duckboard/rules.mk
@@ -0,0 +1,22 @@
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 # Enable Bootmagic Lite
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
15NKRO_ENABLE = yes # Enable N-Key Rollover
16BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
17RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
18AUDIO_ENABLE = no # Audio output
19
20ENCODER_ENABLE = yes
21OLED_ENABLE = yes
22OLED_DRIVER = SSD1306
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..5a774a6e5
--- /dev/null
+++ b/keyboards/doodboard/duckboard_r2/info.json
@@ -0,0 +1,37 @@
1{
2 "keyboard_name": "duckboard",
3 "url": "https://doodboard.xyz/",
4 "maintainer": "doodboard",
5 "layouts": {
6 "LAYOUT": {
7 "layout": [
8 { "x": 1, "y": 0 },
9 { "x": 2, "y": 0 },
10 { "x": 3, "y": 0 },
11 { "x": 4, "y": 0 },
12
13 { "x": 1, "y": 1 },
14 { "x": 2, "y": 1 },
15 { "x": 3, "y": 1 },
16 { "x": 4, "y": 1 },
17
18 { "x": 1, "y": 2 },
19 { "x": 2, "y": 2 },
20 { "x": 3, "y": 2 },
21 { "x": 4, "y": 2 },
22
23 { "x": 0, "y": 3 },
24 { "x": 1, "y": 3 },
25 { "x": 2, "y": 3 },
26 { "x": 3, "y": 3 },
27 { "x": 4, "y": 3 },
28
29 { "x": 0, "y": 4 },
30 { "x": 1, "y": 4 },
31 { "x": 2, "y": 4 },
32 { "x": 3, "y": 4 },
33 { "x": 4, "y": 4 }
34 ]
35 }
36 }
37}
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..af6e469ab
--- /dev/null
+++ b/keyboards/doodboard/duckboard_r2/keymaps/default/keymap.c
@@ -0,0 +1,122 @@
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
41bool 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 return true;
50}
51
52
53#ifdef OLED_ENABLE
54oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; }
55
56
57// WPM-responsive animation stuff here
58#define IDLE_FRAMES 2
59#define IDLE_SPEED 40 // below this wpm value your animation will idle
60
61#define ANIM_FRAME_DURATION 200 // how long each frame lasts in ms
62// #define SLEEP_TIMER 60000 // should sleep after this period of 0 wpm, needs fixing
63#define ANIM_SIZE 636 // number of bytes in array, minimize for adequate firmware size, max is 1024
64
65uint32_t anim_timer = 0;
66uint32_t anim_sleep = 0;
67uint8_t current_idle_frame = 0;
68
69// 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.
70static void render_anim(void) {
71 static const char PROGMEM idle[IDLE_FRAMES][ANIM_SIZE] = {
72 {
73 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
74 },
75 {
76 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
77 }
78 };
79
80 //assumes 1 frame prep stage
81 void animation_phase(void) {
82 current_idle_frame = (current_idle_frame + 1) % IDLE_FRAMES;
83 oled_write_raw_P(idle[abs((IDLE_FRAMES-1)-current_idle_frame)], ANIM_SIZE);
84 }
85
86 if(timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) {
87 anim_timer = timer_read32();
88 animation_phase();
89 }
90 }
91
92bool oled_task_user(void) {
93 render_anim();
94 oled_set_cursor(0,6);
95 oled_write_P(PSTR("DUCK\nBOARD\n"), false);
96 oled_write_P(PSTR("-----\n"), false);
97 // Host Keyboard Layer Status
98 oled_write_P(PSTR("MODE\n"), false);
99 oled_write_P(PSTR("\n"), false);
100
101 switch (get_highest_layer(layer_state)) {
102 case 0:
103 oled_write_P(PSTR("BASE\n"), false);
104 break;
105 case 1:
106 oled_write_P(PSTR("FUNC\n"), false);
107 break;
108 case 2:
109 oled_write_P(PSTR("RGB\n"), false);
110 break;
111 }
112 return false;
113}
114#endif
115
116void keyboard_post_init_user(void) {
117 //Customise these values to debug
118 debug_enable=true;
119 debug_matrix=true;
120 //debug_keyboard=true;
121 //debug_mouse=true;
122}
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..7911d9e3c
--- /dev/null
+++ b/keyboards/doodboard/duckboard_r2/keymaps/via/keymap.c
@@ -0,0 +1,132 @@
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
48bool 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 return true;
57}
58
59
60#ifdef OLED_ENABLE
61oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; }
62
63
64// WPM-responsive animation stuff here
65#define IDLE_FRAMES 2
66#define IDLE_SPEED 40 // below this wpm value your animation will idle
67
68#define ANIM_FRAME_DURATION 200 // how long each frame lasts in ms
69// #define SLEEP_TIMER 60000 // should sleep after this period of 0 wpm, needs fixing
70#define ANIM_SIZE 636 // number of bytes in array, minimize for adequate firmware size, max is 1024
71
72uint32_t anim_timer = 0;
73uint32_t anim_sleep = 0;
74uint8_t current_idle_frame = 0;
75
76// 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.
77static void render_anim(void) {
78 static const char PROGMEM idle[IDLE_FRAMES][ANIM_SIZE] = {
79 {
80 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
81 },
82 {
83 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
84 }
85 };
86
87 //assumes 1 frame prep stage
88 void animation_phase(void) {
89 current_idle_frame = (current_idle_frame + 1) % IDLE_FRAMES;
90 oled_write_raw_P(idle[abs((IDLE_FRAMES-1)-current_idle_frame)], ANIM_SIZE);
91 }
92
93 if(timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) {
94 anim_timer = timer_read32();
95 animation_phase();
96 }
97 }
98
99bool oled_task_user(void) {
100 render_anim();
101 oled_set_cursor(0,6);
102 oled_write_P(PSTR("DUCK\nBOARD\n"), false);
103 oled_write_P(PSTR("-----\n"), false);
104 // Host Keyboard Layer Status
105 oled_write_P(PSTR("MODE\n"), false);
106 oled_write_P(PSTR("\n"), false);
107
108 switch (get_highest_layer(layer_state)) {
109 case 0:
110 oled_write_P(PSTR("BASE\n"), false);
111 break;
112 case 1:
113 oled_write_P(PSTR("FUNC\n"), false);
114 break;
115 case 2:
116 oled_write_P(PSTR("RGB\n"), false);
117 break;
118 case 3:
119 oled_write_P(PSTR("FN2\n"), false);
120 break;
121 }
122 return false;
123}
124#endif
125
126void keyboard_post_init_user(void) {
127 //Customise these values to debug
128 debug_enable=true;
129 debug_matrix=true;
130 //debug_keyboard=true;
131 //debug_mouse=true;
132}
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..3aaae9d19
--- /dev/null
+++ b/keyboards/doodboard/duckboard_r2/rules.mk
@@ -0,0 +1,22 @@
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 # Enable Bootmagic Lite
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
15NKRO_ENABLE = yes # Enable N-Key Rollover
16BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
17RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
18AUDIO_ENABLE = no # Audio output
19
20ENCODER_ENABLE = yes
21OLED_ENABLE = yes
22OLED_DRIVER = SSD1306