Skip to content

Commit

Permalink
Added new keyboard KB16-01 (qmk#17418)
Browse files Browse the repository at this point in the history
  • Loading branch information
HorrorTroll authored Jul 2, 2022
1 parent 25033d5 commit d694488
Show file tree
Hide file tree
Showing 20 changed files with 1,767 additions and 0 deletions.
98 changes: 98 additions & 0 deletions keyboards/doio/kb16/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/* Copyright 2022 DOIO
* Copyright 2022 HorrorTroll <https://github.com/HorrorTroll>
*
* 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

#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID 0xD010
#define PRODUCT_ID 0x1601
#define DEVICE_VER 0x0001
#define MANUFACTURER DOIO
#define PRODUCT KB16-01

/* key matrix size */
#define MATRIX_ROWS 4
#define MATRIX_COLS 7

/* key matrix pins */
#define MATRIX_ROW_PINS { D5, D4, D3, D2 }
#define MATRIX_COL_PINS { F5, F4, F1, F0, B7, B4, B5 }

#define BOOTMAGIC_LITE_ROW 0
#define BOOTMAGIC_LITE_COLUMN 0

/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW

/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5

/* Forcing to use NKRO instead 6KRO */
#define FORCE_NKRO

/* Larger keys per scan */
#define QMK_KEYS_PER_SCAN 12

/* Use the custom font */
#define OLED_FONT_H "lib/glcdfont.c"

/* Encoder pins */
#define ENCODERS_PAD_A { F7, C7, D7 }
#define ENCODERS_PAD_B { E6, C6, D6 }

#ifdef RGB_MATRIX_ENABLE
/* RGB Matrix config */
#define RGB_DI_PIN F6
#define DRIVER_LED_TOTAL 16
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200
#define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS
#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_UP_DOWN
#define RGB_MATRIX_KEYPRESSES
/* RGB Matrix effect */
#define ENABLE_RGB_MATRIX_ALPHAS_MODS
#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
#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_CYCLE_ALL
#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN
#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
#define ENABLE_RGB_MATRIX_DUAL_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_RAIN
#define ENABLE_RGB_MATRIX_PIXEL_FLOW
#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL

#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
#define ENABLE_RGB_MATRIX_MULTISPLASH
#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
#endif
40 changes: 40 additions & 0 deletions keyboards/doio/kb16/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"keyboard_name": "KB16-01",
"url": "",
"maintainer": "HorrorTroll",
"layouts": {
"LAYOUT": {
"layout": [
{"label":"1!", "x":0, "y":0},
{"label":"2@", "x":1, "y":0},
{"label":"3#", "x":2, "y":0},
{"label":"4$", "x":3, "y":0},
{"label":"Encoder 1 CCW", "x":4.25, "y":0, "w":0.5},
{"label":"Encoder 1", "x":4.75, "y":0},
{"label":"Encoder 1 CW", "x":5.75, "y":0, "w":0.5},
{"label":"Encoder 2 CCW", "x":6.25, "y":0, "w":0.5},
{"label":"Encoder 2", "x":6.75, "y":0},
{"label":"Encoder 2 CW", "x":7.75, "y":0, "w":0.5},

{"label":"5%", "x":0, "y":1},
{"label":"6^", "x":1, "y":1},
{"label":"7&", "x":2, "y":1},
{"label":"8*", "x":3, "y":1},

{"label":"9(", "x":0, "y":2},
{"label":"0)", "x":1, "y":2},
{"label":"\u2191", "x":2, "y":2},
{"label":"Enter", "x":3, "y":2},

{"label":"Encoder 3 CCW", "x":5.25, "y":2.5, "w":0.5},
{"label":"Encoder 3", "x":5.75, "y":2.5},
{"label":"Encoder 3 CW", "x":6.75, "y":2.5, "w":0.5},

{"label":"Fn", "x":0, "y":3},
{"label":"\u2190", "x":1, "y":3},
{"label":"\u2193", "x":2, "y":3},
{"label":"\u2192", "x":3, "y":3}
]
}
}
}
66 changes: 66 additions & 0 deletions keyboards/doio/kb16/kb16.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/* Copyright 2022 DOIO
* Copyright 2022 HorrorTroll <https://github.com/HorrorTroll>
*
* 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 "kb16.h"

// OLED animation
#include "lib/logo.h"

#ifdef RGB_MATRIX_ENABLE
led_config_t g_led_config = { {
{ 0, 1, 2, 3, NO_LED, NO_LED, NO_LED },
{ 4, 5, 6, 7, NO_LED, NO_LED, NO_LED },
{ 8, 9, 10, 11, NO_LED, NO_LED, NO_LED },
{ 12, 13, 14, 15, NO_LED, NO_LED, NO_LED }
}, {
{0 , 0}, {75 , 0}, {149, 0}, {224, 0},
{0 , 21}, {75 , 21}, {149, 21}, {224, 21},
{0 , 43}, {75 , 43}, {149, 43}, {224, 43},
{0 , 64}, {75 , 64}, {149, 64}, {224, 64},
}, {
1, 1, 1, 1,
1, 4, 4, 1,
1, 4, 4, 1,
1, 1, 1, 1,
} };
#endif

#ifdef OLED_ENABLE
uint16_t startup_timer;

oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
startup_timer = timer_read();

return rotation;
}

bool oled_task_kb(void) {
static bool finished_logo = false;

if ((timer_elapsed(startup_timer) < 5000) && !finished_logo) {
render_logo();
} else {
finished_logo = true;

if (!oled_task_user()) {
return false;
}
}

return true;
}
#endif
47 changes: 47 additions & 0 deletions keyboards/doio/kb16/kb16.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* Copyright 2022 DOIO
* Copyright 2022 HorrorTroll <https://github.com/HorrorTroll>
*
* 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

#include "quantum.h"

#define XXX KC_NO

/* 06 ◯ 05 16 ◯ 15
* ┌───┬───┬───┬───┐ ┌───┐ ┌───┐
* │00 │01 │02 │03 │ │04 │ │14 │
* ├───┼───┼───┼───┤ └───┘ └───┘
* │10 │11 │12 │13 │
* ├───┼───┼───┼───┤ 26 ◯ 25
* │20 │21 │22 │23 │ ┌───┐
* ├───┼───┼───┼───┤ │24 │
* │30 │31 │32 │33 │ └───┘
* └───┴───┴───┴───┘
*/

