From 9c564b6a5fc249af397e1c1b0ec237a2629072e8 Mon Sep 17 00:00:00 2001 From: Brandon Claveria <48102030+swiftrax@users.noreply.github.com> Date: Tue, 21 Sep 2021 21:25:59 -0700 Subject: [PATCH] [Keyboard] Add Dango40 (#14437) Co-authored-by: Drashna Jaelre Co-authored-by: Swiftrax Co-authored-by: Swiftrax --- keyboards/onekeyco/dango40/config.h | 50 ++++ keyboards/onekeyco/dango40/dango40.c | 27 ++ keyboards/onekeyco/dango40/dango40.h | 33 +++ keyboards/onekeyco/dango40/info.json | 263 ++++++++++++++++++ .../onekeyco/dango40/keymaps/default/keymap.c | 38 +++ .../onekeyco/dango40/keymaps/via/keymap.c | 50 ++++ .../onekeyco/dango40/keymaps/via/rules.mk | 1 + keyboards/onekeyco/dango40/readme.md | 18 ++ keyboards/onekeyco/dango40/rules.mk | 22 ++ 9 files changed, 502 insertions(+) create mode 100644 keyboards/onekeyco/dango40/config.h create mode 100644 keyboards/onekeyco/dango40/dango40.c create mode 100644 keyboards/onekeyco/dango40/dango40.h create mode 100644 keyboards/onekeyco/dango40/info.json create mode 100644 keyboards/onekeyco/dango40/keymaps/default/keymap.c create mode 100644 keyboards/onekeyco/dango40/keymaps/via/keymap.c create mode 100644 keyboards/onekeyco/dango40/keymaps/via/rules.mk create mode 100644 keyboards/onekeyco/dango40/readme.md create mode 100644 keyboards/onekeyco/dango40/rules.mk diff --git a/keyboards/onekeyco/dango40/config.h b/keyboards/onekeyco/dango40/config.h new file mode 100644 index 000000000..fceb8fb25 --- /dev/null +++ b/keyboards/onekeyco/dango40/config.h @@ -0,0 +1,50 @@ +/* +Copyright 2021 Swiftrax + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x04D8 +#define PRODUCT_ID 0xE9B9 +#define DEVICE_VER 0x0001 +#define MANUFACTURER One Key Company +#define PRODUCT Dango40 +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 13 + +// ROWS: Top to bottom, COLS: Left to right + +#define MATRIX_ROW_PINS { F4, F1, F0, C6 } +#define MATRIX_COL_PINS { F7, F6, F5, D3, D5, D4, D6, D7, B4, B5, B6, C7, B0 } + +#define ENCODERS_PAD_A { D2 } +#define ENCODERS_PAD_B { D1 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/*EEPROM for via*/ +#define DYNAMIC_KEYMAP_LAYER_COUNT 5 \ No newline at end of file diff --git a/keyboards/onekeyco/dango40/dango40.c b/keyboards/onekeyco/dango40/dango40.c new file mode 100644 index 000000000..8ca77545b --- /dev/null +++ b/keyboards/onekeyco/dango40/dango40.c @@ -0,0 +1,27 @@ +/* +Copyright 2021 Swiftrax + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include "dango40.h" + +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (clockwise) { + tap_code_delay(KC_VOLU, 10); + } else { + tap_code_delay(KC_VOLD, 10); + } + return true; +} diff --git a/keyboards/onekeyco/dango40/dango40.h b/keyboards/onekeyco/dango40/dango40.h new file mode 100644 index 000000000..9caa62452 --- /dev/null +++ b/keyboards/onekeyco/dango40/dango40.h @@ -0,0 +1,33 @@ +/* +Copyright 2021 Swiftrax + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#pragma once + +#define ___ KC_NO + +#include "quantum.h" + +#define LAYOUT_all( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K31, K32, K34, K36, K37, K39, K3A, K3B \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, }, \ + { K30, K31, K32, ___, K34, ___, K36, K37, ___, K39, K3A, K3B, ___, } \ +} diff --git a/keyboards/onekeyco/dango40/info.json b/keyboards/onekeyco/dango40/info.json new file mode 100644 index 000000000..188cc7473 --- /dev/null +++ b/keyboards/onekeyco/dango40/info.json @@ -0,0 +1,263 @@ +{ + "keyboard_name":"Dango40", + "url":"https://github.com/swiftrax", + "maintainer":"Swiftrax", + "layouts":{ + "LAYOUT":{ + "layout_all":[ + { + "label":"0,0", + "x":0, + "y":0 + }, + { + "label":"0,1", + "x":1, + "y":0 + }, + { + "label":"0,2", + "x":2, + "y":0 + }, + { + "label":"0,3", + "x":3, + "y":0 + }, + { + "label":"0,4", + "x":4, + "y":0 + }, + { + "label":"0,5", + "x":5, + "y":0 + }, + { + "label":"0,6", + "x":6, + "y":0 + }, + { + "label":"0,7", + "x":7, + "y":0 + }, + { + "label":"0,8", + "x":8, + "y":0 + }, + { + "label":"0,9", + "x":9, + "y":0 + }, + { + "label":"0,10", + "x":10, + "y":0 + }, + { + "label":"0,11", + "x":11, + "y":0, + "w":1.75 + }, + { + "label":"0,12", + "x":12.75, + "y":0 + }, + { + "label":"1,0", + "x":0, + "y":1, + "w":1.25 + }, + { + "label":"1,1", + "x":1.25, + "y":1 + }, + { + "label":"1,2", + "x":2.25, + "y":1 + }, + { + "label":"1,3", + "x":3.25, + "y":1 + }, + { + "label":"1,4", + "x":4.25, + "y":1 + }, + { + "label":"1,5", + "x":5.25, + "y":1 + }, + { + "label":"1,6", + "x":6.25, + "y":1 + }, + { + "label":"1,7", + "x":7.25, + "y":1 + }, + { + "label":"1,8", + "x":8.25, + "y":1 + }, + { + "label":"1,9", + "x":9.25, + "y":1 + }, + { + "label":"1,10", + "x":10.25, + "y":1 + }, + { + "label":"1,11", + "x":11.25, + "y":1, + "w":1.5 + }, + { + "label":"1,12", + "x":12.75, + "y":1 + }, + { + "label":"2,0", + "x":0, + "y":2, + "w":1.75 + }, + { + "label":"2,1", + "x":1.75, + "y":2 + }, + { + "label":"2,2", + "x":2.75, + "y":2 + }, + { + "label":"2,3", + "x":3.75, + "y":2 + }, + { + "label":"2,4", + "x":4.75, + "y":2 + }, + { + "label":"2,5", + "x":5.75, + "y":2 + }, + { + "label":"2,6", + "x":6.75, + "y":2 + }, + { + "label":"2,7", + "x":7.75, + "y":2 + }, + { + "label":"2,8", + "x":8.75, + "y":2 + }, + { + "label":"2,9", + "x":9.75, + "y":2 + }, + { + "label":"2,10", + "x":10.75, + "y":2 + }, + { + "label":"2,11", + "x":11.75, + "y":2 + }, + { + "label":"2,12", + "x":12.75, + "y":2 + }, + { + "label":"3,0", + "x":0, + "y":3, + "w":1.25 + }, + { + "label":"3,1", + "x":1.25, + "y":3, + "w":1.5 + }, + { + "label":"3,2", + "x":2.75, + "y":3, + "w":1.25 + }, + { + "label":"3,4", + "x":4, + "y":3, + "w":2.25 + }, + { + "label":"3,6", + "x":6.25, + "y":3, + "w":2.75 + }, + { + "label":"3,7", + "x":9, + "y":3, + "w":1.25 + }, + { + "label":"3,9", + "x":10.25, + "y":3, + "w":1.25 + }, + { + "label":"3,10", + "x":11.5, + "y":3, + "w":1.25 + }, + { + "label":"3,11", + "x":12.75, + "y":3 + } + ] + } + } +} \ No newline at end of file diff --git a/keyboards/onekeyco/dango40/keymaps/default/keymap.c b/keyboards/onekeyco/dango40/keymaps/default/keymap.c new file mode 100644 index 000000000..4bed789d0 --- /dev/null +++ b/keyboards/onekeyco/dango40/keymaps/default/keymap.c @@ -0,0 +1,38 @@ +/* +Copyright 2021 Swiftrax + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_all( + KC_GESC, KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSPC, KC_MUTE, + KC_TAB , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_ENT , KC_PGUP, + KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC , KC_SPC , KC_RALT, KC_RCTL, MO(1) , KC_RGHT + ), + [1] = LAYOUT_all( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + [2] = LAYOUT_all( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/onekeyco/dango40/keymaps/via/keymap.c b/keyboards/onekeyco/dango40/keymaps/via/keymap.c new file mode 100644 index 000000000..5c13bcee8 --- /dev/null +++ b/keyboards/onekeyco/dango40/keymaps/via/keymap.c @@ -0,0 +1,50 @@ +/* +Copyright 2021 Swiftrax + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_all( + KC_GESC, KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSPC, KC_MUTE, + KC_TAB , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_ENT , KC_PGUP, + KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC , KC_SPC , KC_RALT, KC_RCTL, MO(1) , KC_RGHT + ), + [1] = LAYOUT_all( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [2] = LAYOUT_all( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [3] = LAYOUT_all( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [4] = LAYOUT_all( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/onekeyco/dango40/keymaps/via/rules.mk b/keyboards/onekeyco/dango40/keymaps/via/rules.mk new file mode 100644 index 000000000..036bd6d1c --- /dev/null +++ b/keyboards/onekeyco/dango40/keymaps/via/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes \ No newline at end of file diff --git a/keyboards/onekeyco/dango40/readme.md b/keyboards/onekeyco/dango40/readme.md new file mode 100644 index 000000000..4b12f5595 --- /dev/null +++ b/keyboards/onekeyco/dango40/readme.md @@ -0,0 +1,18 @@ +# Dango40 + +40% keyboard + +* Keyboard Maintainer: Swiftrax +* Hardware Supported: Dango40 +* Hardware Availability: Dango40 PCB + +## Bootloader Enter the bootloader in 3 ways: + * **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard + * **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead + * **Keycode in layout**: Press the key mapped to `RESET` if it is available + +Make example for flashing this keyboard (after setting up your build environment): + + make onekeyco/dango40:default:flash + +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/onekeyco/dango40/rules.mk b/keyboards/onekeyco/dango40/rules.mk new file mode 100644 index 000000000..898b0f444 --- /dev/null +++ b/keyboards/onekeyco/dango40/rules.mk @@ -0,0 +1,22 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +ENCODER_ENABLE = yes # Enable encoder \ No newline at end of file