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

gBoards GergoPlex #13027

Merged
merged 28 commits into from
Sep 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4fdbd67
Moved gergoplex to seperate PR
germ Apr 26, 2020
81e0631
vendor + cformat
germ Apr 29, 2020
1006075
Update keyboards/gboards/k/gergoplex/matrix.c
germ Apr 29, 2020
dd2e4b6
lifiting keyboards up
germ May 5, 2020
1cbbe8c
Update readme.md
germ May 5, 2020
b1ebfd9
Update keyboards/gboards/gergoplex/config.h
germ May 19, 2020
838eac4
remove English dicts
germ May 30, 2020
80f0e16
cformatted
germ Jun 18, 2020
5879539
Prettify keymap
pirj Sep 13, 2020
c507ae4
Remove via keymaps
pirj Sep 17, 2020
bad3969
Address QMK pull code review notes
pirj Sep 17, 2020
2615ecf
Cleanup (tabs, excessive comments)
pirj Sep 17, 2020
5bbe0a8
Fix keymap typos
pirj Sep 17, 2020
e7b6e98
Use enum to define layers
pirj Sep 22, 2020
b8371b0
Multiple changes
pirj May 28, 2021
5d27cc8
Remove apparently redundant macros
pirj May 28, 2021
eade93e
Replace direct pin control with IO functions
pirj May 28, 2021
9e619df
config mouse enable and combo delay fix
bttnns May 28, 2021
b532ddf
Remove redundant defines
pirj May 28, 2021
77edf66
Unambiguously refer to the Special layer
pirj May 28, 2021
e85e365
Fix formatting
pirj May 28, 2021
f679484
gboards/gergoplex set IGNORE_MOD_TAP_INTERRUPT
bttnns May 28, 2021
c4576be
Name change
pirj May 29, 2021
f7cc19f
Wording change
pirj May 29, 2021
bd884f8
Update keyboards/gboards/gergoplex/keymaps/default/keymap.c
pirj May 31, 2021
2d77907
Add copyright headers
pirj May 31, 2021
bd8b01c
Fix debounce type
pirj Aug 14, 2021
6dc76f4
Implement colemak-dhm keymap
bttnns May 29, 2021
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
9 changes: 9 additions & 0 deletions keyboards/gboards/combos/colemakdhm-vim-helpers.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Vim-Mode combos

COMB(wfEsc, KC_ESC, KC_W, KC_F)
COMB(rsBspc, KC_BSPC, KC_R, KC_S)
COMB(stTab, KC_TAB, KC_S, KC_T)
COMB(cdEnt, KC_ENT, KC_C, KC_D)
COMB(luEsc, KC_ESC, KC_L, KC_U)
COMB(neCol, KC_COLN, KC_N, KC_E)
COMB(mkEnt, KC_ENT, KC_M, KC_K)
52 changes: 52 additions & 0 deletions keyboards/gboards/gergoplex/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2013 Oleg Kostyuk <cub.uanic@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/>.
*/

// Copy and worked on with love from the EZ team

#pragma once
#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID 0x6B0A
#define PRODUCT_ID 0x0002
#define DEVICE_VER 0x0001
#define MANUFACTURER g Heavy Industries
#define PRODUCT GergoPlex

/* key matrix size */
#define MATRIX_ROWS 10
#define MATRIX_ROWS_PER_SIDE (MATRIX_ROWS / 2)
#define MATRIX_COLS 4

/*
* Keyboard Matrix Assignments
*
* Change this to how you wired your keyboard
* COLS: AVR pins used for columns, left to right
* ROWS: AVR pins used for rows, top to bottom
*/
#define MATRIX_ROW_PINS { F6, F5, F4, F1 }
#define MATRIX_COL_PINS { B1, B2, B3, D2, D3 }
#define UNUSED_PINS
#define IGNORE_MOD_TAP_INTERRUPT
#define COMBO_ALLOW_ACTION_KEYS
#define COMBO_VARIABLE_LEN

