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

Adding TGR Tris/Tris CE Numpad #9139

Merged
merged 11 commits into from
May 27, 2020
50 changes: 50 additions & 0 deletions keyboards/tgr/tris/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
Copyright 2020 halfenergized

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:https://www.gnu.org/licenses/>.
*/

#pragma once

#include "config_common.h"

#define VENDOR_ID 0x5447 //TG
#define PRODUCT_ID 0x5452 //TR
#define DEVICE_VER 0x0001
#define MANUFACTURER TGR
#define PRODUCT Tris
#define DESCRIPTION Numpad by TGR

#define MATRIX_ROWS 6
#define MATRIX_COLS 4

#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5 }
#define MATRIX_COL_PINS { A3, A2, A1, A0 }

#define DIODE_DIRECTION COL2ROW
#define DEBOUNCE 5

#define BACKLIGHT_PIN D4
#define BACKLIGHT_LEVELS 3

#define RGBLED_NUM 6
#define RGBLIGHT_ANIMATIONS

/* key combination for magic key command */
/* defined by default; to change, uncomment and set to the combination you want */
// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT)

/* Bootmagic Lite key configuration */
// #define BOOTMAGIC_LITE_ROW 0
// #define BOOTMAGIC_LITE_COLUMN 0
16 changes: 16 additions & 0 deletions keyboards/tgr/tris/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"keyboard_name": "TGR Tris",
"url": "",
"maintainer": "halfenergized",
"width": 4,
"height": 6,
"layouts": {
"LAYOUT_ortho_6x4": {
"layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":0, "y":2.25}, {"x":1, "y":2.25}, {"x":2, "y":2.25}, {"x":3, "y":2.25}, {"x":0, "y":3.25}, {"x":1, "y":3.25}, {"x":2, "y":3.25}, {"x":3, "y":3.25}, {"x":0, "y":4.25}, {"x":1, "y":4.25}, {"x":2, "y":4.25}, {"x":3, "y":4.25}, {"x":0, "y":5.25}, {"x":1, "y":5.25}, {"x":2, "y":5.25}, {"x":3, "y":5.25}]
},

"LAYOUT_numpad_6x4": {
"layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":0, "y":2.25}, {"x":1, "y":2.25}, {"x":2, "y":2.25}, {"x":3, "y":2.25, "h":2}, {"x":0, "y":3.25}, {"x":1, "y":3.25}, {"x":2, "y":3.25}, {"x":0, "y":4.25}, {"x":1, "y":4.25}, {"x":2, "y":4.25}, {"x":3, "y":4.25, "h":2}, {"x":0, "y":5.25, "w":2}, {"x":2, "y":5.25}]
halfenergized marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
47 changes: 47 additions & 0 deletions keyboards/tgr/tris/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* Copyright 2020 halfenergized
*
* 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:https://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H


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

[0] = LAYOUT_numpad_6x4(
KC_ESC, KC_TAB, MO(1), KC_BSPC,
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
KC_P7, KC_P8, KC_P9,
KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_P1, KC_P2, KC_P3, KC_PENT,
KC_P0, KC_PDOT
),

[1] = LAYOUT_numpad_6x4(
KC_TRNS, KC_TRNS, KC_TRNS, MO(2),
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_HOME, KC_UP, KC_PGUP,
KC_LEFT, KC_TRNS, KC_RGHT, KC_TRNS,
KC_END, KC_DOWN, KC_PGDN, KC_TRNS,
KC_INS, KC_DEL
),

