Skip to content

Commit

Permalink
Add vial support for DOIO KB12-01 (vial-kb#576)
Browse files Browse the repository at this point in the history
  • Loading branch information
OTLabs authored and lesshonor committed Nov 1, 2023
1 parent 495b44c commit 41e6495
Show file tree
Hide file tree
Showing 11 changed files with 402 additions and 0 deletions.
69 changes: 69 additions & 0 deletions keyboards/doio/kb12/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/* Copyright 2022 DOIO
* Copyright 2022 DOIO2022 <https://github.com/DOIO2022>
*
* 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/>.
*/

#pragma once

/* RGB Matrix config */
#define RGB_MATRIX_LED_COUNT 12
#define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_CYCLE_UP_DOWN
#define RGB_DISABLE_WHEN_USB_SUSPENDED
#define RGB_MATRIX_KEYPRESSES
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS

/* RGB Matrix effect */
#define ENABLE_RGB_MATRIX_ALPHAS_MODS
#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
#define ENABLE_RGB_MATRIX_BREATHING
#define ENABLE_RGB_MATRIX_BAND_SAT
#define ENABLE_RGB_MATRIX_BAND_VAL
#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
#define ENABLE_RGB_MATRIX_CYCLE_ALL
#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN
#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL
#define ENABLE_RGB_MATRIX_DUAL_BEACON
#define ENABLE_RGB_MATRIX_RAINBOW_BEACON
#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
#define ENABLE_RGB_MATRIX_RAINDROPS
#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
#define ENABLE_RGB_MATRIX_HUE_BREATHING
#define ENABLE_RGB_MATRIX_HUE_PENDULUM
#define ENABLE_RGB_MATRIX_HUE_WAVE
#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL
#define ENABLE_RGB_MATRIX_PIXEL_RAIN
#define ENABLE_RGB_MATRIX_TYPING_HEATMAP
#define ENABLE_RGB_MATRIX_DIGITAL_RAIN
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
#define ENABLE_RGB_MATRIX_SPLASH
#define ENABLE_RGB_MATRIX_MULTISPLASH
#define ENABLE_RGB_MATRIX_SOLID_SPLASH
#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
78 changes: 78 additions & 0 deletions keyboards/doio/kb12/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"keyboard_name": "KB12-01",
"manufacturer": "DOIO",
"url": "",
"maintainer": "DOIO2022",
"usb": {
"vid": "0xD010",
"pid": "0x1201",
"device_version": "0.0.1"
},
"rgb_matrix": {
"driver": "ws2812"
"layout": [
{"matrix": [0, 0], "x": 0, "y": 0, "flags": 4},
{"matrix": [0, 1], "x": 75, "y": 0, "flags": 4},
{"matrix": [0, 2], "x": 150, "y": 0, "flags": 4},
{"matrix": [0, 3], "x": 224, "y": 0, "flags": 4},
{"matrix": [1, 0], "x": 0, "y": 32, "flags": 4},
{"matrix": [1, 1], "x": 75, "y": 32, "flags": 4},
{"matrix": [1, 2], "x": 150, "y": 32, "flags": 4},
{"matrix": [1, 3], "x": 224, "y": 32, "flags": 4},
{"matrix": [2, 0], "x": 0, "y": 64, "flags": 4},
{"matrix": [2, 1], "x": 75, "y": 64, "flags": 4},
{"matrix": [2, 2], "x": 150, "y": 64, "flags": 4},
{"matrix": [2, 3], "x": 224, "y": 64, "flags": 4}
],
"max_brightness": 200
},
"matrix_pins": {
"cols": ["B14", "B13", "B12", "B0", "A7"],
"rows": ["B3", "B4", "B9"]
},
"diode_direction": "COL2ROW",
"dynamic_keymap": {
"layer_count": 6
},
"encoder": {
"rotary": [
{"pin_a": "B5", "pin_b": "B6"}
]
},
"ws2812": {
"pin": "A10"
},
"processor": "STM32F103",
"bootloader": "stm32duino",
"features": {
"bootmagic": true,
"command": false,
"console": false,
"extrakey": true,
"mousekey": true,
"nkro": true,
"rgb_matrix": true,
"encoder": true
},
"layouts": {
"LAYOUT": {
"layout": [
{ "matrix": [0, 4], "x": 0, "y": 0 },
{ "matrix": [0, 0], "x": 3.25, "y": 0 },
{ "matrix": [0, 1], "x": 4.25, "y": 0 },
{ "matrix": [0, 2], "x": 5.25, "y": 0 },
{ "matrix": [0, 3], "x": 6.25, "y": 0 },

{ "matrix": [1, 0], "x": 7.75, "y": 0 },
{ "matrix": [1, 1], "x": 8.75, "y": 0 },
{ "matrix": [1, 2], "x": 9.75, "y": 0 },
{ "matrix": [1, 3], "x": 10.75, "y": 0 },

{ "matrix": [2, 0], "x": 12.25, "y": 0 },
{ "matrix": [2, 1], "x": 13.25, "y": 0 },
{ "matrix": [2, 2], "x": 14.25, "y": 0 },
{ "matrix": [2, 3], "x": 15.25, "y": 0 }
]
}
}
}
55 changes: 55 additions & 0 deletions keyboards/doio/kb12/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* Copyright 2022 DOIO
* Copyright 2022 DOIO2022 <https://github.com/DOIO2022>
*
* 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/>.
*/


