bgkeeb keyboard added

This commit is contained in:
Sadek Baroudi 2021-11-08 16:38:01 -08:00
parent d234b1b938
commit 0ddccf2f46
9 changed files with 460 additions and 0 deletions

5
bin/build-bgkeeb.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
# TODO: consolidate all the build files into one
make xoiviox/bgkeeb:sadekbaroudi ; cp .build/xoiviox_bgkeeb_sadekbaroudi* /mnt/g/My\ Drive/qmk-keyboards/bgkeeb/ ;

View File

@ -0,0 +1 @@
#include "bgkeeb.h"

View File

@ -0,0 +1,23 @@
#pragma once
#include "quantum.h"
#define ___ KC_NO
#define LAYOUT_split_3x5_3( \
K01, K02, K03, K04, K05, K45, K44, K43, K42, K41, \
K11, K12, K13, K14, K15, K55, K54, K53, K52, K51, \
K21, K22, K23, K24, K25, K65, K64, K63, K62, K61, \
K32, K33, K34, K35, K75, K74, K73, K72 \
) \
{ \
{ K01, K02, K03, K04, K05 }, \
{ K11, K12, K13, K14, K15 }, \
{ K21, K22, K23, K24, K25 }, \
{ ___, K32, K33, K34, K35 }, \
{ K41, K42, K43, K44, K45 }, \
{ K51, K52, K53, K54, K55 }, \
{ K61, K62, K63, K64, K65 }, \
{ ___, K72, K73, K74, K75 } \
}
#define LAYOUT LAYOUT_split_3x5_3

View File

@ -0,0 +1,106 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
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 DEVICE_VER 0x0001
#define VENDOR_ID 0xFEFE
#define PRODUCT_ID 0x8814
#define MANUFACTURER sadekbaroudi
#define PRODUCT sadekbaroudi bgkeeb
#define DESCRIPTION sadekbaroudi bgkeeb
/* key matrix size */
// Rows are doubled-up
#define MATRIX_ROWS 8
#define MATRIX_COLS 10
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
// wiring of each half
#define MATRIX_ROW_PINS { F6, D7, B3, E6 }
#define MATRIX_COL_PINS { F4, D4, F5, B1, B2 }
#define SOFT_SERIAL_PIN D2
#define USE_SERIAL
#define RGB_DI_PIN D3
#ifdef RGBLIGHT_ENABLE
#define RGBLED_NUM 36
#define RGBLIGHT_HUE_STEP 16
#define RGBLIGHT_SAT_STEP 16
#define RGBLIGHT_VAL_STEP 16
#define RGBLIGHT_LIMIT_VAL 60 /* The maximum brightness level for RGBLIGHT_ENABLE */
#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
// /*== all animations enable ==*/
#define RGBLIGHT_ANIMATIONS
// /*== or choose animations ==*/
// #define RGBLIGHT_EFFECT_BREATHING
// #define RGBLIGHT_EFFECT_RAINBOW_MOOD
// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
// #define RGBLIGHT_EFFECT_SNAKE
// #define RGBLIGHT_EFFECT_KNIGHT
// #define RGBLIGHT_EFFECT_CHRISTMAS
// #define RGBLIGHT_EFFECT_STATIC_GRADIENT
// #define RGBLIGHT_EFFECT_RGB_TEST
// #define RGBLIGHT_EFFECT_ALTERNATING
// /*== customize breathing effect ==*/
// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
// /*==== use exp() and sin() ====*/
// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
#endif
#define ENCODERS_PAD_A {B4}
#define ENCODERS_PAD_B {B5}
#define ENCODER_RESOLUTION 4
// Per encoder settings
//#define ENCODER_RESOLUTIONS { 4, 4 }
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
// #define BACKLIGHT_LEVELS 3
/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE
/* disable debug print */
//#define NO_DEBUG
/* disable print */
//#define NO_PRINT
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION

View File