#define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || get_mods() == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)))

#define DEBOUNCE 5
68 changes: 68 additions & 0 deletions keyboards/gboards/gergoplex/gergoplex.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/* Copyright 2021 Jane Bernhardt
*
* 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 "gergoplex.h"
pirj marked this conversation as resolved.
Show resolved Hide resolved

bool i2c_initialized = 0;
i2c_status_t mcp23018_status = 0x20;

void matrix_init_kb(void) {
matrix_init_user();
}
pirj marked this conversation as resolved.
Show resolved Hide resolved

uint8_t init_mcp23018(void) {
print("starting init");
mcp23018_status = 0x20;

// I2C subsystem

if (i2c_initialized == 0) {
i2c_init(); // on pins D(1,0)
i2c_initialized = true;
_delay_ms(1000);
}

// set pin direction
// - unused : input : 1
// - input : input : 1
// - driving : output : 0
mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT);
if (mcp23018_status) goto out;
mcp23018_status = i2c_write(IODIRA, I2C_TIMEOUT);
if (mcp23018_status) goto out;
mcp23018_status = i2c_write(0b11000001, I2C_TIMEOUT);
if (mcp23018_status) goto out;
mcp23018_status = i2c_write(0b11111111, I2C_TIMEOUT);
if (mcp23018_status) goto out;
i2c_stop();

// set pull-up
// - unused : on : 1
// - input : on : 1
// - driving : off : 0
mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT);
if (mcp23018_status) goto out;
mcp23018_status = i2c_write(GPPUA, I2C_TIMEOUT);
if (mcp23018_status) goto out;
mcp23018_status = i2c_write(0b11000001, I2C_TIMEOUT);
if (mcp23018_status) goto out;
mcp23018_status = i2c_write(0b11111111, I2C_TIMEOUT);
if (mcp23018_status) goto out;

out:
i2c_stop();
return mcp23018_status;
}
56 changes: 56 additions & 0 deletions keyboards/gboards/gergoplex/gergoplex.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/* Copyright 2021 Jane Bernhardt
*
* 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
pirj marked this conversation as resolved.
Show resolved Hide resolved

#include "quantum.h"
#include "i2c_master.h"

extern i2c_status_t mcp23018_status;
#define I2C_TIMEOUT 1000
#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
#define CPU_16MHz 0x00

// I2C aliases and register addresses (see "mcp23018.md")
#define I2C_ADDR 0x20 // 0b0100000
#define I2C_ADDR_WRITE ((I2C_ADDR << 1) | I2C_WRITE)
#define I2C_ADDR_READ ((I2C_ADDR << 1) | I2C_READ)
#define IODIRA 0x00 // i/o direction register
#define IODIRB 0x01
#define GPPUA 0x0C // GPIO pull-up resistor register
#define GPIOA 0x12 // general purpose i/o port register (write modifies OLAT)
#define OLATA 0x14 // output latch register

uint8_t init_mcp23018(void);

#define LAYOUT_split_3x5_3( \
L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \
L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \
L20, L21, L22, L23, L24, R20, R21, R22, R23, R24, \
L30, L31, L32, R30, R31, R32 \
) \
{ \
{L04, L14, L24, KC_NO}, \
{L03, L13, L23, L32}, \
{L02, L12, L22, L31}, \
{L01, L11, L21, L30}, \
{L00, L10, L20, KC_NO}, \
{R00, R10, R20, KC_NO}, \
{R01, R11, R21, R30}, \
{R02, R12, R22, R31}, \
{R03, R13, R23, R32}, \
{R04, R14, R24, KC_NO}, \
}
10 changes: 10 additions & 0 deletions keyboards/gboards/gergoplex/keymaps/colemak-dhm/combos.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// List any combo dictionaries you want loaded to your device below!

// User includes
#include "gergoplex.def"

// QMK wide includes
#include "combos/colemakdhm-vim-helpers.def"

// Word completion
// #include "combos/eng-combos.def"
11 changes: 11 additions & 0 deletions keyboards/gboards/gergoplex/keymaps/colemak-dhm/gergoplex.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Gergoplex colemak-dhm specfic combos
COMB(osBacksl, KC_BSLS, KC_Y, KC_SCLN)
COMB(mnLess, KC_LT, KC_M, KC_N)
COMB(eiGreat, KC_GT, KC_E, KC_I)
COMB(xcDash, KC_MINS, KC_X, KC_C)
COMB(hcUnds, KC_UNDS, KC_H, KC_COMM)
COMB(khQuot, KC_QUOT, KC_K, KC_H)
COMB(gvClic, KC_BTN1, KC_G, KC_V)
COMB(tdClic, KC_BTN2, KC_T, KC_D)

SUBS(pasta, "I would just like to interject for a moment.", KC_H, KC_J, KC_K, KC_L)
99 changes: 99 additions & 0 deletions keyboards/gboards/gergoplex/keymaps/colemak-dhm/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/* Good on you for modifying your layout! if you don't have
* time to read the QMK docs, a list of keycodes can be found at
* https://github.com/qmk/qmk_firmware/blob/master/docs/keycodes.md
*/