#include QMK_KEYBOARD_H

enum layer_names {
_LAY0,
_LAY1,
_LAY2,
_LAY3,
_LAY4,
_LAY5
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_LAY0] = LAYOUT(
TO(1), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12),
[_LAY1] = LAYOUT(
TO(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
[_LAY2] = LAYOUT(
TO(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
[_LAY3] = LAYOUT(
TO(4), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
[_LAY4] = LAYOUT(
TO(5), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
[_LAY5] = LAYOUT(
TO(0), RGB_TOG, RGB_MOD, RGB_SPI, RGB_SPD, RGB_SAI, RGB_SAD, RGB_HUI, RGB_HUD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS)

};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[_LAY0] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN) },
[_LAY1] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
[_LAY2] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
[_LAY3] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
[_LAY4] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
[_LAY5] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
};
#endif
55 changes: 55 additions & 0 deletions keyboards/doio/kb12/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* Copyright 2022 DOIO
* Copyright 2022 DOIO2022 <https://github.com/DOIO2022>
*
* 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/>.
*/


#include QMK_KEYBOARD_H

enum layer_names {
_LAY0,
_LAY1,
_LAY2,
_LAY3,
_LAY4,
_LAY5
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_LAY0] = LAYOUT(
TO(1), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12),
[_LAY1] = LAYOUT(
TO(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
[_LAY2] = LAYOUT(
TO(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
[_LAY3] = LAYOUT(
TO(4), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
[_LAY4] = LAYOUT(
TO(5), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
[_LAY5] = LAYOUT(
TO(0), RGB_TOG, RGB_MOD, RGB_SPI, RGB_SPD, RGB_SAI, RGB_SAD, RGB_HUI, RGB_HUD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS)

};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[_LAY0] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN) },
[_LAY1] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
[_LAY2] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
[_LAY3] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
[_LAY4] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
[_LAY5] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
};
#endif
2 changes: 2 additions & 0 deletions keyboards/doio/kb12/keymaps/via/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes
11 changes: 11 additions & 0 deletions keyboards/doio/kb12/keymaps/vial/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright 2023 Oleg Titov <[email protected]>
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

// Unique keyboard id
#define VIAL_KEYBOARD_UID {0x3D, 0x84, 0x24, 0x54, 0xAA, 0xE1, 0xA2, 0x09}

// Unlock with first and last keys
#define VIAL_UNLOCK_COMBO_ROWS { 0, 2 }
#define VIAL_UNLOCK_COMBO_COLS { 0, 3 }
55 changes: 55 additions & 0 deletions keyboards/doio/kb12/keymaps/vial/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* Copyright 2022 DOIO
* Copyright 2022 DOIO2022 <https://github.com/DOIO2022>
*
* 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/>.
*/


#include QMK_KEYBOARD_H

enum layer_names {
_LAY0,
_LAY1,
_LAY2,
_LAY3,
_LAY4,
_LAY5
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_LAY0] = LAYOUT(
TO(1), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12),
[_LAY1] = LAYOUT(
TO(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
[_LAY2] = LAYOUT(
TO(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
[_LAY3] = LAYOUT(
TO(4), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
[_LAY4] = LAYOUT(
TO(5), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
[_LAY5] = LAYOUT(
TO(0), RGB_TOG, RGB_MOD, RGB_SPI, RGB_SPD, RGB_SAI, RGB_SAD, RGB_HUI, RGB_HUD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS)

};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[_LAY0] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN) },
[_LAY1] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
[_LAY2] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
[_LAY3] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
[_LAY4] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
[_LAY5] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
};
#endif
6 changes: 6 additions & 0 deletions keyboards/doio/kb12/keymaps/vial/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
VIA_ENABLE = yes # Enable VIA
VIAL_ENABLE = yes # Enable VIAL

VIALRGB_ENABLE = yes # Enable VIALRGB

ENCODER_MAP_ENABLE = yes # Enable knob
46 changes: 46 additions & 0 deletions keyboards/doio/kb12/keymaps/vial/vial.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "DOIO KB12-01",
"vendorId": "0xFEED",
"productId": "0x6060",
"lighting": "vialrgb",
"matrix": {
"rows": 3,
"cols": 5
},
"layouts": {
"keymap": [
[
{
"x": 0.75
},
"0,4"
],
[
{
"y": -0.5,
"x": 3
},
"0,0",
"0,1",
"0,2",
"0,3",
"1,0",
"1,1",
"1,2",
"1,3",
"2,0",
"2,1",
"2,2",
"2,3"
],
[
{
"y": -0.5,
"x": 0.25
},
"1,4",
"2,4"
]
]
}
}
Loading

0 comments on commit 41e6495

Please sign in to comment.