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

Added new keyboard DOIO KB16 (Rev 2) #18699

Merged
merged 5 commits into from
Oct 26, 2022
Merged
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
Prev Previous commit
Next Next commit
Move old DOIO KB16 into rev 1
  • Loading branch information
HorrorTroll committed Oct 21, 2022
commit 7215bc5dad36d5161ac54c5931e8b35a2a4a0e2c
88 changes: 88 additions & 0 deletions keyboards/doio/kb16/rev1/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/* 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"

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

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

#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

/* 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
42 changes: 42 additions & 0 deletions keyboards/doio/kb16/rev1/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"keyboard_name": "KB16-01",
"manufacturer": "DOIO",
"url": "",
"maintainer": "HorrorTroll",
"usb": {
"vid": "0xD010",
"pid": "0x1601",
"device_version": "0.0.1"
},
"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", "x":4.75, "y":0},

{"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":"Encoder 2", "x":6, "y":0},

{"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", "x":5.375, "y":2.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}
]
}
}
}
45 changes: 45 additions & 0 deletions keyboards/doio/kb16/rev1/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
148 changes: 148 additions & 0 deletions keyboards/doio/kb16/rev1/keymaps/bongocat/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
/* 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 QMK_KEYBOARD_H

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

// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.

enum layer_names {
_BASE,
_FN,
_FN1,
_FN2
};

// enum layer_keycodes { };

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

/*
┌───┬───┬───┬───┐ ┌───┐ ┌───┐
│ 1 │ 2 │ 3 │ 4 │ │Ply│ │TO1│
├───┼───┼───┼───┤ └───┘ └───┘
│ 5 │ 6 │ 7 │ 8 │
├───┼───┼───┼───┤
│ 9 │ 0 │ ↑ │Ent│ ┌───┐
├───┼───┼───┼───┤ │Mut│
│Fn2│ ← │ ↓ │ → │ └───┘
└───┴───┴───┴───┘
┌───┬───┬───┬───┐ ┌───┐ ┌───┐
│ ! │ @ │ # │ $ │ │ │ │ │
├───┼───┼───┼───┤ └───┘ └───┘
│ % │ ^ │ & │ * │
├───┼───┼───┼───┤
│ ( │ ) │ │ │ ┌───┐
├───┼───┼───┼───┤ │ │
│ │ │ │ │ └───┘
└───┴───┴───┴───┘
*/
/* Row: 0 1 2 3 4 */
[_BASE] = LAYOUT(
KC_1, KC_2, KC_3, KC_4, KC_MPLY,
KC_5, KC_6, KC_7, KC_8, TO(_FN),
KC_9, KC_0, KC_UP, KC_ENT, KC_MUTE,
MO(_FN2), KC_LEFT, KC_DOWN, KC_RIGHT
),

/*
┌───┬───┬───┬───┐ ┌───┐ ┌───┐
│ │ │ │ │ │ │ │ │
├───┼───┼───┼───┤ └───┘ └───┘
│ │ │ │ │
├───┼───┼───┼───┤
│ │ │ │ │ ┌───┐
├───┼───┼───┼───┤ │ │
│ │ │ │ │ └───┘
└───┴───┴───┴───┘
*/
/* Row: 0 1 2 3 4 */
[_FN] = LAYOUT(
_______, _______, _______, _______, _______,
_______, _______, _______, _______, TO(_FN1),
_______, _______, _______, _______, _______,
_______, _______, _______, _______
),

/*
┌───┬───┬───┬───┐ ┌───┐ ┌───┐
│ │ │ │ │ │ │ │ │
├───┼───┼───┼───┤ └───┘ └───┘
│ │ │ │ │
├───┼───┼───┼───┤
│ │ │ │ │ ┌───┐
├───┼───┼───┼───┤ │ │
│ │ │ │ │ └───┘
└───┴───┴───┴───┘
*/
/* Row: 0 1 2 3 4 */
[_FN1] = LAYOUT(
_______, _______, _______, _______, _______,
_______, _______, _______, _______, TO(_FN2),
_______, _______, _______, _______, _______,
_______, _______, _______, _______
),

/*
┌───┬───┬───┬───┐ ┌───┐ ┌───┐
│Spi│Spd│ │ │ │ │ │TO0│
├───┼───┼───┼───┤ └───┘ └───┘
│Sai│Sad│ │ │
├───┼───┼───┼───┤
│Tog│Mod│Hui│ │ ┌───┐
├───┼───┼───┼───┤ │ │
│ │Vai│Hud│Vad│ └───┘
└───┴───┴───┴───┘
*/
/* Row: 0 1 2 3 4 */
[_FN2] = LAYOUT(
RGB_SPI, RGB_SPD, _______, QK_BOOT, _______,
RGB_SAI, RGB_SAD, _______, _______, TO(_BASE),
RGB_TOG, RGB_MOD, RGB_HUI, _______, _______,
_______, RGB_VAI, RGB_HUD, RGB_VAD
),
};

#ifdef OLED_ENABLE
bool oled_task_user(void) {
led_t led_usb_state = host_keyboard_led_state();

render_bongocat();
oled_set_cursor(14, 0); // sets cursor to (column, row) using charactar spacing (4 rows on 128x32 screen, anything more will overflow back to the top)
oled_write_P(PSTR("WPM:"), false);
oled_write(get_u8_str(get_current_wpm(), '0'), false); // writes wpm on top right corner of string
oled_set_cursor(17, 2);
oled_write_P(led_usb_state.caps_lock ? PSTR("CAPS") : PSTR(" "), false);
oled_set_cursor(17, 3);
oled_write_P(led_usb_state.scroll_lock ? PSTR("SCRL") : PSTR(" "), false);

return true;
}
#endif

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
[_BASE] = { ENCODER_CCW_CW(KC_MPRV, KC_MNXT), ENCODER_CCW_CW(KC_PGDN, KC_PGUP), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[_FN] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
[_FN1] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
[_FN2] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
};
#endif
17 changes: 17 additions & 0 deletions keyboards/doio/kb16/rev1/keymaps/bongocat/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
SRC += ./lib/bongocat/bongocat.c

# Build Options
# change yes to no to disable
#
MOUSEKEY_ENABLE = no # Mouse keys

VIA_ENABLE = yes

# Additional thing to reduce compiled size
GRAVE_ESC_ENABLE = no

# OLED enabled
WPM_ENABLE = yes

# Encoder enabled
ENCODER_MAP_ENABLE = yes
Loading