#include "gergoplex.h"
#include "g/keymap_combo.h"

enum {
_ALPHA, // default (Colemak DHm)
_SPECIAL, // special characters
_NUMBERS // numbers/function/motion
};

// alpha hold modifiers
#define KC_CTL_A MT(MOD_LCTL, KC_A) // Tap for A, hold for Control
#define KC_CTL_O MT(MOD_RCTL, KC_O) // Tap for colon, hold for Control
#define KC_SFT_Z MT(MOD_LSFT, KC_Z) // Tap for Z, hold for Shift
#define KC_SFT_SL MT(MOD_RSFT, KC_SLSH) // Tap for slash, hold for Shift

// thumb modifiers/toggles
#define KC_GUI_ESC MT(MOD_LGUI, KC_ESC) // Tap for Esc, hold for GUI (Meta, Command, Win)
#define KC_ALT_ENT MT(MOD_LALT, KC_ENT) // Tap for Enter, hold for Alt (Option)
#define KC_SPE_SPC LT(_SPECIAL, KC_SPC) // Tap for Space, hold for Special layer
#define KC_NUM_SPC LT(_NUMBERS, KC_SPC) // Tap for Space, hold for Numbers layer
#define KC_SFT_TAB MT(MOD_RSFT, KC_TAB) // Tap for Tab, hold for Right Shift

/* Combomap
*
* ,-------------------------------. ,-------------------------------.
* | | ESC | | | | | ESC | \ |
* |-------+-----+-----+-----+-----| |-----+-----+-----+-----+-------|
* | | BSPC TAB | | | < : > | |
* |-------+-----+-----+-RMB-+-LMB-| |ENTER+-----+-----+-----+-------|
* | | - ENTER | | | ' _ | | |
* `-------------------------------' `-------------------------------'
* .-----------------. .-----------------.
* | | | | | | | |
* '-----------------' '-----------------'
*/

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap 0: Alpha layer / Colemak DHm
*
* ,-------------------------------. ,-------------------------------.
* | Q | W | F | P | B | | J | L | U | Y | ; |
* |-------+-----+-----+-----+-----| |-----+-----+-----+-----+-------|
* | CTRL A| R | S | T | G | | M | N | E | I | O |
* |-------+-----+-----+-----+-----| |-----+-----+-----+-----+-------|
* | SHFT Z| X | C | D | V | | K | H | < | > |SHFT / |
* `-------------------------------' `-------------------------------'
* .------------------------------. .----------------------.
* | ESC META | ENT ALT | SPC SPE | | SPC NUM | SHFT | TAB |
* '------------------------------' '----------------------'
*/
[_ALPHA] = LAYOUT_split_3x5_3(
KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN,
KC_CTL_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_CTL_O,
KC_SFT_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMMA, KC_DOT, KC_SFT_SL,
KC_GUI_ESC, KC_ALT_ENT, KC_SPE_SPC, KC_NUM_SPC, KC_LSFT, KC_SFT_TAB),