#define LAYOUT( \
K00, K01, K02, K03, K06, K04, K05, \
K10, K11, K12, K13, K16, K14, K15, \
K20, K21, K22, K23, K26, K24, K25, \
K30, K31, K32, K33 \
) { \
{ K00, K01, K02, K03, K04, K05, K06 }, \
{ K10, K11, K12, K13, K14, K15, K16 }, \
{ K20, K21, K22, K23, K24, K25, K26 }, \
{ K30, K31, K32, K33, XXX, XXX, XXX } \
}

45 changes: 45 additions & 0 deletions keyboards/doio/kb16/keymaps/bongocat/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* Copyright 2022 HorrorTroll <https://github.com/HorrorTroll>
*
* 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

/* Additional thing to reduce compiled size */
#define NO_ACTION_ONESHOT
#define LAYER_STATE_8BIT

#ifdef RGB_MATRIX_ENABLE
/* RGB Matrix config */
#undef RGB_MATRIX_KEYPRESSES

/* RGB Matrix effect */
#undef ENABLE_RGB_MATRIX_ALPHAS_MODS
#undef ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
#undef ENABLE_RGB_MATRIX_BREATHING
#undef ENABLE_RGB_MATRIX_BAND_SAT
#undef ENABLE_RGB_MATRIX_BAND_VAL
#undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
#undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
#undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN
#undef ENABLE_RGB_MATRIX_DUAL_BEACON
#undef ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
#undef ENABLE_RGB_MATRIX_RAINDROPS
#undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
#undef ENABLE_RGB_MATRIX_HUE_PENDULUM
#undef ENABLE_RGB_MATRIX_HUE_WAVE
#undef ENABLE_RGB_MATRIX_PIXEL_RAIN
#undef ENABLE_RGB_MATRIX_PIXEL_FLOW
#undef ENABLE_RGB_MATRIX_PIXEL_FRACTAL
#endif
Loading

0 comments on commit d694488

Please sign in to comment.