diff options
| author | doodboard <doodboard@gmail.com> | 2020-09-26 06:30:52 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-25 14:30:52 -0700 |
| commit | 4a83021fe0d07888e0e3bf161882c4ab7221a4a6 (patch) | |
| tree | f79aa634d93c23bf09ec447033804f04eacf425c /keyboards/doodboard | |
| parent | 9570b1bbb4ce2358efedf4a25233ee2c15b8745b (diff) | |
| download | qmk_firmware-4a83021fe0d07888e0e3bf161882c4ab7221a4a6.tar.gz qmk_firmware-4a83021fe0d07888e0e3bf161882c4ab7221a4a6.zip | |
[Keyboard] add duckboard by doodboard (#10318)
* Adding duckboard to QMK
Adding duckboard support to QMK
* added duckboard under doodboard
* changed debouncing delay to debounce
* Update keyboards/doodboard/duckboard/config.h
* Update keyboards/doodboard/duckboard/config.h
* Update keyboards/doodboard/duckboard/kb.h
* Update keyboards/doodboard/duckboard/keymaps/default/keymap.c
* Update keyboards/doodboard/duckboard/rules.mk
* Update keyboards/doodboard/duckboard/kb.h
* Update keyboards/doodboard/duckboard/kb.c
* Update code per review
Update code per review
* folder name errod
folder name errod
* Update keyboards/doodboard/duckboard/config.h
* Update keyboards/doodboard/duckboard/rules.mk
* Update keyboards/doodboard/duckboard/rules.mk
* Update keyboards/doodboard/duckboard/config.h
* Create info.json
* Update keyboards/doodboard/duckboard/duckboard.h
* Update keyboards/doodboard/duckboard/info.json
* Update keyboards/doodboard/duckboard/info.json
* Update keyboards/doodboard/duckboard/duckboard.h
* Update keyboards/doodboard/duckboard/readme.md
Diffstat (limited to 'keyboards/doodboard')
| -rw-r--r-- | keyboards/doodboard/duckboard/config.h | 57 | ||||
| -rw-r--r-- | keyboards/doodboard/duckboard/duckboard.c | 17 | ||||
| -rw-r--r-- | keyboards/doodboard/duckboard/duckboard.h | 34 | ||||
| -rw-r--r-- | keyboards/doodboard/duckboard/info.json | 36 | ||||
| -rw-r--r-- | keyboards/doodboard/duckboard/keymaps/default/keymap.c | 118 | ||||
| -rw-r--r-- | keyboards/doodboard/duckboard/readme.md | 17 | ||||
| -rw-r--r-- | keyboards/doodboard/duckboard/rules.mk | 25 |
7 files changed, 304 insertions, 0 deletions
diff --git a/keyboards/doodboard/duckboard/config.h b/keyboards/doodboard/duckboard/config.h new file mode 100644 index 000000000..ea8a8ae5d --- /dev/null +++ b/keyboards/doodboard/duckboard/config.h | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | /* Copyright 2020 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 0xFEED | ||
| 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..af0cb24be --- /dev/null +++ b/keyboards/doodboard/duckboard/duckboard.c | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | /* Copyright 2020 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..0e753d445 --- /dev/null +++ b/keyboards/doodboard/duckboard/duckboard.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* Copyright 2020 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 | |||
| 18 | #pragma once | ||
| 19 | |||
| 20 | #include "quantum.h" | ||
| 21 | |||
| 22 | #define LAYOUT( \ | ||
| 23 | K01, K02, K03, K04, \ | ||
| 24 | K11, K12, K13, \ | ||
| 25 | K21, K22, K23, K24, \ | ||
| 26 | K31, K32, K33, \ | ||
| 27 | K40, K41, K42, K43, K44 \ | ||
| 28 | ) { \ | ||
| 29 | { KC_NO, K01, K02, K03, K04 }, \ | ||
| 30 | { KC_NO, K11, K12, K13, KC_NO }, \ | ||
| 31 | { KC_NO, K21, K22, K23, K24 }, \ | ||
| 32 | { KC_NO, K31, K32, K33, KC_NO }, \ | ||
| 33 | { K40, K41, K42, K43, K44 } \ | ||
| 34 | } | ||
diff --git a/keyboards/doodboard/duckboard/info.json b/keyboards/doodboard/duckboard/info.json new file mode 100644 index 000000000..ff043779f --- /dev/null +++ b/keyboards/doodboard/duckboard/info.json | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | { | ||
| 2 | "keyboard_name": "duckboard", | ||
| 3 | "url": "", | ||
| 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 | |||
| 19 | {"x": 1, "y": 2}, | ||
| 20 | {"x": 2, "y": 2}, | ||
| 21 | {"x": 3, "y": 2}, | ||
| 22 | {"x": 4, "y": 2}, | ||
| 23 | |||
| 24 | {"x": 1, "y": 3}, | ||
| 25 | {"x": 2, "y": 3}, | ||
| 26 | {"x": 3, "y": 3}, | ||
| 27 | |||
| 28 | {"x": 0, "y": 4}, | ||
| 29 | {"x": 1, "y": 4}, | ||
| 30 | {"x": 2, "y": 4}, | ||
| 31 | {"x": 3, "y": 4}, | ||
| 32 | {"x": 4, "y": 4} | ||
| 33 | ] | ||
| 34 | } | ||
| 35 | } | ||
| 36 | } | ||
diff --git a/keyboards/doodboard/duckboard/keymaps/default/keymap.c b/keyboards/doodboard/duckboard/keymaps/default/keymap.c new file mode 100644 index 000000000..6684e9863 --- /dev/null +++ b/keyboards/doodboard/duckboard/keymaps/default/keymap.c | |||
| @@ -0,0 +1,118 @@ | |||
| 1 | /* Copyright 2020 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 | ||
| 18 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 19 | [0] = LAYOUT( | ||
| 20 | TG(1), KC_PSLS, KC_PAST, KC_PMNS, | ||
| 21 | KC_P7, KC_P8, KC_P9, | ||
| 22 | KC_P4, KC_P5, KC_P6, KC_PPLS, | ||
| 23 | KC_P1, KC_P2, KC_P3, | ||
| 24 | KC_BSPC, KC_MUTE, KC_P0, KC_PDOT, KC_PENT), | ||
| 25 | [1] = LAYOUT( | ||
| 26 | TG(1), KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 27 | KC_HOME, KC_UP, KC_PGUP, | ||
| 28 | KC_LEFT, KC_TRNS, KC_RGHT, KC_TRNS, | ||
| 29 | KC_END, KC_DOWN, KC_PGDN, | ||
| 30 | TG(2), KC_TRNS, KC_INS, KC_DEL, KC_TRNS), | ||
| 31 | [2] = LAYOUT( | ||
| 32 | KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS, | ||
| 33 | RGB_HUI, RGB_SAI, RGB_VAI, | ||
| 34 | RGB_HUD, RGB_SAD, RGB_VAD, KC_TRNS, | ||
| 35 | KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 36 | TG(2), RESET, KC_TRNS, KC_TRNS, KC_TRNS), | ||
| 37 | }; | ||
| 38 | |||
| 39 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
| 40 | if (index == 0) { /* First encoder */ | ||
| 41 | if (clockwise) { | ||
| 42 | tap_code(KC_VOLU); | ||
| 43 | } else { | ||
| 44 | tap_code(KC_VOLD); | ||
| 45 | } | ||
| 46 | } | ||
| 47 | } | ||
| 48 | |||
| 49 | |||
| 50 | #ifdef OLED_DRIVER_ENABLE | ||
| 51 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; } | ||
| 52 | |||
| 53 | |||
| 54 | // WPM-responsive animation stuff here | ||
| 55 | #define IDLE_FRAMES 2 | ||
| 56 | #define IDLE_SPEED 40 // below this wpm value your animation will idle | ||
| 57 | |||
| 58 | #define ANIM_FRAME_DURATION 200 // how long each frame lasts in ms | ||
| 59 | // #define SLEEP_TIMER 60000 // should sleep after this period of 0 wpm, needs fixing | ||
| 60 | #define ANIM_SIZE 636 // number of bytes in array, minimize for adequate firmware size, max is 1024 | ||
| 61 | |||
| 62 | uint32_t anim_timer = 0; | ||
| 63 | uint32_t anim_sleep = 0; | ||
| 64 | uint8_t current_idle_frame = 0; | ||
| 65 | |||
| 66 | // 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. | ||
| 67 | static void render_anim(void) { | ||
| 68 | static const char PROGMEM idle[IDLE_FRAMES][ANIM_SIZE] = { | ||
| 69 | { | ||
| 70 | 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 | ||
| 71 | }, | ||
| 72 | { | ||
| 73 | 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 | ||
| 74 | } | ||
| 75 | }; | ||
| 76 | |||
| 77 | //assumes 1 frame prep stage | ||
| 78 | void animation_phase(void) { | ||
| 79 | current_idle_frame = (current_idle_frame + 1) % IDLE_FRAMES; | ||
| 80 | oled_write_raw_P(idle[abs((IDLE_FRAMES-1)-current_idle_frame)], ANIM_SIZE); | ||
| 81 | } | ||
| 82 | |||
| 83 | if(timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) { | ||
| 84 | anim_timer = timer_read32(); | ||
| 85 | animation_phase(); | ||
| 86 | } | ||
| 87 | } | ||
| 88 | |||
| 89 | void oled_task_user(void) { | ||
| 90 | render_anim(); | ||
| 91 | oled_set_cursor(0,6); | ||
| 92 | oled_write_P(PSTR("DUCK\nBOARD\n"), false); | ||
| 93 | oled_write_P(PSTR("-----\n"), false); | ||
| 94 | // Host Keyboard Layer Status | ||
| 95 | oled_write_P(PSTR("MODE\n"), false); | ||
| 96 | oled_write_P(PSTR("\n"), false); | ||
| 97 | |||
| 98 | switch (get_highest_layer(layer_state)) { | ||
| 99 | case 0: | ||
| 100 | oled_write_P(PSTR("BASE\n"), false); | ||
| 101 | break; | ||
| 102 | case 1: | ||
| 103 | oled_write_P(PSTR("FUNC\n"), false); | ||
| 104 | break; | ||
| 105 | case 2: | ||
| 106 | oled_write_P(PSTR("RGB\n"), false); | ||
| 107 | break; | ||
| 108 | } | ||
| 109 | } | ||
| 110 | #endif | ||
| 111 | |||
| 112 | void keyboard_post_init_user(void) { | ||
| 113 | //Customise these values to debug | ||
| 114 | //debug_enable=true; | ||
| 115 | //debug_matrix=true; | ||
| 116 | //debug_keyboard=true; | ||
| 117 | //debug_mouse=true; | ||
| 118 | } | ||
diff --git a/keyboards/doodboard/duckboard/readme.md b/keyboards/doodboard/duckboard/readme.md new file mode 100644 index 000000000..d2b799ab6 --- /dev/null +++ b/keyboards/doodboard/duckboard/readme.md | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | # duckboard | ||
| 2 | |||
| 3 | An 18-key numpad with rotary encoder and OLED support. | ||
| 4 | |||
| 5 | * Keyboard Maintainer: [doodboard](https://github.com/doodboard) | ||
| 6 | * Hardware Supported: duckboard PCB | ||
| 7 | * Hardware Availability: Private Group Buy | ||
| 8 | |||
| 9 | Make example for this keyboard (after setting up your build environment): | ||
| 10 | |||
| 11 | make doodboard/duckboard:default | ||
| 12 | |||
| 13 | Flashing example for this keyboard: | ||
| 14 | |||
| 15 | make doodboard/duckboard:default:flash | ||
| 16 | |||
| 17 | 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). | ||
diff --git a/keyboards/doodboard/duckboard/rules.mk b/keyboards/doodboard/duckboard/rules.mk new file mode 100644 index 000000000..09a60d8a7 --- /dev/null +++ b/keyboards/doodboard/duckboard/rules.mk | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | # MCU name | ||
| 2 | MCU = atmega32u4 | ||
| 3 | |||
| 4 | # Bootloader selection | ||
| 5 | BOOTLOADER = caterina | ||
| 6 | |||
| 7 | # Build Options | ||
| 8 | # change yes to no to disable | ||
| 9 | # | ||
| 10 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration | ||
| 11 | MOUSEKEY_ENABLE = no # Mouse keys | ||
| 12 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
| 13 | CONSOLE_ENABLE = yes # Console for debug | ||
| 14 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
| 15 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
| 16 | SLEEP_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 | ||
| 18 | NKRO_ENABLE = yes # USB Nkey Rollover | ||
| 19 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
| 20 | RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow | ||
| 21 | BLUETOOTH_ENABLE = no # Enable Bluetooth | ||
| 22 | AUDIO_ENABLE = no # Audio output | ||
| 23 | |||
| 24 | ENCODER_ENABLE = yes | ||
| 25 | OLED_DRIVER_ENABLE = yes | ||