/* Keymap 1: Special characters layer
*
* ,-------------------------------. ,-------------------------------.
* | ! | @ | { | } | | | | ` | ~ | | | \ |
* |-------+-----+-----+-----+-----| |-----+-----+-----+-----+-------|
* | # | $ | ( | ) | RMB | | + | - | / | * | ' |
* |-------+-----+-----+-----+-----| |-----+-----+-----+-----+-------|
* | % | ^ | [ | ] | LMB | | & | = | , | . | - |
* `-------------------------------' `-------------------------------'
* .-------------------------. .-----------------.
* | ComboToggle | ; | = | | = | ; | DEL |
* '-------------------------' '-----------------'
*/
[_SPECIAL] = LAYOUT_split_3x5_3(
KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_GRV, KC_TILD, KC_TRNS, KC_TRNS, KC_BSLS,
KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_BTN2, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_QUOT,
KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_BTN1, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_MINS,
CMB_TOG, KC_SCLN, KC_EQL, KC_EQL, KC_SCLN, KC_DEL),

/* Keymap 2: Numbers/Function/Motion layer
*
* ,-------------------------------. ,-------------------------------.
* | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 |
* |-------+-----+-----+-----+-----| |-----+-----+-----+-----+-------|
* | F1 | F2 | F3 | F4 | F5 | | LFT | DWN | UP | RGT | VOLUP |
* |-------+-----+-----+-----+-----| |-----+-----+-----+-----+-------|
* | F6 | F7 | F8 | F9 | F10 | | MLFT| MDWN| MUP | MRGT| VOLDN |
* `-------------------------------' `-------------------------------'
* .-----------------. .-----------------.
* | F11 | F12 | | | | PLY | SKP |
* '-----------------' '-----------------'
*/
[_NUMBERS] = 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_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_VOLU,
KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_VOLD,
KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT)
};
17 changes: 17 additions & 0 deletions keyboards/gboards/gergoplex/keymaps/colemak-dhm/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#----------------------------------------------------------------------------
# make gboards/gergoplex:default:flash
# Make sure you have dfu-programmer installed!
#----------------------------------------------------------------------------

#Debug options
VERBOSE = no
DEBUG_MATRIX_SCAN_RATE = no
DEBUG_MATRIX = no
CONSOLE_ENABLE = no

#Combos!
VPATH += keyboards/gboards/

ifeq ($(strip $(DEBUG_MATRIX)), yes)
OPT_DEFS += -DDEBUG_MATRIX
endif
11 changes: 11 additions & 0 deletions keyboards/gboards/gergoplex/keymaps/default/combos.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// List any combo dictionaries you want loaded to your device below!

// QMK wide includes
#include "combos/germ-vim-helpers.def"
#include "combos/germ-mouse-keys.def"

// User includes
#include "gergoplex.def"

// Word completion
// #include "combos/eng-combos.def"
10 changes: 10 additions & 0 deletions keyboards/gboards/gergoplex/keymaps/default/gergoplex.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Gergoplex specfic combos

COMB(opBacksl, KC_BSLS, KC_O, KC_P)
COMB(hjLess, KC_LT, KC_H, KC_J)
COMB(klGreat, KC_GT, KC_K, KC_L)
COMB(xcDash, KC_MINS, KC_X, KC_C)
COMB(mcUnds, KC_UNDS, KC_M, KC_COMM)
COMB(nmQuot, KC_QUOT, KC_N, KC_M)

SUBS(pasta, "I'd just like to interject for a moment.", KC_H, KC_J, KC_K, KC_L)
Loading