From 80d679fac3406d9c3d6f3b10e133161c3f938697 Mon Sep 17 00:00:00 2001 From: depermana12 Date: Thu, 6 Jul 2023 13:40:51 +0700 Subject: [Keyboard] Add dp3000 macropad (#21413) --- keyboards/dp3000/config.h | 25 ++++++++ keyboards/dp3000/dp3000.c | 34 +++++++++++ keyboards/dp3000/info.json | 98 +++++++++++++++++++++++++++++++ keyboards/dp3000/keymaps/default/keymap.c | 58 ++++++++++++++++++ keyboards/dp3000/keymaps/default/rules.mk | 1 + keyboards/dp3000/keymaps/via/keymap.c | 58 ++++++++++++++++++ keyboards/dp3000/keymaps/via/rules.mk | 2 + keyboards/dp3000/readme.md | 27 +++++++++ keyboards/dp3000/rules.mk | 1 + 9 files changed, 304 insertions(+) create mode 100644 keyboards/dp3000/config.h create mode 100644 keyboards/dp3000/dp3000.c create mode 100644 keyboards/dp3000/info.json create mode 100644 keyboards/dp3000/keymaps/default/keymap.c create mode 100644 keyboards/dp3000/keymaps/default/rules.mk create mode 100644 keyboards/dp3000/keymaps/via/keymap.c create mode 100644 keyboards/dp3000/keymaps/via/rules.mk create mode 100644 keyboards/dp3000/readme.md create mode 100644 keyboards/dp3000/rules.mk (limited to 'keyboards') diff --git a/keyboards/dp3000/config.h b/keyboards/dp3000/config.h new file mode 100644 index 0000000000..26e9f037f5 --- /dev/null +++ b/keyboards/dp3000/config.h @@ -0,0 +1,25 @@ +/* + * Copyright 2023 deddia permana (@depermana12) + * + * 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 RGB_MATRIX_LED_COUNT 8 +#define RGB_MATRIX_SOLID_REACTIVE_GRADIENT_MODE +#define RGB_MATRIX_KEYPRESSES +#define RGB_MATRIX_KEYRELEASES +#define RGB_MATRIX_FRAMEBUFFER_EFFECTS +#define RGB_DISABLE_WHEN_USB_SUSPENDED diff --git a/keyboards/dp3000/dp3000.c b/keyboards/dp3000/dp3000.c new file mode 100644 index 0000000000..3d99670fe3 --- /dev/null +++ b/keyboards/dp3000/dp3000.c @@ -0,0 +1,34 @@ +/* Copyright 2023 deddia permana (@depermana12) + * + * 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 "quantum.h" + +bool oled_task_kb(void) { + if (!oled_task_user()) { + return false; + } + oled_write_P(PSTR("LAYER: "), false); + oled_write_char('0' + get_highest_layer(layer_state), false); + + led_t led_state = host_keyboard_led_state(); + oled_set_cursor(0, 1); + oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); + oled_set_cursor(0, 2); + oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); + oled_set_cursor(0, 3); + oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); + + return false; +} diff --git a/keyboards/dp3000/info.json b/keyboards/dp3000/info.json new file mode 100644 index 0000000000..c7348c81a8 --- /dev/null +++ b/keyboards/dp3000/info.json @@ -0,0 +1,98 @@ +{ + "manufacturer": "depermana12", + "keyboard_name": "dp3000", + "maintainer": "depermana12", + "diode_direction": "COL2ROW", + "development_board": "promicro", + "features": { + "bootmagic": true, + "command": false, + "console": false, + "extrakey": true, + "encoder": true, + "rgb_matrix": true, + "oled": true, + "mousekey": false, + "nkro": false + }, + "build": { + "lto": true + }, + "url": "https://github.com/depermana12", + "usb": { + "device_version": "1.0.1", + "vid": "0x4450", + "pid": "0x6470" + }, + "encoder": { + "rotary": [ + { "pin_a": "B2", "pin_b": "B1"}, + { "pin_a": "F4", "pin_b": "F5"} + ] + }, + "ws2812": { + "pin": "B5" + }, + "rgb_matrix":{ + "driver":"WS2812", + "max_brightness": 180, + "animations": { + "alphas_mods": true, + "gradient_up_down": true, + "gradient_left_right": true, + "breathing": true, + "band_sat": true, + "band_val": true, + "band_pinwheel_sat": true, + "band_pinwheel_val": true, + "band_spiral_sat": true, + "band_spiral_val": true, + "cycle_all": true, + "cycle_left_right": true, + "cycle_up_down": true, + "rainbow_moving_chevron":true, + "cycle_pinwheel": true, + "cycle_spiral": true, + "raindrops": true, + "hue_breathing": true, + "hue_pendulum": true, + "hue_wave": true, + "typing_heatmap": true, + "solid_reactive_simple": true, + "solid_reactive": true, + "solid_reactive_multinexus": true, + "splash": true, + "solid_splash": true + }, + "layout":[ + { "matrix": [1, 0], "x": 0, "y": 32, "flags":4 }, + { "matrix": [1, 1], "x": 25, "y": 32, "flags":4 }, + { "matrix": [1, 2], "x": 37, "y": 32, "flags":4 }, + { "matrix": [1, 3], "x": 75, "y": 32, "flags":4 }, + { "matrix": [2, 0], "x": 75, "y": 16, "flags":4 }, + { "matrix": [2, 1], "x": 37, "y": 16, "flags":4 }, + { "matrix": [2, 2], "x": 25, "y": 16, "flags":4 }, + { "matrix": [2, 3], "x": 0, "y": 16, "flags":4 } + ] + }, + "matrix_pins": { + "cols": ["D4", "D7", "B4", "C6"], + "rows": ["F6", "F7", "B3"] + }, + "layouts": { + "LAYOUT": { + "layout": [ + { "matrix": [0, 0], "x": 0, "y": 0 }, + { "matrix": [0, 3], "x": 3, "y": 0 }, + { "matrix": [1, 0], "x": 0, "y": 1 }, + { "matrix": [1, 1], "x": 1, "y": 1 }, + { "matrix": [1, 2], "x": 2, "y": 1 }, + { "matrix": [1, 3], "x": 3, "y": 1 }, + { "matrix": [2, 0], "x": 0, "y": 2 }, + { "matrix": [2, 1], "x": 1, "y": 2 }, + { "matrix": [2, 2], "x": 2, "y": 2 }, + { "matrix": [2, 3], "x": 3, "y": 2 } + ] + } + } +} diff --git a/keyboards/dp3000/keymaps/default/keymap.c b/keyboards/dp3000/keymaps/default/keymap.c new file mode 100644 index 0000000000..6d3561edbc --- /dev/null +++ b/keyboards/dp3000/keymaps/default/keymap.c @@ -0,0 +1,58 @@ +/* +Copyright 2023 deddia permana (@depermana12) + +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] = { + /* + * ┌─────────┐ ┌─────────┐ + * │ mute │ │ MO(1) │ + * ├─────────┼─────────┬─────────┼─────────┤ + * │ 1 │ 2 │ 3 │ 4 │ + * ├─────────┼─────────┼─────────┼─────────┤ + * │ 5 │ 6 │ 7 │ 8 │ + * └─────────┴─────────┴─────────┴─────────┘ + */ + [0] = LAYOUT( + KC_MUTE, MO(1), + KC_1, KC_2, KC_3, KC_4, + KC_5, KC_6, KC_7, KC_8 + ), + [1] = LAYOUT( + QK_BOOT, _______, + KC_1, KC_2, KC_3, KC_4, + TO(0), TO(2), TO(3), RGB_TOG + ), + [2] = LAYOUT( + _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______ + ), + [3] = LAYOUT( + _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______ + ) + }; +#if defined (ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(RGB_HUD, RGB_HUI) }, + [1] = { ENCODER_CCW_CW(KC_PGDN, KC_PGUP), ENCODER_CCW_CW(RGB_SAD, RGB_SAI) }, + [2] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_SPD, RGB_SPI) }, + [3] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD), ENCODER_CCW_CW(KC_RIGHT, KC_LEFT)}, +}; +#endif diff --git a/keyboards/dp3000/keymaps/default/rules.mk b/keyboards/dp3000/keymaps/default/rules.mk new file mode 100644 index 0000000000..ee32568148 --- /dev/null +++ b/keyboards/dp3000/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/dp3000/keymaps/via/keymap.c b/keyboards/dp3000/keymaps/via/keymap.c new file mode 100644 index 0000000000..6d3561edbc --- /dev/null +++ b/keyboards/dp3000/keymaps/via/keymap.c @@ -0,0 +1,58 @@ +/* +Copyright 2023 deddia permana (@depermana12) + +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] = { + /* + * ┌─────────┐ ┌─────────┐ + * │ mute │ │ MO(1) │ + * ├─────────┼─────────┬─────────┼─────────┤ + * │ 1 │ 2 │ 3 │ 4 │ + * ├─────────┼─────────┼─────────┼─────────┤ + * │ 5 │ 6 │ 7 │ 8 │ + * └─────────┴─────────┴─────────┴─────────┘ + */ + [0] = LAYOUT( + KC_MUTE, MO(1), + KC_1, KC_2, KC_3, KC_4, + KC_5, KC_6, KC_7, KC_8 + ), + [1] = LAYOUT( + QK_BOOT, _______, + KC_1, KC_2, KC_3, KC_4, + TO(0), TO(2), TO(3), RGB_TOG + ), + [2] = LAYOUT( + _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______ + ), + [3] = LAYOUT( + _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______ + ) + }; +#if defined (ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(RGB_HUD, RGB_HUI) }, + [1] = { ENCODER_CCW_CW(KC_PGDN, KC_PGUP), ENCODER_CCW_CW(RGB_SAD, RGB_SAI) }, + [2] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_SPD, RGB_SPI) }, + [3] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD), ENCODER_CCW_CW(KC_RIGHT, KC_LEFT)}, +}; +#endif diff --git a/keyboards/dp3000/keymaps/via/rules.mk b/keyboards/dp3000/keymaps/via/rules.mk new file mode 100644 index 0000000000..f1adcab005 --- /dev/null +++ b/keyboards/dp3000/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/dp3000/readme.md b/keyboards/dp3000/readme.md new file mode 100644 index 0000000000..3844a66757 --- /dev/null +++ b/keyboards/dp3000/readme.md @@ -0,0 +1,27 @@ +# DP3000 + +![dp3000 macropad](https://i.imgur.com/uBHS8EYh.jpg) + +dp3000 is a simple yet elegant macropad, 2x4 (8 keys), dual encoder, embedded with an Atmel 32u4 chip, powered by QMK. + +* Keyboard Maintainer: [Deddia Permana](https://github.com/depermana12) +* Hardware Supported: DP3000 PCB, ATmega32u4 +* Hardware Availability: [tokopedia.com/gundamtricks](https://www.tokopedia.com/gundamtricks) + +Make example for this keyboard (after setting up your build environment): + + make dp3000:default + +Flashing example for this keyboard: + + make dp3000: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). + +## 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 reset button twice, located in front of the first rotary encoder (left rotary encoder) +* Keycode in layout: Press the key mapped to QK_BOOT if it is available diff --git a/keyboards/dp3000/rules.mk b/keyboards/dp3000/rules.mk new file mode 100644 index 0000000000..6e7633bfe0 --- /dev/null +++ b/keyboards/dp3000/rules.mk @@ -0,0 +1 @@ +# This file intentionally left blank -- cgit v1.2.3