[2] = LAYOUT_numpad_6x4(
RESET, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS
)
halfenergized marked this conversation as resolved.
Show resolved Hide resolved
};
1 change: 1 addition & 0 deletions keyboards/tgr/tris/keymaps/default/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# The default keymap for tris
57 changes: 57 additions & 0 deletions keyboards/tgr/tris/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/* Copyright 2020 halfenergized
*
* 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:https://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H


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

[0] = LAYOUT_numpad_6x4(
KC_ESC, KC_TAB, MO(1), KC_BSPC,
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
KC_P7, KC_P8, KC_P9,
KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_P1, KC_P2, KC_P3, KC_PENT,
KC_P0, KC_PDOT
),

[1] = LAYOUT_numpad_6x4(
KC_TRNS, KC_TRNS, KC_TRNS, MO(2),
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_HOME, KC_UP, KC_PGUP,
KC_LEFT, KC_TRNS, KC_RGHT, KC_TRNS,
KC_END, KC_DOWN, KC_PGDN, KC_TRNS,
KC_INS, KC_DEL
),

[2] = LAYOUT_numpad_6x4(
RESET, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS
),

[3] = LAYOUT_numpad_6x4(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS
)
halfenergized marked this conversation as resolved.
Show resolved Hide resolved

};
4 changes: 4 additions & 0 deletions keyboards/tgr/tris/keymaps/via/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
VIA_ENABLE = yes
LTO_ENABLE = yes

EXTRAKEY_ENABLE = no
19 changes: 19 additions & 0 deletions keyboards/tgr/tris/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# TGR Tris/Tris CE

A short description of the keyboard/project

* Keyboard Maintainer: [poisonking](https://github.com/halfenergized)
* Hardware Supported: Tris PCB
* Hardware Availability: https://geekhack.org/index.php?topic=86221.0

Make example for this keyboard (after setting up your build environment):

make tris:default

Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](https://docs.qmk.fm/#/flashing_bootloadhid))

make tris:default:flash

**Reset Key**: Hold down the key located at top right position, while plugging in the keyboard.

See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
26 changes: 26 additions & 0 deletions keyboards/tgr/tris/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# MCU name
MCU = atmega32a

# Bootloader selection
# Teensy halfkay
# Pro Micro caterina
# Atmel DFU atmel-dfu
# LUFA DFU lufa-dfu
# QMK DFU qmk-dfu
# ATmega32A bootloadHID
# ATmega328P USBasp
BOOTLOADER = bootloadHID

# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = no
MOUSEKEY_ENABLE = no
EXTRAKEY_ENABLE = yes
CONSOLE_ENABLE = no
COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = yes
RGBLIGHT_ENABLE = yes
WS2812_DRIVER = i2c

LAYOUTS = numpad_6x4 ortho_6x4
33 changes: 33 additions & 0 deletions keyboards/tgr/tris/tris.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* Copyright 2020 halfenergized
*
* 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:https://www.gnu.org/licenses/>.
*/

#include "tris.h"

void keyboard_pre_init_kb(void) {
led_init_ports();
keyboard_pre_init_user();
}

void led_init_ports(void) {
setPinOutput(D0);
}

bool led_update_kb(led_t led_state) {
if (led_update_user(led_state)) {
writePin(D0, led_state.num_lock);
}
return true;
}
63 changes: 63 additions & 0 deletions keyboards/tgr/tris/tris.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/* Copyright 2020 halfenergized
*
* 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:https://www.gnu.org/licenses/>.
*/

#pragma once

#include "quantum.h"

/* This is a shortcut to help you visually see your layout.
*
* The first section contains all of the arguments representing the physical
* layout of the board and position of the keys.
*
* The second converts the arguments into a two-dimensional array which
* represents the switch matrix.
*/
#define ___ KC_NO

#define LAYOUT_ortho_6x4( \
k00, k01, k02, k03, \
k10, k11, k12, k13, \
k20, k21, k22, k23, \
k30, k31, k32, k33, \
k40, k41, k42, k43, \
k50, k51, k52, k53 \
)\
{ \
{ k00, k01, k02, k03 }, \
{ k10, k11, k12, k13 }, \
{ k20, k21, k22, k23 }, \
{ k30, k31, k32, k33 }, \
{ k40, k41, k42, k43 }, \
{ k50, k51, k52, k53 } \
}

#define LAYOUT_numpad_6x4( \
k00, k01, k02, k03, \
k10, k11, k12, k13, \
k20, k21, k22, \
k30, k31, k32, k33, \
k40, k41, k42, k43, \
k50, k52 \
) \
halfenergized marked this conversation as resolved.
Show resolved Hide resolved
{ \
{ k00, k01, k02, k03 }, \
{ k10, k11, k12, k13 }, \
{ k20, k21, k22, ___ }, \
{ k30, k31, k32, k33 }, \
{ k40, k41, k42, k43 }, \
{ k50, ___, k52, ___ } \
}