@ -0,0 +1,161 @@
#include QMK_KEYBOARD_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.
#define _QWERTY 0
#define _LOWER 1
#define _RAISE 2
#define _ADJUST 16
enum custom_keycodes {
QWERTY = SAFE_RANGE,
LOWER,
RAISE,
ADJUST,
};
// Defines for task manager and such
#define CALTDEL LCTL(LALT(KC_DEL))
#define TSKMGR LCTL(LSFT(KC_ESC))
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
*
* ,----------------------------------. ,----------------------------------.
* | Q | W | E | R | T | | Y | U | I | O | P |
* |------+------+------+------+------| |------+------+------+------+------|
* | A | S | D | F | G | | H | J | K | L | ; |
* |------+------+------+------+------| |------+------+------+------+------|
* | Z | X | C | V | B | | N | M | , | . | / |
* `----------------------------------' `----------------------------------'
* ,--------------------. ,------,-------------.
* | Ctrl | LOWER| | | | RAISE| Shift|
* `-------------| Space| |BckSpc|------+------.
* | | | |
* `------' `------'
*/
[_QWERTY] = LAYOUT_split_3x5_3( \
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, \
KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, \
KC_LCTL, LOWER, KC_SPC, KC_BSPC, RAISE, OSM(MOD_LSFT) \
),
/* Raise
*
* ,----------------------------------. ,----------------------------------.
* | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 |
* |------+------+------+------+------| |------+------+------+------+------|
* | Tab | Left | Down | Up | Right| | | - | = | [ | ] |
* |------+------+------+------+------| |------+------+------+------+------|
* | Ctrl| ` | GUI | Alt | | | | | | \ | ' |
* `----------------------------------' `----------------------------------'
* ,--------------------. ,------,-------------.
* | | LOWER| | | | RAISE| |
* `-------------| | | |------+------.
* | | | |
* `------' `------'
*/
[_RAISE] = LAYOUT_split_3x5_3( \
KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, \
KC_TAB, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, \
KC_LCTL, KC_GRV, KC_LGUI, KC_LALT, _______, _______, _______, _______, KC_BSLS, KC_QUOT, \
_______, _______, _______, _______, _______, _______ \
),
/* Lower
*
* ,----------------------------------. ,----------------------------------.
* | ! | @ | # | $ | % | | ^ | & | * | ( | ) |
* |------+------+------+------+------| |------+------+------+------+------|
* | Esc | | | | | | | _ | + | { | } |
* |------+------+------+------+------| |------+------+------+------+------|
* | Caps| ~ | | | | | | | | | | " |
* `----------------------------------' `----------------------------------'
* ,--------------------. ,------,-------------.
* | | LOWER| | | | RAISE| Del |
* `-------------| | | Enter|------+------.
* | | | |
* `------' `------'
*/
[_LOWER] = LAYOUT_split_3x5_3( \
KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, \
KC_ESC, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, \
KC_CAPS, KC_TILD, _______, _______, _______, _______, _______, _______, KC_PIPE, KC_DQT, \
_______, _______, _______, KC_ENT, _______, KC_DEL \
),
/* Adjust (Lower + Raise)
*
* ,----------------------------------. ,----------------------------------.
* | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 |
* |------+------+------+------+------| |------+------+------+------+------|
* | F11 | F12 | | | | | | | |Taskmg|caltde|
* |------+------+------+------+------| |------+------+------+------+------|
* | Reset| | | | | | | | | | |
* `----------------------------------' `----------------------------------'
* ,--------------------. ,------,-------------.
* | | LOWER| | | | RAISE| |
* `-------------| | | |------+------.
* | | | |
* `------' `------'
*/
[_ADJUST] = LAYOUT_split_3x5_3( \
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, \
KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, TSKMGR, CALTDEL, \
RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______ \
)
};
void persistant_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_qwerty);
#endif
persistant_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case ADJUST:
if (record->event.pressed) {
layer_on(_ADJUST);
} else {
layer_off(_ADJUST);
}
return false;
break;
}
return true;
}

View File

