Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add doio/kb03 #24815

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions keyboards/doio/kb03/kb03.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/* Copyright (C) 2025 DOIO
* Copyright (C) 2025 ClownFish (@clownfish-og)
*
* 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 <http://www.gnu.org/licenses/>.
*/
clownfish-og marked this conversation as resolved.
Show resolved Hide resolved

#include QMK_KEYBOARD_H

#ifdef RGB_MATRIX_ENABLE

bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
if (!process_record_user(keycode, record)) {
return false;
}
switch (keycode) {
case RM_TOGG:
if (record->event.pressed) {
switch (rgb_matrix_get_flags()) {
case LED_FLAG_ALL: {
rgb_matrix_set_flags(LED_FLAG_NONE);
rgb_matrix_set_color_all(0, 0, 0);
} break;
default: {
rgb_matrix_set_flags(LED_FLAG_ALL);
} break;
}
}
if (!rgb_matrix_is_enabled()) {
rgb_matrix_set_flags(LED_FLAG_ALL);
rgb_matrix_enable();
}
return false;
}
return true;
}

bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) {
return false;
}

hsv_t hsv = {0, 255, 100};
switch (get_highest_layer(layer_state)) {
case 0:
hsv = (hsv_t){HSV_RED};
break;
case 1:
hsv = (hsv_t){HSV_GREEN};
break;
case 2:
hsv = (hsv_t){HSV_BLUE};
break;
case 3:
hsv = (hsv_t){HSV_WHITE};
break;
default:
hsv = (hsv_t){HSV_YELLOW};
break;
}
hsv.v = (rgb_matrix_get_val() * 70 / 200) + 30; //set indicator brightness range 30-100, vary based on RGB Matrix brightness
rgb_t rgb = hsv_to_rgb(hsv);
rgb_matrix_set_color(9, rgb.r, rgb.g, rgb.b);
return false;
}

#endif
102 changes: 102 additions & 0 deletions keyboards/doio/kb03/keyboard.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"manufacturer": "DOIO",
"keyboard_name": "KB03-01",
"maintainer": "clownfish-og",
"bootloader": "stm32duino",
"diode_direction": "COL2ROW",
"encoder": {
"rotary": [
{"pin_a": "B5", "pin_b": "B6", "resolution": 4},
{"pin_a": "A2", "pin_b": "A1", "resolution": 2}
]
},
"features": {
"bootmagic": true,
"encoder": true,
"extrakey": true,
"mousekey": true,
"nkro": false,
"rgb_matrix": true
},
"matrix_pins": {
"cols": ["B14", "B13", "B12", "B0", "A7"],
"rows": ["B3"]
},
"processor": "STM32F103",
"rgb_matrix": {
"animations": {
"band_pinwheel_sat": true,
"band_pinwheel_val": true,
"band_sat": true,
"band_spiral_sat": true,
"band_spiral_val": true,
"band_val": true,
"breathing": true,
"cycle_all": true,
"cycle_left_right": true,
"cycle_out_in": true,
"cycle_out_in_dual": true,
"cycle_pinwheel": true,
"cycle_spiral": true,
"cycle_up_down": true,
"dual_beacon": true,
"gradient_left_right": true,
"gradient_up_down": true,
"hue_breathing": true,
"hue_pendulum": true,
"hue_wave": true,
"jellybean_raindrops": true,
"rainbow_beacon": true,
"rainbow_moving_chevron": true,
"rainbow_pinwheels": true,
"raindrops": true,
"solid_reactive": true,
"solid_reactive_cross": true,
"solid_reactive_nexus": true,
"solid_reactive_simple": true,
"solid_reactive_wide": true,
"solid_splash": true,
"splash": true
},
"center_point": [32, 32],
"default": {
"animation": "dual_beacon"
},
"driver": "ws2812",
"hue_step": 16,
"layout": [
{"matrix": [0, 0], "x": 0, "y": 0, "flags": 4},
{"matrix": [0, 1], "x": 32, "y": 0, "flags": 4},
{"matrix": [0, 2], "x": 64, "y": 0, "flags": 4},
{"x": 64, "y": 0, "flags": 2},
{"x": 0, "y": 0, "flags": 2},
{"x": 0, "y": 32, "flags": 2},
{"x": 0, "y": 64, "flags": 2},
{"x": 64, "y": 64, "flags": 2},
{"x": 64, "y": 32, "flags": 2},
{"x": 10, "y": 0, "flags": 8}
],
"max_brightness": 200,
"sleep": true
},
"url": "https://www.keebmonkey.com/products/megalodon-dual-layer-knob-macro-pad",
"usb": {
"device_version": "0.0.1",
"pid": "0x0301",
"vid": "0xD010"
},
"ws2812": {
"pin": "A10"
},
"layouts": {
"LAYOUT": {
"layout": [
{"label": "Layers", "matrix": [0, 3], "x": 0.75, "y": 0},
{"label": "1!", "matrix": [0, 0], "x": 0, "y": 1.5},
{"label": "2@", "matrix": [0, 1], "x": 1, "y": 1.5},
{"label": "3#", "matrix": [0, 2], "x": 2, "y": 1.5},
{"label": "Encoder", "matrix": [0, 4], "x": 0.5, "y": 2.75, "w": 2, "h": 2}
]
}
}
}
21 changes: 21 additions & 0 deletions keyboards/doio/kb03/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 2025 DOIO
// Copyright 2025 ClownFish (@clownfish-og)
// SPDX-License-Identifier: GPL-2.0-or-later

#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
TO(1), KC_1, KC_2, KC_3, KC_MUTE
),
[1] = LAYOUT(
TO(0), RM_VALD, RM_NEXT, RM_VALU, RM_TOGG
)
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[0] = { ENCODER_CCW_CW(MS_WHLU, MS_WHLD), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[1] = { ENCODER_CCW_CW(RM_SATD, RM_SATU), ENCODER_CCW_CW(RM_HUED, RM_HUEU) }
};
#endif
1 change: 1 addition & 0 deletions keyboards/doio/kb03/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ENCODER_MAP_ENABLE = yes
clownfish-og marked this conversation as resolved.
Show resolved Hide resolved
27 changes: 27 additions & 0 deletions keyboards/doio/kb03/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# DOIO KB03-01

![KB03-01](https://i.imgur.com/bnlDpkY.png)

QMK for Megalodon DOIO Dual Layer Knob 3 Key macropad.

* Keyboard Maintainer: [clownfish-og](https://github.com/clownfish-og)
* Hardware Supported: DOIO KB03-01 using APM32F103CBT6 (clone STM32F103CBT6)
* Hardware Availability: https://www.keebmonkey.com/products/megalodon-dual-layer-knob-macro-pad

Make example for this keyboard (after setting up your build environment):

make doio/kb03:default

Flashing example for this keyboard:

make doio/kb03: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 the button on the back of the PCB - some may have pads you must short instead
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available
2 changes: 2 additions & 0 deletions keyboards/doio/kb03/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Configure for 128K flash
MCU_LDSCRIPT = STM32F103xB
clownfish-og marked this conversation as resolved.
Show resolved Hide resolved
Loading