@ -0,0 +1,110 @@
/* Copyright 2021 Sadek Baroudi
*
* 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 "sadekbaroudi.h"
#include QMK_KEYBOARD_H
/*
* The `LAYOUT_bgkeeb_base` macro is a template to allow the use of identical
* modifiers for the default layouts (eg QWERTY, Colemak, Dvorak, etc), so
* that there is no need to set them up for each layout, and modify all of
* them if I want to change them. This helps to keep consistency and ease
* of use. K## is a placeholder to pass through the individual keycodes
*/
// Note: changed the thumb keys from the following, testing out a new layout:
// KC_DEL, LT(_NAVIGATION,KC_ENT), LT(_FUNCTION,KC_TAB), LT(_FUNCTION,KC_BSPC), LT(_SYMBOLS,KC_SPACE), KC_QUOT "\"
// _______, KC_BSPC, LT(_NAVIGATION,KC_ENT), LT(_SYMBOLS,KC_SPACE), KC_QUOT, _______ "\"
// clang-format off
#define LAYOUT_bgkeeb_base( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \
) \
LAYOUT_wrapper( \
K01, K02, K03, LT(_FUNCTION, K04), K05, K06, LT(_FUNCTION, K07), LT(_WINNAV,K08), K09, K0A, \
LCTL_T(K11), LGUI_T(K12), LALT_T(K13), LSFT_T(K14), K15, LT(_MOUSE, K16), RSFT_T(K17), RALT_T(K18), RGUI_T(K19), RCTL_T(K1A), \
K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, \
KC_MUTE, KC_DEL, LT(_NAVIGATION,KC_ENT), LT(_FUNCTION,KC_TAB), LT(_MEDIA,KC_BSPC), LT(_SYMBOLS,KC_SPACE), KC_QUOT, LCTL(KC_BSPC) \
)
/* Re-pass though to allow templates to be used */
#define LAYOUT_bgkeeb_base_wrapper(...) LAYOUT_bgkeeb_base(__VA_ARGS__)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT_bgkeeb_base_wrapper(
_________________QWERTY_L1_________________, _________________QWERTY_R1_________________,
_________________QWERTY_L2_________________, _________________QWERTY_R2_________________,
_________________QWERTY_L3_________________, _________________QWERTY_R3_________________
),
[_COLEMAK] = LAYOUT_bgkeeb_base_wrapper(
______________COLEMAK_MOD_DH_L1____________, ______________COLEMAK_MOD_DH_R1____________,
______________COLEMAK_MOD_DH_L2____________, ______________COLEMAK_MOD_DH_R2____________,
______________COLEMAK_MOD_DH_L3____________, ______________COLEMAK_MOD_DH_R3____________
),
[_ISRT] = LAYOUT_bgkeeb_base_wrapper(
_________________ISRT_L1________________, _________________ISRT_R1________________,
_________________ISRT_L2________________, _________________ISRT_R2________________,
_________________ISRT_L3________________, _________________ISRT_R3________________
),
[_NAVIGATION] = LAYOUT_wrapper(
________________NAVIGATION_1_______________, _________________NUMPAD_1__________________,
________________NAVIGATION_2_______________, _________________NUMPAD_2__________________,
________________NAVIGATION_3_______________, _________________NUMPAD_3__________________,
_______, _______, _______, KC_TAB, KC_BSPC, KC_SPACE, KC_DOT, _______
),
[_SYMBOLS] = LAYOUT_wrapper(
________________SYMBOLS_L1_________________, ________________SYMBOLS_R1_________________,
________________SYMBOLS_L2_________________, ________________SYMBOLS_R2_________________,
________________SYMBOLS_L3_________________, ________________SYMBOLS_R3_________________,
_______, _______, KC_ENT, KC_DEL, KC_BSPC, _______, _______, _______
),
[_FUNCTION] = LAYOUT_wrapper(
________________SHIFTNAV_1_________________, ________________FUNCTION_1_________________,
________________SHIFTNAV_2_________________, ________________FUNCTION_2_________________,
________________SHIFTNAV_3_________________, ________________FUNCTION_3_________________,
_______, _______, _______, _______, N_DEL_LINE, KC_SPACE, _______, _______
),
[_MEDIA] = LAYOUT_wrapper(
___________________RGB_1___________________, _________________MACROS_1__________________,
___________________RGB_2___________________, _________________MACROS_2__________________,
___________________RGB_3___________________, _________________MACROS_3__________________,
_______, _______, _______, _______, _______, _______, _______, _______
),
[_MOUSE] = LAYOUT_wrapper(
__________________MOUSE_1__________________, ___________________BLANK___________________,
__________________MOUSE_2__________________, ___________________BLANK___________________,
__________________MOUSE_3__________________, ___________________BLANK___________________,
_______, _______, KC_MS_BTN1, KC_MS_BTN3, KC_MS_BTN3, KC_MS_BTN2, _______, _______
),
[_WINNAV] = LAYOUT_wrapper(
__________________WIN_NAV_1________________, ___________________BLANK___________________,
__________________WIN_NAV_2________________, ___________________BLANK___________________,
___________________BLANK___________________, ___________________BLANK___________________,
_______, _______, _______, _______, _______, _______, _______, _______
)
};

View File

@ -0,0 +1,23 @@
# bgkeeb
* Keyboard Maintainer: sadekbaroudi
* Hardware Supported: bgkeeb PCB rev1 Pro Micro
Make example for this keyboard (after setting up your build environment):
make bgkeeb:default
Flashing example for this keyboard ([using the command line](https://docs.qmk.fm/#/newbs_flashing?id=flash-your-keyboard-from-the-command-line)):
make bgkeeb:default:flash
See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information.
## Build Guide
To be built
## Choosing which board to plug the USB cable into (choosing Master)
Because the two boards are identical, the firmware has logic to differentiate the left and right board. It uses two strategies to figure things out, [EE_HANDS](https://docs.qmk.fm/#/feature_split_keyboard?id=handedness-by-eeprom) or [by define](https://docs.qmk.fm/#/feature_split_keyboard?id=handedness-by-define). See [setting-handedness](https://docs.qmk.fm/#/config_options?id=setting-handedness) for more information.

View File

@ -0,0 +1,26 @@
# MCU name
MCU = atmega32u4
# Bootloader selection
BOOTLOADER = caterina
# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = no # USB Nkey Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
ENCODER_ENABLE = yes
SPLIT_KEYBOARD = yes
LAYOUTS = split_3x5_3

View File

@ -66,6 +66,11 @@ expanded before being used as arguments to the LAYOUT_xxx macro.
# define LAYOUT LAYOUT_ffkb
#endif
// Since bgkeeb uses the name LAYOUT_bgkeeb instead of LAYOUT
#if (!defined(LAYOUT) && defined(LAYOUT_bgkeeb))
# define LAYOUT LAYOUT_bgkeeb
#endif
// clang-format off
#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__)